aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc/org.texi
diff options
context:
space:
mode:
authorStefan Monnier2012-03-25 16:37:21 -0400
committerStefan Monnier2012-03-25 16:37:21 -0400
commit699c782b7668c44d0fa4446331b0590a6d5dac82 (patch)
tree5dcce364741d0761920a3d274b0fc8aba4103d45 /doc/misc/org.texi
parent98fb480ee31bf74cf554044f60f21df16566dd7f (diff)
parente99a9b8bdccadded1f6fae88ee7a2a93dfd4eacf (diff)
downloademacs-pending.tar.gz
emacs-pending.zip
Merge from trunkpending
Diffstat (limited to 'doc/misc/org.texi')
-rw-r--r--doc/misc/org.texi3955
1 files changed, 2843 insertions, 1112 deletions
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index a0ec20c4034..2a41d6b9301 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -4,8 +4,8 @@
4@setfilename ../../info/org 4@setfilename ../../info/org
5@settitle The Org Manual 5@settitle The Org Manual
6 6
7@set VERSION 7.4 7@set VERSION 7.8.03
8@set DATE December 2010 8@set DATE January 2012
9 9
10@c Use proper quote and backtick for code sections in PDF output 10@c Use proper quote and backtick for code sections in PDF output
11@c Cf. Texinfo manual 14.2 11@c Cf. Texinfo manual 14.2
@@ -34,9 +34,9 @@
34 34
35@c Below we define the following macros for Org key tables: 35@c Below we define the following macros for Org key tables:
36 36
37@c orgkey{key} A key item 37@c orgkey{key} A key item
38@c orgcmd{key,cmd} Key with command name 38@c orgcmd{key,cmd} Key with command name
39@c xorgcmd{key,cmmand} Key with command name as @itemx 39@c xorgcmd{key,cmd} Key with command name as @itemx
40@c orgcmdnki{key,cmd} Like orgcmd, but do not index the key 40@c orgcmdnki{key,cmd} Like orgcmd, but do not index the key
41@c orgcmdtkc{text,key,cmd} Like orgcmd,special text instead of key 41@c orgcmdtkc{text,key,cmd} Like orgcmd,special text instead of key
42@c orgcmdkkc{key1,key2,cmd} Two keys with one command name, use "or" 42@c orgcmdkkc{key1,key2,cmd} Two keys with one command name, use "or"
@@ -265,7 +265,7 @@
265@copying 265@copying
266This manual is for Org version @value{VERSION}. 266This manual is for Org version @value{VERSION}.
267 267
268Copyright @copyright{} 2004-2011 Free Software Foundation, Inc. 268Copyright @copyright{} 2004-2012 Free Software Foundation, Inc.
269 269
270@quotation 270@quotation
271Permission is granted to copy, distribute and/or modify this document 271Permission is granted to copy, distribute and/or modify this document
@@ -286,7 +286,7 @@ license to the document, as described in section 6 of the license.
286@end quotation 286@end quotation
287@end copying 287@end copying
288 288
289@dircategory Emacs editing modes 289@dircategory Emacs
290@direntry 290@direntry
291* Org Mode: (org). Outline-based notes management and organizer 291* Org Mode: (org). Outline-based notes management and organizer
292@end direntry 292@end direntry
@@ -296,7 +296,7 @@ license to the document, as described in section 6 of the license.
296 296
297@subtitle Release @value{VERSION} 297@subtitle Release @value{VERSION}
298@author by Carsten Dominik 298@author by Carsten Dominik
299with contributions by David O'Toole, Bastien Guerry, Philip Rooke, Dan Davison, Eric Schulte, and Thomas Dye 299with contributions by David O'Toole, Bastien Guerry, Philip Rooke, Dan Davison, Eric Schulte, Thomas Dye and Jambunathan K.
300 300
301@c The following two commands start the copyright page. 301@c The following two commands start the copyright page.
302@page 302@page
@@ -377,11 +377,12 @@ The spreadsheet
377* References:: How to refer to another field or range 377* References:: How to refer to another field or range
378* Formula syntax for Calc:: Using Calc to compute stuff 378* Formula syntax for Calc:: Using Calc to compute stuff
379* Formula syntax for Lisp:: Writing formulas in Emacs Lisp 379* Formula syntax for Lisp:: Writing formulas in Emacs Lisp
380* Field formulas:: Formulas valid for a single field 380* Durations and time values:: How to compute durations and time values
381* Field and range formulas:: Formula for specific (ranges of) fields
381* Column formulas:: Formulas valid for an entire column 382* Column formulas:: Formulas valid for an entire column
382* Editing and debugging formulas:: Fixing formulas 383* Editing and debugging formulas:: Fixing formulas
383* Updating the table:: Recomputing all dependent fields 384* Updating the table:: Recomputing all dependent fields
384* Advanced features:: Field names, parameters and automatic recalc 385* Advanced features:: Field and column names, parameters and automatic recalc
385 386
386Hyperlinks 387Hyperlinks
387 388
@@ -432,7 +433,7 @@ Tags
432Properties and columns 433Properties and columns
433 434
434* Property syntax:: How properties are spelled out 435* Property syntax:: How properties are spelled out
435* Special properties:: Access to other Org-mode features 436* Special properties:: Access to other Org mode features
436* Property searches:: Matching property values 437* Property searches:: Matching property values
437* Property inheritance:: Passing values down the tree 438* Property inheritance:: Passing values down the tree
438* Column view:: Tabular viewing and editing 439* Column view:: Tabular viewing and editing
@@ -461,7 +462,7 @@ Dates and times
461 462
462Creating timestamps 463Creating timestamps
463 464
464* The date/time prompt:: How Org-mode helps you entering date and time 465* The date/time prompt:: How Org mode helps you entering date and time
465* Custom time format:: Making dates look different 466* Custom time format:: Making dates look different
466 467
467Deadlines and scheduling 468Deadlines and scheduling
@@ -480,7 +481,7 @@ Capture - Refile - Archive
480* Capture:: Capturing new stuff 481* Capture:: Capturing new stuff
481* Attachments:: Add files to tasks 482* Attachments:: Add files to tasks
482* RSS Feeds:: Getting input from RSS feeds 483* RSS Feeds:: Getting input from RSS feeds
483* Protocols:: External (e.g. Browser) access to Emacs and Org 484* Protocols:: External (e.g.@: Browser) access to Emacs and Org
484* Refiling notes:: Moving a tree from one place to another 485* Refiling notes:: Moving a tree from one place to another
485* Archiving:: What to do with finished projects 486* Archiving:: What to do with finished projects
486 487
@@ -540,7 +541,7 @@ Markup for rich export
540* Include files:: Include additional files into a document 541* Include files:: Include additional files into a document
541* Index entries:: Making an index 542* Index entries:: Making an index
542* Macro replacement:: Use macros to create complex output 543* Macro replacement:: Use macros to create complex output
543* Embedded LaTeX:: LaTeX can be freely used inside Org documents 544* Embedded @LaTeX{}:: LaTeX can be freely used inside Org documents
544 545
545Structural markup elements 546Structural markup elements
546 547
@@ -559,8 +560,8 @@ Embedded @LaTeX{}
559 560
560* Special symbols:: Greek letters and other symbols 561* Special symbols:: Greek letters and other symbols
561* Subscripts and superscripts:: Simple syntax for raising/lowering text 562* Subscripts and superscripts:: Simple syntax for raising/lowering text
562* LaTeX fragments:: Complex formulas made easy 563* @LaTeX{} fragments:: Complex formulas made easy
563* Previewing LaTeX fragments:: What will this snippet look like? 564* Previewing @LaTeX{} fragments:: What will this snippet look like?
564* CDLaTeX mode:: Speed up entering of formulas 565* CDLaTeX mode:: Speed up entering of formulas
565 566
566Exporting 567Exporting
@@ -570,8 +571,9 @@ Exporting
570* The export dispatcher:: How to access exporter commands 571* The export dispatcher:: How to access exporter commands
571* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding 572* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
572* HTML export:: Exporting to HTML 573* HTML export:: Exporting to HTML
573* LaTeX and PDF export:: Exporting to @LaTeX{}, and processing to PDF 574* @LaTeX{} and PDF export:: Exporting to @LaTeX{}, and processing to PDF
574* DocBook export:: Exporting to DocBook 575* DocBook export:: Exporting to DocBook
576* OpenDocument Text export:: Exporting to OpenDocument Text
575* TaskJuggler export:: Exporting to TaskJuggler 577* TaskJuggler export:: Exporting to TaskJuggler
576* Freemind export:: Exporting to Freemind mind maps 578* Freemind export:: Exporting to Freemind mind maps
577* XOXO export:: Exporting to XOXO 579* XOXO export:: Exporting to XOXO
@@ -580,7 +582,8 @@ Exporting
580HTML export 582HTML export
581 583
582* HTML Export commands:: How to invoke HTML export 584* HTML Export commands:: How to invoke HTML export
583* Quoting HTML tags:: Using direct HTML in Org-mode 585* HTML preamble and postamble:: How to insert a preamble and a postamble
586* Quoting HTML tags:: Using direct HTML in Org mode
584* Links in HTML export:: How links will be interpreted and formatted 587* Links in HTML export:: How links will be interpreted and formatted
585* Tables in HTML export:: How to modify the formatting of tables 588* Tables in HTML export:: How to modify the formatting of tables
586* Images in HTML export:: How to insert figures into HTML output 589* Images in HTML export:: How to insert figures into HTML output
@@ -591,11 +594,11 @@ HTML export
591 594
592@LaTeX{} and PDF export 595@LaTeX{} and PDF export
593 596
594* LaTeX/PDF export commands:: Which key invokes which commands 597* @LaTeX{}/PDF export commands::
595* Header and sectioning:: Setting up the export file structure 598* Header and sectioning:: Setting up the export file structure
596* Quoting LaTeX code:: Incorporating literal @LaTeX{} code 599* Quoting @LaTeX{} code:: Incorporating literal @LaTeX{} code
597* Tables in LaTeX export:: Options for exporting tables to @LaTeX{} 600* Tables in @LaTeX{} export:: Options for exporting tables to @LaTeX{}
598* Images in LaTeX export:: How to insert figures into @LaTeX{} output 601* Images in @LaTeX{} export:: How to insert figures into @LaTeX{} output
599* Beamer class export:: Turning the file into a presentation 602* Beamer class export:: Turning the file into a presentation
600 603
601DocBook export 604DocBook export
@@ -607,6 +610,31 @@ DocBook export
607* Images in DocBook export:: How to insert figures into DocBook output 610* Images in DocBook export:: How to insert figures into DocBook output
608* Special characters:: How to handle special characters 611* Special characters:: How to handle special characters
609 612
613OpenDocument Text export
614
615* Pre-requisites for @acronym{ODT} export:: What packages @acronym{ODT} exporter relies on
616* @acronym{ODT} export commands:: How to invoke @acronym{ODT} export
617* Applying custom styles:: How to apply custom styles to the output
618* Links in @acronym{ODT} export:: How links will be interpreted and formatted
619* Tables in @acronym{ODT} export:: How Tables are exported
620* Images in @acronym{ODT} export:: How to insert images
621* Math formatting in @acronym{ODT} export:: How @LaTeX{} fragments are formatted
622* Literal examples in @acronym{ODT} export:: How source and example blocks are formatted
623* Advanced topics in @acronym{ODT} export:: Read this if you are a power user
624
625Math formatting in @acronym{ODT} export
626
627* Working with @LaTeX{} math snippets:: How to embed @LaTeX{} math fragments
628* Working with MathML or OpenDocument formula files:: How to embed equations in native format
629
630Advanced topics in @acronym{ODT} export
631
632* Exporting and converting to other formats:: How to produce @samp{pdf} and other formats
633* Working with OpenDocument style files:: Explore the internals
634* Creating one-off styles:: How to produce custom highlighting etc
635* Customizing tables in @acronym{ODT} export:: How to define and use Table templates
636* Validating OpenDocument XML:: How to debug corrupt OpenDocument files
637
610Publishing 638Publishing
611 639
612* Configuration:: Defining projects 640* Configuration:: Defining projects
@@ -620,7 +648,7 @@ Configuration
620* Sources and destinations:: From here to there 648* Sources and destinations:: From here to there
621* Selecting files:: What files are part of the project? 649* Selecting files:: What files are part of the project?
622* Publishing action:: Setting the function doing the publishing 650* Publishing action:: Setting the function doing the publishing
623* Publishing options:: Tweaking HTML export 651* Publishing options:: Tweaking HTML/@LaTeX{} export
624* Publishing links:: Which links keep working after publishing? 652* Publishing links:: Which links keep working after publishing?
625* Sitemap:: Generating a list of all pages 653* Sitemap:: Generating a list of all pages
626* Generating an index:: An index that reaches across pages 654* Generating an index:: An index that reaches across pages
@@ -636,12 +664,12 @@ Working with source code
636* Editing source code:: Language major-mode editing 664* Editing source code:: Language major-mode editing
637* Exporting code blocks:: Export contents and/or results 665* Exporting code blocks:: Export contents and/or results
638* Extracting source code:: Create pure source code files 666* Extracting source code:: Create pure source code files
639* Evaluating code blocks:: Place results of evaluation in the Org-mode buffer 667* Evaluating code blocks:: Place results of evaluation in the Org mode buffer
640* Library of Babel:: Use and contribute to a library of useful code blocks 668* Library of Babel:: Use and contribute to a library of useful code blocks
641* Languages:: List of supported code block languages 669* Languages:: List of supported code block languages
642* Header arguments:: Configure code block functionality 670* Header arguments:: Configure code block functionality
643* Results of evaluation:: How evaluation results are handled 671* Results of evaluation:: How evaluation results are handled
644* Noweb reference syntax:: Literate programming in Org-mode 672* Noweb reference syntax:: Literate programming in Org mode
645* Key bindings and useful functions:: Work quickly with code blocks 673* Key bindings and useful functions:: Work quickly with code blocks
646* Batch execution:: Call functions from the command line 674* Batch execution:: Call functions from the command line
647 675
@@ -655,7 +683,7 @@ Using header arguments
655* System-wide header arguments:: Set global default values 683* System-wide header arguments:: Set global default values
656* Language-specific header arguments:: Set default values by language 684* Language-specific header arguments:: Set default values by language
657* Buffer-wide header arguments:: Set default values for a specific buffer 685* Buffer-wide header arguments:: Set default values for a specific buffer
658* Header arguments in Org-mode properties:: Set default values for a buffer or heading 686* Header arguments in Org mode properties:: Set default values for a buffer or heading
659* Code block specific header arguments:: The most common way to set values 687* Code block specific header arguments:: The most common way to set values
660* Header arguments in function calls:: The most specific level 688* Header arguments in function calls:: The most specific level
661 689
@@ -669,13 +697,19 @@ Specific header arguments
669 directory for code block execution 697 directory for code block execution
670* exports:: Export code and/or results 698* exports:: Export code and/or results
671* tangle:: Toggle tangling and specify file name 699* tangle:: Toggle tangling and specify file name
700* mkdirp:: Toggle creation of parent directories of target
701 files during tangling
672* comments:: Toggle insertion of comments in tangled 702* comments:: Toggle insertion of comments in tangled
673 code files 703 code files
704* padline:: Control insertion of padding lines in tangled
705 code files
674* no-expand:: Turn off variable assignment and noweb 706* no-expand:: Turn off variable assignment and noweb
675 expansion during tangling 707 expansion during tangling
676* session:: Preserve the state of code evaluation 708* session:: Preserve the state of code evaluation
677* noweb:: Toggle expansion of noweb references 709* noweb:: Toggle expansion of noweb references
710* noweb-ref:: Specify block's noweb reference resolution target
678* cache:: Avoid re-evaluating unchanged code blocks 711* cache:: Avoid re-evaluating unchanged code blocks
712* sep:: Delimiter for writing tabular results outside Org
679* hlines:: Handle horizontal lines in tables 713* hlines:: Handle horizontal lines in tables
680* colnames:: Handle column names in tables 714* colnames:: Handle column names in tables
681* rownames:: Handle row names in tables 715* rownames:: Handle row names in tables
@@ -694,6 +728,7 @@ Miscellaneous
694* Clean view:: Getting rid of leading stars in the outline 728* Clean view:: Getting rid of leading stars in the outline
695* TTY keys:: Using Org on a tty 729* TTY keys:: Using Org on a tty
696* Interaction:: Other Emacs packages 730* Interaction:: Other Emacs packages
731* org-crypt.el:: Encrypting Org files
697 732
698Interaction with other packages 733Interaction with other packages
699 734
@@ -716,7 +751,7 @@ Hacking
716Tables and lists in arbitrary syntax 751Tables and lists in arbitrary syntax
717 752
718* Radio tables:: Sending and receiving radio tables 753* Radio tables:: Sending and receiving radio tables
719* A LaTeX example:: Step by step, almost a tutorial 754* A @LaTeX{} example:: Step by step, almost a tutorial
720* Translator functions:: Copy and modify 755* Translator functions:: Copy and modify
721* Radio lists:: Doing the same for lists 756* Radio lists:: Doing the same for lists
722 757
@@ -769,7 +804,7 @@ create dynamic @i{agenda views}.
769 804
770Org mode contains the Org Babel environment which allows you to work with 805Org mode contains the Org Babel environment which allows you to work with
771embedded source code blocks in a file, to facilitate code evaluation, 806embedded source code blocks in a file, to facilitate code evaluation,
772documentation, and tangling. 807documentation, and literate programming techniques.
773 808
774Org's automatic, context-sensitive table editor with spreadsheet 809Org's automatic, context-sensitive table editor with spreadsheet
775capabilities can be integrated into any major mode by activating the 810capabilities can be integrated into any major mode by activating the
@@ -803,6 +838,11 @@ version of Org, as well as additional information, frequently asked
803questions (FAQ), links to tutorials, etc@. This page is located at 838questions (FAQ), links to tutorials, etc@. This page is located at
804@uref{http://orgmode.org}. 839@uref{http://orgmode.org}.
805 840
841@cindex print edition
842The version 7.3 of this manual is available as a
843@uref{http://www.network-theory.co.uk/org/manual/, paperback book from Network
844Theory Ltd.}
845
806@page 846@page
807 847
808 848
@@ -813,7 +853,9 @@ questions (FAQ), links to tutorials, etc@. This page is located at
813 853
814@b{Important:} @i{If you are using a version of Org that is part of the Emacs 854@b{Important:} @i{If you are using a version of Org that is part of the Emacs
815distribution or an XEmacs package, please skip this section and go directly 855distribution or an XEmacs package, please skip this section and go directly
816to @ref{Activation}.} 856to @ref{Activation}. To see what version of Org (if any) is part of your
857Emacs distribution, type @kbd{M-x load-library RET org} and then @kbd{M-x
858org-version}.}
817 859
818If you have downloaded Org from the Web, either as a distribution @file{.zip} 860If you have downloaded Org from the Web, either as a distribution @file{.zip}
819or @file{.tar} file, or as a Git archive, you must take the following steps 861or @file{.tar} file, or as a Git archive, you must take the following steps
@@ -852,20 +894,26 @@ make install
852@end example 894@end example
853 895
854Installing Info files is system dependent, because of differences in the 896Installing Info files is system dependent, because of differences in the
855@file{install-info} program. In Debian it copies the info files into the 897@file{install-info} program. The following should correctly install the Info
856correct directory and modifies the info directory file. In many other 898files on most systems, please send a bug report if not@footnote{The output
857systems, the files need to be copied to the correct directory separately, and 899from install-info (if any) is also system dependent. In particular Debian
858@file{install-info} then only modifies the directory file. Check your system 900and its derivatives use two different versions of install-info and you may
859documentation to find out which of the following commands you need: 901see the message:
902
903@example
904This is not dpkg install-info anymore, but GNU install-info
905See the man page for ginstall-info for command line arguments
906@end example
907
908@noindent which can be safely ignored.}.
860 909
861@example 910@example
862make install-info 911make install-info
863make install-info-debian
864@end example 912@end example
865 913
866Then add the following line to @file{.emacs}. It is needed so that 914Then add the following line to @file{.emacs}. It is needed so that
867Emacs can autoload functions that are located in files not immediately loaded 915Emacs can autoload functions that are located in files not immediately loaded
868when Org-mode starts. 916when Org mode starts.
869@lisp 917@lisp
870(require 'org-install) 918(require 'org-install)
871@end lisp 919@end lisp
@@ -880,31 +928,30 @@ Do not forget to activate Org as described in the following section.
880@cindex global key bindings 928@cindex global key bindings
881@cindex key bindings, global 929@cindex key bindings, global
882 930
883Add the following lines to your @file{.emacs} file. The last three lines 931To make sure files with extension @file{.org} use Org mode, add the following
884define @emph{global} keys for the commands @command{org-store-link}, 932line to your @file{.emacs} file.
885@command{org-agenda}, and @command{org-iswitchb}---please choose suitable
886keys yourself.
887
888@lisp 933@lisp
889;; The following lines are always needed. Choose your own keys.
890(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) 934(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
935@end lisp
936@noindent Org mode buffers need font-lock to be turned on - this is the
937default in Emacs@footnote{If you don't use font-lock globally, turn it on in
938Org buffer with @code{(add-hook 'org-mode-hook 'turn-on-font-lock)}}.
939
940The four Org commands @command{org-store-link}, @command{org-capture},
941@command{org-agenda}, and @command{org-iswitchb} should be accessible through
942global keys (i.e.@: anywhere in Emacs, not just in Org buffers). Here are
943suggested bindings for these keys, please modify the keys to your own
944liking.
945@lisp
891(global-set-key "\C-cl" 'org-store-link) 946(global-set-key "\C-cl" 'org-store-link)
947(global-set-key "\C-cc" 'org-capture)
892(global-set-key "\C-ca" 'org-agenda) 948(global-set-key "\C-ca" 'org-agenda)
893(global-set-key "\C-cb" 'org-iswitchb) 949(global-set-key "\C-cb" 'org-iswitchb)
894@end lisp 950@end lisp
895 951
896Furthermore, you must activate @code{font-lock-mode} in Org 952@cindex Org mode, turning on
897buffers, because significant functionality depends on font-locking being
898active. You can do this with either one of the following two lines
899(XEmacs users must use the second option):
900@lisp
901(global-font-lock-mode 1) ; for all buffers
902(add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
903@end lisp
904
905@cindex Org-mode, turning on
906With this setup, all files with extension @samp{.org} will be put 953With this setup, all files with extension @samp{.org} will be put
907into Org-mode. As an alternative, make the first line of a file look 954into Org mode. As an alternative, make the first line of a file look
908like this: 955like this:
909 956
910@example 957@example
@@ -912,7 +959,7 @@ MY PROJECTS -*- mode: org; -*-
912@end example 959@end example
913 960
914@vindex org-insert-mode-line-in-empty-file 961@vindex org-insert-mode-line-in-empty-file
915@noindent which will select Org-mode for this buffer no matter what 962@noindent which will select Org mode for this buffer no matter what
916the file's name is. See also the variable 963the file's name is. See also the variable
917@code{org-insert-mode-line-in-empty-file}. 964@code{org-insert-mode-line-in-empty-file}.
918 965
@@ -955,6 +1002,36 @@ version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org
955that you only need to add your description. If you re not sending the Email 1002that you only need to add your description. If you re not sending the Email
956from within Emacs, please copy and paste the content into your Email program. 1003from within Emacs, please copy and paste the content into your Email program.
957 1004
1005Sometimes you might face a problem due to an error in your Emacs or Org mode
1006setup. Before reporting a bug, it is very helpful to start Emacs with minimal
1007customizations and reproduce the problem. Doing so often helps you determine
1008if the problem is with your customization or with Org mode itself. You can
1009start a typical minimal session with a command like the example below.
1010
1011@example
1012$ emacs -Q -l /path/to/minimal-org.el
1013@end example
1014
1015However if you are using Org mode as distributed with Emacs, a minimal setup
1016is not necessary. In that case it is sufficient to start Emacs as @code{emacs
1017-Q}. The @code{minimal-org.el} setup file can have contents as shown below.
1018
1019@example
1020;;; Minimal setup to load latest `org-mode'
1021
1022;; activate debugging
1023(setq debug-on-error t
1024 debug-on-signal nil
1025 debug-on-quit nil)
1026
1027;; add latest org-mode to load path
1028(add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp"))
1029(add-to-list 'load-path (expand-file-name "/path/to/org-mode/contrib/lisp"))
1030
1031;; activate org
1032(require 'org-install)
1033@end example
1034
958If an error occurs, a backtrace can be very useful (see below on how to 1035If an error occurs, a backtrace can be very useful (see below on how to
959create one). Often a small example file helps, along with clear information 1036create one). Often a small example file helps, along with clear information
960about: 1037about:
@@ -977,7 +1054,7 @@ error occurred. Here is how to produce a useful backtrace:
977 1054
978@enumerate 1055@enumerate
979@item 1056@item
980Reload uncompiled versions of all Org-mode Lisp files. The backtrace 1057Reload uncompiled versions of all Org mode Lisp files. The backtrace
981contains much more information if it is produced with uncompiled code. 1058contains much more information if it is produced with uncompiled code.
982To do this, use 1059To do this, use
983@example 1060@example
@@ -1164,8 +1241,8 @@ Reveal context around point, showing the current entry, the following heading
1164and the hierarchy above. Useful for working near a location that has been 1241and the hierarchy above. Useful for working near a location that has been
1165exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command 1242exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
1166(@pxref{Agenda commands}). With a prefix argument show, on each 1243(@pxref{Agenda commands}). With a prefix argument show, on each
1167level, all sibling headings. With double prefix arg, also show the entire 1244level, all sibling headings. With a double prefix argument, also show the
1168subtree of the parent. 1245entire subtree of the parent.
1169@orgcmd{C-c C-k,show-branches} 1246@orgcmd{C-c C-k,show-branches}
1170Expose all the headings of the subtree, CONTENT view for just one subtree. 1247Expose all the headings of the subtree, CONTENT view for just one subtree.
1171@orgcmd{C-c C-x b,org-tree-to-indirect-buffer} 1248@orgcmd{C-c C-x b,org-tree-to-indirect-buffer}
@@ -1183,6 +1260,8 @@ but without affecting visibility in that buffer.}. With a numeric
1183prefix argument N, go up to level N and then take that tree. If N is 1260prefix argument N, go up to level N and then take that tree. If N is
1184negative then go up that many levels. With a @kbd{C-u} prefix, do not remove 1261negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
1185the previously used indirect buffer. 1262the previously used indirect buffer.
1263@orgcmd{C-c C-x v,org-copy-visible}
1264Copy the @i{visible} text in the region into the kill ring.
1186@end table 1265@end table
1187 1266
1188@vindex org-startup-folded 1267@vindex org-startup-folded
@@ -1192,7 +1271,7 @@ the previously used indirect buffer.
1192@cindex @code{showeverything}, STARTUP keyword 1271@cindex @code{showeverything}, STARTUP keyword
1193 1272
1194When Emacs first visits an Org file, the global state is set to 1273When Emacs first visits an Org file, the global state is set to
1195OVERVIEW, i.e. only the top level headlines are visible. This can be 1274OVERVIEW, i.e.@: only the top level headlines are visible. This can be
1196configured through the variable @code{org-startup-folded}, or on a 1275configured through the variable @code{org-startup-folded}, or on a
1197per-file basis by adding one of the following lines anywhere in the 1276per-file basis by adding one of the following lines anywhere in the
1198buffer: 1277buffer:
@@ -1212,7 +1291,7 @@ for this property are @code{folded}, @code{children}, @code{content}, and
1212@code{all}. 1291@code{all}.
1213@table @asis 1292@table @asis
1214@orgcmd{C-u C-u @key{TAB},org-set-startup-visibility} 1293@orgcmd{C-u C-u @key{TAB},org-set-startup-visibility}
1215Switch back to the startup visibility of the buffer, i.e. whatever is 1294Switch back to the startup visibility of the buffer, i.e.@: whatever is
1216requested by startup options and @samp{VISIBILITY} properties in individual 1295requested by startup options and @samp{VISIBILITY} properties in individual
1217entries. 1296entries.
1218@end table 1297@end table
@@ -1273,19 +1352,17 @@ See also the variable @code{org-goto-interface}.
1273@table @asis 1352@table @asis
1274@orgcmd{M-@key{RET},org-insert-heading} 1353@orgcmd{M-@key{RET},org-insert-heading}
1275@vindex org-M-RET-may-split-line 1354@vindex org-M-RET-may-split-line
1276Insert new heading with same level as current. If the cursor is in a 1355Insert new heading with same level as current. If the cursor is in a plain
1277plain list item, a new item is created (@pxref{Plain lists}). To force 1356list item, a new item is created (@pxref{Plain lists}). To force creation of
1278creation of a new headline, use a prefix argument, or first press @key{RET} 1357a new headline, use a prefix argument. When this command is used in the
1279to get to the beginning of the next line. When this command is used in 1358middle of a line, the line is split and the rest of the line becomes the new
1280the middle of a line, the line is split and the rest of the line becomes 1359headline@footnote{If you do not want the line to be split, customize the
1281the new headline@footnote{If you do not want the line to be split, 1360variable @code{org-M-RET-may-split-line}.}. If the command is used at the
1282customize the variable @code{org-M-RET-may-split-line}.}. If the 1361beginning of a headline, the new headline is created before the current line.
1283command is used at the beginning of a headline, the new headline is 1362If at the beginning of any other line, the content of that line is made the
1284created before the current line. If at the beginning of any other line, 1363new heading. If the command is used at the end of a folded subtree (i.e.@:
1285the content of that line is made the new heading. If the command is 1364behind the ellipses at the end of a headline), then a headline like the
1286used at the end of a folded subtree (i.e. behind the ellipses at the end 1365current one will be inserted after the end of the subtree.
1287of a headline), then a headline like the current one will be inserted
1288after the end of the subtree.
1289@orgcmd{C-@key{RET},org-insert-heading-respect-content} 1366@orgcmd{C-@key{RET},org-insert-heading-respect-content}
1290Just like @kbd{M-@key{RET}}, except when adding a new heading below the 1367Just like @kbd{M-@key{RET}}, except when adding a new heading below the
1291current heading, the new heading is placed after the body instead of before 1368current heading, the new heading is placed after the body instead of before
@@ -1317,7 +1394,7 @@ level).
1317@orgcmd{M-S-@key{down},org-move-subtree-down} 1394@orgcmd{M-S-@key{down},org-move-subtree-down}
1318Move subtree down (swap with next subtree of same level). 1395Move subtree down (swap with next subtree of same level).
1319@orgcmd{C-c C-x C-w,org-cut-subtree} 1396@orgcmd{C-c C-x C-w,org-cut-subtree}
1320Kill subtree, i.e. remove it from buffer but save in kill ring. 1397Kill subtree, i.e.@: remove it from buffer but save in kill ring.
1321With a numeric prefix argument N, kill N sequential subtrees. 1398With a numeric prefix argument N, kill N sequential subtrees.
1322@orgcmd{C-c C-x M-w,org-copy-subtree} 1399@orgcmd{C-c C-x M-w,org-copy-subtree}
1323Copy subtree to kill ring. With a numeric prefix argument N, copy the N 1400Copy subtree to kill ring. With a numeric prefix argument N, copy the N
@@ -1362,6 +1439,8 @@ sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes, duplicate
1362entries will also be removed. 1439entries will also be removed.
1363@orgcmd{C-x n s,org-narrow-to-subtree} 1440@orgcmd{C-x n s,org-narrow-to-subtree}
1364Narrow buffer to current subtree. 1441Narrow buffer to current subtree.
1442@orgcmd{C-x n b,org-narrow-to-block}
1443Narrow buffer to current block.
1365@orgcmd{C-x n w,widen} 1444@orgcmd{C-x n w,widen}
1366Widen buffer to remove narrowing. 1445Widen buffer to remove narrowing.
1367@orgcmd{C-c *,org-toggle-heading} 1446@orgcmd{C-c *,org-toggle-heading}
@@ -1396,7 +1475,7 @@ functionality.
1396@vindex org-show-following-heading 1475@vindex org-show-following-heading
1397@vindex org-show-siblings 1476@vindex org-show-siblings
1398@vindex org-show-entry-below 1477@vindex org-show-entry-below
1399An important feature of Org-mode is the ability to construct @emph{sparse 1478An important feature of Org mode is the ability to construct @emph{sparse
1400trees} for selected information in an outline tree, so that the entire 1479trees} for selected information in an outline tree, so that the entire
1401document is folded as much as possible, but the selected information is made 1480document is folded as much as possible, but the selected information is made
1402visible along with the headline structure above it@footnote{See also the 1481visible along with the headline structure above it@footnote{See also the
@@ -1405,7 +1484,7 @@ variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
1405control on how much context is shown around each match.}. Just try it out 1484control on how much context is shown around each match.}. Just try it out
1406and you will see immediately how it works. 1485and you will see immediately how it works.
1407 1486
1408Org-mode contains several commands creating such trees, all these 1487Org mode contains several commands creating such trees, all these
1409commands can be accessed through a dispatcher: 1488commands can be accessed through a dispatcher:
1410 1489
1411@table @asis 1490@table @asis
@@ -1413,7 +1492,7 @@ commands can be accessed through a dispatcher:
1413This prompts for an extra key to select a sparse-tree creating command. 1492This prompts for an extra key to select a sparse-tree creating command.
1414@orgcmd{C-c / r,org-occur} 1493@orgcmd{C-c / r,org-occur}
1415@vindex org-remove-highlights-with-change 1494@vindex org-remove-highlights-with-change
1416Occur. Prompts for a regexp and shows a sparse tree with all matches. If 1495Prompts for a regexp and shows a sparse tree with all matches. If
1417the match is in a headline, the headline is made visible. If the match is in 1496the match is in a headline, the headline is made visible. If the match is in
1418the body of an entry, headline and body are made visible. In order to 1497the body of an entry, headline and body are made visible. In order to
1419provide minimal context, also the full hierarchy of headlines above the match 1498provide minimal context, also the full hierarchy of headlines above the match
@@ -1423,8 +1502,13 @@ editing command@footnote{This depends on the option
1423@code{org-remove-highlights-with-change}}, or by pressing @kbd{C-c C-c}. 1502@code{org-remove-highlights-with-change}}, or by pressing @kbd{C-c C-c}.
1424When called with a @kbd{C-u} prefix argument, previous highlights are kept, 1503When called with a @kbd{C-u} prefix argument, previous highlights are kept,
1425so several calls to this command can be stacked. 1504so several calls to this command can be stacked.
1505@orgcmdkkc{M-g n,M-g M-n,next-error}
1506Jump to the next sparse tree match in this buffer.
1507@orgcmdkkc{M-g p,M-g M-p,previous-error}
1508Jump to the previous sparse tree match in this buffer.
1426@end table 1509@end table
1427 1510
1511
1428@noindent 1512@noindent
1429@vindex org-agenda-custom-commands 1513@vindex org-agenda-custom-commands
1430For frequently used sparse trees of specific search strings, you can 1514For frequently used sparse trees of specific search strings, you can
@@ -1472,44 +1556,47 @@ Org knows ordered lists, unordered lists, and description lists.
1472@emph{Unordered} list items start with @samp{-}, @samp{+}, or 1556@emph{Unordered} list items start with @samp{-}, @samp{+}, or
1473@samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or 1557@samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
1474they will be seen as top-level headlines. Also, when you are hiding leading 1558they will be seen as top-level headlines. Also, when you are hiding leading
1475stars to get a clean outline view, plain list items starting with a star are 1559stars to get a clean outline view, plain list items starting with a star may
1476visually indistinguishable from true headlines. In short: even though 1560be hard to distinguish from true headlines. In short: even though @samp{*}
1477@samp{*} is supported, it may be better to not use it for plain list items.} 1561is supported, it may be better to not use it for plain list items.} as
1478as bullets. 1562bullets.
1479@item 1563@item
1480@vindex org-plain-list-ordered-item-terminator 1564@vindex org-plain-list-ordered-item-terminator
1565@vindex org-alphabetical-lists
1481@emph{Ordered} list items start with a numeral followed by either a period or 1566@emph{Ordered} list items start with a numeral followed by either a period or
1482a right parenthesis@footnote{You can filter out any of them by configuring 1567a right parenthesis@footnote{You can filter out any of them by configuring
1483@code{org-plain-list-ordered-item-terminator}.}, such as @samp{1.} or 1568@code{org-plain-list-ordered-item-terminator}.}, such as @samp{1.} or
1484@samp{1)}. If you want a list to start with a different value (e.g. 20), start 1569@samp{1)}@footnote{You can also get @samp{a.}, @samp{A.}, @samp{a)} and
1485the text of the item with @code{[@@20]}@footnote{If there's a checkbox in the 1570@samp{A)} by configuring @code{org-alphabetical-lists}. To minimize
1486item, the cookie must be put @emph{before} the checkbox.}. Those constructs 1571confusion with normal text, those are limited to one character only. Beyond
1487can be used in any item of the list in order to enforce a particular 1572that limit, bullets will automatically fallback to numbers.}. If you want a
1488numbering. 1573list to start with a different value (e.g.@: 20), start the text of the item
1574with @code{[@@20]}@footnote{If there's a checkbox in the item, the cookie
1575must be put @emph{before} the checkbox. If you have activated alphabetical
1576lists, you can also use counters like @code{[@@b]}.}. Those constructs can
1577be used in any item of the list in order to enforce a particular numbering.
1489@item 1578@item
1490@emph{Description} list items are unordered list items, and contain the 1579@emph{Description} list items are unordered list items, and contain the
1491separator @samp{ :: } to separate the description @emph{term} from the 1580separator @samp{ :: } to distinguish the description @emph{term} from the
1492description. 1581description.
1493@end itemize 1582@end itemize
1494 1583
1495Items belonging to the same list must have the same indentation on the first 1584Items belonging to the same list must have the same indentation on the first
1496line. In particular, if an ordered list reaches number @samp{10.}, then the 1585line. In particular, if an ordered list reaches number @samp{10.}, then the
14972--digit numbers must be written left-aligned with the other numbers in the 15862--digit numbers must be written left-aligned with the other numbers in the
1498list. 1587list. An item ends before the next line that is less or equally indented
1588than its bullet/number.
1499 1589
1500@vindex org-list-ending-method 1590@vindex org-list-ending-method
1501@vindex org-list-end-regexp 1591@vindex org-list-end-regexp
1502@vindex org-empty-line-terminates-plain-lists 1592@vindex org-empty-line-terminates-plain-lists
1503Two methods@footnote{To disable either of them, configure 1593Two methods@footnote{To disable either of them, configure
1504@code{org-list-ending-method}.} are provided to terminate lists. A list ends 1594@code{org-list-ending-method}.} are provided to terminate lists. A list ends
1505before the next line that is indented like the bullet/number or less, or it 1595whenever every item has ended, which means before any line less or equally
1506ends before two blank lines@footnote{See also 1596indented than items at top level. It also ends before two blank
1507@code{org-empty-line-terminates-plain-lists}.}. In both cases, all levels of 1597lines@footnote{See also @code{org-empty-line-terminates-plain-lists}.}. In
1508the list are closed@footnote{So you cannot have a sublist, some text and then 1598that case, all items are closed. For finer control, you can end lists with
1509another sublist while still in the same top-level list item. This used to be 1599any pattern set in @code{org-list-end-regexp}. Here is an example:
1510possible, but it was only supported in the HTML exporter and difficult to
1511manage with automatic indentation.}. For finer control, you can end lists
1512with any pattern set in @code{org-list-end-regexp}. Here is an example:
1513 1600
1514@example 1601@example
1515@group 1602@group
@@ -1520,8 +1607,8 @@ with any pattern set in @code{org-list-end-regexp}. Here is an example:
1520 + this was already my favorite scene in the book 1607 + this was already my favorite scene in the book
1521 + I really like Miranda Otto. 1608 + I really like Miranda Otto.
1522 3. Peter Jackson being shot by Legolas 1609 3. Peter Jackson being shot by Legolas
1523 He makes a really funny face when it happens.
1524 - on DVD only 1610 - on DVD only
1611 He makes a really funny face when it happens.
1525 But in the end, no individual scenes matter but the film as a whole. 1612 But in the end, no individual scenes matter but the film as a whole.
1526 Important actors in this film are: 1613 Important actors in this film are:
1527 - @b{Elijah Wood} :: He plays Frodo 1614 - @b{Elijah Wood} :: He plays Frodo
@@ -1536,13 +1623,15 @@ XEmacs, you should use Kyle E. Jones' @file{filladapt.el}. To turn this on,
1536put into @file{.emacs}: @code{(require 'filladapt)}}, and by exporting them 1623put into @file{.emacs}: @code{(require 'filladapt)}}, and by exporting them
1537properly (@pxref{Exporting}). Since indentation is what governs the 1624properly (@pxref{Exporting}). Since indentation is what governs the
1538structure of these lists, many structural constructs like @code{#+BEGIN_...} 1625structure of these lists, many structural constructs like @code{#+BEGIN_...}
1539blocks can be indented to signal that they should be considered as a list 1626blocks can be indented to signal that they belong to a particular item.
1540item.
1541 1627
1542@vindex org-list-demote-modify-bullet 1628@vindex org-list-demote-modify-bullet
1629@vindex org-list-indent-offset
1543If you find that using a different bullet for a sub-list (than that used for 1630If you find that using a different bullet for a sub-list (than that used for
1544the current list-level) improves readability, customize the variable 1631the current list-level) improves readability, customize the variable
1545@code{org-list-demote-modify-bullet}. 1632@code{org-list-demote-modify-bullet}. To get a greater difference of
1633indentation between items and theirs sub-items, customize
1634@code{org-list-indent-offset}.
1546 1635
1547@vindex org-list-automatic-rules 1636@vindex org-list-automatic-rules
1548The following commands act on items when the cursor is in the first line of 1637The following commands act on items when the cursor is in the first line of
@@ -1553,62 +1642,63 @@ to disable them individually.
1553 1642
1554@table @asis 1643@table @asis
1555@orgcmd{@key{TAB},org-cycle} 1644@orgcmd{@key{TAB},org-cycle}
1645@cindex cycling, in plain lists
1556@vindex org-cycle-include-plain-lists 1646@vindex org-cycle-include-plain-lists
1557Items can be folded just like headline levels. Normally this works only if 1647Items can be folded just like headline levels. Normally this works only if
1558the cursor is on a plain list item. For more details, see the variable 1648the cursor is on a plain list item. For more details, see the variable
1559@code{org-cycle-include-plain-lists}. If this variable is set to 1649@code{org-cycle-include-plain-lists}. If this variable is set to
1560@code{integrate}, plain list items will be treated like low-level 1650@code{integrate}, plain list items will be treated like low-level
1561headlines. The level of an item is then given by the 1651headlines. The level of an item is then given by the indentation of the
1562indentation of the bullet/number. Items are always subordinate to real 1652bullet/number. Items are always subordinate to real headlines, however; the
1563headlines, however; the hierarchies remain completely separated. 1653hierarchies remain completely separated. In a new item with no text yet, the
1654first @key{TAB} demotes the item to become a child of the previous
1655one. Subsequent @key{TAB}s move the item to meaningful levels in the list
1656and eventually get it back to its initial position.
1564@orgcmd{M-@key{RET},org-insert-heading} 1657@orgcmd{M-@key{RET},org-insert-heading}
1565@vindex org-M-RET-may-split-line 1658@vindex org-M-RET-may-split-line
1566@vindex org-list-automatic-rules 1659@vindex org-list-automatic-rules
1567Insert new item at current level. With a prefix argument, force a new 1660Insert new item at current level. With a prefix argument, force a new
1568heading (@pxref{Structure editing}). If this command is used in the middle 1661heading (@pxref{Structure editing}). If this command is used in the middle
1569of a line, the line is @emph{split} and the rest of the line becomes the new 1662of an item, that item is @emph{split} in two, and the second part becomes the
1570item@footnote{If you do not want the line to be split, customize the variable 1663new item@footnote{If you do not want the item to be split, customize the
1571@code{org-M-RET-may-split-line}.}. If this command is executed @emph{before 1664variable @code{org-M-RET-may-split-line}.}. If this command is executed
1572an item's body}, the new item is created @emph{before} the current item. If the 1665@emph{before item's body}, the new item is created @emph{before} the current
1573command is executed in the white space before the text that is part of an 1666one.
1574item but does not contain the bullet, a bullet is added to the current line. 1667@end table
1575 1668
1576As a new item cannot be inserted in a structural construct (like an example 1669@table @kbd
1577or source code block) within a list, Org will instead insert it right before
1578the structure, or return an error.
1579@kindex M-S-@key{RET} 1670@kindex M-S-@key{RET}
1580@item M-S-@key{RET} 1671@item M-S-RET
1581Insert a new item with a checkbox (@pxref{Checkboxes}). 1672Insert a new item with a checkbox (@pxref{Checkboxes}).
1582@orgcmd{@key{TAB},org-cycle}
1583In a new item with no text yet, the first @key{TAB} demotes the item to
1584become a child of the previous one. Subsequent @key{TAB}s move the item to
1585meaningful levels in the list and eventually get it back to its initial
1586position.
1587@kindex S-@key{down} 1673@kindex S-@key{down}
1588@item S-@key{up} 1674@item S-up
1589@itemx S-@key{down} 1675@itemx S-down
1590@cindex shift-selection-mode 1676@cindex shift-selection-mode
1591@vindex org-support-shift-select 1677@vindex org-support-shift-select
1592Jump to the previous/next item in the current list, but only if 1678@vindex org-list-use-circular-motion
1679Jump to the previous/next item in the current list@footnote{If you want to
1680cycle around items that way, you may customize
1681@code{org-list-use-circular-motion}.}, but only if
1593@code{org-support-shift-select} is off. If not, you can still use paragraph 1682@code{org-support-shift-select} is off. If not, you can still use paragraph
1594jumping commands like @kbd{C-@key{up}} and @kbd{C-@key{down}} to quite 1683jumping commands like @kbd{C-@key{up}} and @kbd{C-@key{down}} to quite
1595similar effect. 1684similar effect.
1596@kindex M-S-@key{up} 1685@kindex M-@key{up}
1597@kindex M-S-@key{down} 1686@kindex M-@key{down}
1598@item M-S-@key{up} 1687@item M-up
1599@itemx M-S-@key{down} 1688@itemx M-down
1600Move the item including subitems up/down (swap with previous/next item 1689Move the item including subitems up/down@footnote{See
1601of same indentation). If the list is ordered, renumbering is 1690@code{org-liste-use-circular-motion} for a cyclic behavior.} (swap with
1602automatic. 1691previous/next item of same indentation). If the list is ordered, renumbering
1692is automatic.
1603@kindex M-@key{left} 1693@kindex M-@key{left}
1604@kindex M-@key{right} 1694@kindex M-@key{right}
1605@item M-@key{left} 1695@item M-left
1606@itemx M-@key{right} 1696@itemx M-right
1607Decrease/increase the indentation of an item, leaving children alone. 1697Decrease/increase the indentation of an item, leaving children alone.
1608@kindex M-S-@key{left} 1698@kindex M-S-@key{left}
1609@kindex M-S-@key{right} 1699@kindex M-S-@key{right}
1610@item M-S-@key{left} 1700@item M-S-left
1611@itemx M-S-@key{right} 1701@itemx M-S-right
1612Decrease/increase the indentation of the item, including subitems. 1702Decrease/increase the indentation of the item, including subitems.
1613Initially, the item tree is selected based on current indentation. When 1703Initially, the item tree is selected based on current indentation. When
1614these commands are executed several times in direct succession, the initially 1704these commands are executed several times in direct succession, the initially
@@ -1623,9 +1713,8 @@ influence on the text @emph{after} the list.
1623@kindex C-c C-c 1713@kindex C-c C-c
1624@item C-c C-c 1714@item C-c C-c
1625If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the 1715If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
1626state of the checkbox. Also, makes sure that all the 1716state of the checkbox. In any case, verify bullets and indentation
1627items on this list level use the same bullet and that the numbering of list 1717consistency in the whole list.
1628items (if applicable) is correct.
1629@kindex C-c - 1718@kindex C-c -
1630@vindex org-plain-list-ordered-item-terminator 1719@vindex org-plain-list-ordered-item-terminator
1631@vindex org-list-automatic-rules 1720@vindex org-list-automatic-rules
@@ -1636,17 +1725,23 @@ depending on @code{org-plain-list-ordered-item-terminator}, the type of list,
1636and its position@footnote{See @code{bullet} rule in 1725and its position@footnote{See @code{bullet} rule in
1637@code{org-list-automatic-rules} for more information.}. With a numeric 1726@code{org-list-automatic-rules} for more information.}. With a numeric
1638prefix argument N, select the Nth bullet from this list. If there is an 1727prefix argument N, select the Nth bullet from this list. If there is an
1639active region when calling this, all lines will be converted to list items. 1728active region when calling this, selected text will be changed into an item.
1640If the first line already was a list item, any item markers will be removed 1729With a prefix argument, all lines will be converted to list items. If the
1641from the list. Finally, even without an active region, a normal line will be 1730first line already was a list item, any item marker will be removed from the
1731list. Finally, even without an active region, a normal line will be
1642converted into a list item. 1732converted into a list item.
1643@kindex C-c * 1733@kindex C-c *
1644@item C-c * 1734@item C-c *
1645Turn a plain list item into a headline (so that it becomes a subheading at 1735Turn a plain list item into a headline (so that it becomes a subheading at
1646its location). @xref{Structure editing}, for a detailed explanation. 1736its location). @xref{Structure editing}, for a detailed explanation.
1737@kindex C-c C-*
1738@item C-c C-*
1739Turn the whole plain list into a subtree of the current heading. Checkboxes
1740(@pxref{Checkboxes}) will become TODO (resp. DONE) keywords when unchecked
1741(resp. checked).
1647@kindex S-@key{left} 1742@kindex S-@key{left}
1648@kindex S-@key{right} 1743@kindex S-@key{right}
1649@item S-@key{left}/@key{right} 1744@item S-left/right
1650@vindex org-support-shift-select 1745@vindex org-support-shift-select
1651This command also cycles bullet styles when the cursor in on the bullet or 1746This command also cycles bullet styles when the cursor in on the bullet or
1652anywhere in an item line, details depending on 1747anywhere in an item line, details depending on
@@ -1665,7 +1760,7 @@ numerically, alphabetically, by time, or by custom function.
1665 1760
1666@vindex org-drawers 1761@vindex org-drawers
1667Sometimes you want to keep information associated with an entry, but you 1762Sometimes you want to keep information associated with an entry, but you
1668normally don't want to see it. For this, Org-mode has @emph{drawers}. 1763normally don't want to see it. For this, Org mode has @emph{drawers}.
1669Drawers need to be configured with the variable 1764Drawers need to be configured with the variable
1670@code{org-drawers}@footnote{You can define drawers on a per-file basis 1765@code{org-drawers}@footnote{You can define drawers on a per-file basis
1671with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers 1766with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
@@ -1675,7 +1770,7 @@ look like this:
1675** This is a headline 1770** This is a headline
1676 Still outside the drawer 1771 Still outside the drawer
1677 :DRAWERNAME: 1772 :DRAWERNAME:
1678 This is inside the drawer. 1773 This is inside the drawer.
1679 :END: 1774 :END:
1680 After the drawer. 1775 After the drawer.
1681@end example 1776@end example
@@ -1683,7 +1778,7 @@ look like this:
1683Visibility cycling (@pxref{Visibility cycling}) on the headline will hide and 1778Visibility cycling (@pxref{Visibility cycling}) on the headline will hide and
1684show the entry, but keep the drawer collapsed to a single line. In order to 1779show the entry, but keep the drawer collapsed to a single line. In order to
1685look inside the drawer, you need to move the cursor to the drawer line and 1780look inside the drawer, you need to move the cursor to the drawer line and
1686press @key{TAB} there. Org-mode uses the @code{PROPERTIES} drawer for 1781press @key{TAB} there. Org mode uses the @code{PROPERTIES} drawer for
1687storing properties (@pxref{Properties and Columns}), and you can also arrange 1782storing properties (@pxref{Properties and Columns}), and you can also arrange
1688for state change notes (@pxref{Tracking TODO state changes}) and clock times 1783for state change notes (@pxref{Tracking TODO state changes}) and clock times
1689(@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}. If you 1784(@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}. If you
@@ -1700,7 +1795,7 @@ Add a time-stamped note to the LOGBOOK drawer.
1700 1795
1701@vindex org-hide-block-startup 1796@vindex org-hide-block-startup
1702@cindex blocks, folding 1797@cindex blocks, folding
1703Org-mode uses begin...end blocks for various purposes from including source 1798Org mode uses begin...end blocks for various purposes from including source
1704code examples (@pxref{Literal examples}) to capturing time logging 1799code examples (@pxref{Literal examples}) to capturing time logging
1705information (@pxref{Clocking work time}). These blocks can be folded and 1800information (@pxref{Clocking work time}). These blocks can be folded and
1706unfolded by pressing TAB in the begin line. You can also get all blocks 1801unfolded by pressing TAB in the begin line. You can also get all blocks
@@ -1718,10 +1813,10 @@ or on a per-file basis by using
1718@section Footnotes 1813@section Footnotes
1719@cindex footnotes 1814@cindex footnotes
1720 1815
1721Org-mode supports the creation of footnotes. In contrast to the 1816Org mode supports the creation of footnotes. In contrast to the
1722@file{footnote.el} package, Org-mode's footnotes are designed for work on a 1817@file{footnote.el} package, Org mode's footnotes are designed for work on a
1723larger document, not only for one-off documents like emails. The basic 1818larger document, not only for one-off documents like emails. The basic
1724syntax is similar to the one used by @file{footnote.el}, i.e. a footnote is 1819syntax is similar to the one used by @file{footnote.el}, i.e.@: a footnote is
1725defined in a paragraph that is started by a footnote marker in square 1820defined in a paragraph that is started by a footnote marker in square
1726brackets in column 0, no indentation allowed. If you need a paragraph break 1821brackets in column 0, no indentation allowed. If you need a paragraph break
1727inside a footnote, use the @LaTeX{} idiom @samp{\par}. The footnote reference 1822inside a footnote, use the @LaTeX{} idiom @samp{\par}. The footnote reference
@@ -1733,11 +1828,11 @@ The Org homepage[fn:1] now looks a lot better than it used to.
1733[fn:1] The link is: http://orgmode.org 1828[fn:1] The link is: http://orgmode.org
1734@end example 1829@end example
1735 1830
1736Org-mode extends the number-based syntax to @emph{named} footnotes and 1831Org mode extends the number-based syntax to @emph{named} footnotes and
1737optional inline definition. Using plain numbers as markers (as 1832optional inline definition. Using plain numbers as markers (as
1738@file{footnote.el} does) is supported for backward compatibility, but not 1833@file{footnote.el} does) is supported for backward compatibility, but not
1739encouraged because of possible conflicts with @LaTeX{} snippets (@pxref{Embedded 1834encouraged because of possible conflicts with @LaTeX{} snippets (@pxref{Embedded
1740LaTeX}). Here are the valid references: 1835@LaTeX{}}). Here are the valid references:
1741 1836
1742@table @code 1837@table @code
1743@item [1] 1838@item [1]
@@ -1798,7 +1893,7 @@ S @r{Short for first @code{r}, then @code{s} action.}
1798n @r{Normalize the footnotes by collecting all definitions (including} 1893n @r{Normalize the footnotes by collecting all definitions (including}
1799 @r{inline definitions) into a special section, and then numbering them} 1894 @r{inline definitions) into a special section, and then numbering them}
1800 @r{in sequence. The references will then also be numbers. This is} 1895 @r{in sequence. The references will then also be numbers. This is}
1801 @r{meant to be the final step before finishing a document (e.g. sending} 1896 @r{meant to be the final step before finishing a document (e.g.@: sending}
1802 @r{off an email). The exporters do this automatically, and so could} 1897 @r{off an email). The exporters do this automatically, and so could}
1803 @r{something like @code{message-send-hook}.} 1898 @r{something like @code{message-send-hook}.}
1804d @r{Delete the footnote at point, and all definitions of and references} 1899d @r{Delete the footnote at point, and all definitions of and references}
@@ -1827,15 +1922,15 @@ you can use the usual commands to follow these links.
1827@cindex Orgstruct mode 1922@cindex Orgstruct mode
1828@cindex minor mode for structure editing 1923@cindex minor mode for structure editing
1829 1924
1830If you like the intuitive way the Org-mode structure editing and list 1925If you like the intuitive way the Org mode structure editing and list
1831formatting works, you might want to use these commands in other modes like 1926formatting works, you might want to use these commands in other modes like
1832Text mode or Mail mode as well. The minor mode @code{orgstruct-mode} makes 1927Text mode or Mail mode as well. The minor mode @code{orgstruct-mode} makes
1833this possible. Toggle the mode with @kbd{M-x orgstruct-mode}, or 1928this possible. Toggle the mode with @kbd{M-x orgstruct-mode}, or
1834turn it on by default, for example in Mail mode, with one of: 1929turn it on by default, for example in Message mode, with one of:
1835 1930
1836@lisp 1931@lisp
1837(add-hook 'mail-mode-hook 'turn-on-orgstruct) 1932(add-hook 'message-mode-hook 'turn-on-orgstruct)
1838(add-hook 'mail-mode-hook 'turn-on-orgstruct++) 1933(add-hook 'message-mode-hook 'turn-on-orgstruct++)
1839@end lisp 1934@end lisp
1840 1935
1841When this mode is active and the cursor is on a line that looks to Org like a 1936When this mode is active and the cursor is on a line that looks to Org like a
@@ -1875,10 +1970,11 @@ calculator).
1875@section The built-in table editor 1970@section The built-in table editor
1876@cindex table editor, built-in 1971@cindex table editor, built-in
1877 1972
1878Org makes it easy to format tables in plain ASCII. Any line with 1973Org makes it easy to format tables in plain ASCII. Any line with @samp{|} as
1879@samp{|} as the first non-whitespace character is considered part of a 1974the first non-whitespace character is considered part of a table. @samp{|}
1880table. @samp{|} is also the column separator. A table might look like 1975is also the column separator@footnote{To insert a vertical bar into a table
1881this: 1976field, use @code{\vert} or, inside a word @code{abc\vert@{@}def}.}. A table
1977might look like this:
1882 1978
1883@example 1979@example
1884| Name | Phone | Age | 1980| Name | Phone | Age |
@@ -1919,7 +2015,7 @@ unpredictable for you, configure the variables
1919@table @kbd 2015@table @kbd
1920@tsubheading{Creation and conversion} 2016@tsubheading{Creation and conversion}
1921@orgcmd{C-c |,org-table-create-or-convert-from-region} 2017@orgcmd{C-c |,org-table-create-or-convert-from-region}
1922Convert the active region to table. If every line contains at least one 2018Convert the active region to table. If every line contains at least one
1923TAB character, the function assumes that the material is tab separated. 2019TAB character, the function assumes that the material is tab separated.
1924If every line contains a comma, comma-separated values (CSV) are assumed. 2020If every line contains a comma, comma-separated values (CSV) are assumed.
1925If not, lines are split at whitespace into fields. You can use a prefix 2021If not, lines are split at whitespace into fields. You can use a prefix
@@ -1928,7 +2024,7 @@ C-u} forces TAB, and a numeric argument N indicates that at least N
1928consecutive spaces, or alternatively a TAB will be the separator. 2024consecutive spaces, or alternatively a TAB will be the separator.
1929@* 2025@*
1930If there is no active region, this command creates an empty Org 2026If there is no active region, this command creates an empty Org
1931table. But it's easier just to start typing, like 2027table. But it is easier just to start typing, like
1932@kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}. 2028@kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
1933 2029
1934@tsubheading{Re-aligning and field motion} 2030@tsubheading{Re-aligning and field motion}
@@ -2043,7 +2139,10 @@ increment. This key is also used by shift-selection and related modes
2043Edit the current field in a separate window. This is useful for fields that 2139Edit the current field in a separate window. This is useful for fields that
2044are not fully visible (@pxref{Column width and alignment}). When called with 2140are not fully visible (@pxref{Column width and alignment}). When called with
2045a @kbd{C-u} prefix, just make the full field visible, so that it can be 2141a @kbd{C-u} prefix, just make the full field visible, so that it can be
2046edited in place. 2142edited in place. When called with two @kbd{C-u} prefixes, make the editor
2143window follow the cursor through the table and always show the current
2144field. The follow mode exits automatically when the cursor leaves the table,
2145or when you repeat this command with @kbd{C-u C-u C-c `}.
2047@c 2146@c
2048@item M-x org-table-import 2147@item M-x org-table-import
2049Import a file as a table. The table should be TAB or whitespace 2148Import a file as a table. The table should be TAB or whitespace
@@ -2187,10 +2286,10 @@ If you like the intuitive way the Org table editor works, you
2187might also want to use it in other modes like Text mode or Mail mode. 2286might also want to use it in other modes like Text mode or Mail mode.
2188The minor mode Orgtbl mode makes this possible. You can always toggle 2287The minor mode Orgtbl mode makes this possible. You can always toggle
2189the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for 2288the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
2190example in mail mode, use 2289example in Message mode, use
2191 2290
2192@lisp 2291@lisp
2193(add-hook 'mail-mode-hook 'turn-on-orgtbl) 2292(add-hook 'message-mode-hook 'turn-on-orgtbl)
2194@end lisp 2293@end lisp
2195 2294
2196Furthermore, with some special setup, it is possible to maintain tables 2295Furthermore, with some special setup, it is possible to maintain tables
@@ -2219,11 +2318,12 @@ formula, moving these references by arrow keys
2219* References:: How to refer to another field or range 2318* References:: How to refer to another field or range
2220* Formula syntax for Calc:: Using Calc to compute stuff 2319* Formula syntax for Calc:: Using Calc to compute stuff
2221* Formula syntax for Lisp:: Writing formulas in Emacs Lisp 2320* Formula syntax for Lisp:: Writing formulas in Emacs Lisp
2222* Field formulas:: Formulas valid for a single field 2321* Durations and time values:: How to compute durations and time values
2322* Field and range formulas:: Formula for specific (ranges of) fields
2223* Column formulas:: Formulas valid for an entire column 2323* Column formulas:: Formulas valid for an entire column
2224* Editing and debugging formulas:: Fixing formulas 2324* Editing and debugging formulas:: Fixing formulas
2225* Updating the table:: Recomputing all dependent fields 2325* Updating the table:: Recomputing all dependent fields
2226* Advanced features:: Field names, parameters and automatic recalc 2326* Advanced features:: Field and column names, parameters and automatic recalc
2227@end menu 2327@end menu
2228 2328
2229@node References, Formula syntax for Calc, The spreadsheet, The spreadsheet 2329@node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
@@ -2243,35 +2343,42 @@ field, or press @kbd{C-c @}} to toggle the display of a grid.
2243Formulas can reference the value of another field in two ways. Like in 2343Formulas can reference the value of another field in two ways. Like in
2244any other spreadsheet, you may reference fields with a letter/number 2344any other spreadsheet, you may reference fields with a letter/number
2245combination like @code{B3}, meaning the 2nd field in the 3rd row. 2345combination like @code{B3}, meaning the 2nd field in the 3rd row.
2246@c Such references are always fixed to that field, they don't change 2346@vindex org-table-use-standard-references
2247@c when you copy and paste a formula to a different field. So 2347However, Org prefers@footnote{Org will understand references typed by the
2248@c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets. 2348user as @samp{B4}, but it will not use this syntax when offering a formula
2249 2349for editing. You can customize this behavior using the variable
2250@noindent 2350@code{org-table-use-standard-references}.} to use another, more general
2251Org also uses another, more general operator that looks like this: 2351representation that looks like this:
2252@example 2352@example
2253@@@var{row}$@var{column} 2353@@@var{row}$@var{column}
2254@end example 2354@end example
2255 2355
2256@noindent 2356Column specifications can be absolute like @code{$1},
2257Column references can be absolute like @samp{1}, @samp{2},...@samp{@var{N}}, 2357@code{$2},...@code{$@var{N}}, or relative to the current column (i.e.@: the
2258or relative to the current column like @samp{+1} or @samp{-2}. 2358column of the field which is being computed) like @code{$+1} or @code{$-2}.
2259 2359@code{$<} and @code{$>} are immutable references to the first and last
2260The row specification only counts data lines and ignores horizontal 2360column, respectively, and you can use @code{$>>>} to indicate the third
2261separator lines (hlines). You can use absolute row numbers 2361column from the right.
2262@samp{1}...@samp{@var{N}}, and row numbers relative to the current row like 2362
2263@samp{+3} or @samp{-1}. Or specify the row relative to one of the 2363The row specification only counts data lines and ignores horizontal separator
2264hlines: @samp{I} refers to the first hline@footnote{Note that only 2364lines (hlines). Like with columns, you can use absolute row numbers
2265hlines are counted that @emph{separate} table lines. If the table 2365@code{@@1}, @code{@@2},...@code{@@@var{N}}, and row numbers relative to the
2266starts with a hline above the header, it does not count.}, @samp{II} to 2366current row like @code{@@+3} or @code{@@-1}. @code{@@<} and @code{@@>} are
2267the second, etc@. @samp{-I} refers to the first such line above the 2367immutable references the first and last@footnote{For backward compatibility
2268current line, @samp{+I} to the first such line below the current line. 2368you can also use special names like @code{$LR5} and @code{$LR12} to refer in
2269You can also write @samp{III+2} which is the second data line after the 2369a stable way to the 5th and 12th field in the last row of the table.
2270third hline in the table. 2370However, this syntax is deprecated, it should not be used for new documents.
2271 2371Use @code{@@>$} instead.} row in the table, respectively. You may also
2272@samp{0} refers to the current row and column. Also, if you omit 2372specify the row relative to one of the hlines: @code{@@I} refers to the first
2273either the column or the row part of the reference, the current 2373hline, @code{@@II} to the second, etc@. @code{@@-I} refers to the first such
2274row/column is implied. 2374line above the current line, @code{@@+I} to the first such line below the
2375current line. You can also write @code{@@III+2} which is the second data line
2376after the third hline in the table.
2377
2378@code{@@0} and @code{$0} refer to the current row and column, respectively,
2379i.e. to the row/column for the field being computed. Also, if you omit
2380either the column or the row part of the reference, the current row/column is
2381implied.
2275 2382
2276Org's references with @emph{unsigned} numbers are fixed references 2383Org's references with @emph{unsigned} numbers are fixed references
2277in the sense that if you use the same reference in the formula for two 2384in the sense that if you use the same reference in the formula for two
@@ -2280,20 +2387,15 @@ Org's references with @emph{signed} numbers are floating
2280references because the same reference operator can reference different 2387references because the same reference operator can reference different
2281fields depending on the field being calculated by the formula. 2388fields depending on the field being calculated by the formula.
2282 2389
2283As a special case, references like @samp{$LR5} and @samp{$LR12} can be used
2284to refer in a stable way to the 5th and 12th field in the last row of the
2285table.
2286
2287Here are a few examples: 2390Here are a few examples:
2288 2391
2289@example 2392@example
2290@@2$3 @r{2nd row, 3rd column} 2393@@2$3 @r{2nd row, 3rd column (same as @code{C2})}
2291C2 @r{same as previous} 2394$5 @r{column 5 in the current row (same as @code{E&})}
2292$5 @r{column 5 in the current row}
2293E& @r{same as previous}
2294@@2 @r{current column, row 2} 2395@@2 @r{current column, row 2}
2295@@-1$-3 @r{the field one row up, three columns to the left} 2396@@-1$-3 @r{the field one row up, three columns to the left}
2296@@-I$2 @r{field just under hline above current row, column 2} 2397@@-I$2 @r{field just under hline above current row, column 2}
2398@@>$5 @r{field in the last row, in column 5}
2297@end example 2399@end example
2298 2400
2299@subsubheading Range references 2401@subsubheading Range references
@@ -2308,11 +2410,12 @@ format at least for the first field (i.e the reference must start with
2308@samp{@@} in order to be interpreted correctly). Examples: 2410@samp{@@} in order to be interpreted correctly). Examples:
2309 2411
2310@example 2412@example
2311$1..$3 @r{First three fields in the current row.} 2413$1..$3 @r{first three fields in the current row}
2312$P..$Q @r{Range, using column names (see under Advanced)} 2414$P..$Q @r{range, using column names (see under Advanced)}
2313@@2$1..@@4$3 @r{6 fields between these two fields.} 2415$<<<..$>> @r{start in third column, continue to the one but last}
2314A2..C4 @r{Same as above.} 2416@@2$1..@@4$3 @r{6 fields between these two fields (same as @code{A2..C4})}
2315@@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row} 2417@@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
2418@@I..II @r{between first and second hline, short for @code{@@I..@@II}}
2316@end example 2419@end example
2317 2420
2318@noindent Range references return a vector of values that can be fed 2421@noindent Range references return a vector of values that can be fed
@@ -2339,7 +2442,7 @@ $3 = remote(FOO, @@@@#$2) @r{copy column 2 from table FOO into}
2339@end example 2442@end example
2340 2443
2341@noindent For the second example, table FOO must have at least as many rows 2444@noindent For the second example, table FOO must have at least as many rows
2342as the current table. Inefficient@footnote{The computation time scales as 2445as the current table. Note that this is inefficient@footnote{The computation time scales as
2343O(N^2) because table FOO is parsed for each field to be copied.} for large 2446O(N^2) because table FOO is parsed for each field to be copied.} for large
2344number of rows. 2447number of rows.
2345 2448
@@ -2440,7 +2543,6 @@ n3 s3 e2 f4 @r{Normal, scientific, engineering, or fixed}
2440D R @r{angle modes: degrees, radians} 2543D R @r{angle modes: degrees, radians}
2441F S @r{fraction and symbolic modes} 2544F S @r{fraction and symbolic modes}
2442N @r{interpret all fields as numbers, use 0 for non-numbers} 2545N @r{interpret all fields as numbers, use 0 for non-numbers}
2443T @r{force text interpretation}
2444E @r{keep empty fields in ranges} 2546E @r{keep empty fields in ranges}
2445L @r{literal} 2547L @r{literal}
2446@end example 2548@end example
@@ -2474,10 +2576,13 @@ taylor($3,x=7,2) @r{Taylor series of $3, at x=7, second degree}
2474Calc also contains a complete set of logical operations. For example 2576Calc also contains a complete set of logical operations. For example
2475 2577
2476@example 2578@example
2477if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty} 2579if($1<20,teen,string("")) @r{"teen" if age $1 less than 20, else empty}
2478@end example 2580@end example
2479 2581
2480@node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet 2582Note that you can also use two org-specific flags @code{T} and @code{t} for
2583durations computations @ref{Durations and time values}.
2584
2585@node Formula syntax for Lisp, Durations and time values, Formula syntax for Calc, The spreadsheet
2481@subsection Emacs Lisp forms as formulas 2586@subsection Emacs Lisp forms as formulas
2482@cindex Lisp forms, as table formulas 2587@cindex Lisp forms, as table formulas
2483 2588
@@ -2496,7 +2601,7 @@ you provide the @samp{L} flag, all fields will be interpolated literally,
2496without quotes. I.e., if you want a reference to be interpreted as a string 2601without quotes. I.e., if you want a reference to be interpreted as a string
2497by the Lisp form, enclose the reference operator itself in double-quotes, 2602by the Lisp form, enclose the reference operator itself in double-quotes,
2498like @code{"$3"}. Ranges are inserted as space-separated fields, so you can 2603like @code{"$3"}. Ranges are inserted as space-separated fields, so you can
2499+embed them in list or vector syntax. Here are a few examples---note how the 2604embed them in list or vector syntax. Here are a few examples---note how the
2500@samp{N} mode is used when we do computations in Lisp: 2605@samp{N} mode is used when we do computations in Lisp:
2501 2606
2502@example 2607@example
@@ -2508,31 +2613,64 @@ like @code{"$3"}. Ranges are inserted as space-separated fields, so you can
2508 '(apply '+ '($1..$4));N 2613 '(apply '+ '($1..$4));N
2509@end example 2614@end example
2510 2615
2511@node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet 2616@node Durations and time values, Field and range formulas, Formula syntax for Lisp, The spreadsheet
2512@subsection Field formulas 2617@subsection Durations and time values
2618@cindex Duration, computing
2619@cindex Time, computing
2620@vindex org-table-duration-custom-format
2621
2622If you want to compute time values use the @code{T} flag, either in Calc
2623formulas or Elisp formulas:
2624
2625@example
2626@group
2627 | Task 1 | Task 2 | Total |
2628 |---------+----------+----------|
2629 | 2:12 | 1:47 | 03:59:00 |
2630 | 3:02:20 | -2:07:00 | 0.92 |
2631 #+TBLFM: @@2$3=$1+$2;T::@@3$3=$1+$2;t
2632@end group
2633@end example
2634
2635Input duration values must be of the form @code{[HH:MM[:SS]}, where seconds
2636are optional. With the @code{T} flag, computed durations will be displayed
2637as @code{[HH:MM:SS} (see the first formula above). With the @code{t} flag,
2638computed durations will be displayed according to the value of the variable
2639@code{org-table-duration-custom-format}, which defaults to @code{'hours} and
2640will display the result as a fraction of hours (see the second formula in the
2641example above).
2642
2643Negative duration values can be manipulated as well, and integers will be
2644considered as seconds in addition and subtraction.
2645
2646@node Field and range formulas, Column formulas, Durations and time values, The spreadsheet
2647@subsection Field and range formulas
2513@cindex field formula 2648@cindex field formula
2649@cindex range formula
2514@cindex formula, for individual table field 2650@cindex formula, for individual table field
2651@cindex formula, for range of fields
2515 2652
2516To assign a formula to a particular field, type it directly into the 2653To assign a formula to a particular field, type it directly into the field,
2517field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you 2654preceded by @samp{:=}, for example @samp{:=vsum(@@II..III)}. When you press
2518press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in 2655@key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the field,
2519the field, the formula will be stored as the formula for this field, 2656the formula will be stored as the formula for this field, evaluated, and the
2520evaluated, and the current field replaced with the result. 2657current field will be replaced with the result.
2521 2658
2522@cindex #+TBLFM 2659@cindex #+TBLFM
2523Formulas are stored in a special line starting with @samp{#+TBLFM:} 2660Formulas are stored in a special line starting with @samp{#+TBLFM:} directly
2524directly below the table. If you type the equation in the 4th field of 2661below the table. If you type the equation in the 4th field of the 3rd data
2525the 3rd data line in the table, the formula will look like 2662line in the table, the formula will look like @samp{@@3$4=$1+$2}. When
2526@samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows 2663inserting/deleting/swapping column and rows with the appropriate commands,
2527with the appropriate commands, @i{absolute references} (but not relative 2664@i{absolute references} (but not relative ones) in stored formulas are
2528ones) in stored formulas are modified in order to still reference the 2665modified in order to still reference the same field. To avoid this from
2529same field. Of course this is not true if you edit the table structure 2666happening, in particular in range references, anchor ranges at the table
2530with normal editing commands---then you must fix the equations yourself. 2667borders (using @code{@@<}, @code{@@>}, @code{$<}, @code{$>}), or at hlines
2531The left-hand side of a formula may also be a named field (@pxref{Advanced 2668using the @code{@@I} notation. Automatic adaptation of field references does
2532features}), or a last-row reference like @samp{$LR3}. 2669of cause not happen if you edit the table structure with normal editing
2533 2670commands---then you must fix the equations yourself.
2534Instead of typing an equation into the field, you may also use the 2671
2535following command 2672Instead of typing an equation into the field, you may also use the following
2673command
2536 2674
2537@table @kbd 2675@table @kbd
2538@orgcmd{C-u C-c =,org-table-eval-formula} 2676@orgcmd{C-u C-c =,org-table-eval-formula}
@@ -2541,17 +2679,38 @@ formula with default taken from the @samp{#+TBLFM:} line, applies
2541it to the current field, and stores it. 2679it to the current field, and stores it.
2542@end table 2680@end table
2543 2681
2544@node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet 2682The left-hand side of a formula can also be a special expression in order to
2683assign the formula to a number of different fields. There is no keyboard
2684shortcut to enter such range formulas. To add them, use the formula editor
2685(@pxref{Editing and debugging formulas}) or edit the @code{#+TBLFM:} line
2686directly.
2687
2688@table @code
2689@item $2=
2690Column formula, valid for the entire column. This is so common that Org
2691treats these formulas in a special way, see @ref{Column formulas}.
2692@item @@3=
2693Row formula, applies to all fields in the specified row. @code{@@>=} means
2694the last row.
2695@item @@1$2..@@4$3=
2696Range formula, applies to all fields in the given rectangular range. This
2697can also be used to assign a formula to some but not all fields in a row.
2698@item $name=
2699Named field, see @ref{Advanced features}.
2700@end table
2701
2702@node Column formulas, Editing and debugging formulas, Field and range formulas, The spreadsheet
2545@subsection Column formulas 2703@subsection Column formulas
2546@cindex column formula 2704@cindex column formula
2547@cindex formula, for table column 2705@cindex formula, for table column
2548 2706
2549Often in a table, the same formula should be used for all fields in a 2707When you assign a formula to a simple column reference like @code{$3=}, the
2550particular column. Instead of having to copy the formula to all fields 2708same formula will be used in all fields of that column, with the following
2551in that column, Org allows you to assign a single formula to an entire 2709very convenient exceptions: (i) If the table contains horizontal separator
2552column. If the table contains horizontal separator hlines, everything 2710hlines, everything before the first such line is considered part of the table
2553before the first such line is considered part of the table @emph{header} 2711@emph{header} and will not be modified by column formulas. (ii) Fields that
2554and will not be modified by column formulas. 2712already get a value from a field/range formula will be left alone by column
2713formulas. These conditions make column formulas very easy to use.
2555 2714
2556To assign a formula to a column, type it directly into any field in the 2715To assign a formula to a column, type it directly into any field in the
2557column, preceded by an equal sign, like @samp{=$1+$2}. When you press 2716column, preceded by an equal sign, like @samp{=$1+$2}. When you press
@@ -2560,9 +2719,9 @@ the formula will be stored as the formula for the current column, evaluated
2560and the current field replaced with the result. If the field contains only 2719and the current field replaced with the result. If the field contains only
2561@samp{=}, the previously stored formula for this column is used. For each 2720@samp{=}, the previously stored formula for this column is used. For each
2562column, Org will only remember the most recently used formula. In the 2721column, Org will only remember the most recently used formula. In the
2563@samp{#+TBLFM:} line, column formulas will look like @samp{$4=$1+$2}. The left-hand 2722@samp{#+TBLFM:} line, column formulas will look like @samp{$4=$1+$2}. The
2564side of a column formula cannot currently be the name of column, it 2723left-hand side of a column formula can not be the name of column, it must be
2565must be the numeric column reference. 2724the numeric column reference or @code{$>}.
2566 2725
2567Instead of typing an equation into the field, you may also use the 2726Instead of typing an equation into the field, you may also use the
2568following command: 2727following command:
@@ -2572,7 +2731,7 @@ following command:
2572Install a new formula for the current column and replace current field with 2731Install a new formula for the current column and replace current field with
2573the result of the formula. The command prompts for a formula, with default 2732the result of the formula. The command prompts for a formula, with default
2574taken from the @samp{#+TBLFM} line, applies it to the current field and 2733taken from the @samp{#+TBLFM} line, applies it to the current field and
2575stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command 2734stores it. With a numeric prefix argument(e.g.@: @kbd{C-5 C-c =}) the command
2576will apply it to that many consecutive fields in the current column. 2735will apply it to that many consecutive fields in the current column.
2577@end table 2736@end table
2578 2737
@@ -2593,7 +2752,7 @@ if possible. If you prefer to only work with the internal format (like
2593@table @kbd 2752@table @kbd
2594@orgcmdkkc{C-c =,C-u C-c =,org-table-eval-formula} 2753@orgcmdkkc{C-c =,C-u C-c =,org-table-eval-formula}
2595Edit the formula associated with the current column/field in the 2754Edit the formula associated with the current column/field in the
2596minibuffer. See @ref{Column formulas}, and @ref{Field formulas}. 2755minibuffer. See @ref{Column formulas}, and @ref{Field and range formulas}.
2597@orgcmd{C-u C-u C-c =,org-table-eval-formula} 2756@orgcmd{C-u C-u C-c =,org-table-eval-formula}
2598Re-insert the active formula (either a 2757Re-insert the active formula (either a
2599field formula, or a column formula) into the current field, so that you 2758field formula, or a column formula) into the current field, so that you
@@ -2696,7 +2855,7 @@ following commands:
2696@table @kbd 2855@table @kbd
2697@orgcmd{C-c *,org-table-recalculate} 2856@orgcmd{C-c *,org-table-recalculate}
2698Recalculate the current row by first applying the stored column formulas 2857Recalculate the current row by first applying the stored column formulas
2699from left to right, and all field formulas in the current row. 2858from left to right, and all field/range formulas in the current row.
2700@c 2859@c
2701@kindex C-u C-c * 2860@kindex C-u C-c *
2702@item C-u C-c * 2861@item C-u C-c *
@@ -2721,9 +2880,12 @@ dependencies.
2721@node Advanced features, , Updating the table, The spreadsheet 2880@node Advanced features, , Updating the table, The spreadsheet
2722@subsection Advanced features 2881@subsection Advanced features
2723 2882
2724If you want the recalculation of fields to happen automatically, or if 2883If you want the recalculation of fields to happen automatically, or if you
2725you want to be able to assign @i{names} to fields and columns, you need 2884want to be able to assign @i{names}@footnote{Such names must start by an
2726to reserve the first column of the table for special marking characters. 2885alphabetic character and use only alphanumeric/underscore characters.} to
2886fields and columns, you need to reserve the first column of the table for
2887special marking characters.
2888
2727@table @kbd 2889@table @kbd
2728@orgcmd{C-#,org-table-rotate-recalc-marks} 2890@orgcmd{C-#,org-table-rotate-recalc-marks}
2729Rotate the calculation mark in first column through the states @samp{ }, 2891Rotate the calculation mark in first column through the states @samp{ },
@@ -2849,7 +3011,7 @@ Further control over the labels, type, content, and appearance of plots can
2849be exercised through the @code{#+PLOT:} lines preceding a table. See below 3011be exercised through the @code{#+PLOT:} lines preceding a table. See below
2850for a complete list of Org-plot options. For more information and examples 3012for a complete list of Org-plot options. For more information and examples
2851see the Org-plot tutorial at 3013see the Org-plot tutorial at
2852@uref{http://orgmode.org/worg/org-tutorials/org-plot.php}. 3014@uref{http://orgmode.org/worg/org-tutorials/org-plot.html}.
2853 3015
2854@subsubheading Plot Options 3016@subsubheading Plot Options
2855 3017
@@ -2874,7 +3036,7 @@ Specify whether the plot will be @code{2d}, @code{3d}, or @code{grid}.
2874 3036
2875@item with 3037@item with
2876Specify a @code{with} option to be inserted for every col being plotted 3038Specify a @code{with} option to be inserted for every col being plotted
2877(e.g. @code{lines}, @code{points}, @code{boxes}, @code{impulses}, etc...). 3039(e.g.@: @code{lines}, @code{points}, @code{boxes}, @code{impulses}, etc...).
2878Defaults to @code{lines}. 3040Defaults to @code{lines}.
2879 3041
2880@item file 3042@item file
@@ -2892,7 +3054,7 @@ When plotting @code{3d} or @code{grid} types, set this to @code{t} to graph a
2892flat mapping rather than a @code{3d} slope. 3054flat mapping rather than a @code{3d} slope.
2893 3055
2894@item timefmt 3056@item timefmt
2895Specify format of Org-mode timestamps as they will be parsed by Gnuplot. 3057Specify format of Org mode timestamps as they will be parsed by Gnuplot.
2896Defaults to @samp{%Y-%m-%d-%H:%M:%S}. 3058Defaults to @samp{%Y-%m-%d-%H:%M:%S}.
2897 3059
2898@item script 3060@item script
@@ -2976,7 +3138,7 @@ or with a mouse click (@pxref{Handling links}). Links to custom IDs will
2976point to the corresponding headline. The preferred match for a text link is 3138point to the corresponding headline. The preferred match for a text link is
2977a @i{dedicated target}: the same string in double angular brackets. Targets 3139a @i{dedicated target}: the same string in double angular brackets. Targets
2978may be located anywhere; sometimes it is convenient to put them into a 3140may be located anywhere; sometimes it is convenient to put them into a
2979comment line. For example 3141comment line. For example
2980 3142
2981@example 3143@example
2982# <<My Target>> 3144# <<My Target>>
@@ -3055,11 +3217,19 @@ file:papers/last.pdf @r{file, relative path}
3055./papers/last.pdf @r{same as above} 3217./papers/last.pdf @r{same as above}
3056file:/myself@@some.where:papers/last.pdf @r{file, path on remote machine} 3218file:/myself@@some.where:papers/last.pdf @r{file, path on remote machine}
3057/myself@@some.where:papers/last.pdf @r{same as above} 3219/myself@@some.where:papers/last.pdf @r{same as above}
3058file:sometextfile::NNN @r{file with line number to jump to} 3220file:sometextfile::NNN @r{file, jump to line number}
3059file:projects.org @r{another Org file} 3221file:projects.org @r{another Org file}
3060file:projects.org::some words @r{text search in Org file} 3222file:projects.org::some words @r{text search in Org file}@footnote{
3223The actual behavior of the search will depend on the value of
3224the variable @code{org-link-search-must-match-exact-headline}. If its value
3225is nil, then a fuzzy text search will be done. If it is t, then only the
3226exact headline will be matched. If the value is @code{'query-to-create},
3227then an exact headline will be searched; if it is not found, then the user
3228will be queried to create it.}
3061file:projects.org::*task title @r{heading search in Org file} 3229file:projects.org::*task title @r{heading search in Org file}
3062docview:papers/last.pdf::NNN @r{open file in doc-view mode at page NNN} 3230file+sys:/path/to/file @r{open via OS, like double-click}
3231file+emacs:/path/to/file @r{force opening by Emacs}
3232docview:papers/last.pdf::NNN @r{open in doc-view mode at page}
3063id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID} 3233id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID}
3064news:comp.emacs @r{Usenet link} 3234news:comp.emacs @r{Usenet link}
3065mailto:adent@@galaxy.net @r{Mail link} 3235mailto:adent@@galaxy.net @r{Mail link}
@@ -3076,12 +3246,14 @@ gnus:group @r{Gnus group link}
3076gnus:group#id @r{Gnus article link} 3246gnus:group#id @r{Gnus article link}
3077bbdb:R.*Stallman @r{BBDB link (with regexp)} 3247bbdb:R.*Stallman @r{BBDB link (with regexp)}
3078irc:/irc.com/#emacs/bob @r{IRC link} 3248irc:/irc.com/#emacs/bob @r{IRC link}
3079info:org:External%20links @r{Info node link (with encoded space)} 3249info:org#External links @r{Info node link}
3080shell:ls *.org @r{A shell command} 3250shell:ls *.org @r{A shell command}
3081elisp:org-agenda @r{Interactive Elisp command} 3251elisp:org-agenda @r{Interactive Elisp command}
3082elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate} 3252elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate}
3083@end example 3253@end example
3084 3254
3255For customizing Org to add new link types @ref{Adding hyperlink types}.
3256
3085A link should be enclosed in double brackets and may contain a 3257A link should be enclosed in double brackets and may contain a
3086descriptive text to be displayed instead of the URL (@pxref{Link 3258descriptive text to be displayed instead of the URL (@pxref{Link
3087format}), for example: 3259format}), for example:
@@ -3120,10 +3292,12 @@ create a link. The link will be stored for later insertion into an Org
3120buffer (see below). What kind of link will be created depends on the current 3292buffer (see below). What kind of link will be created depends on the current
3121buffer: 3293buffer:
3122 3294
3123@b{Org-mode buffers}@* 3295@b{Org mode buffers}@*
3124For Org files, if there is a @samp{<<target>>} at the cursor, the link points 3296For Org files, if there is a @samp{<<target>>} at the cursor, the link points
3125to the target. Otherwise it points to the current headline, which will also 3297to the target. Otherwise it points to the current headline, which will also
3126be the description. 3298be the description@footnote{If the headline contains a timestamp, it will be
3299removed from the link and result in a wrong link -- you should avoid putting
3300timestamp in the headline.}.
3127 3301
3128@vindex org-link-to-org-use-id 3302@vindex org-link-to-org-use-id
3129@cindex property, CUSTOM_ID 3303@cindex property, CUSTOM_ID
@@ -3221,6 +3395,7 @@ link and description parts of the link.
3221@cindex following links 3395@cindex following links
3222@orgcmd{C-c C-o,org-open-at-point} 3396@orgcmd{C-c C-o,org-open-at-point}
3223@vindex org-file-apps 3397@vindex org-file-apps
3398@vindex org-link-frame-setup
3224Open link at point. This will launch a web browser for URLs (using 3399Open link at point. This will launch a web browser for URLs (using
3225@command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for 3400@command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
3226the corresponding links, and execute the command in a shell link. When the 3401the corresponding links, and execute the command in a shell link. When the
@@ -3234,7 +3409,9 @@ Classification of files is based on file extension only. See option
3234visit the file with Emacs, use a @kbd{C-u} prefix. If you want to avoid 3409visit the file with Emacs, use a @kbd{C-u} prefix. If you want to avoid
3235opening in Emacs, use a @kbd{C-u C-u} prefix.@* 3410opening in Emacs, use a @kbd{C-u C-u} prefix.@*
3236If the cursor is on a headline, but not on a link, offer all links in the 3411If the cursor is on a headline, but not on a link, offer all links in the
3237headline and entry text. 3412headline and entry text. If you want to setup the frame configuration for
3413following links, customize @code{org-link-frame-setup}.
3414
3238@orgkey @key{RET} 3415@orgkey @key{RET}
3239@vindex org-return-follows-link 3416@vindex org-return-follows-link
3240When @code{org-return-follows-link} is set, @kbd{@key{RET}} will also follow 3417When @code{org-return-follows-link} is set, @kbd{@key{RET}} will also follow
@@ -3261,7 +3438,7 @@ variable @code{org-display-internal-link-with-indirect-buffer}}.
3261@cindex @code{inlineimages}, STARTUP keyword 3438@cindex @code{inlineimages}, STARTUP keyword
3262@cindex @code{noinlineimages}, STARTUP keyword 3439@cindex @code{noinlineimages}, STARTUP keyword
3263Toggle the inline display of linked images. Normally this will only inline 3440Toggle the inline display of linked images. Normally this will only inline
3264images that have no description part in the link, i.e. images that will also 3441images that have no description part in the link, i.e.@: images that will also
3265be inlined during export. When called with a prefix argument, also display 3442be inlined during export. When called with a prefix argument, also display
3266images that do have a link description. You can ask for inline images to be 3443images that do have a link description. You can ask for inline images to be
3267displayed at startup by configuring the variable 3444displayed at startup by configuring the variable
@@ -3270,7 +3447,7 @@ displayed at startup by configuring the variable
3270@orgcmd{C-c %,org-mark-ring-push} 3447@orgcmd{C-c %,org-mark-ring-push}
3271@cindex mark ring 3448@cindex mark ring
3272Push the current position onto the mark ring, to be able to return 3449Push the current position onto the mark ring, to be able to return
3273easily. Commands following an internal link do this automatically. 3450easily. Commands following an internal link do this automatically.
3274@c 3451@c
3275@orgcmd{C-c &,org-mark-ring-goto} 3452@orgcmd{C-c &,org-mark-ring-goto}
3276@cindex links, returning to 3453@cindex links, returning to
@@ -3288,8 +3465,8 @@ to @kbd{C-n} and @kbd{C-p}
3288@lisp 3465@lisp
3289(add-hook 'org-load-hook 3466(add-hook 'org-load-hook
3290 (lambda () 3467 (lambda ()
3291 (define-key 'org-mode-map "\C-n" 'org-next-link) 3468 (define-key org-mode-map "\C-n" 'org-next-link)
3292 (define-key 'org-mode-map "\C-p" 'org-previous-link))) 3469 (define-key org-mode-map "\C-p" 'org-previous-link)))
3293@end lisp 3470@end lisp
3294@end table 3471@end table
3295 3472
@@ -3363,7 +3540,7 @@ can define them in the file with
3363@noindent 3540@noindent
3364In-buffer completion (@pxref{Completion}) can be used after @samp{[} to 3541In-buffer completion (@pxref{Completion}) can be used after @samp{[} to
3365complete link abbreviations. You may also define a function 3542complete link abbreviations. You may also define a function
3366@code{org-PREFIX-complete-link} that implements special (e.g. completion) 3543@code{org-PREFIX-complete-link} that implements special (e.g.@: completion)
3367support for inserting such a link with @kbd{C-c C-l}. Such a function should 3544support for inserting such a link with @kbd{C-c C-l}. Such a function should
3368not accept any arguments, and return the full link with prefix. 3545not accept any arguments, and return the full link with prefix.
3369 3546
@@ -3375,7 +3552,7 @@ not accept any arguments, and return the full link with prefix.
3375File links can contain additional information to make Emacs jump to a 3552File links can contain additional information to make Emacs jump to a
3376particular location in the file when following a link. This can be a 3553particular location in the file when following a link. This can be a
3377line number or a search option after a double@footnote{For backward 3554line number or a search option after a double@footnote{For backward
3378compatibility, line numbers can also follow a single colon.} colon. For 3555compatibility, line numbers can also follow a single colon.} colon. For
3379example, when the command @kbd{C-c l} creates a link (@pxref{Handling 3556example, when the command @kbd{C-c l} creates a link (@pxref{Handling
3380links}) to a file, it encodes the words in the current line as a search 3557links}) to a file, it encodes the words in the current line as a search
3381string that can be used to find this line back later when following the 3558string that can be used to find this line back later when following the
@@ -3408,7 +3585,7 @@ Link to a heading with a @code{CUSTOM_ID} property
3408@item /regexp/ 3585@item /regexp/
3409Do a regular expression search for @code{regexp}. This uses the Emacs 3586Do a regular expression search for @code{regexp}. This uses the Emacs
3410command @code{occur} to list all matches in a separate window. If the 3587command @code{occur} to list all matches in a separate window. If the
3411target file is in Org-mode, @code{org-occur} is used to create a 3588target file is in Org mode, @code{org-occur} is used to create a
3412sparse tree with the matches. 3589sparse tree with the matches.
3413@c If the target file is a directory, 3590@c If the target file is a directory,
3414@c @code{grep} will be used to search all files in the directory. 3591@c @code{grep} will be used to search all files in the directory.
@@ -3447,7 +3624,7 @@ an implementation example. See the file @file{org-bibtex.el}.
3447@chapter TODO items 3624@chapter TODO items
3448@cindex TODO items 3625@cindex TODO items
3449 3626
3450Org-mode does not maintain TODO lists as separate documents@footnote{Of 3627Org mode does not maintain TODO lists as separate documents@footnote{Of
3451course, you can make a document that contains only long lists of TODO items, 3628course, you can make a document that contains only long lists of TODO items,
3452but this is not required.}. Instead, TODO items are an integral part of the 3629but this is not required.}. Instead, TODO items are an integral part of the
3453notes file, because TODO items usually come up while taking notes! With Org 3630notes file, because TODO items usually come up while taking notes! With Org
@@ -3456,7 +3633,7 @@ information is not duplicated, and the entire context from which the TODO
3456item emerged is always present. 3633item emerged is always present.
3457 3634
3458Of course, this technique for managing TODO items scatters them 3635Of course, this technique for managing TODO items scatters them
3459throughout your notes file. Org-mode compensates for this by providing 3636throughout your notes file. Org mode compensates for this by providing
3460methods to give you an overview of all the things that you have to do. 3637methods to give you an overview of all the things that you have to do.
3461 3638
3462@menu 3639@menu
@@ -3517,7 +3694,7 @@ entire buffer, but shows all TODO items (with not-DONE state) and the
3517headings hierarchy above them. With a prefix argument (or by using @kbd{C-c 3694headings hierarchy above them. With a prefix argument (or by using @kbd{C-c
3518/ T}), search for a specific TODO. You will be prompted for the keyword, and 3695/ T}), search for a specific TODO. You will be prompted for the keyword, and
3519you can also give a list of keywords like @code{KWD1|KWD2|...} to list 3696you can also give a list of keywords like @code{KWD1|KWD2|...} to list
3520entries that match any one of these keywords. With numeric prefix argument 3697entries that match any one of these keywords. With a numeric prefix argument
3521N, show the tree for the Nth keyword in the variable 3698N, show the tree for the Nth keyword in the variable
3522@code{org-todo-keywords}. With two prefix arguments, find all TODO states, 3699@code{org-todo-keywords}. With two prefix arguments, find all TODO states,
3523both un-done and done. 3700both un-done and done.
@@ -3542,7 +3719,7 @@ option @code{org-todo-state-tags-triggers} for details.
3542 3719
3543@vindex org-todo-keywords 3720@vindex org-todo-keywords
3544By default, marked TODO entries have one of only two states: TODO and 3721By default, marked TODO entries have one of only two states: TODO and
3545DONE. Org-mode allows you to classify TODO items in more complex ways 3722DONE. Org mode allows you to classify TODO items in more complex ways
3546with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With 3723with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
3547special setup, the TODO keyword system can work differently in different 3724special setup, the TODO keyword system can work differently in different
3548files. 3725files.
@@ -3567,7 +3744,7 @@ TODO items in particular (@pxref{Tags}).
3567 3744
3568You can use TODO keywords to indicate different @emph{sequential} states 3745You can use TODO keywords to indicate different @emph{sequential} states
3569in the process of working on an item, for example@footnote{Changing 3746in the process of working on an item, for example@footnote{Changing
3570this variable only becomes effective after restarting Org-mode in a 3747this variable only becomes effective after restarting Org mode in a
3571buffer.}: 3748buffer.}:
3572 3749
3573@lisp 3750@lisp
@@ -3610,7 +3787,7 @@ be set up like this:
3610 3787
3611In this case, different keywords do not indicate a sequence, but rather 3788In this case, different keywords do not indicate a sequence, but rather
3612different types. So the normal work flow would be to assign a task to a 3789different types. So the normal work flow would be to assign a task to a
3613person, and later to mark it DONE. Org-mode supports this style by adapting 3790person, and later to mark it DONE. Org mode supports this style by adapting
3614the workings of the command @kbd{C-c C-t}@footnote{This is also true for the 3791the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
3615@kbd{t} command in the timeline and agenda buffers.}. When used several 3792@kbd{t} command in the timeline and agenda buffers.}. When used several
3616times in succession, it will still cycle through all names, in order to first 3793times in succession, it will still cycle through all names, in order to first
@@ -3641,7 +3818,7 @@ like this:
3641 (sequence "|" "CANCELED"))) 3818 (sequence "|" "CANCELED")))
3642@end lisp 3819@end lisp
3643 3820
3644The keywords should all be different, this helps Org-mode to keep track 3821The keywords should all be different, this helps Org mode to keep track
3645of which subsequence should be used for a given entry. In this setup, 3822of which subsequence should be used for a given entry. In this setup,
3646@kbd{C-c C-t} only operates within a subsequence, so it switches from 3823@kbd{C-c C-t} only operates within a subsequence, so it switches from
3647@code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to 3824@code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
@@ -3688,8 +3865,8 @@ key after each keyword, in parentheses. For example:
3688@end lisp 3865@end lisp
3689 3866
3690@vindex org-fast-tag-selection-include-todo 3867@vindex org-fast-tag-selection-include-todo
3691If you then press @code{C-c C-t} followed by the selection key, the entry 3868If you then press @kbd{C-c C-t} followed by the selection key, the entry
3692will be switched to this state. @key{SPC} can be used to remove any TODO 3869will be switched to this state. @kbd{SPC} can be used to remove any TODO
3693keyword from an entry.@footnote{Check also the variable 3870keyword from an entry.@footnote{Check also the variable
3694@code{org-fast-tag-selection-include-todo}, it allows you to change the TODO 3871@code{org-fast-tag-selection-include-todo}, it allows you to change the TODO
3695state through the tags interface (@pxref{Setting tags}), in case you like to 3872state through the tags interface (@pxref{Setting tags}), in case you like to
@@ -3738,9 +3915,9 @@ Remember that the keywords after the vertical bar (or the last keyword
3738if no bar is there) must always mean that the item is DONE (although you 3915if no bar is there) must always mean that the item is DONE (although you
3739may use a different word). After changing one of these lines, use 3916may use a different word). After changing one of these lines, use
3740@kbd{C-c C-c} with the cursor still in the line to make the changes 3917@kbd{C-c C-c} with the cursor still in the line to make the changes
3741known to Org-mode@footnote{Org-mode parses these lines only when 3918known to Org mode@footnote{Org mode parses these lines only when
3742Org-mode is activated after visiting a file. @kbd{C-c C-c} with the 3919Org mode is activated after visiting a file. @kbd{C-c C-c} with the
3743cursor in a line starting with @samp{#+} is simply restarting Org-mode 3920cursor in a line starting with @samp{#+} is simply restarting Org mode
3744for the current buffer.}. 3921for the current buffer.}.
3745 3922
3746@node Faces for TODO keywords, TODO dependencies, Per-file keywords, TODO extensions 3923@node Faces for TODO keywords, TODO dependencies, Per-file keywords, TODO extensions
@@ -3750,7 +3927,7 @@ for the current buffer.}.
3750@vindex org-todo @r{(face)} 3927@vindex org-todo @r{(face)}
3751@vindex org-done @r{(face)} 3928@vindex org-done @r{(face)}
3752@vindex org-todo-keyword-faces 3929@vindex org-todo-keyword-faces
3753Org-mode highlights TODO keywords with special faces: @code{org-todo} 3930Org mode highlights TODO keywords with special faces: @code{org-todo}
3754for keywords indicating that an item still has to be acted upon, and 3931for keywords indicating that an item still has to be acted upon, and
3755@code{org-done} for keywords indicating that an item is finished. If 3932@code{org-done} for keywords indicating that an item is finished. If
3756you are using more than 2 different states, you might want to use 3933you are using more than 2 different states, you might want to use
@@ -3766,7 +3943,7 @@ special faces for some of them. This can be done using the variable
3766@end lisp 3943@end lisp
3767 3944
3768While using a list with face properties as shown for CANCELED @emph{should} 3945While using a list with face properties as shown for CANCELED @emph{should}
3769work, this does not aways seem to be the case. If necessary, define a 3946work, this does not always seem to be the case. If necessary, define a
3770special face and use that. A string is interpreted as a color. The variable 3947special face and use that. A string is interpreted as a color. The variable
3771@code{org-faces-easy-properties} determines if that color is interpreted as a 3948@code{org-faces-easy-properties} determines if that color is interpreted as a
3772foreground or a background color. 3949foreground or a background color.
@@ -3796,7 +3973,7 @@ example:
3796 3973
3797* Parent 3974* Parent
3798 :PROPERTIES: 3975 :PROPERTIES:
3799 :ORDERED: t 3976 :ORDERED: t
3800 :END: 3977 :END:
3801** TODO a 3978** TODO a
3802** TODO b, needs to wait for (a) 3979** TODO b, needs to wait for (a)
@@ -3838,7 +4015,7 @@ module @file{org-depend.el}.
3838@cindex progress logging 4015@cindex progress logging
3839@cindex logging, of progress 4016@cindex logging, of progress
3840 4017
3841Org-mode can automatically record a timestamp and possibly a note when 4018Org mode can automatically record a timestamp and possibly a note when
3842you mark a TODO item as DONE, or even each time you change the state of 4019you mark a TODO item as DONE, or even each time you change the state of
3843a TODO item. This system is highly configurable, settings can be on a 4020a TODO item. This system is highly configurable, settings can be on a
3844per-keyword basis and can be localized to a file or even a subtree. For 4021per-keyword basis and can be localized to a file or even a subtree. For
@@ -3902,21 +4079,25 @@ behavior---the recommended drawer for this is called @code{LOGBOOK}. You can
3902also overrule the setting of this variable for a subtree by setting a 4079also overrule the setting of this variable for a subtree by setting a
3903@code{LOG_INTO_DRAWER} property. 4080@code{LOG_INTO_DRAWER} property.
3904 4081
3905Since it is normally too much to record a note for every state, Org-mode 4082Since it is normally too much to record a note for every state, Org mode
3906expects configuration on a per-keyword basis for this. This is achieved by 4083expects configuration on a per-keyword basis for this. This is achieved by
3907adding special markers @samp{!} (for a timestamp) and @samp{@@} (for a note) 4084adding special markers @samp{!} (for a timestamp) or @samp{@@} (for a note
3908in parentheses after each keyword. For example, with the setting 4085with timestamp) in parentheses after each keyword. For example, with the
4086setting
3909 4087
3910@lisp 4088@lisp
3911(setq org-todo-keywords 4089(setq org-todo-keywords
3912 '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)"))) 4090 '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
3913@end lisp 4091@end lisp
3914 4092
4093To record a timestamp without a note for TODO keywords configured with
4094@samp{@@}, just type @kbd{C-c C-c} to enter a blank note when prompted.
4095
3915@noindent 4096@noindent
3916@vindex org-log-done 4097@vindex org-log-done
3917you not only define global TODO keywords and fast access keys, but also 4098you not only define global TODO keywords and fast access keys, but also
3918request that a time is recorded when the entry is set to 4099request that a time is recorded when the entry is set to
3919DONE@footnote{It is possible that Org-mode will record two timestamps 4100DONE@footnote{It is possible that Org mode will record two timestamps
3920when you are using both @code{org-log-done} and state change logging. 4101when you are using both @code{org-log-done} and state change logging.
3921However, it will never prompt for two notes---if you have configured 4102However, it will never prompt for two notes---if you have configured
3922both, the state change recording note will take precedence and cancel 4103both, the state change recording note will take precedence and cancel
@@ -3972,7 +4153,7 @@ called ``habits''. A habit has the following properties:
3972You have enabled the @code{habits} module by customizing the variable 4153You have enabled the @code{habits} module by customizing the variable
3973@code{org-modules}. 4154@code{org-modules}.
3974@item 4155@item
3975The habit is a TODO, with a TODO keyword representing an open state. 4156The habit is a TODO item, with a TODO keyword representing an open state.
3976@item 4157@item
3977The property @code{STYLE} is set to the value @code{habit}. 4158The property @code{STYLE} is set to the value @code{habit}.
3978@item 4159@item
@@ -3986,8 +4167,8 @@ syntax @samp{.+2d/3d}, which says that you want to do the task at least every
3986three days, but at most every two days. 4167three days, but at most every two days.
3987@item 4168@item
3988You must also have state logging for the @code{DONE} state enabled, in order 4169You must also have state logging for the @code{DONE} state enabled, in order
3989for historical data to be represented in the consistency graph. If it's not 4170for historical data to be represented in the consistency graph. If it is not
3990enabled it's not an error, but the consistency graphs will be largely 4171enabled it is not an error, but the consistency graphs will be largely
3991meaningless. 4172meaningless.
3992@end enumerate 4173@end enumerate
3993 4174
@@ -4045,7 +4226,7 @@ habits are displayed in the agenda.
4045@table @code 4226@table @code
4046@item org-habit-graph-column 4227@item org-habit-graph-column
4047The buffer column at which the consistency graph should be drawn. This will 4228The buffer column at which the consistency graph should be drawn. This will
4048overwrite any text in that column, so it's a good idea to keep your habits' 4229overwrite any text in that column, so it is a good idea to keep your habits'
4049titles brief and to the point. 4230titles brief and to the point.
4050@item org-habit-preceding-days 4231@item org-habit-preceding-days
4051The amount of history, in days before today, to appear in consistency graphs. 4232The amount of history, in days before today, to appear in consistency graphs.
@@ -4065,7 +4246,7 @@ which should only be done in certain contexts, for example.
4065@section Priorities 4246@section Priorities
4066@cindex priorities 4247@cindex priorities
4067 4248
4068If you use Org-mode extensively, you may end up with enough TODO items that 4249If you use Org mode extensively, you may end up with enough TODO items that
4069it starts to make sense to prioritize them. Prioritizing can be done by 4250it starts to make sense to prioritize them. Prioritizing can be done by
4070placing a @emph{priority cookie} into the headline of a TODO item, like this 4251placing a @emph{priority cookie} into the headline of a TODO item, like this
4071 4252
@@ -4075,11 +4256,11 @@ placing a @emph{priority cookie} into the headline of a TODO item, like this
4075 4256
4076@noindent 4257@noindent
4077@vindex org-priority-faces 4258@vindex org-priority-faces
4078By default, Org-mode supports three priorities: @samp{A}, @samp{B}, and 4259By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
4079@samp{C}. @samp{A} is the highest priority. An entry without a cookie is 4260@samp{C}. @samp{A} is the highest priority. An entry without a cookie is
4080treated just like priority @samp{B}. Priorities make a difference only for 4261treated just like priority @samp{B}. Priorities make a difference only for
4081sorting in the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they 4262sorting in the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they
4082have no inherent meaning to Org-mode. The cookies can be highlighted with 4263have no inherent meaning to Org mode. The cookies can be highlighted with
4083special faces by customizing the variable @code{org-priority-faces}. 4264special faces by customizing the variable @code{org-priority-faces}.
4084 4265
4085Priorities can be attached to any outline node; they do not need to be TODO 4266Priorities can be attached to any outline node; they do not need to be TODO
@@ -4186,7 +4367,7 @@ large number of subtasks (@pxref{Checkboxes}).
4186 4367
4187@vindex org-list-automatic-rules 4368@vindex org-list-automatic-rules
4188Every item in a plain list@footnote{With the exception of description 4369Every item in a plain list@footnote{With the exception of description
4189lists. But you can allow it by modifying @code{org-list-automatic-rules} 4370lists. But you can allow it by modifying @code{org-list-automatic-rules}
4190accordingly.} (@pxref{Plain lists}) can be made into a checkbox by starting 4371accordingly.} (@pxref{Plain lists}) can be made into a checkbox by starting
4191it with the string @samp{[ ]}. This feature is similar to TODO items 4372it with the string @samp{[ ]}. This feature is similar to TODO items
4192(@pxref{TODO Items}), but is more lightweight. Checkboxes are not included 4373(@pxref{TODO Items}), but is more lightweight. Checkboxes are not included
@@ -4225,7 +4406,7 @@ be placed into a headline or into (the first line of) a plain list item.
4225Each cookie covers checkboxes of direct children structurally below the 4406Each cookie covers checkboxes of direct children structurally below the
4226headline/item on which the cookie appears@footnote{Set the variable 4407headline/item on which the cookie appears@footnote{Set the variable
4227@code{org-hierarchical-checkbox-statistics} if you want such cookies to 4408@code{org-hierarchical-checkbox-statistics} if you want such cookies to
4228represent the all checkboxes below the cookie, not just the direct 4409count all checkboxes below the cookie, not just those belonging to direct
4229children.}. You have to insert the cookie yourself by typing either 4410children.}. You have to insert the cookie yourself by typing either
4230@samp{[/]} or @samp{[%]}. With @samp{[/]} you get an @samp{n out of m} 4411@samp{[/]} or @samp{[%]}. With @samp{[/]} you get an @samp{n out of m}
4231result, as in the examples above. With @samp{[%]} you get information about 4412result, as in the examples above. With @samp{[%]} you get information about
@@ -4246,9 +4427,11 @@ off a box while there are unchecked boxes above it.
4246 4427
4247@table @kbd 4428@table @kbd
4248@orgcmd{C-c C-c,org-toggle-checkbox} 4429@orgcmd{C-c C-c,org-toggle-checkbox}
4249Toggle checkbox status or (with prefix arg) checkbox presence at point. With 4430Toggle checkbox status or (with prefix arg) checkbox presence at point.
4250double prefix argument, set it to @samp{[-]}, which is considered to be an 4431With a single prefix argument, add an empty checkbox or remove the current
4251intermediate state. 4432one@footnote{`C-u C-c C-c' on the @emph{first} item of a list with no checkbox
4433will add checkboxes to the rest of the list.}. With a double prefix argument, set it to @samp{[-]}, which is
4434considered to be an intermediate state.
4252@orgcmd{C-c C-x C-b,org-toggle-checkbox} 4435@orgcmd{C-c C-x C-b,org-toggle-checkbox}
4253Toggle checkbox status or (with prefix arg) checkbox presence at point. With 4436Toggle checkbox status or (with prefix arg) checkbox presence at point. With
4254double prefix argument, set it to @samp{[-]}, which is considered to be an 4437double prefix argument, set it to @samp{[-]}, which is considered to be an
@@ -4265,9 +4448,8 @@ this headline and the next (so @emph{not} the entire subtree).
4265If there is no active region, just toggle the checkbox at point. 4448If there is no active region, just toggle the checkbox at point.
4266@end itemize 4449@end itemize
4267@orgcmd{M-S-@key{RET},org-insert-todo-heading} 4450@orgcmd{M-S-@key{RET},org-insert-todo-heading}
4268Insert a new item with a checkbox. 4451Insert a new item with a checkbox. This works only if the cursor is already
4269This works only if the cursor is already in a plain list item 4452in a plain list item (@pxref{Plain lists}).
4270(@pxref{Plain lists}).
4271@orgcmd{C-c C-x o,org-toggle-ordered-property} 4453@orgcmd{C-c C-x o,org-toggle-ordered-property}
4272@vindex org-track-ordered-property-with-tag 4454@vindex org-track-ordered-property-with-tag
4273@cindex property, ORDERED 4455@cindex property, ORDERED
@@ -4283,8 +4465,7 @@ a @kbd{C-u} prefix, update the entire file. Checkbox statistic cookies are
4283updated automatically if you toggle checkboxes with @kbd{C-c C-c} and make 4465updated automatically if you toggle checkboxes with @kbd{C-c C-c} and make
4284new ones with @kbd{M-S-@key{RET}}. TODO statistics cookies update when 4466new ones with @kbd{M-S-@key{RET}}. TODO statistics cookies update when
4285changing TODO states. If you delete boxes/entries or add/change them by 4467changing TODO states. If you delete boxes/entries or add/change them by
4286hand, use this command to get things back into sync. Or simply toggle any 4468hand, use this command to get things back into sync.
4287entry twice (checkboxes with @kbd{C-c C-c}).
4288@end table 4469@end table
4289 4470
4290@node Tags, Properties and Columns, TODO Items, Top 4471@node Tags, Properties and Columns, TODO Items, Top
@@ -4295,7 +4476,7 @@ entry twice (checkboxes with @kbd{C-c C-c}).
4295@cindex sparse tree, tag based 4476@cindex sparse tree, tag based
4296 4477
4297An excellent way to implement labels and contexts for cross-correlating 4478An excellent way to implement labels and contexts for cross-correlating
4298information is to assign @i{tags} to headlines. Org-mode has extensive 4479information is to assign @i{tags} to headlines. Org mode has extensive
4299support for tags. 4480support for tags.
4300 4481
4301@vindex org-tag-faces 4482@vindex org-tag-faces
@@ -4374,7 +4555,7 @@ also a special command for inserting tags:
4374@orgcmd{C-c C-q,org-set-tags-command} 4555@orgcmd{C-c C-q,org-set-tags-command}
4375@cindex completion, of tags 4556@cindex completion, of tags
4376@vindex org-tags-column 4557@vindex org-tags-column
4377Enter new tags for the current headline. Org-mode will either offer 4558Enter new tags for the current headline. Org mode will either offer
4378completion or a special single-key interface for setting tags, see 4559completion or a special single-key interface for setting tags, see
4379below. After pressing @key{RET}, the tags will be inserted and aligned 4560below. After pressing @key{RET}, the tags will be inserted and aligned
4380to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all 4561to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
@@ -4386,7 +4567,7 @@ When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
4386@end table 4567@end table
4387 4568
4388@vindex org-tag-alist 4569@vindex org-tag-alist
4389Org will support tag insertion based on a @emph{list of tags}. By 4570Org supports tag insertion based on a @emph{list of tags}. By
4390default this list is constructed dynamically, containing all tags 4571default this list is constructed dynamically, containing all tags
4391currently used in the buffer. You may also globally specify a hard list 4572currently used in the buffer. You may also globally specify a hard list
4392of tags with the variable @code{org-tag-alist}. Finally you can set 4573of tags with the variable @code{org-tag-alist}. Finally you can set
@@ -4417,7 +4598,7 @@ by adding a STARTUP option line to that file:
4417#+STARTUP: noptag 4598#+STARTUP: noptag
4418@end example 4599@end example
4419 4600
4420By default Org-mode uses the standard minibuffer completion facilities for 4601By default Org mode uses the standard minibuffer completion facilities for
4421entering tags. However, it also implements another, quicker, tag selection 4602entering tags. However, it also implements another, quicker, tag selection
4422method called @emph{fast tag selection}. This allows you to select and 4603method called @emph{fast tag selection}. This allows you to select and
4423deselect tags with just a single key press. For this to work well you should 4604deselect tags with just a single key press. For this to work well you should
@@ -4498,6 +4679,8 @@ exclusive tags will turn off any other tags from that group.
4498@item @key{TAB} 4679@item @key{TAB}
4499Enter a tag in the minibuffer, even if the tag is not in the predefined 4680Enter a tag in the minibuffer, even if the tag is not in the predefined
4500list. You will be able to complete on all tags present in the buffer. 4681list. You will be able to complete on all tags present in the buffer.
4682You can also add several tags: just separate them with a comma.
4683
4501@kindex @key{SPC} 4684@kindex @key{SPC}
4502@item @key{SPC} 4685@item @key{SPC}
4503Clear all tags for this line. 4686Clear all tags for this line.
@@ -4548,7 +4731,7 @@ Once a system of tags has been set up, it can be used to collect related
4548information into special lists. 4731information into special lists.
4549 4732
4550@table @kbd 4733@table @kbd
4551@orgcmdkkc{C-c / m,C-c \,org-match-sparse-tree} 4734@orgcmdkkc{C-c / m,C-c \\,org-match-sparse-tree}
4552Create a sparse tree with all headlines matching a tags search. With a 4735Create a sparse tree with all headlines matching a tags search. With a
4553@kbd{C-u} prefix argument, ignore headlines that are not a TODO line. 4736@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
4554@orgcmd{C-c a m,org-tags-view} 4737@orgcmd{C-c a m,org-tags-view}
@@ -4574,25 +4757,26 @@ and properties. For a complete description with many examples, see
4574@chapter Properties and columns 4757@chapter Properties and columns
4575@cindex properties 4758@cindex properties
4576 4759
4577Properties are a set of key-value pairs associated with an entry. There 4760A property is a key-value pair associated with an entry. Properties can be
4578are two main applications for properties in Org-mode. First, properties 4761set so they are associated with a single entry, with every entry in a tree,
4579are like tags, but with a value. Second, you can use properties to 4762or with every entry in an Org mode file.
4580implement (very basic) database capabilities in an Org buffer. For 4763
4581an example of the first application, imagine maintaining a file where 4764There are two main applications for properties in Org mode. First,
4765properties are like tags, but with a value. Imagine maintaining a file where
4582you document bugs and plan releases for a piece of software. Instead of 4766you document bugs and plan releases for a piece of software. Instead of
4583using tags like @code{:release_1:}, @code{:release_2:}, one can use a 4767using tags like @code{:release_1:}, @code{:release_2:}, you can use a
4584property, say @code{:Release:}, that in different subtrees has different 4768property, say @code{:Release:}, that in different subtrees has different
4585values, such as @code{1.0} or @code{2.0}. For an example of the second 4769values, such as @code{1.0} or @code{2.0}. Second, you can use properties to
4586application of properties, imagine keeping track of your music CDs, 4770implement (very basic) database capabilities in an Org buffer. Imagine
4587where properties could be things such as the album, artist, date of 4771keeping track of your music CDs, where properties could be things such as the
4588release, number of tracks, and so on. 4772album, artist, date of release, number of tracks, and so on.
4589 4773
4590Properties can be conveniently edited and viewed in column view 4774Properties can be conveniently edited and viewed in column view
4591(@pxref{Column view}). 4775(@pxref{Column view}).
4592 4776
4593@menu 4777@menu
4594* Property syntax:: How properties are spelled out 4778* Property syntax:: How properties are spelled out
4595* Special properties:: Access to other Org-mode features 4779* Special properties:: Access to other Org mode features
4596* Property searches:: Matching property values 4780* Property searches:: Matching property values
4597* Property inheritance:: Passing values down the tree 4781* Property inheritance:: Passing values down the tree
4598* Column view:: Tabular viewing and editing 4782* Column view:: Tabular viewing and editing
@@ -4604,7 +4788,8 @@ Properties can be conveniently edited and viewed in column view
4604@cindex property syntax 4788@cindex property syntax
4605@cindex drawer, for properties 4789@cindex drawer, for properties
4606 4790
4607Properties are key-value pairs. They need to be inserted into a special 4791Properties are key-value pairs. When they are associated with a single entry
4792or with a tree they need to be inserted into a special
4608drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property 4793drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
4609is specified on a single line, with the key (surrounded by colons) 4794is specified on a single line, with the key (surrounded by colons)
4610first, and the value after it. Here is an example: 4795first, and the value after it. Here is an example:
@@ -4622,6 +4807,10 @@ first, and the value after it. Here is an example:
4622 :END: 4807 :END:
4623@end example 4808@end example
4624 4809
4810Depending on the value of @code{org-use-property-inheritance}, a property set
4811this way will either be associated with a single entry, or the sub-tree
4812defined by the entry, see @ref{Property inheritance}.
4813
4625You may define the allowed values for a particular property @samp{:Xyz:} 4814You may define the allowed values for a particular property @samp{:Xyz:}
4626by setting a property @samp{:Xyz_ALL:}. This special property is 4815by setting a property @samp{:Xyz_ALL:}. This special property is
4627@emph{inherited}, so if you set it in a level 1 entry, it will apply to 4816@emph{inherited}, so if you set it in a level 1 entry, it will apply to
@@ -4646,6 +4835,37 @@ file, use a line like
4646#+PROPERTY: NDisks_ALL 1 2 3 4 4835#+PROPERTY: NDisks_ALL 1 2 3 4
4647@end example 4836@end example
4648 4837
4838If you want to add to the value of an existing property, append a @code{+} to
4839the property name. The following results in the property @code{var} having
4840the value ``foo=1 bar=2''.
4841@cindex property, +
4842@example
4843#+PROPERTY: var foo=1
4844#+PROPERTY: var+ bar=2
4845@end example
4846
4847It is also possible to add to the values of inherited properties. The
4848following results in the @code{genres} property having the value ``Classic
4849Baroque'' under the @code{Goldberg Variations} subtree.
4850@cindex property, +
4851@example
4852* CD collection
4853** Classic
4854 :PROPERTIES:
4855 :GENRES: Classic
4856 :END:
4857*** Goldberg Variations
4858 :PROPERTIES:
4859 :Title: Goldberg Variations
4860 :Composer: J.S. Bach
4861 :Artist: Glen Gould
4862 :Publisher: Deutsche Grammophon
4863 :NDisks: 1
4864 :GENRES+: Baroque
4865 :END:
4866@end example
4867Note that a property can only have one entry per Drawer.
4868
4649@vindex org-global-properties 4869@vindex org-global-properties
4650Property values set with the global variable 4870Property values set with the global variable
4651@code{org-global-properties} can be inherited by all entries in all 4871@code{org-global-properties} can be inherited by all entries in all
@@ -4655,7 +4875,7 @@ Org files.
4655The following commands help to work with properties: 4875The following commands help to work with properties:
4656 4876
4657@table @kbd 4877@table @kbd
4658@orgcmd{M-@key{TAB},org-complete} 4878@orgcmd{M-@key{TAB},pcomplete}
4659After an initial colon in a line, complete property keys. All keys used 4879After an initial colon in a line, complete property keys. All keys used
4660in the current file will be offered as possible completions. 4880in the current file will be offered as possible completions.
4661@orgcmd{C-c C-x p,org-set-property} 4881@orgcmd{C-c C-x p,org-set-property}
@@ -4686,11 +4906,11 @@ nearest column format definition.
4686@section Special properties 4906@section Special properties
4687@cindex properties, special 4907@cindex properties, special
4688 4908
4689Special properties provide an alternative access method to Org-mode 4909Special properties provide an alternative access method to Org mode features,
4690features, like the TODO state or the priority of an entry, discussed in the 4910like the TODO state or the priority of an entry, discussed in the previous
4691previous chapters. This interface exists so that you can include 4911chapters. This interface exists so that you can include these states in a
4692these states in a column view (@pxref{Column view}), or to use them in 4912column view (@pxref{Column view}), or to use them in queries. The following
4693queries. The following property names are special and should not be 4913property names are special and (except for @code{:CATEGORY:}) should not be
4694used as keys in the properties drawer: 4914used as keys in the properties drawer:
4695 4915
4696@cindex property, special, TODO 4916@cindex property, special, TODO
@@ -4707,6 +4927,7 @@ used as keys in the properties drawer:
4707@cindex property, special, BLOCKED 4927@cindex property, special, BLOCKED
4708@c guessing that ITEM is needed in this area; also, should this list be sorted? 4928@c guessing that ITEM is needed in this area; also, should this list be sorted?
4709@cindex property, special, ITEM 4929@cindex property, special, ITEM
4930@cindex property, special, FILE
4710@example 4931@example
4711TODO @r{The TODO keyword of the entry.} 4932TODO @r{The TODO keyword of the entry.}
4712TAGS @r{The tags defined directly in the headline.} 4933TAGS @r{The tags defined directly in the headline.}
@@ -4719,9 +4940,10 @@ CLOSED @r{When was this entry closed?}
4719TIMESTAMP @r{The first keyword-less timestamp in the entry.} 4940TIMESTAMP @r{The first keyword-less timestamp in the entry.}
4720TIMESTAMP_IA @r{The first inactive timestamp in the entry.} 4941TIMESTAMP_IA @r{The first inactive timestamp in the entry.}
4721CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}} 4942CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
4722 @r{must be run first to compute the values.} 4943 @r{must be run first to compute the values in the current buffer.}
4723BLOCKED @r{"t" if task is currently blocked by children or siblings} 4944BLOCKED @r{"t" if task is currently blocked by children or siblings}
4724ITEM @r{The content of the entry.} 4945ITEM @r{The content of the entry.}
4946FILE @r{The filename the entry is located in.}
4725@end example 4947@end example
4726 4948
4727@node Property searches, Property inheritance, Special properties, Properties and Columns 4949@node Property searches, Property inheritance, Special properties, Properties and Columns
@@ -4766,9 +4988,9 @@ a regular expression and matched against the property values.
4766@cindex inheritance, of properties 4988@cindex inheritance, of properties
4767 4989
4768@vindex org-use-property-inheritance 4990@vindex org-use-property-inheritance
4769The outline structure of Org-mode documents lends itself to an 4991The outline structure of Org mode documents lends itself to an
4770inheritance model of properties: if the parent in a tree has a certain 4992inheritance model of properties: if the parent in a tree has a certain
4771property, the children can inherit this property. Org-mode does not 4993property, the children can inherit this property. Org mode does not
4772turn this on by default, because it can slow down property searches 4994turn this on by default, because it can slow down property searches
4773significantly and is often not needed. However, if you find inheritance 4995significantly and is often not needed. However, if you find inheritance
4774useful, you can turn it on by setting the variable 4996useful, you can turn it on by setting the variable
@@ -4779,7 +5001,7 @@ inherited properties. If a property has the value @samp{nil}, this is
4779interpreted as an explicit undefine of the property, so that inheritance 5001interpreted as an explicit undefine of the property, so that inheritance
4780search will stop at this value and return @code{nil}. 5002search will stop at this value and return @code{nil}.
4781 5003
4782Org-mode has a few properties for which inheritance is hard-coded, at 5004Org mode has a few properties for which inheritance is hard-coded, at
4783least for the special applications for which they are used: 5005least for the special applications for which they are used:
4784 5006
4785@cindex property, COLUMNS 5007@cindex property, COLUMNS
@@ -4810,7 +5032,7 @@ subtree (@pxref{Tracking TODO state changes}).
4810A great way to view and edit properties in an outline tree is 5032A great way to view and edit properties in an outline tree is
4811@emph{column view}. In column view, each outline node is turned into a 5033@emph{column view}. In column view, each outline node is turned into a
4812table row. Columns in this table provide access to properties of the 5034table row. Columns in this table provide access to properties of the
4813entries. Org-mode implements columns by overlaying a tabular structure 5035entries. Org mode implements columns by overlaying a tabular structure
4814over the headline of each item. While the headlines have been turned 5036over the headline of each item. While the headlines have been turned
4815into a table row, you can still change the visibility of the outline 5037into a table row, you can still change the visibility of the outline
4816tree. For example, you get a compact table by switching to CONTENTS 5038tree. For example, you get a compact table by switching to CONTENTS
@@ -4886,7 +5108,7 @@ optional. The individual parts have the following meaning:
4886@var{property} @r{The property that should be edited in this column.} 5108@var{property} @r{The property that should be edited in this column.}
4887 @r{Special properties representing meta data are allowed here} 5109 @r{Special properties representing meta data are allowed here}
4888 @r{as well (@pxref{Special properties})} 5110 @r{as well (@pxref{Special properties})}
4889@var{title} @r{The header text for the column. If omitted, the property} 5111@var{title} @r{The header text for the column. If omitted, the property}
4890 @r{name is used.} 5112 @r{name is used.}
4891@{@var{summary-type}@} @r{The summary type. If specified, the column values for} 5113@{@var{summary-type}@} @r{The summary type. If specified, the column values for}
4892 @r{parent nodes are computed from the children.} 5114 @r{parent nodes are computed from the children.}
@@ -4912,7 +5134,7 @@ optional. The individual parts have the following meaning:
4912 5134
4913@noindent 5135@noindent
4914Be aware that you can only have one summary type for any property you 5136Be aware that you can only have one summary type for any property you
4915include. Subsequent columns referencing the same property will all display the 5137include. Subsequent columns referencing the same property will all display the
4916same summary information. 5138same summary information.
4917 5139
4918The @code{est+} summary type requires further explanation. It is used for 5140The @code{est+} summary type requires further explanation. It is used for
@@ -4923,12 +5145,12 @@ of estimating a particular task will take 5 days, you might estimate it as
4923average at 5.5 days, but the first represents a more predictable delivery. 5145average at 5.5 days, but the first represents a more predictable delivery.
4924 5146
4925When combining a set of such estimates, simply adding the lows and highs 5147When combining a set of such estimates, simply adding the lows and highs
4926produces an unrealistically wide result. Instead, @code{est+} adds the 5148produces an unrealistically wide result. Instead, @code{est+} adds the
4927statistical mean and variance of the sub-tasks, generating a final estimate 5149statistical mean and variance of the sub-tasks, generating a final estimate
4928from the sum. For example, suppose you had ten tasks, each of which was 5150from the sum. For example, suppose you had ten tasks, each of which was
4929estimated at 0.5 to 2 days of work. Straight addition produces an estimate 5151estimated at 0.5 to 2 days of work. Straight addition produces an estimate
4930of 5 to 20 days, representing what to expect if everything goes either 5152of 5 to 20 days, representing what to expect if everything goes either
4931extremely well or extremely poorly. In contrast, @code{est+} estimates the 5153extremely well or extremely poorly. In contrast, @code{est+} estimates the
4932full job more realistically, at 10-15 days. 5154full job more realistically, at 10-15 days.
4933 5155
4934Here is an example for a complete columns definition, along with allowed 5156Here is an example for a complete columns definition, along with allowed
@@ -4944,7 +5166,7 @@ values.
4944 5166
4945@noindent 5167@noindent
4946The first column, @samp{%25ITEM}, means the first 25 characters of the 5168The first column, @samp{%25ITEM}, means the first 25 characters of the
4947item itself, i.e. of the headline. You probably always should start the 5169item itself, i.e.@: of the headline. You probably always should start the
4948column definition with the @samp{ITEM} specifier. The other specifiers 5170column definition with the @samp{ITEM} specifier. The other specifiers
4949create columns @samp{Owner} with a list of names as allowed values, for 5171create columns @samp{Owner} with a list of names as allowed values, for
4950@samp{Status} with four different possible values, and for a checkbox 5172@samp{Status} with four different possible values, and for a checkbox
@@ -5112,9 +5334,9 @@ property API}.
5112 5334
5113To assist project planning, TODO items can be labeled with a date and/or 5335To assist project planning, TODO items can be labeled with a date and/or
5114a time. The specially formatted string carrying the date and time 5336a time. The specially formatted string carrying the date and time
5115information is called a @emph{timestamp} in Org-mode. This may be a 5337information is called a @emph{timestamp} in Org mode. This may be a
5116little confusing because timestamp is often used as indicating when 5338little confusing because timestamp is often used as indicating when
5117something was created or last changed. However, in Org-mode this term 5339something was created or last changed. However, in Org mode this term
5118is used in a much wider sense. 5340is used in a much wider sense.
5119 5341
5120@menu 5342@menu
@@ -5137,17 +5359,20 @@ is used in a much wider sense.
5137@cindex scheduling 5359@cindex scheduling
5138 5360
5139A timestamp is a specification of a date (possibly with a time or a range of 5361A timestamp is a specification of a date (possibly with a time or a range of
5140times) in a special format, either @samp{<2003-09-16 Tue>} or 5362times) in a special format, either @samp{<2003-09-16 Tue>}@footnote{In this
5141@samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue 5363simplest form, the day name is optional when you type the date yourself.
514212:00-12:30>}@footnote{This is inspired by the standard ISO 8601 date/time 5364However, any dates inserted or modified by Org will add that day name, for
5143format. To use an alternative format, see @ref{Custom time format}.}. A 5365reading convenience.} or @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16
5144timestamp can appear anywhere in the headline or body of an Org tree entry. 5366Tue 12:00-12:30>}@footnote{This is inspired by the standard ISO 8601
5145Its presence causes entries to be shown on specific dates in the agenda 5367date/time format. To use an alternative format, see @ref{Custom time
5146(@pxref{Weekly/daily agenda}). We distinguish: 5368format}.}. A timestamp can appear anywhere in the headline or body of an Org
5369tree entry. Its presence causes entries to be shown on specific dates in the
5370agenda (@pxref{Weekly/daily agenda}). We distinguish:
5147 5371
5148@table @var 5372@table @var
5149@item Plain timestamp; Event; Appointment 5373@item Plain timestamp; Event; Appointment
5150@cindex timestamp 5374@cindex timestamp
5375@cindex appointment
5151A simple timestamp just assigns a date/time to an item. This is just 5376A simple timestamp just assigns a date/time to an item. This is just
5152like writing down an appointment or event in a paper agenda. In the 5377like writing down an appointment or event in a paper agenda. In the
5153timeline and agenda displays, the headline of an entry associated with a 5378timeline and agenda displays, the headline of an entry associated with a
@@ -5170,13 +5395,23 @@ following will show up in the agenda every Wednesday:
5170@end example 5395@end example
5171 5396
5172@item Diary-style sexp entries 5397@item Diary-style sexp entries
5173For more complex date specifications, Org-mode supports using the 5398For more complex date specifications, Org mode supports using the special
5174special sexp diary entries implemented in the Emacs calendar/diary 5399sexp diary entries implemented in the Emacs calendar/diary
5175package. For example 5400package@footnote{When working with the standard diary sexp functions, you
5401need to be very careful with the order of the arguments. That order depend
5402evilly on the variable @code{calendar-date-style} (or, for older Emacs
5403versions, @code{european-calendar-style}). For example, to specify a date
5404December 12, 2005, the call might look like @code{(diary-date 12 1 2005)} or
5405@code{(diary-date 1 12 2005)} or @code{(diary-date 2005 12 1)}, depending on
5406the settings. This has been the source of much confusion. Org mode users
5407can resort to special versions of these functions like @code{org-date} or
5408@code{org-anniversary}. These work just like the corresponding @code{diary-}
5409functions, but with stable ISO order of arguments (year, month, day) wherever
5410applicable, independent of the value of @code{calendar-date-style}.}. For example
5176 5411
5177@example 5412@example
5178* The nerd meeting on every 2nd Thursday of the month 5413* The nerd meeting on every 2nd Thursday of the month
5179 <%%(diary-float t 4 2)> 5414 <%%(org-float t 4 2)>
5180@end example 5415@end example
5181 5416
5182@item Time/Date range 5417@item Time/Date range
@@ -5209,7 +5444,7 @@ angular ones. These timestamps are inactive in the sense that they do
5209@cindex creating timestamps 5444@cindex creating timestamps
5210@cindex timestamps, creating 5445@cindex timestamps, creating
5211 5446
5212For Org-mode to recognize timestamps, they need to be in the specific 5447For Org mode to recognize timestamps, they need to be in the specific
5213format. All commands listed below produce timestamps in the correct 5448format. All commands listed below produce timestamps in the correct
5214format. 5449format.
5215 5450
@@ -5233,6 +5468,9 @@ Like @kbd{C-c .} and @kbd{C-c !}, but use the alternative format which
5233contains date and time. The default time can be rounded to multiples of 5 5468contains date and time. The default time can be rounded to multiples of 5
5234minutes, see the option @code{org-time-stamp-rounding-minutes}. 5469minutes, see the option @code{org-time-stamp-rounding-minutes}.
5235@c 5470@c
5471@orgkey{C-c C-c}
5472Normalize timestamp, insert/fix day name if missing or wrong.
5473@c
5236@orgcmd{C-c <,org-date-from-calendar} 5474@orgcmd{C-c <,org-date-from-calendar}
5237Insert a timestamp corresponding to the cursor date in the Calendar. 5475Insert a timestamp corresponding to the cursor date in the Calendar.
5238@c 5476@c
@@ -5256,7 +5494,7 @@ like @samp{15:30-16:30}, modifying the first time will also shift the second,
5256shifting the time block with constant length. To change the length, modify 5494shifting the time block with constant length. To change the length, modify
5257the second time. Note that if the cursor is in a headline and not at a 5495the second time. Note that if the cursor is in a headline and not at a
5258timestamp, these same keys modify the priority of an item. 5496timestamp, these same keys modify the priority of an item.
5259(@pxref{Priorities}). The key bindings also conflict with shift-selection and 5497(@pxref{Priorities}). The key bindings also conflict with shift-selection and
5260related modes (@pxref{Conflicts}). 5498related modes (@pxref{Conflicts}).
5261@c 5499@c
5262@orgcmd{C-c C-y,org-evaluate-time-range} 5500@orgcmd{C-c C-y,org-evaluate-time-range}
@@ -5268,7 +5506,7 @@ the following column).
5268 5506
5269 5507
5270@menu 5508@menu
5271* The date/time prompt:: How Org-mode helps you entering date and time 5509* The date/time prompt:: How Org mode helps you entering date and time
5272* Custom time format:: Making dates look different 5510* Custom time format:: Making dates look different
5273@end menu 5511@end menu
5274 5512
@@ -5278,17 +5516,17 @@ the following column).
5278@cindex time, reading in minibuffer 5516@cindex time, reading in minibuffer
5279 5517
5280@vindex org-read-date-prefer-future 5518@vindex org-read-date-prefer-future
5281When Org-mode prompts for a date/time, the default is shown in default 5519When Org mode prompts for a date/time, the default is shown in default
5282date/time format, and the prompt therefore seems to ask for a specific 5520date/time format, and the prompt therefore seems to ask for a specific
5283format. But it will in fact accept any string containing some date and/or 5521format. But it will in fact accept any string containing some date and/or
5284time information, and it is really smart about interpreting your input. You 5522time information, and it is really smart about interpreting your input. You
5285can, for example, use @kbd{C-y} to paste a (possibly multi-line) string 5523can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
5286copied from an email message. Org-mode will find whatever information is in 5524copied from an email message. Org mode will find whatever information is in
5287there and derive anything you have not specified from the @emph{default date 5525there and derive anything you have not specified from the @emph{default date
5288and time}. The default is usually the current date and time, but when 5526and time}. The default is usually the current date and time, but when
5289modifying an existing timestamp, or when entering the second stamp of a 5527modifying an existing timestamp, or when entering the second stamp of a
5290range, it is taken from the stamp in the buffer. When filling in 5528range, it is taken from the stamp in the buffer. When filling in
5291information, Org-mode assumes that most of the time you will want to enter a 5529information, Org mode assumes that most of the time you will want to enter a
5292date in the future: if you omit the month/year and the given day/month is 5530date in the future: if you omit the month/year and the given day/month is
5293@i{before} today, it will assume that you mean a future date@footnote{See the 5531@i{before} today, it will assume that you mean a future date@footnote{See the
5294variable @code{org-read-date-prefer-future}. You may set that variable to 5532variable @code{org-read-date-prefer-future}. You may set that variable to
@@ -5297,24 +5535,24 @@ tomorrow.}. If the date has been automatically shifted into the future, the
5297time prompt will show this with @samp{(=>F).} 5535time prompt will show this with @samp{(=>F).}
5298 5536
5299For example, let's assume that today is @b{June 13, 2006}. Here is how 5537For example, let's assume that today is @b{June 13, 2006}. Here is how
5300various inputs will be interpreted, the items filled in by Org-mode are 5538various inputs will be interpreted, the items filled in by Org mode are
5301in @b{bold}. 5539in @b{bold}.
5302 5540
5303@example 5541@example
53043-2-5 --> 2003-02-05 55423-2-5 @result{} 2003-02-05
53052/5/3 --> 2003-02-05 55432/5/3 @result{} 2003-02-05
530614 --> @b{2006}-@b{06}-14 554414 @result{} @b{2006}-@b{06}-14
530712 --> @b{2006}-@b{07}-12 554512 @result{} @b{2006}-@b{07}-12
53082/5 --> @b{2007}-02-05 55462/5 @result{} @b{2007}-02-05
5309Fri --> nearest Friday (default date or later) 5547Fri @result{} nearest Friday (default date or later)
5310sep 15 --> @b{2006}-09-15 5548sep 15 @result{} @b{2006}-09-15
5311feb 15 --> @b{2007}-02-15 5549feb 15 @result{} @b{2007}-02-15
5312sep 12 9 --> 2009-09-12 5550sep 12 9 @result{} 2009-09-12
531312:45 --> @b{2006}-@b{06}-@b{13} 12:45 555112:45 @result{} @b{2006}-@b{06}-@b{13} 12:45
531422 sept 0:34 --> @b{2006}-09-22 0:34 555222 sept 0:34 @result{} @b{2006}-09-22 0:34
5315w4 --> ISO week for of the current year @b{2006} 5553w4 @result{} ISO week for of the current year @b{2006}
53162012 w4 fri --> Friday of ISO week 4 in 2012 55542012 w4 fri @result{} Friday of ISO week 4 in 2012
53172012-w04-5 --> Same as above 55552012-w04-5 @result{} Same as above
5318@end example 5556@end example
5319 5557
5320Furthermore you can specify a relative date by giving, as the 5558Furthermore you can specify a relative date by giving, as the
@@ -5323,16 +5561,16 @@ letter ([dwmy]) to indicate change in days, weeks, months, or years. With a
5323single plus or minus, the date is always relative to today. With a 5561single plus or minus, the date is always relative to today. With a
5324double plus or minus, it is relative to the default date. If instead of 5562double plus or minus, it is relative to the default date. If instead of
5325a single letter, you use the abbreviation of day name, the date will be 5563a single letter, you use the abbreviation of day name, the date will be
5326the Nth such day. E.g. 5564the Nth such day, e.g.@:
5327 5565
5328@example 5566@example
5329+0 --> today 5567+0 @result{} today
5330. --> today 5568. @result{} today
5331+4d --> four days from today 5569+4d @result{} four days from today
5332+4 --> same as above 5570+4 @result{} same as above
5333+2w --> two weeks from today 5571+2w @result{} two weeks from today
5334++5 --> five days from default date 5572++5 @result{} five days from default date
5335+2tue --> second Tuesday from now. 5573+2tue @result{} second Tuesday from now.
5336@end example 5574@end example
5337 5575
5338@vindex parse-time-months 5576@vindex parse-time-months
@@ -5341,14 +5579,22 @@ The function understands English month and weekday abbreviations. If
5341you want to use unabbreviated names and/or other languages, configure 5579you want to use unabbreviated names and/or other languages, configure
5342the variables @code{parse-time-months} and @code{parse-time-weekdays}. 5580the variables @code{parse-time-months} and @code{parse-time-weekdays}.
5343 5581
5582@vindex org-read-date-force-compatible-dates
5583Not all dates can be represented in a given Emacs implementation. By default
5584Org mode forces dates into the compatibility range 1970--2037 which works on
5585all Emacs implementations. If you want to use dates outside of this range,
5586read the docstring of the variable
5587@code{org-read-date-force-compatible-dates}.
5588
5344You can specify a time range by giving start and end times or by giving a 5589You can specify a time range by giving start and end times or by giving a
5345start time and a duration (in HH:MM format). Use `-' or `-@{@}-' as the separator 5590start time and a duration (in HH:MM format). Use one or two dash(es) as the
5346in the former case and use '+' as the separator in the latter case. E.g. 5591separator in the former case and use '+' as the separator in the latter
5592case, e.g.@:
5347 5593
5348@example 5594@example
534911am-1:15pm --> 11:00-13:15 559511am-1:15pm @result{} 11:00-13:15
535011am--1:15pm --> same as above 559611am--1:15pm @result{} same as above
535111am+2:15 --> same as above 559711am+2:15 @result{} same as above
5352@end example 5598@end example
5353 5599
5354@cindex calendar, for selecting date 5600@cindex calendar, for selecting date
@@ -5399,7 +5645,7 @@ minibuffer@footnote{If you find this distracting, turn the display of with
5399 5645
5400@vindex org-display-custom-times 5646@vindex org-display-custom-times
5401@vindex org-time-stamp-custom-formats 5647@vindex org-time-stamp-custom-formats
5402Org-mode uses the standard ISO notation for dates and times as it is 5648Org mode uses the standard ISO notation for dates and times as it is
5403defined in ISO 8601. If you cannot get used to this and require another 5649defined in ISO 8601. If you cannot get used to this and require another
5404representation of date and time to keep you happy, you can get it by 5650representation of date and time to keep you happy, you can get it by
5405customizing the variables @code{org-display-custom-times} and 5651customizing the variables @code{org-display-custom-times} and
@@ -5411,7 +5657,7 @@ Toggle the display of custom formats for dates and times.
5411@end table 5657@end table
5412 5658
5413@noindent 5659@noindent
5414Org-mode needs the default format for scanning, so the custom date/time 5660Org mode needs the default format for scanning, so the custom date/time
5415format does not @emph{replace} the default format---instead it is put 5661format does not @emph{replace} the default format---instead it is put
5416@emph{over} the default format using text properties. This has the 5662@emph{over} the default format using text properties. This has the
5417following consequences: 5663following consequences:
@@ -5479,7 +5725,7 @@ The headline will be listed under the given date@footnote{It will still
5479be listed on that date after it has been marked DONE. If you don't like 5725be listed on that date after it has been marked DONE. If you don't like
5480this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In 5726this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
5481addition, a reminder that the scheduled date has passed will be present 5727addition, a reminder that the scheduled date has passed will be present
5482in the compilation for @emph{today}, until the entry is marked DONE, i.e. 5728in the compilation for @emph{today}, until the entry is marked DONE, i.e.@:
5483the task will automatically be forwarded until completed. 5729the task will automatically be forwarded until completed.
5484 5730
5485@example 5731@example
@@ -5488,23 +5734,23 @@ the task will automatically be forwarded until completed.
5488@end example 5734@end example
5489 5735
5490@noindent 5736@noindent
5491@b{Important:} Scheduling an item in Org-mode should @i{not} be 5737@b{Important:} Scheduling an item in Org mode should @i{not} be
5492understood in the same way that we understand @i{scheduling a meeting}. 5738understood in the same way that we understand @i{scheduling a meeting}.
5493Setting a date for a meeting is just a simple appointment, you should 5739Setting a date for a meeting is just a simple appointment, you should
5494mark this entry with a simple plain timestamp, to get this item shown 5740mark this entry with a simple plain timestamp, to get this item shown
5495on the date where it applies. This is a frequent misunderstanding by 5741on the date where it applies. This is a frequent misunderstanding by
5496Org users. In Org-mode, @i{scheduling} means setting a date when you 5742Org users. In Org mode, @i{scheduling} means setting a date when you
5497want to start working on an action item. 5743want to start working on an action item.
5498@end table 5744@end table
5499 5745
5500You may use timestamps with repeaters in scheduling and deadline 5746You may use timestamps with repeaters in scheduling and deadline
5501entries. Org-mode will issue early and late warnings based on the 5747entries. Org mode will issue early and late warnings based on the
5502assumption that the timestamp represents the @i{nearest instance} of 5748assumption that the timestamp represents the @i{nearest instance} of
5503the repeater. However, the use of diary sexp entries like 5749the repeater. However, the use of diary sexp entries like
5504@c 5750@c
5505@code{<%%(diary-float t 42)>} 5751@code{<%%(org-float t 42)>}
5506@c 5752@c
5507in scheduling and deadline timestamps is limited. Org-mode does not 5753in scheduling and deadline timestamps is limited. Org mode does not
5508know enough about the internals of each sexp function to issue early and 5754know enough about the internals of each sexp function to issue early and
5509late warnings. However, it will show the item on each day where the 5755late warnings. However, it will show the item on each day where the
5510sexp entry matches. 5756sexp entry matches.
@@ -5517,29 +5763,30 @@ sexp entry matches.
5517@node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling 5763@node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
5518@subsection Inserting deadlines or schedules 5764@subsection Inserting deadlines or schedules
5519 5765
5520The following commands allow you to quickly insert a deadline or to schedule 5766The following commands allow you to quickly insert@footnote{The @samp{SCHEDULED} and
5767@samp{DEADLINE} dates are inserted on the line right below the headline. Don't put
5768any text between this line and the headline.} a deadline or to schedule
5521an item: 5769an item:
5522 5770
5523@table @kbd 5771@table @kbd
5524@c 5772@c
5525@orgcmd{C-c C-d,org-deadline} 5773@orgcmd{C-c C-d,org-deadline}
5526Insert @samp{DEADLINE} keyword along with a stamp. The insertion will happen 5774Insert @samp{DEADLINE} keyword along with a stamp. The insertion will happen
5527in the line directly following the headline. When called with a prefix arg, 5775in the line directly following the headline. Any CLOSED timestamp will be
5528an existing deadline will be removed from the entry. Depending on the 5776removed. When called with a prefix arg, an existing deadline will be removed
5529variable @code{org-log-redeadline}@footnote{with corresponding 5777from the entry. Depending on the variable @code{org-log-redeadline}@footnote{with corresponding
5530@code{#+STARTUP} keywords @code{logredeadline}, @code{lognoteredeadline}, 5778@code{#+STARTUP} keywords @code{logredeadline}, @code{lognoteredeadline},
5531and @code{nologredeadline}}, a note will be taken when changing an existing 5779and @code{nologredeadline}}, a note will be taken when changing an existing
5532deadline. 5780deadline.
5533@c FIXME Any CLOSED timestamp will be removed.???????? 5781
5534@c
5535@orgcmd{C-c C-s,org-schedule} 5782@orgcmd{C-c C-s,org-schedule}
5536Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will 5783Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
5537happen in the line directly following the headline. Any CLOSED timestamp 5784happen in the line directly following the headline. Any CLOSED timestamp
5538will be removed. When called with a prefix argument, remove the scheduling 5785will be removed. When called with a prefix argument, remove the scheduling
5539date from the entry. Depending on the variable 5786date from the entry. Depending on the variable
5540@code{org-log-reschedule}@footnote{with corresponding @code{#+STARTUP} 5787@code{org-log-reschedule}@footnote{with corresponding @code{#+STARTUP}
5541keywords @code{logredeadline}, @code{lognoteredeadline}, and 5788keywords @code{logreschedule}, @code{lognotereschedule}, and
5542@code{nologredeadline}}, a note will be taken when changing an existing 5789@code{nologreschedule}}, a note will be taken when changing an existing
5543scheduling time. 5790scheduling time.
5544@c 5791@c
5545@orgcmd{C-c C-x C-k,org-mark-entry-for-agenda-action} 5792@orgcmd{C-c C-x C-k,org-mark-entry-for-agenda-action}
@@ -5566,12 +5813,17 @@ Sparse tree for deadlines and scheduled items before a given date.
5566Sparse tree for deadlines and scheduled items after a given date. 5813Sparse tree for deadlines and scheduled items after a given date.
5567@end table 5814@end table
5568 5815
5816Note that @code{org-schedule} and @code{org-deadline} supports
5817setting the date by indicating a relative time: e.g. +1d will set
5818the date to the next day after today, and --1w will set the date
5819to the previous week before any current timestamp.
5820
5569@node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling 5821@node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
5570@subsection Repeated tasks 5822@subsection Repeated tasks
5571@cindex tasks, repeated 5823@cindex tasks, repeated
5572@cindex repeated tasks 5824@cindex repeated tasks
5573 5825
5574Some tasks need to be repeated again and again. Org-mode helps to 5826Some tasks need to be repeated again and again. Org mode helps to
5575organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED, 5827organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
5576or plain timestamp. In the following example 5828or plain timestamp. In the following example
5577@example 5829@example
@@ -5591,7 +5843,7 @@ over-due, so it is important to be able to mark such an entry as completed
5591once you have done so. When you mark a DEADLINE or a SCHEDULE with the TODO 5843once you have done so. When you mark a DEADLINE or a SCHEDULE with the TODO
5592keyword DONE, it will no longer produce entries in the agenda. The problem 5844keyword DONE, it will no longer produce entries in the agenda. The problem
5593with this is, however, that then also the @emph{next} instance of the 5845with this is, however, that then also the @emph{next} instance of the
5594repeated entry will not be active. Org-mode deals with this in the following 5846repeated entry will not be active. Org mode deals with this in the following
5595way: When you try to mark such an entry DONE (using @kbd{C-c C-t}), it will 5847way: When you try to mark such an entry DONE (using @kbd{C-c C-t}), it will
5596shift the base date of the repeating timestamp by the repeater interval, and 5848shift the base date of the repeating timestamp by the repeater interval, and
5597immediately set the entry state back to TODO@footnote{In fact, the target 5849immediately set the entry state back to TODO@footnote{In fact, the target
@@ -5624,7 +5876,7 @@ task, this may not be the best way to handle it. For example, if you
5624forgot to call your father for 3 weeks, it does not make sense to call 5876forgot to call your father for 3 weeks, it does not make sense to call
5625him 3 times in a single day to make up for it. Finally, there are tasks 5877him 3 times in a single day to make up for it. Finally, there are tasks
5626like changing batteries which should always repeat a certain time 5878like changing batteries which should always repeat a certain time
5627@i{after} the last time you did it. For these tasks, Org-mode has 5879@i{after} the last time you did it. For these tasks, Org mode has
5628special repeaters @samp{++} and @samp{.+}. For example: 5880special repeaters @samp{++} and @samp{.+}. For example:
5629 5881
5630@example 5882@example
@@ -5653,7 +5905,7 @@ created for this purpose, it is described in @ref{Structure editing}.
5653@cindex clocking time 5905@cindex clocking time
5654@cindex time clocking 5906@cindex time clocking
5655 5907
5656Org-mode allows you to clock the time you spend on specific tasks in a 5908Org mode allows you to clock the time you spend on specific tasks in a
5657project. When you start working on an item, you can start the clock. 5909project. When you start working on an item, you can start the clock.
5658When you stop working on that task, or when you mark the task done, the 5910When you stop working on that task, or when you mark the task done, the
5659clock is stopped and the corresponding time interval is recorded. It 5911clock is stopped and the corresponding time interval is recorded. It
@@ -5684,11 +5936,15 @@ what to do with it.
5684@table @kbd 5936@table @kbd
5685@orgcmd{C-c C-x C-i,org-clock-in} 5937@orgcmd{C-c C-x C-i,org-clock-in}
5686@vindex org-clock-into-drawer 5938@vindex org-clock-into-drawer
5939@cindex property, LOG_INTO_DRAWER
5687Start the clock on the current item (clock-in). This inserts the CLOCK 5940Start the clock on the current item (clock-in). This inserts the CLOCK
5688keyword together with a timestamp. If this is not the first clocking of 5941keyword together with a timestamp. If this is not the first clocking of
5689this item, the multiple CLOCK lines will be wrapped into a 5942this item, the multiple CLOCK lines will be wrapped into a
5690@code{:LOGBOOK:} drawer (see also the variable 5943@code{:LOGBOOK:} drawer (see also the variable
5691@code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument, 5944@code{org-clock-into-drawer}). You can also overrule
5945the setting of this variable for a subtree by setting a
5946@code{CLOCK_INTO_DRAWER} or @code{LOG_INTO_DRAWER} property.
5947When called with a @kbd{C-u} prefix argument,
5692select the task from a list of recently clocked tasks. With two @kbd{C-u 5948select the task from a list of recently clocked tasks. With two @kbd{C-u
5693C-u} prefixes, clock into the task at point and mark it as the default task. 5949C-u} prefixes, clock into the task at point and mark it as the default task.
5694The default task will always be available when selecting a clocking task, 5950The default task will always be available when selecting a clocking task,
@@ -5730,6 +5986,9 @@ Update the effort estimate for the current clock task.
5730Recompute the time interval after changing one of the timestamps. This 5986Recompute the time interval after changing one of the timestamps. This
5731is only necessary if you edit the timestamps directly. If you change 5987is only necessary if you edit the timestamps directly. If you change
5732them with @kbd{S-@key{cursor}} keys, the update is automatic. 5988them with @kbd{S-@key{cursor}} keys, the update is automatic.
5989@orgcmd{C-S-@key{up/down},org-clock-timestamps-up/down}
5990On @code{CLOCK} log lines, increase/decrease both timestamps at the same
5991time so that duration keeps the same.
5733@orgcmd{C-c C-t,org-todo} 5992@orgcmd{C-c C-t,org-todo}
5734Changing the TODO state of an item to DONE automatically stops the clock 5993Changing the TODO state of an item to DONE automatically stops the clock
5735if it is running in this same item. 5994if it is running in this same item.
@@ -5741,12 +6000,12 @@ Jump to the headline of the currently clocked in task. With a @kbd{C-u}
5741prefix arg, select the target task from a list of recently clocked tasks. 6000prefix arg, select the target task from a list of recently clocked tasks.
5742@orgcmd{C-c C-x C-d,org-clock-display} 6001@orgcmd{C-c C-x C-d,org-clock-display}
5743@vindex org-remove-highlights-with-change 6002@vindex org-remove-highlights-with-change
5744Display time summaries for each subtree in the current buffer. This 6003Display time summaries for each subtree in the current buffer. This puts
5745puts overlays at the end of each headline, showing the total time 6004overlays at the end of each headline, showing the total time recorded under
5746recorded under that heading, including the time of any subheadings. You 6005that heading, including the time of any subheadings. You can use visibility
5747can use visibility cycling to study the tree, but the overlays disappear 6006cycling to study the tree, but the overlays disappear when you change the
5748when you change the buffer (see variable 6007buffer (see variable @code{org-remove-highlights-with-change}) or press
5749@code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}. 6008@kbd{C-c C-c}.
5750@end table 6009@end table
5751 6010
5752The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in 6011The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
@@ -5765,10 +6024,11 @@ formatted as one or several Org tables.
5765@table @kbd 6024@table @kbd
5766@orgcmd{C-c C-x C-r,org-clock-report} 6025@orgcmd{C-c C-x C-r,org-clock-report}
5767Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock 6026Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
5768report as an Org-mode table into the current file. When the cursor is 6027report as an Org mode table into the current file. When the cursor is
5769at an existing clock table, just update it. When called with a prefix 6028at an existing clock table, just update it. When called with a prefix
5770argument, jump to the first clock report in the current document and 6029argument, jump to the first clock report in the current document and
5771update it. 6030update it. The clock table always includes also trees with
6031@code{:ARCHIVE:} tag.
5772@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update} 6032@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
5773Update dynamic block at point. The cursor needs to be in the 6033Update dynamic block at point. The cursor needs to be in the
5774@code{#+BEGIN} line of the dynamic block. 6034@code{#+BEGIN} line of the dynamic block.
@@ -5830,7 +6090,8 @@ be selected:
5830 @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.} 6090 @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
5831:stepskip0 @r{Do not show steps that have zero time.} 6091:stepskip0 @r{Do not show steps that have zero time.}
5832:fileskip0 @r{Do not show table sections from files which did not contribute.} 6092:fileskip0 @r{Do not show table sections from files which did not contribute.}
5833:tags @r{A tags match to select entries that should contribute}. 6093:tags @r{A tags match to select entries that should contribute. See}
6094 @r{@ref{Matching tags and properties} for the match syntax.}
5834@end example 6095@end example
5835 6096
5836Then there are options which determine the formatting of the table. There 6097Then there are options which determine the formatting of the table. There
@@ -5838,6 +6099,7 @@ options are interpreted by the function @code{org-clocktable-write-default},
5838but you can specify your own function using the @code{:formatter} parameter. 6099but you can specify your own function using the @code{:formatter} parameter.
5839@example 6100@example
5840:emphasize @r{When @code{t}, emphasize level one and level two items.} 6101:emphasize @r{When @code{t}, emphasize level one and level two items.}
6102:lang @r{Language@footnote{Language terms can be set through the variable @code{org-clock-clocktable-language-setup}.} to use for descriptive cells like "Task".}
5841:link @r{Link the item headlines in the table to their origins.} 6103:link @r{Link the item headlines in the table to their origins.}
5842:narrow @r{An integer to limit the width of the headline column in} 6104:narrow @r{An integer to limit the width of the headline column in}
5843 @r{the org table. If you write it like @samp{50!}, then the} 6105 @r{the org table. If you write it like @samp{50!}, then the}
@@ -5850,6 +6112,9 @@ but you can specify your own function using the @code{:formatter} parameter.
5850 @r{All are overwritten except if there is an explicit @code{:narrow}} 6112 @r{All are overwritten except if there is an explicit @code{:narrow}}
5851:timestamp @r{A timestamp for the entry, when available. Look for SCHEDULED,} 6113:timestamp @r{A timestamp for the entry, when available. Look for SCHEDULED,}
5852 @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.} 6114 @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
6115:properties @r{List of properties that should be shown in the table. Each}
6116 @r{property will get its own column.}
6117:inherit-props @r{When this flag is @code{t}, the values for @code{:properties} will be inherited.}
5853:formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.} 6118:formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
5854 @r{As a special case, @samp{:formula %} adds a column with % time.} 6119 @r{As a special case, @samp{:formula %} adds a column with % time.}
5855 @r{If you do not specify a formula here, any existing formula} 6120 @r{If you do not specify a formula here, any existing formula}
@@ -5897,7 +6162,7 @@ applying it to another one.
5897By customizing the variable @code{org-clock-idle-time} to some integer, such 6162By customizing the variable @code{org-clock-idle-time} to some integer, such
5898as 10 or 15, Emacs can alert you when you get back to your computer after 6163as 10 or 15, Emacs can alert you when you get back to your computer after
5899being idle for that many minutes@footnote{On computers using Mac OS X, 6164being idle for that many minutes@footnote{On computers using Mac OS X,
5900idleness is based on actual user idleness, not just Emacs' idle time. For 6165idleness is based on actual user idleness, not just Emacs's idle time. For
5901X11, you can install a utility program @file{x11idle.c}, available in the 6166X11, you can install a utility program @file{x11idle.c}, available in the
5902UTILITIES directory of the Org git distribution, to get the same general 6167UTILITIES directory of the Org git distribution, to get the same general
5903treatment of idleness. On other systems, idle time refers to Emacs idle time 6168treatment of idleness. On other systems, idle time refers to Emacs idle time
@@ -5945,7 +6210,7 @@ If you restart Emacs and clock into any task, Org will notice that you have a
5945dangling clock which was never clocked out from your last session. Using 6210dangling clock which was never clocked out from your last session. Using
5946that clock's starting time as the beginning of the unaccounted-for period, 6211that clock's starting time as the beginning of the unaccounted-for period,
5947Org will ask how you want to resolve that time. The logic and behavior is 6212Org will ask how you want to resolve that time. The logic and behavior is
5948identical to dealing with away time due to idleness; it's just happening due 6213identical to dealing with away time due to idleness; it is just happening due
5949to a recovery event rather than a set amount of idle time. 6214to a recovery event rather than a set amount of idle time.
5950 6215
5951You can also check all the files visited by your Org agenda for dangling 6216You can also check all the files visited by your Org agenda for dangling
@@ -5982,7 +6247,7 @@ together with clock sums (if you want to clock your time). For a specific
5982buffer you can use 6247buffer you can use
5983 6248
5984@example 6249@example
5985#+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00 6250#+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00
5986#+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM 6251#+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
5987@end example 6252@end example
5988 6253
@@ -6060,8 +6325,8 @@ not started at exactly the right moment.
6060@kindex C-c C-x ; 6325@kindex C-c C-x ;
6061@kindex ; 6326@kindex ;
6062 6327
6063Calling @code{org-timer-set-timer} from an Org-mode buffer runs a countdown 6328Calling @code{org-timer-set-timer} from an Org mode buffer runs a countdown
6064timer. Use @key{;} from agenda buffers, @key{C-c C-x ;} everwhere else. 6329timer. Use @kbd{;} from agenda buffers, @key{C-c C-x ;} everywhere else.
6065 6330
6066@code{org-timer-set-timer} prompts the user for a duration and displays a 6331@code{org-timer-set-timer} prompts the user for a duration and displays a
6067countdown timer in the modeline. @code{org-timer-default-timer} sets the 6332countdown timer in the modeline. @code{org-timer-default-timer} sets the
@@ -6083,7 +6348,7 @@ trees to an archive file keeps the system compact and fast.
6083* Capture:: Capturing new stuff 6348* Capture:: Capturing new stuff
6084* Attachments:: Add files to tasks 6349* Attachments:: Add files to tasks
6085* RSS Feeds:: Getting input from RSS feeds 6350* RSS Feeds:: Getting input from RSS feeds
6086* Protocols:: External (e.g. Browser) access to Emacs and Org 6351* Protocols:: External (e.g.@: Browser) access to Emacs and Org
6087* Refiling notes:: Moving a tree from one place to another 6352* Refiling notes:: Moving a tree from one place to another
6088* Archiving:: What to do with finished projects 6353* Archiving:: What to do with finished projects
6089@end menu 6354@end menu
@@ -6094,7 +6359,7 @@ trees to an archive file keeps the system compact and fast.
6094 6359
6095Org's method for capturing new items is heavily inspired by John Wiegley 6360Org's method for capturing new items is heavily inspired by John Wiegley
6096excellent remember package. Up to version 6.36 Org used a special setup 6361excellent remember package. Up to version 6.36 Org used a special setup
6097for @file{remember.el}. @file{org-remember.el} is still part of Org-mode for 6362for @file{remember.el}. @file{org-remember.el} is still part of Org mode for
6098backward compatibility with existing setups. You can find the documentation 6363backward compatibility with existing setups. You can find the documentation
6099for org-remember at @url{http://orgmode.org/org-remember.pdf}. 6364for org-remember at @url{http://orgmode.org/org-remember.pdf}.
6100 6365
@@ -6138,6 +6403,7 @@ suggestion.} for capturing new material.
6138@orgcmd{C-c c,org-capture} 6403@orgcmd{C-c c,org-capture}
6139Call the command @code{org-capture}. Note that this keybinding is global and 6404Call the command @code{org-capture}. Note that this keybinding is global and
6140not active by default - you need to install it. If you have templates 6405not active by default - you need to install it. If you have templates
6406@cindex date tree
6141defined @pxref{Capture templates}, it will offer these templates for 6407defined @pxref{Capture templates}, it will offer these templates for
6142selection or use a new Org outline node as the default template. It will 6408selection or use a new Org outline node as the default template. It will
6143insert the template into the target file and switch to an indirect buffer 6409insert the template into the target file and switch to an indirect buffer
@@ -6172,7 +6438,7 @@ prefix commands:
6172 6438
6173@table @kbd 6439@table @kbd
6174@orgkey{C-u C-c c} 6440@orgkey{C-u C-c c}
6175Visit the target location of a cpature template. You get to select the 6441Visit the target location of a capture template. You get to select the
6176template in the usual way. 6442template in the usual way.
6177@orgkey{C-u C-u C-c c} 6443@orgkey{C-u C-u C-c c}
6178Visit the last stored capture item in its buffer. 6444Visit the last stored capture item in its buffer.
@@ -6220,6 +6486,14 @@ extremely useful for deriving tasks from emails, for example. You fill in
6220the task definition, press @code{C-c C-c} and Org returns you to the same 6486the task definition, press @code{C-c C-c} and Org returns you to the same
6221place where you started the capture process. 6487place where you started the capture process.
6222 6488
6489To define special keys to capture to a particular template without going
6490through the interactive template selection, you can create your key binding
6491like this:
6492
6493@lisp
6494(define-key global-map "\C-cx"
6495 (lambda () (interactive) (org-capture nil "x")))
6496@end lisp
6223 6497
6224@menu 6498@menu
6225* Template elements:: What is needed for a complete template entry 6499* Template elements:: What is needed for a complete template entry
@@ -6230,14 +6504,14 @@ place where you started the capture process.
6230@subsubsection Template elements 6504@subsubsection Template elements
6231 6505
6232Now lets look at the elements of a template definition. Each entry in 6506Now lets look at the elements of a template definition. Each entry in
6233@code{org-capture-templates} is a list with the following items: 6507@code{org-capture-templates} is a list with the following items:
6234 6508
6235@table @var 6509@table @var
6236@item keys 6510@item keys
6237The keys that will select the template, as a string, characters 6511The keys that will select the template, as a string, characters
6238only, for example @code{"a"} for a template to be selected with a 6512only, for example @code{"a"} for a template to be selected with a
6239single key, or @code{"bt"} for selection with two keys. When using 6513single key, or @code{"bt"} for selection with two keys. When using
6240several keys, keys using the same prefix key must be sequential 6514several keys, keys using the same prefix key must be sequential
6241in the list and preceded by a 2-element entry explaining the 6515in the list and preceded by a 2-element entry explaining the
6242prefix key, for example 6516prefix key, for example
6243@example 6517@example
@@ -6254,9 +6528,8 @@ selection.
6254The type of entry, a symbol. Valid values are: 6528The type of entry, a symbol. Valid values are:
6255@table @code 6529@table @code
6256@item entry 6530@item entry
6257An Org-mode node, with a headline. Will be filed as the child of the 6531An Org mode node, with a headline. Will be filed as the child of the target
6258target entry or as a top-level entry. The target file should be an Org-mode 6532entry or as a top-level entry. The target file should be an Org mode file.
6259file.
6260@item item 6533@item item
6261A plain list item, placed in the first plain list at the target 6534A plain list item, placed in the first plain list at the target
6262location. Again the target file should be an Org file. 6535location. Again the target file should be an Org file.
@@ -6273,11 +6546,12 @@ Text to be inserted as it is.
6273 6546
6274@item target 6547@item target
6275@vindex org-default-notes-file 6548@vindex org-default-notes-file
6276Specification of where the captured item should be placed. In Org-mode 6549Specification of where the captured item should be placed. In Org mode
6277files, targets usually define a node. Entries will become children of this 6550files, targets usually define a node. Entries will become children of this
6278node. Other types will be added to the table or list in the body of this 6551node. Other types will be added to the table or list in the body of this
6279node. Most target specifications contain a file name. If that file name is 6552node. Most target specifications contain a file name. If that file name is
6280the empty string, it defaults to @code{org-default-notes-file}. 6553the empty string, it defaults to @code{org-default-notes-file}. A file can
6554also be given as a variable, function, or Emacs Lisp form.
6281 6555
6282Valid values are: 6556Valid values are:
6283@table @code 6557@table @code
@@ -6342,14 +6616,25 @@ before and after the new item. Default 0, only common other value is 1.
6342@item :clock-in 6616@item :clock-in
6343Start the clock in this item. 6617Start the clock in this item.
6344 6618
6619@item :clock-keep
6620Keep the clock running when filing the captured entry.
6621
6345@item :clock-resume 6622@item :clock-resume
6346If starting the capture interrupted a clock, restart that clock when finished 6623If starting the capture interrupted a clock, restart that clock when finished
6347with the capture. 6624with the capture. Note that @code{:clock-keep} has precedence over
6625@code{:clock-resume}. When setting both to @code{t}, the current clock will
6626run and the previous one will not be resumed.
6348 6627
6349@item :unnarrowed 6628@item :unnarrowed
6350Do not narrow the target buffer, simply show the full buffer. Default is to 6629Do not narrow the target buffer, simply show the full buffer. Default is to
6351narrow it so that you only see the new material. 6630narrow it so that you only see the new material.
6352 6631
6632@item :table-line-pos
6633Specification of the location in the table where the new line should be
6634inserted. It should be a string like @code{"II-3"} meaning that the new
6635line should become the third line before the second horizontal separator
6636line.
6637
6353@item :kill-buffer 6638@item :kill-buffer
6354If the target file was not yet visited when capture was invoked, kill the 6639If the target file was not yet visited when capture was invoked, kill the
6355buffer again after capture is completed. 6640buffer again after capture is completed.
@@ -6361,37 +6646,39 @@ buffer again after capture is completed.
6361 6646
6362In the template itself, special @kbd{%}-escapes@footnote{If you need one of 6647In the template itself, special @kbd{%}-escapes@footnote{If you need one of
6363these sequences literally, escape the @kbd{%} with a backslash.} allow 6648these sequences literally, escape the @kbd{%} with a backslash.} allow
6364dynamic insertion of content: 6649dynamic insertion of content. The templates are expanded in the order given here:
6365 6650
6366@comment SJE: should these sentences terminate in period?
6367@smallexample 6651@smallexample
6368%^@{@var{prompt}@} @r{prompt the user for a string and replace this sequence with it.} 6652%[@var{file}] @r{insert the contents of the file given by @var{file}.}
6369 @r{You may specify a default value and a completion table with} 6653%(@var{sexp}) @r{evaluate Elisp @var{sexp} and replace with the result.}
6370 @r{%^@{prompt|default|completion2|completion3...@}} 6654%<...> @r{the result of format-time-string on the ... format specification.}
6371 @r{The arrow keys access a prompt-specific history.} 6655%t @r{timestamp, date only.}
6372%a @r{annotation, normally the link created with @code{org-store-link}} 6656%T @r{timestamp with date and time.}
6373%A @r{like @code{%a}, but prompt for the description part} 6657%u, %U @r{like the above, but inactive timestamps.}
6658%a @r{annotation, normally the link created with @code{org-store-link}.}
6374%i @r{initial content, the region when capture is called while the} 6659%i @r{initial content, the region when capture is called while the}
6375 @r{region is active.} 6660 @r{region is active.}
6376 @r{The entire text will be indented like @code{%i} itself.} 6661 @r{The entire text will be indented like @code{%i} itself.}
6377%t @r{timestamp, date only} 6662%A @r{like @code{%a}, but prompt for the description part.}
6378%T @r{timestamp with date and time}
6379%u, %U @r{like the above, but inactive timestamps}
6380%^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
6381 @r{You may define a prompt like @code{%^@{Birthday@}t}}
6382%n @r{user name (taken from @code{user-full-name})}
6383%c @r{Current kill ring head.} 6663%c @r{Current kill ring head.}
6384%x @r{Content of the X clipboard.} 6664%x @r{Content of the X clipboard.}
6385%^C @r{Interactive selection of which kill or clip to use.} 6665%k @r{title of the currently clocked task.}
6386%^L @r{Like @code{%^C}, but insert as link.} 6666%K @r{link to the currently clocked task.}
6387%k @r{title of the currently clocked task} 6667%n @r{user name (taken from @code{user-full-name}).}
6388%K @r{link to the currently clocked task} 6668%f @r{file visited by current buffer when org-capture was called.}
6669%F @r{full path of the file or directory visited by current buffer.}
6670%:keyword @r{specific information for certain link types, see below.}
6389%^g @r{prompt for tags, with completion on tags in target file.} 6671%^g @r{prompt for tags, with completion on tags in target file.}
6390%^G @r{prompt for tags, with completion all tags in all agenda files.} 6672%^G @r{prompt for tags, with completion all tags in all agenda files.}
6391%^@{@var{prop}@}p @r{Prompt the user for a value for property @var{prop}} 6673%^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}.}
6392%:keyword @r{specific information for certain link types, see below} 6674 @r{You may define a prompt like @code{%^@{Birthday@}t}.}
6393%[@var{file}] @r{insert the contents of the file given by @var{file}} 6675%^C @r{Interactive selection of which kill or clip to use.}
6394%(@var{sexp}) @r{evaluate Elisp @var{sexp} and replace with the result} 6676%^L @r{Like @code{%^C}, but insert as link.}
6677%^@{@var{prop}@}p @r{Prompt the user for a value for property @var{prop}.}
6678%^@{@var{prompt}@} @r{prompt the user for a string and replace this sequence with it.}
6679 @r{You may specify a default value and a completion table with}
6680 @r{%^@{prompt|default|completion2|completion3...@}.}
6681 @r{The arrow keys access a prompt-specific history.}
6395@end smallexample 6682@end smallexample
6396 6683
6397@noindent 6684@noindent
@@ -6403,8 +6690,8 @@ similar way.}:
6403 6690
6404@vindex org-from-is-user-regexp 6691@vindex org-from-is-user-regexp
6405@smallexample 6692@smallexample
6406Link type | Available keywords 6693Link type | Available keywords
6407-------------------+---------------------------------------------- 6694------------------------+----------------------------------------------
6408bbdb | %:name %:company 6695bbdb | %:name %:company
6409irc | %:server %:port %:nick 6696irc | %:server %:port %:nick
6410vm, wl, mh, mew, rmail | %:type %:subject %:message-id 6697vm, wl, mh, mew, rmail | %:type %:subject %:message-id
@@ -6482,7 +6769,7 @@ Create a new attachment as an Emacs buffer.
6482Synchronize the current task with its attachment directory, in case you added 6769Synchronize the current task with its attachment directory, in case you added
6483attachments yourself. 6770attachments yourself.
6484 6771
6485@orgcmdtkc{p,C-c C-a o,org-attach-open} 6772@orgcmdtkc{o,C-c C-a o,org-attach-open}
6486@vindex org-file-apps 6773@vindex org-file-apps
6487Open current task's attachment. If there is more than one, prompt for a 6774Open current task's attachment. If there is more than one, prompt for a
6488file name first. Opening will follow the rules set by @code{org-file-apps}. 6775file name first. Opening will follow the rules set by @code{org-file-apps}.
@@ -6610,7 +6897,7 @@ create new nodes as new parents for refiling on the fly, check the
6610variable @code{org-refile-allow-creating-parent-nodes}. 6897variable @code{org-refile-allow-creating-parent-nodes}.
6611When the variable @code{org-log-refile}@footnote{with corresponding 6898When the variable @code{org-log-refile}@footnote{with corresponding
6612@code{#+STARTUP} keywords @code{logrefile}, @code{lognoterefile}, 6899@code{#+STARTUP} keywords @code{logrefile}, @code{lognoterefile},
6613and @code{nologrefile}} is set, a time stamp or a note will be 6900and @code{nologrefile}} is set, a timestamp or a note will be
6614recorded when an entry has been refiled. 6901recorded when an entry has been refiled.
6615@orgkey{C-u C-c C-w} 6902@orgkey{C-u C-c C-w}
6616Use the refile interface to jump to a heading. 6903Use the refile interface to jump to a heading.
@@ -6835,7 +7122,7 @@ The information to be shown is normally collected from all @emph{agenda
6835files}, the files listed in the variable 7122files}, the files listed in the variable
6836@code{org-agenda-files}@footnote{If the value of that variable is not a 7123@code{org-agenda-files}@footnote{If the value of that variable is not a
6837list, but a single file name, then the list of agenda files will be 7124list, but a single file name, then the list of agenda files will be
6838maintained in that external file.}. If a directory is part of this list, 7125maintained in that external file.}. If a directory is part of this list,
6839all files with the extension @file{.org} in this directory will be part 7126all files with the extension @file{.org} in this directory will be part
6840of the list. 7127of the list.
6841 7128
@@ -6848,13 +7135,14 @@ the easiest way to maintain it is through the following commands
6848 7135
6849@cindex files, adding to agenda list 7136@cindex files, adding to agenda list
6850@table @kbd 7137@table @kbd
6851@orgcmd{C-c [,org-agenda-to-front} 7138@orgcmd{C-c [,org-agenda-file-to-front}
6852Add current file to the list of agenda files. The file is added to 7139Add current file to the list of agenda files. The file is added to
6853the front of the list. If it was already in the list, it is moved to 7140the front of the list. If it was already in the list, it is moved to
6854the front. With a prefix argument, file is added/moved to the end. 7141the front. With a prefix argument, file is added/moved to the end.
6855@orgcmd{C-c ],org-remove-file} 7142@orgcmd{C-c ],org-remove-file}
6856Remove current file from the list of agenda files. 7143Remove current file from the list of agenda files.
6857@kindex C-, 7144@kindex C-,
7145@cindex cycling, of agenda files
6858@orgcmd{C-',org-cycle-agenda-files} 7146@orgcmd{C-',org-cycle-agenda-files}
6859@itemx C-, 7147@itemx C-,
6860Cycle through agenda file list, visiting one file after the other. 7148Cycle through agenda file list, visiting one file after the other.
@@ -6905,7 +7193,7 @@ Lift the restriction.
6905@cindex agenda dispatcher 7193@cindex agenda dispatcher
6906@cindex dispatching agenda commands 7194@cindex dispatching agenda commands
6907The views are created through a dispatcher, which should be bound to a 7195The views are created through a dispatcher, which should be bound to a
6908global key---for example @kbd{C-c a} (@pxref{Installation}). In the 7196global key---for example @kbd{C-c a} (@pxref{Activation}). In the
6909following we will assume that @kbd{C-c a} is indeed how the dispatcher 7197following we will assume that @kbd{C-c a} is indeed how the dispatcher
6910is accessed and list keyboard access to commands accordingly. After 7198is accessed and list keyboard access to commands accordingly. After
6911pressing @kbd{C-c a}, an additional letter is required to execute a 7199pressing @kbd{C-c a}, an additional letter is required to execute a
@@ -7010,7 +7298,7 @@ anniversaries, lunar phases, sunrise/set, recurrent appointments
7010Org. It can be very useful to combine output from Org with 7298Org. It can be very useful to combine output from Org with
7011the diary. 7299the diary.
7012 7300
7013In order to include entries from the Emacs diary into Org-mode's 7301In order to include entries from the Emacs diary into Org mode's
7014agenda, you only need to customize the variable 7302agenda, you only need to customize the variable
7015 7303
7016@lisp 7304@lisp
@@ -7019,7 +7307,7 @@ agenda, you only need to customize the variable
7019 7307
7020@noindent After that, everything will happen automatically. All diary 7308@noindent After that, everything will happen automatically. All diary
7021entries including holidays, anniversaries, etc., will be included in the 7309entries including holidays, anniversaries, etc., will be included in the
7022agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and 7310agenda buffer created by Org mode. @key{SPC}, @key{TAB}, and
7023@key{RET} can be used from the agenda buffer to jump to the diary 7311@key{RET} can be used from the agenda buffer to jump to the diary
7024file in order to edit existing diary entries. The @kbd{i} command to 7312file in order to edit existing diary entries. The @kbd{i} command to
7025insert new entries for the current date works in the agenda buffer, as 7313insert new entries for the current date works in the agenda buffer, as
@@ -7030,7 +7318,7 @@ between calendar and agenda.
7030 7318
7031If you are using the diary only for sexp entries and holidays, it is 7319If you are using the diary only for sexp entries and holidays, it is
7032faster to not use the above setting, but instead to copy or even move 7320faster to not use the above setting, but instead to copy or even move
7033the entries into an Org file. Org-mode evaluates diary-style sexp 7321the entries into an Org file. Org mode evaluates diary-style sexp
7034entries, and does it faster because there is no overhead for first 7322entries, and does it faster because there is no overhead for first
7035creating the diary display. Note that the sexp entries must start at 7323creating the diary display. Note that the sexp entries must start at
7036the left margin, no whitespace is allowed before them. For example, 7324the left margin, no whitespace is allowed before them. For example,
@@ -7042,8 +7330,8 @@ will be made in the agenda:
7042#+CATEGORY: Holiday 7330#+CATEGORY: Holiday
7043%%(org-calendar-holiday) ; special function for holiday names 7331%%(org-calendar-holiday) ; special function for holiday names
7044#+CATEGORY: Ann 7332#+CATEGORY: Ann
7045%%(diary-anniversary 5 14 1956)@footnote{Note that the order of the arguments (month, day, year) depends on the setting of @code{calendar-date-style}.} Arthur Dent is %d years old 7333%%(org-anniversary 1956 5 14)@footnote{@code{org-anniversary} is just like @code{diary-anniversary}, but the argument order is always according to ISO and therefore independent of the value of @code{calendar-date-style}.} Arthur Dent is %d years old
7046%%(diary-anniversary 10 2 1869) Mahatma Gandhi would be %d years old 7334%%(org-anniversary 1869 10 2) Mahatma Gandhi would be %d years old
7047@end example 7335@end example
7048 7336
7049@subsubheading Anniversaries from BBDB 7337@subsubheading Anniversaries from BBDB
@@ -7054,7 +7342,7 @@ If you are using the Big Brothers Database to store your contacts, you will
7054very likely prefer to store anniversaries in BBDB rather than in a 7342very likely prefer to store anniversaries in BBDB rather than in a
7055separate Org or diary file. Org supports this and will show BBDB 7343separate Org or diary file. Org supports this and will show BBDB
7056anniversaries as part of the agenda. All you need to do is to add the 7344anniversaries as part of the agenda. All you need to do is to add the
7057following to one your your agenda files: 7345following to one of your agenda files:
7058 7346
7059@example 7347@example
7060* Anniversaries 7348* Anniversaries
@@ -7066,16 +7354,17 @@ following to one your your agenda files:
7066 7354
7067You can then go ahead and define anniversaries for a BBDB record. Basically, 7355You can then go ahead and define anniversaries for a BBDB record. Basically,
7068you need to press @kbd{C-o anniversary @key{RET}} with the cursor in a BBDB 7356you need to press @kbd{C-o anniversary @key{RET}} with the cursor in a BBDB
7069record and then add the date in the format @code{YYYY-MM-DD}, followed by a 7357record and then add the date in the format @code{YYYY-MM-DD} or @code{MM-DD},
7070space and the class of the anniversary (@samp{birthday} or @samp{wedding}, or 7358followed by a space and the class of the anniversary (@samp{birthday} or
7071a format string). If you omit the class, it will default to @samp{birthday}. 7359@samp{wedding}, or a format string). If you omit the class, it will default to
7072Here are a few examples, the header for the file @file{org-bbdb.el} contains 7360@samp{birthday}. Here are a few examples, the header for the file
7073more detailed information. 7361@file{org-bbdb.el} contains more detailed information.
7074 7362
7075@example 7363@example
70761973-06-22 73641973-06-22
736506-22
70771955-08-02 wedding 73661955-08-02 wedding
70782008-04-14 %s released version 6.01 of org-mode, %d years ago 73672008-04-14 %s released version 6.01 of org mode, %d years ago
7079@end example 7368@end example
7080 7369
7081After a change to BBDB, or for the first agenda display during an Emacs 7370After a change to BBDB, or for the first agenda display during an Emacs
@@ -7087,12 +7376,14 @@ in an Org or Diary file.
7087@subsubheading Appointment reminders 7376@subsubheading Appointment reminders
7088@cindex @file{appt.el} 7377@cindex @file{appt.el}
7089@cindex appointment reminders 7378@cindex appointment reminders
7379@cindex appointment
7380@cindex reminders
7090 7381
7091Org can interact with Emacs appointments notification facility. To add all 7382Org can interact with Emacs appointments notification facility. To add all
7092the appointments of your agenda files, use the command 7383the appointments of your agenda files, use the command
7093@code{org-agenda-to-appt}. This command also lets you filter through the 7384@code{org-agenda-to-appt}. This command also lets you filter through the
7094list of your appointments and add only those belonging to a specific category 7385list of your appointments and add only those belonging to a specific category
7095or matching a regular expression. See the docstring for details. 7386or matching a regular expression. See the docstring for details.
7096 7387
7097@node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views 7388@node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
7098@subsection The global TODO list 7389@subsection The global TODO list
@@ -7265,7 +7556,7 @@ brackets (like @samp{DEADLINE<="<2008-12-24 18:30>"}), both values are
7265assumed to be date/time specifications in the standard Org way, and the 7556assumed to be date/time specifications in the standard Org way, and the
7266comparison will be done accordingly. Special values that will be recognized 7557comparison will be done accordingly. Special values that will be recognized
7267are @code{"<now>"} for now (including time), and @code{"<today>"}, and 7558are @code{"<now>"} for now (including time), and @code{"<today>"}, and
7268@code{"<tomorrow>"} for these days at 0:00 hours, i.e. without a time 7559@code{"<tomorrow>"} for these days at 0:00 hours, i.e.@: without a time
7269specification. Also strings like @code{"<+5d>"} or @code{"<-2m>"} with units 7560specification. Also strings like @code{"<+5d>"} or @code{"<-2m>"} with units
7270@code{d}, @code{w}, @code{m}, and @code{y} for day, week, month, and year, 7561@code{d}, @code{w}, @code{m}, and @code{y} for day, week, month, and year,
7271respectively, can be used. 7562respectively, can be used.
@@ -7288,7 +7579,7 @@ other properties will slow down the search. However, once you have paid the
7288price by accessing one property, testing additional properties is cheap 7579price by accessing one property, testing additional properties is cheap
7289again. 7580again.
7290 7581
7291You can configure Org-mode to use property inheritance during a search, but 7582You can configure Org mode to use property inheritance during a search, but
7292beware that this can slow down searches considerably. See @ref{Property 7583beware that this can slow down searches considerably. See @ref{Property
7293inheritance}, for details. 7584inheritance}, for details.
7294 7585
@@ -7321,7 +7612,7 @@ Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
7321@cindex timeline, single file 7612@cindex timeline, single file
7322@cindex time-sorted view 7613@cindex time-sorted view
7323 7614
7324The timeline summarizes all time-stamped items from a single Org-mode 7615The timeline summarizes all time-stamped items from a single Org mode
7325file in a @emph{time-sorted view}. The main purpose of this command is 7616file in a @emph{time-sorted view}. The main purpose of this command is
7326to give an overview over events in a project. 7617to give an overview over events in a project.
7327 7618
@@ -7342,7 +7633,7 @@ The commands available in the timeline buffer are listed in
7342@cindex text search 7633@cindex text search
7343@cindex searching, for text 7634@cindex searching, for text
7344 7635
7345This agenda view is a general text search facility for Org-mode entries. 7636This agenda view is a general text search facility for Org mode entries.
7346It is particularly useful to find notes. 7637It is particularly useful to find notes.
7347 7638
7348@table @kbd 7639@table @kbd
@@ -7368,12 +7659,13 @@ the files listed in @code{org-agenda-text-search-extra-files}.
7368 7659
7369@node Stuck projects, , Search view, Built-in agenda views 7660@node Stuck projects, , Search view, Built-in agenda views
7370@subsection Stuck projects 7661@subsection Stuck projects
7662@pindex GTD, Getting Things Done
7371 7663
7372If you are following a system like David Allen's GTD to organize your 7664If you are following a system like David Allen's GTD to organize your
7373work, one of the ``duties'' you have is a regular review to make sure 7665work, one of the ``duties'' you have is a regular review to make sure
7374that all projects move along. A @emph{stuck} project is a project that 7666that all projects move along. A @emph{stuck} project is a project that
7375has no defined next actions, so it will never show up in the TODO lists 7667has no defined next actions, so it will never show up in the TODO lists
7376Org-mode produces. During the review, you need to identify such 7668Org mode produces. During the review, you need to identify such
7377projects and define next actions for them. 7669projects and define next actions for them.
7378 7670
7379@table @kbd 7671@table @kbd
@@ -7391,7 +7683,7 @@ work for you. The built-in default assumes that all your projects are
7391level-2 headlines, and that a project is not stuck if it has at least 7683level-2 headlines, and that a project is not stuck if it has at least
7392one entry marked with a TODO keyword TODO or NEXT or NEXTACTION. 7684one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
7393 7685
7394Let's assume that you, in your own way of using Org-mode, identify 7686Let's assume that you, in your own way of using Org mode, identify
7395projects with a tag PROJECT, and that you use a TODO keyword MAYBE to 7687projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
7396indicate a project that should not be considered yet. Let's further 7688indicate a project that should not be considered yet. Let's further
7397assume that the TODO keyword DONE marks finished projects, and that NEXT 7689assume that the TODO keyword DONE marks finished projects, and that NEXT
@@ -7418,12 +7710,14 @@ will still be searched for stuck projects.
7418@cindex presentation, of agenda items 7710@cindex presentation, of agenda items
7419 7711
7420@vindex org-agenda-prefix-format 7712@vindex org-agenda-prefix-format
7421Before displaying items in an agenda view, Org-mode visually prepares 7713@vindex org-agenda-tags-column
7422the items and sorts them. Each item occupies a single line. The line 7714Before displaying items in an agenda view, Org mode visually prepares the
7423starts with a @emph{prefix} that contains the @emph{category} 7715items and sorts them. Each item occupies a single line. The line starts
7424(@pxref{Categories}) of the item and other important information. You can 7716with a @emph{prefix} that contains the @emph{category} (@pxref{Categories})
7425customize the prefix using the option @code{org-agenda-prefix-format}. 7717of the item and other important information. You can customize in which
7426The prefix is followed by a cleaned-up version of the outline headline 7718column tags will be displayed through @code{org-agenda-tags-column}. You can
7719also customize the prefix using the option @code{org-agenda-prefix-format}.
7720This prefix is followed by a cleaned-up version of the outline headline
7427associated with the item. 7721associated with the item.
7428 7722
7429@menu 7723@menu
@@ -7470,7 +7764,7 @@ You can set up icons for category by customizing the
7470@subsection Time-of-day specifications 7764@subsection Time-of-day specifications
7471@cindex time-of-day specification 7765@cindex time-of-day specification
7472 7766
7473Org-mode checks each agenda item for a time-of-day specification. The 7767Org mode checks each agenda item for a time-of-day specification. The
7474time can be part of the timestamp that triggered inclusion into the 7768time can be part of the timestamp that triggered inclusion into the
7475agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time 7769agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
7476ranges can be specified with two timestamps, like 7770ranges can be specified with two timestamps, like
@@ -7482,7 +7776,7 @@ plain text (like @samp{12:45} or a @samp{8:30-1pm}). If the agenda
7482integrates the Emacs diary (@pxref{Weekly/daily agenda}), time 7776integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
7483specifications in diary entries are recognized as well. 7777specifications in diary entries are recognized as well.
7484 7778
7485For agenda display, Org-mode extracts the time and displays it in a 7779For agenda display, Org mode extracts the time and displays it in a
7486standard 24 hour format as part of the prefix. The example times in 7780standard 24 hour format as part of the prefix. The example times in
7487the previous paragraphs would end up in the agenda like this: 7781the previous paragraphs would end up in the agenda like this:
7488 7782
@@ -7608,34 +7902,31 @@ will be followed without a selection prompt.
7608 7902
7609@tsubheading{Change display} 7903@tsubheading{Change display}
7610@cindex display changing, in agenda 7904@cindex display changing, in agenda
7905@kindex A
7906@item A
7907Interactively select another agenda view and append it to the current view.
7908@c
7611@kindex o 7909@kindex o
7612@item o 7910@item o
7613Delete other windows. 7911Delete other windows.
7614@c 7912@c
7615@c @kindex v d 7913@orgcmdkskc{v d,d,org-agenda-day-view}
7616@c @kindex d 7914@xorgcmdkskc{v w,w,org-agenda-day-view}
7617@c @kindex v w
7618@c @kindex w
7619@c @kindex v m
7620@c @kindex v y
7621@c @item v d @ @r{or short} @ d
7622@c @itemx v w @ @r{or short} @ w
7623@c @itemx v m
7624@c @itemx v y
7625@orgcmdkskc{v d,d,org-aganda-day-view}
7626@xorgcmdkskc{v w,w,org-aganda-day-view}
7627@xorgcmd{v m,org-agenda-month-view} 7915@xorgcmd{v m,org-agenda-month-view}
7628@xorgcmd{v y,org-agenda-month-year} 7916@xorgcmd{v y,org-agenda-month-year}
7629Switch to day/week/month/year view. When switching to day or week view, 7917@xorgcmd{v SPC,org-agenda-reset-view}
7630this setting becomes the default for subsequent agenda commands. Since 7918@vindex org-agenda-span
7631month and year views are slow to create, they do not become the default. 7919Switch to day/week/month/year view. When switching to day or week view, this
7632A numeric prefix argument may be used to jump directly to a specific day 7920setting becomes the default for subsequent agenda refreshes. Since month and
7633of the year, ISO week, month, or year, respectively. For example, 7921year views are slow to create, they do not become the default. A numeric
7634@kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When 7922prefix argument may be used to jump directly to a specific day of the year,
7635setting day, week, or month view, a year may be encoded in the prefix 7923ISO week, month, or year, respectively. For example, @kbd{32 d} jumps to
7636argument as well. For example, @kbd{200712 w} will jump to week 12 in 7924February 1st, @kbd{9 w} to ISO week number 9. When setting day, week, or
76372007. If such a year specification has only one or two digits, it will 7925month view, a year may be encoded in the prefix argument as well. For
7638be mapped to the interval 1938-2037. 7926example, @kbd{200712 w} will jump to week 12 in 2007. If such a year
7927specification has only one or two digits, it will be mapped to the interval
79281938-2037. @kbd{v @key{SPC}} will reset to what is set in
7929@code{org-agenda-span}.
7639@c 7930@c
7640@orgcmd{f,org-agenda-later} 7931@orgcmd{f,org-agenda-later}
7641Go forward in time to display the following @code{org-agenda-current-span} days. 7932Go forward in time to display the following @code{org-agenda-current-span} days.
@@ -7683,14 +7974,25 @@ press @kbd{v a} again.
7683@c 7974@c
7684@orgcmdkskc{v R,R,org-agenda-clockreport-mode} 7975@orgcmdkskc{v R,R,org-agenda-clockreport-mode}
7685@vindex org-agenda-start-with-clockreport-mode 7976@vindex org-agenda-start-with-clockreport-mode
7977@vindex org-clock-report-include-clocking-task
7686Toggle Clockreport mode. In Clockreport mode, the daily/weekly agenda will 7978Toggle Clockreport mode. In Clockreport mode, the daily/weekly agenda will
7687always show a table with the clocked times for the timespan and file scope 7979always show a table with the clocked times for the timespan and file scope
7688covered by the current agenda view. The initial setting for this mode in new 7980covered by the current agenda view. The initial setting for this mode in new
7689agenda buffers can be set with the variable 7981agenda buffers can be set with the variable
7690@code{org-agenda-start-with-clockreport-mode}. By using a prefix argument 7982@code{org-agenda-start-with-clockreport-mode}. By using a prefix argument
7691when toggling this mode (i.e. @kbd{C-u R}), the clock table will not show 7983when toggling this mode (i.e.@: @kbd{C-u R}), the clock table will not show
7692contributions from entries that are hidden by agenda filtering@footnote{Only 7984contributions from entries that are hidden by agenda filtering@footnote{Only
7693tags filtering will be respected here, effort filtering is ignored.}. 7985tags filtering will be respected here, effort filtering is ignored.}. See
7986also the variable @code{org-clock-report-include-clocking-task}.
7987@c
7988@orgkey{v c}
7989@vindex org-agenda-clock-consistency-checks
7990Show overlapping clock entries, clocking gaps, and other clocking problems in
7991the current agenda range. You can then visit clocking lines and fix them
7992manually. See the variable @code{org-agenda-clock-consistency-checks} for
7993information on how to customize the definition of what constituted a clocking
7994problem. To return to normal agenda display, press @kbd{l} to exit Logbook
7995mode.
7694@c 7996@c
7695@orgcmdkskc{v E,E,org-agenda-entry-text-mode} 7997@orgcmdkskc{v E,E,org-agenda-entry-text-mode}
7696@vindex org-agenda-start-with-entry-text-mode 7998@vindex org-agenda-start-with-entry-text-mode
@@ -7707,13 +8009,13 @@ prefix argument will temporarily modify that number to the prefix value.
7707Toggle the time grid on and off. See also the variables 8009Toggle the time grid on and off. See also the variables
7708@code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}. 8010@code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
7709@c 8011@c
7710@orgcmd{r,org-agenda-rodo} 8012@orgcmd{r,org-agenda-redo}
7711Recreate the agenda buffer, for example to reflect the changes after 8013Recreate the agenda buffer, for example to reflect the changes after
7712modification of the timestamps of items with @kbd{S-@key{left}} and 8014modification of the timestamps of items with @kbd{S-@key{left}} and
7713@kbd{S-@key{right}}. When the buffer is the global TODO list, a prefix 8015@kbd{S-@key{right}}. When the buffer is the global TODO list, a prefix
7714argument is interpreted to create a selective list for a specific TODO 8016argument is interpreted to create a selective list for a specific TODO
7715keyword. 8017keyword.
7716@orgcmd{g,org-agenda-rodo} 8018@orgcmd{g,org-agenda-redo}
7717Same as @kbd{r}. 8019Same as @kbd{r}.
7718@c 8020@c
7719@orgcmdkskc{C-x C-s,s,org-save-all-org-buffers} 8021@orgcmdkskc{C-x C-s,s,org-save-all-org-buffers}
@@ -7734,18 +8036,27 @@ Remove the restriction lock on the agenda, if it is currently restricted to a
7734file or subtree (@pxref{Agenda files}). 8036file or subtree (@pxref{Agenda files}).
7735 8037
7736@tsubheading{Secondary filtering and query editing} 8038@tsubheading{Secondary filtering and query editing}
7737@cindex filtering, by tag and effort, in agenda 8039@cindex filtering, by tag category and effort, in agenda
7738@cindex tag filtering, in agenda 8040@cindex tag filtering, in agenda
8041@cindex category filtering, in agenda
7739@cindex effort filtering, in agenda 8042@cindex effort filtering, in agenda
7740@cindex query editing, in agenda 8043@cindex query editing, in agenda
7741 8044
8045@orgcmd{<,org-agenda-filter-by-category}
8046@vindex org-agenda-category-filter-preset
8047
8048Filter the current agenda view with respect to the category of the item at
8049point. Pressing @code{<} another time will remove this filter. You can add
8050a filter preset through the option @code{org-agenda-category-filter-preset}
8051(see below.)
8052
7742@orgcmd{/,org-agenda-filter-by-tag} 8053@orgcmd{/,org-agenda-filter-by-tag}
7743@vindex org-agenda-filter-preset 8054@vindex org-agenda-tag-filter-preset
7744Filter the current agenda view with respect to a tag and/or effort estimates. 8055Filter the current agenda view with respect to a tag and/or effort estimates.
7745The difference between this and a custom agenda command is that filtering is 8056The difference between this and a custom agenda command is that filtering is
7746very fast, so that you can switch quickly between different filters without 8057very fast, so that you can switch quickly between different filters without
7747having to recreate the agenda.@footnote{Custom commands can preset a filter by 8058having to recreate the agenda.@footnote{Custom commands can preset a filter by
7748binding the variable @code{org-agenda-filter-preset} as an option. This 8059binding the variable @code{org-agenda-tag-filter-preset} as an option. This
7749filter will then be applied to the view and persist as a basic filter through 8060filter will then be applied to the view and persist as a basic filter through
7750refreshes and more secondary filtering. The filter is a global property of 8061refreshes and more secondary filtering. The filter is a global property of
7751the entire agenda view---in a block agenda, you should only set this in the 8062the entire agenda view---in a block agenda, you should only set this in the
@@ -7806,7 +8117,7 @@ Internet, and outside of business hours, with something like this:
7806@end group 8117@end group
7807@end lisp 8118@end lisp
7808 8119
7809@orgcmd{\,org-agenda-filter-by-tag-refine} 8120@orgcmd{\\,org-agenda-filter-by-tag-refine}
7810Narrow the current agenda filter by an additional condition. When called with 8121Narrow the current agenda filter by an additional condition. When called with
7811prefix arg, remove the entries that @emph{do} have the tag, or that do match 8122prefix arg, remove the entries that @emph{do} have the tag, or that do match
7812the effort criterion. You can achieve the same effect by pressing @kbd{+} or 8123the effort criterion. You can achieve the same effect by pressing @kbd{+} or
@@ -7889,8 +8200,8 @@ agenda, change a tag for all headings in the region.
7889@kindex , 8200@kindex ,
7890@item , 8201@item ,
7891Set the priority for the current item (@command{org-agenda-priority}). 8202Set the priority for the current item (@command{org-agenda-priority}).
7892Org-mode prompts for the priority character. If you reply with @key{SPC}, the 8203Org mode prompts for the priority character. If you reply with @key{SPC},
7893priority cookie is removed from the entry. 8204the priority cookie is removed from the entry.
7894@c 8205@c
7895@orgcmd{P,org-agenda-show-priority} 8206@orgcmd{P,org-agenda-show-priority}
7896Display weighted priority of current item. 8207Display weighted priority of current item.
@@ -7935,13 +8246,15 @@ command.
7935@c 8246@c
7936@orgcmd{S-@key{right},org-agenda-do-date-later} 8247@orgcmd{S-@key{right},org-agenda-do-date-later}
7937Change the timestamp associated with the current line by one day into the 8248Change the timestamp associated with the current line by one day into the
7938future. With a numeric prefix argument, change it by that many days. For 8249future. If the date is in the past, the first call to this command will move
7939example, @kbd{3 6 5 S-@key{right}} will change it by a year. With a 8250it to today.@*
7940@kbd{C-u} prefix, change the time by one hour. If you immediately repeat the 8251With a numeric prefix argument, change it by that many days. For example,
7941command, it will continue to change hours even without the prefix arg. With 8252@kbd{3 6 5 S-@key{right}} will change it by a year. With a @kbd{C-u} prefix,
7942a double @kbd{C-u C-u} prefix, do the same for changing minutes. The stamp 8253change the time by one hour. If you immediately repeat the command, it will
7943is changed in the original Org file, but the change is not directly reflected 8254continue to change hours even without the prefix arg. With a double @kbd{C-u
7944in the agenda buffer. Use @kbd{r} or @kbd{g} to update the buffer. 8255C-u} prefix, do the same for changing minutes.@*
8256The stamp is changed in the original Org file, but the change is not directly
8257reflected in the agenda buffer. Use @kbd{r} or @kbd{g} to update the buffer.
7945@c 8258@c
7946@orgcmd{S-@key{left},org-agenda-do-date-earlier} 8259@orgcmd{S-@key{left},org-agenda-do-date-earlier}
7947Change the timestamp associated with the current line by one day 8260Change the timestamp associated with the current line by one day
@@ -7971,6 +8284,9 @@ Jump to the running clock in another window.
7971Mark the entry at point for bulk action. With prefix arg, mark that many 8284Mark the entry at point for bulk action. With prefix arg, mark that many
7972successive entries. 8285successive entries.
7973@c 8286@c
8287@orgcmd{%,org-agenda-bulk-mark-regexp}
8288Mark entries matching a regular expression for bulk action.
8289@c
7974@orgcmd{u,org-agenda-bulk-unmark} 8290@orgcmd{u,org-agenda-bulk-unmark}
7975Unmark entry for bulk action. 8291Unmark entry for bulk action.
7976@c 8292@c
@@ -7989,15 +8305,30 @@ $ @r{Archive all selected entries.}
7989A @r{Archive entries by moving them to their respective archive siblings.} 8305A @r{Archive entries by moving them to their respective archive siblings.}
7990t @r{Change TODO state. This prompts for a single TODO keyword and} 8306t @r{Change TODO state. This prompts for a single TODO keyword and}
7991 @r{changes the state of all selected entries, bypassing blocking and} 8307 @r{changes the state of all selected entries, bypassing blocking and}
7992 @r{suppressing logging notes (but not time stamps).} 8308 @r{suppressing logging notes (but not timestamps).}
7993+ @r{Add a tag to all selected entries.} 8309+ @r{Add a tag to all selected entries.}
7994- @r{Remove a tag from all selected entries.} 8310- @r{Remove a tag from all selected entries.}
7995s @r{Schedule all items to a new date. To shift existing schedule dates} 8311s @r{Schedule all items to a new date. To shift existing schedule dates}
7996 @r{by a fixed number of days, use something starting with double plus} 8312 @r{by a fixed number of days, use something starting with double plus}
7997 @r{at the prompt, for example @samp{++8d} or @samp{++2w}.} 8313 @r{at the prompt, for example @samp{++8d} or @samp{++2w}.}
7998S @r{Reschedule randomly by N days. N will be prompted for. With prefix} 8314S @r{Reschedule randomly into the coming N days. N will be prompted for.}
7999 @r{arg (@kbd{C-u B S}), scatter only accross weekdays.} 8315 @r{With prefix arg (@kbd{C-u B S}), scatter only across weekdays.}
8000d @r{Set deadline to a specific date.} 8316d @r{Set deadline to a specific date.}
8317f @r{Apply a function to marked entries.}
8318 @r{For example, the function below sets the CATEGORY property of the}
8319 @r{entries to web.}
8320 @r{(defun set-category ()}
8321 @r{ (interactive "P")}
8322 @r{ (let* ((marker (or (org-get-at-bol 'org-hd-marker)}
8323 @r{ (org-agenda-error)))}
8324 @r{ (buffer (marker-buffer marker)))}
8325 @r{ (with-current-buffer buffer}
8326 @r{ (save-excursion}
8327 @r{ (save-restriction}
8328 @r{ (widen)}
8329 @r{ (goto-char marker)}
8330 @r{ (org-back-to-heading t)}
8331 @r{ (org-set-property "CATEGORY" "web"))))))}
8001@end example 8332@end example
8002 8333
8003 8334
@@ -8008,7 +8339,7 @@ d @r{Set deadline to a specific date.}
8008Open the Emacs calendar and move to the date at the agenda cursor. 8339Open the Emacs calendar and move to the date at the agenda cursor.
8009@c 8340@c
8010@orgcmd{c,org-calendar-goto-agenda} 8341@orgcmd{c,org-calendar-goto-agenda}
8011When in the calendar, compute and show the Org-mode agenda for the 8342When in the calendar, compute and show the Org mode agenda for the
8012date at the cursor. 8343date at the cursor.
8013@c 8344@c
8014@cindex diary entries, creating from agenda 8345@cindex diary entries, creating from agenda
@@ -8021,8 +8352,8 @@ file@footnote{This file is parsed for the agenda when
8021command in the calendar. The diary file will pop up in another window, where 8352command in the calendar. The diary file will pop up in another window, where
8022you can add the entry. 8353you can add the entry.
8023 8354
8024If you configure @code{org-agenda-diary-file} to point to an Org-mode file, 8355If you configure @code{org-agenda-diary-file} to point to an Org mode file,
8025Org will create entries (in org-mode syntax) in that file instead. Most 8356Org will create entries (in Org mode syntax) in that file instead. Most
8026entries will be stored in a date-based outline tree that will later make it 8357entries will be stored in a date-based outline tree that will later make it
8027easy to archive appointments from previous months/years. The tree will be 8358easy to archive appointments from previous months/years. The tree will be
8028built under an entry with a @code{DATE_TREE} property, or else with years as 8359built under an entry with a @code{DATE_TREE} property, or else with years as
@@ -8198,7 +8529,7 @@ command @kbd{C-c a o} provides a similar view for office tasks.
8198@cindex options, for custom agenda views 8529@cindex options, for custom agenda views
8199 8530
8200@vindex org-agenda-custom-commands 8531@vindex org-agenda-custom-commands
8201Org-mode contains a number of variables regulating agenda construction 8532Org mode contains a number of variables regulating agenda construction
8202and display. The global variables define the behavior for all agenda 8533and display. The global variables define the behavior for all agenda
8203commands, including the custom commands. However, if you want to change 8534commands, including the custom commands. However, if you want to change
8204some settings just for a single custom view, you can do so. Setting 8535some settings just for a single custom view, you can do so. Setting
@@ -8270,11 +8601,11 @@ yourself.
8270@cindex agenda views, exporting 8601@cindex agenda views, exporting
8271 8602
8272If you are away from your computer, it can be very useful to have a printed 8603If you are away from your computer, it can be very useful to have a printed
8273version of some agenda views to carry around. Org-mode can export custom 8604version of some agenda views to carry around. Org mode can export custom
8274agenda views as plain text, HTML@footnote{You need to install Hrvoje Niksic's 8605agenda views as plain text, HTML@footnote{You need to install Hrvoje Niksic's
8275@file{htmlize.el}.}, Postscript, PDF@footnote{To create PDF output, the 8606@file{htmlize.el}.}, Postscript, PDF@footnote{To create PDF output, the
8276ghostscript @file{ps2pdf} utility must be installed on the system. Selecting 8607ghostscript @file{ps2pdf} utility must be installed on the system. Selecting
8277a PDF file with also create the postscript file.}, and iCalendar files. If 8608a PDF file will also create the postscript file.}, and iCalendar files. If
8278you want to do this only occasionally, use the command 8609you want to do this only occasionally, use the command
8279 8610
8280@table @kbd 8611@table @kbd
@@ -8334,7 +8665,7 @@ or absolute.
8334@end lisp 8665@end lisp
8335 8666
8336The extension of the file name determines the type of export. If it is 8667The extension of the file name determines the type of export. If it is
8337@file{.html}, Org-mode will use the @file{htmlize.el} package to convert 8668@file{.html}, Org mode will use the @file{htmlize.el} package to convert
8338the buffer to HTML and save it to this file name. If the extension is 8669the buffer to HTML and save it to this file name. If the extension is
8339@file{.ps}, @code{ps-print-buffer-with-faces} is used to produce 8670@file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
8340Postscript output. If the extension is @file{.ics}, iCalendar export is 8671Postscript output. If the extension is @file{.ics}, iCalendar export is
@@ -8381,14 +8712,14 @@ in @code{org-agenda-custom-commands} take precedence.
8381@noindent 8712@noindent
8382From the command line you may also use 8713From the command line you may also use
8383@example 8714@example
8384emacs -f org-batch-store-agenda-views -kill 8715emacs -eval (org-batch-store-agenda-views) -kill
8385@end example 8716@end example
8386@noindent 8717@noindent
8387or, if you need to modify some parameters@footnote{Quoting depends on the 8718or, if you need to modify some parameters@footnote{Quoting depends on the
8388system you use, please check the FAQ for examples.} 8719system you use, please check the FAQ for examples.}
8389@example 8720@example
8390emacs -eval '(org-batch-store-agenda-views \ 8721emacs -eval '(org-batch-store-agenda-views \
8391 org-agenda-span month \ 8722 org-agenda-span (quote month) \
8392 org-agenda-start-day "2007-11-01" \ 8723 org-agenda-start-day "2007-11-01" \
8393 org-agenda-include-diary nil \ 8724 org-agenda-include-diary nil \
8394 org-agenda-files (quote ("~/org/project.org")))' \ 8725 org-agenda-files (quote ("~/org/project.org")))' \
@@ -8430,7 +8761,7 @@ This causes the following issues:
8430Org needs to make a decision which @code{COLUMNS} format to use. Since the 8761Org needs to make a decision which @code{COLUMNS} format to use. Since the
8431entries in the agenda are collected from different files, and different files 8762entries in the agenda are collected from different files, and different files
8432may have different @code{COLUMNS} formats, this is a non-trivial problem. 8763may have different @code{COLUMNS} formats, this is a non-trivial problem.
8433Org first checks if the variable @code{org-overriding-columns-format} is 8764Org first checks if the variable @code{org-agenda-overriding-columns-format} is
8434currently set, and if so, takes the format from there. Otherwise it takes 8765currently set, and if so, takes the format from there. Otherwise it takes
8435the format associated with the first item in the agenda, or, if that item 8766the format associated with the first item in the agenda, or, if that item
8436does not have a specific format (defined in a property, or in its file), it 8767does not have a specific format (defined in a property, or in its file), it
@@ -8463,11 +8794,11 @@ the agenda).
8463@node Markup, Exporting, Agenda Views, Top 8794@node Markup, Exporting, Agenda Views, Top
8464@chapter Markup for rich export 8795@chapter Markup for rich export
8465 8796
8466When exporting Org-mode documents, the exporter tries to reflect the 8797When exporting Org mode documents, the exporter tries to reflect the
8467structure of the document as accurately as possible in the backend. Since 8798structure of the document as accurately as possible in the backend. Since
8468export targets like HTML, @LaTeX{}, or DocBook allow much richer formatting, 8799export targets like HTML, @LaTeX{}, or DocBook allow much richer formatting,
8469Org-mode has rules on how to prepare text for rich export. This section 8800Org mode has rules on how to prepare text for rich export. This section
8470summarizes the markup rules used in an Org-mode buffer. 8801summarizes the markup rules used in an Org mode buffer.
8471 8802
8472@menu 8803@menu
8473* Structural markup elements:: The basic structure as seen by the exporter 8804* Structural markup elements:: The basic structure as seen by the exporter
@@ -8476,7 +8807,7 @@ summarizes the markup rules used in an Org-mode buffer.
8476* Include files:: Include additional files into a document 8807* Include files:: Include additional files into a document
8477* Index entries:: Making an index 8808* Index entries:: Making an index
8478* Macro replacement:: Use macros to create complex output 8809* Macro replacement:: Use macros to create complex output
8479* Embedded LaTeX:: LaTeX can be freely used inside Org documents 8810* Embedded @LaTeX{}:: LaTeX can be freely used inside Org documents
8480@end menu 8811@end menu
8481 8812
8482@node Structural markup elements, Images and tables, Markup, Markup 8813@node Structural markup elements, Images and tables, Markup, Markup
@@ -8559,7 +8890,7 @@ the table of contents entirely, by configuring the variable
8559@cindex text before first headline, markup rules 8890@cindex text before first headline, markup rules
8560@cindex #+TEXT 8891@cindex #+TEXT
8561 8892
8562Org-mode normally exports the text before the first headline, and even uses 8893Org mode normally exports the text before the first headline, and even uses
8563the first line as the document title. The text will be fully marked up. If 8894the first line as the document title. The text will be fully marked up. If
8564you need to include literal HTML, @LaTeX{}, or DocBook code, use the special 8895you need to include literal HTML, @LaTeX{}, or DocBook code, use the special
8565constructs described below in the sections for the individual exporters. 8896constructs described below in the sections for the individual exporters.
@@ -8579,7 +8910,7 @@ If you still want to have some text before the first headline, use the
8579#+OPTIONS: skip:t 8910#+OPTIONS: skip:t
8580#+TEXT: This text will go before the *first* headline. 8911#+TEXT: This text will go before the *first* headline.
8581#+TEXT: [TABLE-OF-CONTENTS] 8912#+TEXT: [TABLE-OF-CONTENTS]
8582#+TEXT: This goes between the table of contents and the first headline 8913#+TEXT: This goes between the table of contents and the *first* headline
8583@end example 8914@end example
8584 8915
8585@node Lists, Paragraphs, Initial text, Structural markup elements 8916@node Lists, Paragraphs, Initial text, Structural markup elements
@@ -8613,7 +8944,7 @@ can use this construct, which can also be used to format poetry.
8613 8944
8614When quoting a passage from another document, it is customary to format this 8945When quoting a passage from another document, it is customary to format this
8615as a paragraph that is indented on both the left and the right margin. You 8946as a paragraph that is indented on both the left and the right margin. You
8616can include quotations in Org-mode documents like this: 8947can include quotations in Org mode documents like this:
8617 8948
8618@cindex #+BEGIN_QUOTE 8949@cindex #+BEGIN_QUOTE
8619@example 8950@example
@@ -8638,9 +8969,9 @@ but not any simpler
8638@cindex footnotes, markup rules 8969@cindex footnotes, markup rules
8639@cindex @file{footnote.el} 8970@cindex @file{footnote.el}
8640 8971
8641Footnotes defined in the way described in @ref{Footnotes}, will be exported by 8972Footnotes defined in the way described in @ref{Footnotes}, will be exported
8642all backends. Org allows multiple references to the same note, and 8973by all backends. Org allows multiple references to the same note, and
8643different backends support this to varying degrees. 8974multiple footnotes side by side.
8644 8975
8645@node Emphasis and monospace, Horizontal rules, Footnote markup, Structural markup elements 8976@node Emphasis and monospace, Horizontal rules, Footnote markup, Structural markup elements
8646@subheading Emphasis and monospace 8977@subheading Emphasis and monospace
@@ -8653,14 +8984,14 @@ different backends support this to varying degrees.
8653@cindex strike-through text, markup rules 8984@cindex strike-through text, markup rules
8654You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=} 8985You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
8655and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text 8986and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
8656in the code and verbatim string is not processed for Org-mode specific 8987in the code and verbatim string is not processed for Org mode specific
8657syntax; it is exported verbatim. 8988syntax; it is exported verbatim.
8658 8989
8659@node Horizontal rules, Comment lines, Emphasis and monospace, Structural markup elements 8990@node Horizontal rules, Comment lines, Emphasis and monospace, Structural markup elements
8660@subheading Horizontal rules 8991@subheading Horizontal rules
8661@cindex horizontal rules, markup rules 8992@cindex horizontal rules, markup rules
8662A line consisting of only dashes, and at least 5 of them, will be 8993A line consisting of only dashes, and at least 5 of them, will be exported as
8663exported as a horizontal line (@samp{<hr/>} in HTML). 8994a horizontal line (@samp{<hr/>} in HTML and @code{\hrule} in @LaTeX{}).
8664 8995
8665@node Comment lines, , Horizontal rules, Structural markup elements 8996@node Comment lines, , Horizontal rules, Structural markup elements
8666@subheading Comment lines 8997@subheading Comment lines
@@ -8669,7 +9000,7 @@ exported as a horizontal line (@samp{<hr/>} in HTML).
8669@cindex #+BEGIN_COMMENT 9000@cindex #+BEGIN_COMMENT
8670 9001
8671Lines starting with @samp{#} in column zero are treated as comments and will 9002Lines starting with @samp{#} in column zero are treated as comments and will
8672never be exported. If you want an indented line to be treated as a comment, 9003never be exported. If you want an indented line to be treated as a comment,
8673start it with @samp{#+ }. Also entire subtrees starting with the word 9004start it with @samp{#+ }. Also entire subtrees starting with the word
8674@samp{COMMENT} will never be exported. Finally, regions surrounded by 9005@samp{COMMENT} will never be exported. Finally, regions surrounded by
8675@samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported. 9006@samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
@@ -8687,8 +9018,8 @@ Toggle the COMMENT keyword at the beginning of an entry.
8687@cindex tables, markup rules 9018@cindex tables, markup rules
8688@cindex #+CAPTION 9019@cindex #+CAPTION
8689@cindex #+LABEL 9020@cindex #+LABEL
8690Both the native Org-mode tables (@pxref{Tables}) and tables formatted with 9021Both the native Org mode tables (@pxref{Tables}) and tables formatted with
8691the @file{table.el} package will be exported properly. For Org-mode tables, 9022the @file{table.el} package will be exported properly. For Org mode tables,
8692the lines before the first horizontal separator line will become table header 9023the lines before the first horizontal separator line will become table header
8693lines. You can use the following lines somewhere before the table to assign 9024lines. You can use the following lines somewhere before the table to assign
8694a caption and a label for cross references, and in the text you can refer to 9025a caption and a label for cross references, and in the text you can refer to
@@ -8701,6 +9032,11 @@ the object with @code{\ref@{tab:basic-data@}}:
8701 |-----|----| 9032 |-----|----|
8702@end example 9033@end example
8703 9034
9035Optionally, the caption can take the form:
9036@example
9037#+CAPTION: [Caption for list of figures]@{Caption for table (or link).@}
9038@end example
9039
8704@cindex inlined images, markup rules 9040@cindex inlined images, markup rules
8705Some backends (HTML, @LaTeX{}, and DocBook) allow you to directly include 9041Some backends (HTML, @LaTeX{}, and DocBook) allow you to directly include
8706images into the exported document. Org does this, if a link to an image 9042images into the exported document. Org does this, if a link to an image
@@ -8753,22 +9089,25 @@ If the example is source code from a programming language, or any other text
8753that can be marked up by font-lock in Emacs, you can ask for the example to 9089that can be marked up by font-lock in Emacs, you can ask for the example to
8754look like the fontified Emacs buffer@footnote{This works automatically for 9090look like the fontified Emacs buffer@footnote{This works automatically for
8755the HTML backend (it requires version 1.34 of the @file{htmlize.el} package, 9091the HTML backend (it requires version 1.34 of the @file{htmlize.el} package,
8756which is distributed with Org). Fontified code chunks in LaTeX can be 9092which is distributed with Org). Fontified code chunks in @LaTeX{} can be
8757achieved using either the listings or the 9093achieved using either the listings or the
8758@url{http://code.google.com/p/minted, minted,} package. To use listings, turn 9094@url{http://code.google.com/p/minted, minted,} package. To use listings, turn
8759on the variable @code{org-export-latex-listings} and ensure that the listings 9095on the variable @code{org-export-latex-listings} and ensure that the listings
8760package is included by the LaTeX header (e.g. by configuring 9096package is included by the @LaTeX{} header (e.g.@: by configuring
8761@code{org-export-latex-packages-alist}). See the listings documentation for 9097@code{org-export-latex-packages-alist}). See the listings documentation for
8762configuration options, including obtaining colored output. For minted it is 9098configuration options, including obtaining colored output. For minted it is
8763necessary to install the program @url{http://pygments.org, pygments}, in 9099necessary to install the program @url{http://pygments.org, pygments}, in
8764addition to setting @code{org-export-latex-minted}, ensuring that the minted 9100addition to setting @code{org-export-latex-minted}, ensuring that the minted
8765package is included by the LaTeX header, and ensuring that the 9101package is included by the @LaTeX{} header, and ensuring that the
8766@code{-shell-escape} option is passed to @file{pdflatex} (see 9102@code{-shell-escape} option is passed to @file{pdflatex} (see
8767@code{org-latex-to-pdf-process}). See the documentation of the variables 9103@code{org-latex-to-pdf-process}). See the documentation of the variables
8768@code{org-export-latex-listings} and @code{org-export-latex-minted} for 9104@code{org-export-latex-listings} and @code{org-export-latex-minted} for
8769further details.}. This is done with the @samp{src} block, where you also 9105further details.}. This is done with the @samp{src} block, where you also
8770need to specify the name of the major mode that should be used to fontify the 9106need to specify the name of the major mode that should be used to fontify the
8771example: 9107example@footnote{Code in @samp{src} blocks may also be evaluated either
9108interactively or on export. See @pxref{Working With Source Code} for more
9109information on evaluating code blocks.}, see @ref{Easy Templates} for
9110shortcuts to easily insert code blocks.
8772@cindex #+BEGIN_SRC 9111@cindex #+BEGIN_SRC
8773 9112
8774@example 9113@example
@@ -8784,7 +9123,7 @@ switch to the end of the @code{BEGIN} line, to get the lines of the example
8784numbered. If you use a @code{+n} switch, the numbering from the previous 9123numbered. If you use a @code{+n} switch, the numbering from the previous
8785numbered snippet will be continued in the current one. In literal examples, 9124numbered snippet will be continued in the current one. In literal examples,
8786Org will interpret strings like @samp{(ref:name)} as labels, and use them as 9125Org will interpret strings like @samp{(ref:name)} as labels, and use them as
8787targets for special hyperlinks like @code{[[(name)]]} (i.e. the reference name 9126targets for special hyperlinks like @code{[[(name)]]} (i.e.@: the reference name
8788enclosed in single parenthesis). In HTML, hovering the mouse over such a 9127enclosed in single parenthesis). In HTML, hovering the mouse over such a
8789link will remote-highlight the corresponding code line, which is kind of 9128link will remote-highlight the corresponding code line, which is kind of
8790cool. 9129cool.
@@ -8792,7 +9131,7 @@ cool.
8792You can also add a @code{-r} switch which @i{removes} the labels from the 9131You can also add a @code{-r} switch which @i{removes} the labels from the
8793source code@footnote{Adding @code{-k} to @code{-n -r} will @i{keep} the 9132source code@footnote{Adding @code{-k} to @code{-n -r} will @i{keep} the
8794labels in the source code while using line numbers for the links, which might 9133labels in the source code while using line numbers for the links, which might
8795be useful to explain those in an org-mode example code.}. With the @code{-n} 9134be useful to explain those in an Org mode example code.}. With the @code{-n}
8796switch, links to these references will be labeled by the line numbers from 9135switch, links to these references will be labeled by the line numbers from
8797the code listing, otherwise links will use the labels with no parentheses. 9136the code listing, otherwise links will use the labels with no parentheses.
8798Here is an example: 9137Here is an example:
@@ -8811,8 +9150,12 @@ If the syntax for the label format conflicts with the language syntax, use a
8811@code{-l} switch to change the format, for example @samp{#+BEGIN_SRC pascal 9150@code{-l} switch to change the format, for example @samp{#+BEGIN_SRC pascal
8812-n -r -l "((%s))"}. See also the variable @code{org-coderef-label-format}. 9151-n -r -l "((%s))"}. See also the variable @code{org-coderef-label-format}.
8813 9152
8814HTML export also allows examples to be published as text areas, @xref{Text 9153HTML export also allows examples to be published as text areas (@pxref{Text
8815areas in HTML export}. 9154areas in HTML export}).
9155
9156Because the @code{#+BEGIN_...} and @code{#+END_...} patterns need to be added
9157so often, shortcuts are provided using the Easy Templates facility
9158(@pxref{Easy Templates}).
8816 9159
8817@table @kbd 9160@table @kbd
8818@kindex C-c ' 9161@kindex C-c '
@@ -8851,14 +9194,14 @@ include your @file{.emacs} file, you could use:
8851#+INCLUDE: "~/.emacs" src emacs-lisp 9194#+INCLUDE: "~/.emacs" src emacs-lisp
8852@end example 9195@end example
8853@noindent 9196@noindent
8854The optional second and third parameter are the markup (e.g. @samp{quote}, 9197The optional second and third parameter are the markup (e.g.@: @samp{quote},
8855@samp{example}, or @samp{src}), and, if the markup is @samp{src}, the 9198@samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
8856language for formatting the contents. The markup is optional; if it is not 9199language for formatting the contents. The markup is optional; if it is not
8857given, the text will be assumed to be in Org-mode format and will be 9200given, the text will be assumed to be in Org mode format and will be
8858processed normally. The include line will also allow additional keyword 9201processed normally. The include line will also allow additional keyword
8859parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the 9202parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
8860first line and for each following line, @code{:minlevel} in order to get 9203first line and for each following line, @code{:minlevel} in order to get
8861org-mode content demoted to a specified level, as well as any options 9204Org mode content demoted to a specified level, as well as any options
8862accepted by the selected markup. For example, to include a file as an item, 9205accepted by the selected markup. For example, to include a file as an item,
8863use 9206use
8864 9207
@@ -8866,6 +9209,17 @@ use
8866#+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " " 9209#+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
8867@end example 9210@end example
8868 9211
9212You can also include a portion of a file by specifying a lines range using
9213the @code{:lines} parameter. The line at the upper end of the range will not
9214be included. The start and/or the end of the range may be omitted to use the
9215obvious defaults.
9216
9217@example
9218#+INCLUDE: "~/.emacs" :lines "5-10" @r{Include lines 5 to 10, 10 excluded}
9219#+INCLUDE: "~/.emacs" :lines "-10" @r{Include lines 1 to 10, 10 excluded}
9220#+INCLUDE: "~/.emacs" :lines "10-" @r{Include lines from 10 to EOF}
9221@end example
9222
8869@table @kbd 9223@table @kbd
8870@kindex C-c ' 9224@kindex C-c '
8871@item C-c ' 9225@item C-c '
@@ -8890,7 +9244,7 @@ an index} for more information.
8890 9244
8891 9245
8892 9246
8893@node Macro replacement, Embedded LaTeX, Index entries, Markup 9247@node Macro replacement, Embedded @LaTeX{}, Index entries, Markup
8894@section Macro replacement 9248@section Macro replacement
8895@cindex macro replacement, during export 9249@cindex macro replacement, during export
8896@cindex #+MACRO 9250@cindex #+MACRO
@@ -8915,7 +9269,7 @@ Macro expansion takes place during export, and some people use it to
8915construct complex HTML code. 9269construct complex HTML code.
8916 9270
8917 9271
8918@node Embedded LaTeX, , Macro replacement, Markup 9272@node Embedded @LaTeX{}, , Macro replacement, Markup
8919@section Embedded @LaTeX{} 9273@section Embedded @LaTeX{}
8920@cindex @TeX{} interpretation 9274@cindex @TeX{} interpretation
8921@cindex @LaTeX{} interpretation 9275@cindex @LaTeX{} interpretation
@@ -8925,7 +9279,7 @@ include scientific notes, which often require mathematical symbols and the
8925occasional formula. @LaTeX{}@footnote{@LaTeX{} is a macro system based on 9279occasional formula. @LaTeX{}@footnote{@LaTeX{} is a macro system based on
8926Donald E. Knuth's @TeX{} system. Many of the features described here as 9280Donald E. Knuth's @TeX{} system. Many of the features described here as
8927``@LaTeX{}'' are really from @TeX{}, but for simplicity I am blurring this 9281``@LaTeX{}'' are really from @TeX{}, but for simplicity I am blurring this
8928distinction.} is widely used to typeset scientific documents. Org-mode 9282distinction.} is widely used to typeset scientific documents. Org mode
8929supports embedding @LaTeX{} code into its files, because many academics are 9283supports embedding @LaTeX{} code into its files, because many academics are
8930used to writing and reading @LaTeX{} source code, and because it can be 9284used to writing and reading @LaTeX{} source code, and because it can be
8931readily processed to produce pretty output for a number of export backends. 9285readily processed to produce pretty output for a number of export backends.
@@ -8933,12 +9287,12 @@ readily processed to produce pretty output for a number of export backends.
8933@menu 9287@menu
8934* Special symbols:: Greek letters and other symbols 9288* Special symbols:: Greek letters and other symbols
8935* Subscripts and superscripts:: Simple syntax for raising/lowering text 9289* Subscripts and superscripts:: Simple syntax for raising/lowering text
8936* LaTeX fragments:: Complex formulas made easy 9290* @LaTeX{} fragments:: Complex formulas made easy
8937* Previewing LaTeX fragments:: What will this snippet look like? 9291* Previewing @LaTeX{} fragments:: What will this snippet look like?
8938* CDLaTeX mode:: Speed up entering of formulas 9292* CDLaTeX mode:: Speed up entering of formulas
8939@end menu 9293@end menu
8940 9294
8941@node Special symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX 9295@node Special symbols, Subscripts and superscripts, Embedded @LaTeX{}, Embedded @LaTeX{}
8942@subsection Special symbols 9296@subsection Special symbols
8943@cindex math symbols 9297@cindex math symbols
8944@cindex special symbols 9298@cindex special symbols
@@ -8951,7 +9305,7 @@ You can use @LaTeX{} macros to insert special symbols like @samp{\alpha} to
8951indicate the Greek letter, or @samp{\to} to indicate an arrow. Completion 9305indicate the Greek letter, or @samp{\to} to indicate an arrow. Completion
8952for these macros is available, just type @samp{\} and maybe a few letters, 9306for these macros is available, just type @samp{\} and maybe a few letters,
8953and press @kbd{M-@key{TAB}} to see possible completions. Unlike @LaTeX{} 9307and press @kbd{M-@key{TAB}} to see possible completions. Unlike @LaTeX{}
8954code, Org-mode allows these macros to be present without surrounding math 9308code, Org mode allows these macros to be present without surrounding math
8955delimiters, for example: 9309delimiters, for example:
8956 9310
8957@example 9311@example
@@ -8985,7 +9339,7 @@ buffer content which remains plain ASCII, but it overlays the UTF-8 character
8985for display purposes only. 9339for display purposes only.
8986@end table 9340@end table
8987 9341
8988@node Subscripts and superscripts, LaTeX fragments, Special symbols, Embedded LaTeX 9342@node Subscripts and superscripts, @LaTeX{} fragments, Special symbols, Embedded @LaTeX{}
8989@subsection Subscripts and superscripts 9343@subsection Subscripts and superscripts
8990@cindex subscript 9344@cindex subscript
8991@cindex superscript 9345@cindex superscript
@@ -9023,13 +9377,13 @@ In addition to showing entities as UTF-8 characters, this command will also
9023format sub- and superscripts in a WYSIWYM way. 9377format sub- and superscripts in a WYSIWYM way.
9024@end table 9378@end table
9025 9379
9026@node LaTeX fragments, Previewing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX 9380@node @LaTeX{} fragments, Previewing @LaTeX{} fragments, Subscripts and superscripts, Embedded @LaTeX{}
9027@subsection @LaTeX{} fragments 9381@subsection @LaTeX{} fragments
9028@cindex @LaTeX{} fragments 9382@cindex @LaTeX{} fragments
9029 9383
9030@vindex org-format-latex-header 9384@vindex org-format-latex-header
9031Going beyond symbols and sub- and superscripts, a full formula language is 9385Going beyond symbols and sub- and superscripts, a full formula language is
9032needed. Org-mode can contain @LaTeX{} math fragments, and it supports ways 9386needed. Org mode can contain @LaTeX{} math fragments, and it supports ways
9033to process these for several export backends. When exporting to @LaTeX{}, 9387to process these for several export backends. When exporting to @LaTeX{},
9034the code is obviously left as it is. When exporting to HTML, Org invokes the 9388the code is obviously left as it is. When exporting to HTML, Org invokes the
9035@uref{http://www.mathjax.org, MathJax library} (@pxref{Math formatting in 9389@uref{http://www.mathjax.org, MathJax library} (@pxref{Math formatting in
@@ -9038,7 +9392,7 @@ this regularly or on pages with significant page views, you should install
9038@file{MathJax} on your own 9392@file{MathJax} on your own
9039server in order to limit the load of our server.}. Finally, it can also 9393server in order to limit the load of our server.}. Finally, it can also
9040process the mathematical expressions into images@footnote{For this to work 9394process the mathematical expressions into images@footnote{For this to work
9041you need to be on a system with a working @LaTeX{} installation. You also 9395you need to be on a system with a working @LaTeX{} installation. You also
9042need the @file{dvipng} program, available at 9396need the @file{dvipng} program, available at
9043@url{http://sourceforge.net/projects/dvipng/}. The @LaTeX{} header that will 9397@url{http://sourceforge.net/projects/dvipng/}. The @LaTeX{} header that will
9044be used when processing a fragment can be configured with the variable 9398be used when processing a fragment can be configured with the variable
@@ -9082,10 +9436,10 @@ can configure the option @code{org-format-latex-options} to deselect the
9082ones you do not wish to have interpreted by the @LaTeX{} converter. 9436ones you do not wish to have interpreted by the @LaTeX{} converter.
9083 9437
9084@vindex org-export-with-LaTeX-fragments 9438@vindex org-export-with-LaTeX-fragments
9085LaTeX processing can be configured with the variable 9439@LaTeX{} processing can be configured with the variable
9086@code{org-export-with-LaTeX-fragments}. The default setting is @code{t} 9440@code{org-export-with-LaTeX-fragments}. The default setting is @code{t}
9087which means @file{MathJax} for HTML, and no processing for DocBook, ASCII and 9441which means @file{MathJax} for HTML, and no processing for DocBook, ASCII and
9088LaTeX backends. You can also set this variable on a per-file basis using one 9442@LaTeX{} backends. You can also set this variable on a per-file basis using one
9089of these lines: 9443of these lines:
9090 9444
9091@example 9445@example
@@ -9095,9 +9449,9 @@ of these lines:
9095#+OPTIONS: LaTeX:verbatim @r{Verbatim export, for jsMath or so} 9449#+OPTIONS: LaTeX:verbatim @r{Verbatim export, for jsMath or so}
9096@end example 9450@end example
9097 9451
9098@node Previewing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX 9452@node Previewing @LaTeX{} fragments, CDLaTeX mode, @LaTeX{} fragments, Embedded @LaTeX{}
9099@subsection Previewing LaTeX fragments 9453@subsection Previewing @LaTeX{} fragments
9100@cindex LaTeX fragments, preview 9454@cindex @LaTeX{} fragments, preview
9101 9455
9102If you have @file{dvipng} installed, @LaTeX{} fragments can be processed to 9456If you have @file{dvipng} installed, @LaTeX{} fragments can be processed to
9103produce preview images of the typeset expressions: 9457produce preview images of the typeset expressions:
@@ -9118,22 +9472,22 @@ Remove the overlay preview images.
9118 9472
9119@vindex org-format-latex-options 9473@vindex org-format-latex-options
9120You can customize the variable @code{org-format-latex-options} to influence 9474You can customize the variable @code{org-format-latex-options} to influence
9121some aspects of the preview. In particular, the @code{:scale} (and for HTML 9475some aspects of the preview. In particular, the @code{:scale} (and for HTML
9122export, @code{:html-scale}) property can be used to adjust the size of the 9476export, @code{:html-scale}) property can be used to adjust the size of the
9123preview images. 9477preview images.
9124 9478
9125@node CDLaTeX mode, , Previewing LaTeX fragments, Embedded LaTeX 9479@node CDLaTeX mode, , Previewing @LaTeX{} fragments, Embedded @LaTeX{}
9126@subsection Using CDLa@TeX{} to enter math 9480@subsection Using CD@LaTeX{} to enter math
9127@cindex CDLa@TeX{} 9481@cindex CD@LaTeX{}
9128 9482
9129CDLa@TeX{} mode is a minor mode that is normally used in combination with a 9483CD@LaTeX{} mode is a minor mode that is normally used in combination with a
9130major @LaTeX{} mode like AUC@TeX{} in order to speed-up insertion of 9484major @LaTeX{} mode like AUC@TeX{} in order to speed-up insertion of
9131environments and math templates. Inside Org-mode, you can make use of 9485environments and math templates. Inside Org mode, you can make use of
9132some of the features of CDLa@TeX{} mode. You need to install 9486some of the features of CD@LaTeX{} mode. You need to install
9133@file{cdlatex.el} and @file{texmathp.el} (the latter comes also with 9487@file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
9134AUC@TeX{}) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}. 9488AUC@TeX{}) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
9135Don't use CDLa@TeX{} mode itself under Org-mode, but use the light 9489Don't use CD@LaTeX{} mode itself under Org mode, but use the light
9136version @code{org-cdlatex-mode} that comes as part of Org-mode. Turn it 9490version @code{org-cdlatex-mode} that comes as part of Org mode. Turn it
9137on for the current buffer with @code{M-x org-cdlatex-mode}, or for all 9491on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
9138Org files with 9492Org files with
9139 9493
@@ -9142,7 +9496,7 @@ Org files with
9142@end lisp 9496@end lisp
9143 9497
9144When this mode is enabled, the following features are present (for more 9498When this mode is enabled, the following features are present (for more
9145details see the documentation of CDLa@TeX{} mode): 9499details see the documentation of CD@LaTeX{} mode):
9146@itemize @bullet 9500@itemize @bullet
9147@kindex C-c @{ 9501@kindex C-c @{
9148@item 9502@item
@@ -9150,7 +9504,7 @@ Environment templates can be inserted with @kbd{C-c @{}.
9150@item 9504@item
9151@kindex @key{TAB} 9505@kindex @key{TAB}
9152The @key{TAB} key will do template expansion if the cursor is inside a 9506The @key{TAB} key will do template expansion if the cursor is inside a
9153@LaTeX{} fragment@footnote{Org-mode has a method to test if the cursor is 9507@LaTeX{} fragment@footnote{Org mode has a method to test if the cursor is
9154inside such a fragment, see the documentation of the function 9508inside such a fragment, see the documentation of the function
9155@code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will 9509@code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
9156expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor 9510expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
@@ -9187,18 +9541,20 @@ is normal.
9187@chapter Exporting 9541@chapter Exporting
9188@cindex exporting 9542@cindex exporting
9189 9543
9190Org-mode documents can be exported into a variety of other formats. For 9544Org mode documents can be exported into a variety of other formats. For
9191printing and sharing of notes, ASCII export produces a readable and simple 9545printing and sharing of notes, ASCII export produces a readable and simple
9192version of an Org file. HTML export allows you to publish a notes file on 9546version of an Org file. HTML export allows you to publish a notes file on
9193the web, while the XOXO format provides a solid base for exchange with a 9547the web, while the XOXO format provides a solid base for exchange with a
9194broad range of other applications. @LaTeX{} export lets you use Org-mode and 9548broad range of other applications. @LaTeX{} export lets you use Org mode and
9195its structured editing functions to easily create @LaTeX{} files. DocBook 9549its structured editing functions to easily create @LaTeX{} files. DocBook
9196export makes it possible to convert Org files to many other formats using 9550export makes it possible to convert Org files to many other formats using
9197DocBook tools. For project management you can create gantt and resource 9551DocBook tools. OpenDocument Text(@acronym{ODT}) export allows seamless
9198charts by using TaskJuggler export. To incorporate entries with associated 9552collaboration across organizational boundaries. For project management you
9199times like deadlines or appointments into a desktop calendar program like 9553can create gantt and resource charts by using TaskJuggler export. To
9200iCal, Org-mode can also produce extracts in the iCalendar format. Currently 9554incorporate entries with associated times like deadlines or appointments into
9201Org-mode only supports export, not import of these different formats. 9555a desktop calendar program like iCal, Org mode can also produce extracts in
9556the iCalendar format. Currently Org mode only supports export, not import of
9557these different formats.
9202 9558
9203Org supports export of selected regions when @code{transient-mark-mode} is 9559Org supports export of selected regions when @code{transient-mark-mode} is
9204enabled (default in Emacs 23). 9560enabled (default in Emacs 23).
@@ -9209,8 +9565,9 @@ enabled (default in Emacs 23).
9209* The export dispatcher:: How to access exporter commands 9565* The export dispatcher:: How to access exporter commands
9210* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding 9566* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
9211* HTML export:: Exporting to HTML 9567* HTML export:: Exporting to HTML
9212* LaTeX and PDF export:: Exporting to @LaTeX{}, and processing to PDF 9568* @LaTeX{} and PDF export:: Exporting to @LaTeX{}, and processing to PDF
9213* DocBook export:: Exporting to DocBook 9569* DocBook export:: Exporting to DocBook
9570* OpenDocument Text export:: Exporting to OpenDocument Text
9214* TaskJuggler export:: Exporting to TaskJuggler 9571* TaskJuggler export:: Exporting to TaskJuggler
9215* Freemind export:: Exporting to Freemind mind maps 9572* Freemind export:: Exporting to Freemind mind maps
9216* XOXO export:: Exporting to XOXO 9573* XOXO export:: Exporting to XOXO
@@ -9219,26 +9576,35 @@ enabled (default in Emacs 23).
9219 9576
9220@node Selective export, Export options, Exporting, Exporting 9577@node Selective export, Export options, Exporting, Exporting
9221@section Selective export 9578@section Selective export
9222@cindex export, selective by tags 9579@cindex export, selective by tags or TODO keyword
9223 9580
9224@vindex org-export-select-tags 9581@vindex org-export-select-tags
9225@vindex org-export-exclude-tags 9582@vindex org-export-exclude-tags
9583@cindex org-export-with-tasks
9226You may use tags to select the parts of a document that should be exported, 9584You may use tags to select the parts of a document that should be exported,
9227or to exclude parts from export. This behavior is governed by two variables: 9585or to exclude parts from export. This behavior is governed by two variables:
9228@code{org-export-select-tags} and @code{org-export-exclude-tags}. 9586@code{org-export-select-tags} and @code{org-export-exclude-tags},
9587respectively defaulting to @code{'(:export:)} and @code{'(:noexport:)}.
9229 9588
9230Org first checks if any of the @emph{select} tags is present in the buffer. 9589@enumerate
9231If yes, all trees that do not carry one of these tags will be excluded. If a 9590@item
9232selected tree is a subtree, the heading hierarchy above it will also be 9591Org first checks if any of the @emph{select} tags is present in the
9233selected for export, but not the text below those headings. 9592buffer. If yes, all trees that do not carry one of these tags will be
9593excluded. If a selected tree is a subtree, the heading hierarchy above it
9594will also be selected for export, but not the text below those headings.
9234 9595
9235@noindent 9596@item
9236If none of the select tags is found, the whole buffer will be selected for 9597If none of the select tags is found, the whole buffer will be selected for
9237export. 9598export.
9238 9599
9239@noindent 9600@item
9240Finally, all subtrees that are marked by any of the @emph{exclude} tags will 9601Finally, all subtrees that are marked by any of the @emph{exclude} tags will
9241be removed from the export buffer. 9602be removed from the export buffer.
9603@end enumerate
9604
9605The variable @code{org-export-with-tasks} can be configured to select which
9606kind of tasks should be included for export. See the docstring of the
9607variable for more information.
9242 9608
9243@node Export options, The export dispatcher, Selective export, Exporting 9609@node Export options, The export dispatcher, Selective export, Exporting
9244@section Export options 9610@section Export options
@@ -9279,30 +9645,31 @@ Insert template with export options, see example below.
9279@vindex user-full-name 9645@vindex user-full-name
9280@vindex user-mail-address 9646@vindex user-mail-address
9281@vindex org-export-default-language 9647@vindex org-export-default-language
9648@vindex org-export-date-timestamp-format
9282@example 9649@example
9283#+TITLE: the title to be shown (default is the buffer name) 9650#+TITLE: the title to be shown (default is the buffer name)
9284#+AUTHOR: the author (default taken from @code{user-full-name}) 9651#+AUTHOR: the author (default taken from @code{user-full-name})
9285#+DATE: a date, fixed, or a format string for @code{format-time-string} 9652#+DATE: a date, an Org timestamp@footnote{@code{org-export-date-timestamp-format} defines how this timestamp will be exported.}, or a format string for @code{format-time-string}
9286#+EMAIL: his/her email address (default from @code{user-mail-address}) 9653#+EMAIL: his/her email address (default from @code{user-mail-address})
9287#+DESCRIPTION: the page description, e.g. for the XHTML meta tag 9654#+DESCRIPTION: the page description, e.g.@: for the XHTML meta tag
9288#+KEYWORDS: the page keywords, e.g. for the XHTML meta tag 9655#+KEYWORDS: the page keywords, e.g.@: for the XHTML meta tag
9289#+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language}) 9656#+LANGUAGE: language for HTML, e.g.@: @samp{en} (@code{org-export-default-language})
9290#+TEXT: Some descriptive text to be inserted at the beginning. 9657#+TEXT: Some descriptive text to be inserted at the beginning.
9291#+TEXT: Several lines may be given. 9658#+TEXT: Several lines may be given.
9292#+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ... 9659#+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
9293#+BIND: lisp-var lisp-val, e.g.: org-export-latex-low-levels itemize 9660#+BIND: lisp-var lisp-val, e.g.@:: @code{org-export-latex-low-levels itemize}
9294 @r{You need to confirm using these, or configure @code{org-export-allow-BIND}} 9661 @r{You need to confirm using these, or configure @code{org-export-allow-BIND}}
9295#+LINK_UP: the ``up'' link of an exported page 9662#+LINK_UP: the ``up'' link of an exported page
9296#+LINK_HOME: the ``home'' link of an exported page 9663#+LINK_HOME: the ``home'' link of an exported page
9297#+LATEX_HEADER: extra line(s) for the LaTeX header, like \usepackage@{xyz@} 9664#+LATEX_HEADER: extra line(s) for the @LaTeX{} header, like \usepackage@{xyz@}
9298#+EXPORT_SELECT_TAGS: Tags that select a tree for export 9665#+EXPORT_SELECT_TAGS: Tags that select a tree for export
9299#+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export 9666#+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
9300#+XSLT: the XSLT stylesheet used by DocBook exporter to generate FO file 9667#+XSLT: the XSLT stylesheet used by DocBook exporter to generate FO file
9301@end example 9668@end example
9302 9669
9303@noindent 9670@noindent
9304The OPTIONS line is a compact@footnote{If you want to configure many options 9671The @code{#+OPTIONS} line is a compact@footnote{If you want to configure many options
9305this way, you can use several OPTIONS lines.} form to specify export 9672this way, you can use several @code{#+OPTIONS} lines.} form to specify export
9306settings. Here you can: 9673settings. Here you can:
9307@cindex headline levels 9674@cindex headline levels
9308@cindex section-numbers 9675@cindex section-numbers
@@ -9319,6 +9686,11 @@ settings. Here you can:
9319@cindex @LaTeX{} fragments 9686@cindex @LaTeX{} fragments
9320@cindex author info, in export 9687@cindex author info, in export
9321@cindex time info, in export 9688@cindex time info, in export
9689@vindex org-export-plist-vars
9690@vindex org-export-author-info
9691@vindex org-export-creator-info
9692@vindex org-export-email-info
9693@vindex org-export-time-stamp-file
9322@example 9694@example
9323H: @r{set the number of headline levels for export} 9695H: @r{set the number of headline levels for export}
9324num: @r{turn on/off section-numbers} 9696num: @r{turn on/off section-numbers}
@@ -9333,6 +9705,8 @@ toc: @r{turn on/off table of contents, or set level limit (integer)}
9333-: @r{turn on/off conversion of special strings.} 9705-: @r{turn on/off conversion of special strings.}
9334f: @r{turn on/off footnotes like this[1].} 9706f: @r{turn on/off footnotes like this[1].}
9335todo: @r{turn on/off inclusion of TODO keywords into exported text} 9707todo: @r{turn on/off inclusion of TODO keywords into exported text}
9708tasks: @r{turn on/off inclusion of tasks (TODO items), can be nil to remove}
9709 @r{all tasks, @code{todo} to remove DONE tasks, or list of kwds to keep}
9336pri: @r{turn on/off priority cookies} 9710pri: @r{turn on/off priority cookies}
9337tags: @r{turn on/off inclusion of tags, may also be @code{not-in-toc}} 9711tags: @r{turn on/off inclusion of tags, may also be @code{not-in-toc}}
9338<: @r{turn on/off inclusion of any time/date stamps like DEADLINES} 9712<: @r{turn on/off inclusion of any time/date stamps like DEADLINES}
@@ -9348,11 +9722,13 @@ d: @r{turn on/off inclusion of drawers}
9348@end example 9722@end example
9349@noindent 9723@noindent
9350These options take effect in both the HTML and @LaTeX{} export, except for 9724These options take effect in both the HTML and @LaTeX{} export, except for
9351@code{TeX} and @code{LaTeX}, which are respectively @code{t} and @code{nil} 9725@code{TeX} and @code{LaTeX} options, which are respectively @code{t} and
9352for the @LaTeX{} export. The default values for these and many other options 9726@code{nil} for the @LaTeX{} export.
9353are given by a set of variables. For a list of such variables, the 9727
9354corresponding OPTIONS keys and also the publishing keys (@pxref{Project 9728The default values for these and many other options are given by a set of
9355alist}), see the constant @code{org-export-plist-vars}. 9729variables. For a list of such variables, the corresponding OPTIONS keys and
9730also the publishing keys (@pxref{Project alist}), see the constant
9731@code{org-export-plist-vars}.
9356 9732
9357When exporting only a single subtree by selecting it with @kbd{C-c @@} before 9733When exporting only a single subtree by selecting it with @kbd{C-c @@} before
9358calling an export command, the subtree can overrule some of the file's export 9734calling an export command, the subtree can overrule some of the file's export
@@ -9381,11 +9757,11 @@ separate Emacs process@footnote{To make this behavior the default, customize
9381the variable @code{org-export-run-in-background}.}. 9757the variable @code{org-export-run-in-background}.}.
9382@orgcmd{C-c C-e v,org-export-visible} 9758@orgcmd{C-c C-e v,org-export-visible}
9383Like @kbd{C-c C-e}, but only export the text that is currently visible 9759Like @kbd{C-c C-e}, but only export the text that is currently visible
9384(i.e. not hidden by outline visibility). 9760(i.e.@: not hidden by outline visibility).
9385@orgcmd{C-u C-u C-c C-e,org-export} 9761@orgcmd{C-u C-u C-c C-e,org-export}
9386@vindex org-export-run-in-background 9762@vindex org-export-run-in-background
9387Call the exporter, but reverse the setting of 9763Call the exporter, but reverse the setting of
9388@code{org-export-run-in-background}, i.e. request background processing if 9764@code{org-export-run-in-background}, i.e.@: request background processing if
9389not set, or force processing in the current Emacs process if set. 9765not set, or force processing in the current Emacs process if set.
9390@end table 9766@end table
9391 9767
@@ -9395,7 +9771,7 @@ not set, or force processing in the current Emacs process if set.
9395@cindex Latin-1 export 9771@cindex Latin-1 export
9396@cindex UTF-8 export 9772@cindex UTF-8 export
9397 9773
9398ASCII export produces a simple and very readable version of an Org-mode 9774ASCII export produces a simple and very readable version of an Org mode
9399file, containing only plain ASCII. Latin-1 and UTF-8 export augment the file 9775file, containing only plain ASCII. Latin-1 and UTF-8 export augment the file
9400with special characters and symbols available in these encodings. 9776with special characters and symbols available in these encodings.
9401 9777
@@ -9409,7 +9785,7 @@ Export as ASCII file. For an Org file, @file{myfile.org}, the ASCII file
9409will be @file{myfile.txt}. The file will be overwritten without 9785will be @file{myfile.txt}. The file will be overwritten without
9410warning. If there is an active region@footnote{This requires 9786warning. If there is an active region@footnote{This requires
9411@code{transient-mark-mode} be turned on.}, only the region will be 9787@code{transient-mark-mode} be turned on.}, only the region will be
9412exported. If the selected region is a single tree@footnote{To select the 9788exported. If the selected region is a single tree@footnote{To select the
9413current subtree, use @kbd{C-c @@}.}, the tree head will 9789current subtree, use @kbd{C-c @@}.}, the tree head will
9414become the document title. If the tree head entry has or inherits an 9790become the document title. If the tree head entry has or inherits an
9415@code{EXPORT_FILE_NAME} property, that name will be used for the 9791@code{EXPORT_FILE_NAME} property, that name will be used for the
@@ -9450,17 +9826,18 @@ Links will be exported in a footnote-like style, with the descriptive part in
9450the text and the link in a note before the next heading. See the variable 9826the text and the link in a note before the next heading. See the variable
9451@code{org-export-ascii-links-to-notes} for details and other options. 9827@code{org-export-ascii-links-to-notes} for details and other options.
9452 9828
9453@node HTML export, LaTeX and PDF export, ASCII/Latin-1/UTF-8 export, Exporting 9829@node HTML export, @LaTeX{} and PDF export, ASCII/Latin-1/UTF-8 export, Exporting
9454@section HTML export 9830@section HTML export
9455@cindex HTML export 9831@cindex HTML export
9456 9832
9457Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive 9833Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
9458HTML formatting, in ways similar to John Gruber's @emph{markdown} 9834HTML formatting, in ways similar to John Gruber's @emph{markdown}
9459language, but with additional support for tables. 9835language, but with additional support for tables.
9460 9836
9461@menu 9837@menu
9462* HTML Export commands:: How to invoke HTML export 9838* HTML Export commands:: How to invoke HTML export
9463* Quoting HTML tags:: Using direct HTML in Org-mode 9839* HTML preamble and postamble:: How to insert a preamble and a postamble
9840* Quoting HTML tags:: Using direct HTML in Org mode
9464* Links in HTML export:: How links will be interpreted and formatted 9841* Links in HTML export:: How links will be interpreted and formatted
9465* Tables in HTML export:: How to modify the formatting of tables 9842* Tables in HTML export:: How to modify the formatting of tables
9466* Images in HTML export:: How to insert figures into HTML output 9843* Images in HTML export:: How to insert figures into HTML output
@@ -9470,7 +9847,7 @@ language, but with additional support for tables.
9470* JavaScript support:: Info and Folding in a web browser 9847* JavaScript support:: Info and Folding in a web browser
9471@end menu 9848@end menu
9472 9849
9473@node HTML Export commands, Quoting HTML tags, HTML export, HTML export 9850@node HTML Export commands, HTML preamble and postamble, HTML export, HTML export
9474@subsection HTML export commands 9851@subsection HTML export commands
9475 9852
9476@cindex region, active 9853@cindex region, active
@@ -9479,11 +9856,11 @@ language, but with additional support for tables.
9479@table @kbd 9856@table @kbd
9480@orgcmd{C-c C-e h,org-export-as-html} 9857@orgcmd{C-c C-e h,org-export-as-html}
9481@cindex property, EXPORT_FILE_NAME 9858@cindex property, EXPORT_FILE_NAME
9482Export as HTML file @file{myfile.html}. For an Org file @file{myfile.org}, 9859Export as HTML file. For an Org file @file{myfile.org},
9483the ASCII file will be @file{myfile.html}. The file will be overwritten 9860the HTML file will be @file{myfile.html}. The file will be overwritten
9484without warning. If there is an active region@footnote{This requires 9861without warning. If there is an active region@footnote{This requires
9485@code{transient-mark-mode} be turned on.}, only the region will be 9862@code{transient-mark-mode} be turned on.}, only the region will be
9486exported. If the selected region is a single tree@footnote{To select the 9863exported. If the selected region is a single tree@footnote{To select the
9487current subtree, use @kbd{C-c @@}.}, the tree head will become the document 9864current subtree, use @kbd{C-c @@}.}, the tree head will become the document
9488title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME} 9865title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
9489property, that name will be used for the export. 9866property, that name will be used for the export.
@@ -9498,11 +9875,11 @@ the region. This is good for cut-and-paste operations.
9498@item C-c C-e v h/b/H/R 9875@item C-c C-e v h/b/H/R
9499Export only the visible part of the document. 9876Export only the visible part of the document.
9500@item M-x org-export-region-as-html 9877@item M-x org-export-region-as-html
9501Convert the region to HTML under the assumption that it was Org-mode 9878Convert the region to HTML under the assumption that it was Org mode
9502syntax before. This is a global command that can be invoked in any 9879syntax before. This is a global command that can be invoked in any
9503buffer. 9880buffer.
9504@item M-x org-replace-region-by-HTML 9881@item M-x org-replace-region-by-HTML
9505Replace the active region (assumed to be in Org-mode syntax) by HTML 9882Replace the active region (assumed to be in Org mode syntax) by HTML
9506code. 9883code.
9507@end table 9884@end table
9508 9885
@@ -9519,7 +9896,43 @@ specify it with a numeric prefix argument. For example,
9519@noindent 9896@noindent
9520creates two levels of headings and does the rest as items. 9897creates two levels of headings and does the rest as items.
9521 9898
9522@node Quoting HTML tags, Links in HTML export, HTML Export commands, HTML export 9899
9900@node HTML preamble and postamble, Quoting HTML tags, HTML Export commands, HTML export
9901@subsection HTML preamble and postamble
9902@vindex org-export-html-preamble
9903@vindex org-export-html-postamble
9904@vindex org-export-html-preamble-format
9905@vindex org-export-html-postamble-format
9906@vindex org-export-html-validation-link
9907@vindex org-export-author-info
9908@vindex org-export-email-info
9909@vindex org-export-creator-info
9910@vindex org-export-time-stamp-file
9911
9912The HTML exporter lets you define a preamble and a postamble.
9913
9914The default value for @code{org-export-html-preamble} is @code{t}, which
9915means that the preamble is inserted depending on the relevant formatting
9916string in @code{org-export-html-preamble-format}.
9917
9918Setting @code{org-export-html-preamble} to a string will override the default
9919formatting string. Setting it to a function, will insert the output of the
9920function, which must be a string; such a function takes no argument but you
9921can check against the value of @code{opt-plist}, which contains the list of
9922publishing properties for the current file. Setting to @code{nil} will not
9923insert any preamble.
9924
9925The default value for @code{org-export-html-postamble} is @code{'auto}, which
9926means that the HTML exporter will look for the value of
9927@code{org-export-author-info}, @code{org-export-email-info},
9928@code{org-export-creator-info} and @code{org-export-time-stamp-file},
9929@code{org-export-html-validation-link} and build the postamble from these
9930values. Setting @code{org-export-html-postamble} to @code{t} will insert the
9931postamble from the relevant formatting string found in
9932@code{org-export-html-postamble-format}. Setting it to @code{nil} will not
9933insert any postamble.
9934
9935@node Quoting HTML tags, Links in HTML export, HTML preamble and postamble, HTML export
9523@subsection Quoting HTML tags 9936@subsection Quoting HTML tags
9524 9937
9525Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and 9938Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
@@ -9568,7 +9981,7 @@ and @code{style} attributes for a link:
9568 9981
9569@cindex #+ATTR_HTML 9982@cindex #+ATTR_HTML
9570@example 9983@example
9571#+ATTR_HTML: title="The Org-mode homepage" style="color:red;" 9984#+ATTR_HTML: title="The Org mode homepage" style="color:red;"
9572[[http://orgmode.org]] 9985[[http://orgmode.org]]
9573@end example 9986@end example
9574 9987
@@ -9577,7 +9990,7 @@ and @code{style} attributes for a link:
9577@cindex tables, in HTML 9990@cindex tables, in HTML
9578@vindex org-export-html-table-tag 9991@vindex org-export-html-table-tag
9579 9992
9580Org-mode tables are exported to HTML using the table tag defined in 9993Org mode tables are exported to HTML using the table tag defined in
9581@code{org-export-html-table-tag}. The default setting makes tables without 9994@code{org-export-html-table-tag}. The default setting makes tables without
9582cell borders and frame. If you would like to change this for individual 9995cell borders and frame. If you would like to change this for individual
9583tables, place something like the following before the table: 9996tables, place something like the following before the table:
@@ -9586,7 +9999,7 @@ tables, place something like the following before the table:
9586@cindex #+ATTR_HTML 9999@cindex #+ATTR_HTML
9587@example 10000@example
9588#+CAPTION: This is a table with lines around and between cells 10001#+CAPTION: This is a table with lines around and between cells
9589#+ATTR_HTML: border="2" rules="all" frame="all" 10002#+ATTR_HTML: border="2" rules="all" frame="border"
9590@end example 10003@end example
9591 10004
9592@node Images in HTML export, Math formatting in HTML export, Tables in HTML export, HTML export 10005@node Images in HTML export, Math formatting in HTML export, Tables in HTML export, HTML export
@@ -9624,18 +10037,18 @@ support text viewers and accessibility, and align it to the right.
9624@end example 10037@end example
9625 10038
9626@noindent 10039@noindent
9627and you could use @code{http} addresses just as well. 10040You could use @code{http} addresses just as well.
9628 10041
9629@node Math formatting in HTML export, Text areas in HTML export, Images in HTML export, HTML export 10042@node Math formatting in HTML export, Text areas in HTML export, Images in HTML export, HTML export
9630@subsection Math formatting in HTML export 10043@subsection Math formatting in HTML export
9631@cindex MathJax 10044@cindex MathJax
9632@cindex dvipng 10045@cindex dvipng
9633 10046
9634@LaTeX{} math snippets (@pxref{LaTeX fragments}) can be displayed in two 10047@LaTeX{} math snippets (@pxref{@LaTeX{} fragments}) can be displayed in two
9635different ways on HTML pages. The default is to use the 10048different ways on HTML pages. The default is to use the
9636@uref{http://www.mathjax.org, MathJax system} which should work out of the 10049@uref{http://www.mathjax.org, MathJax system} which should work out of the
9637box with Org mode installation because @code{http://orgmode.org} serves 10050box with Org mode installation because @code{http://orgmode.org} serves
9638@file{MathJax} for Org-mode users for small applications and for testing 10051@file{MathJax} for Org mode users for small applications and for testing
9639purposes. @b{If you plan to use this regularly or on pages with significant 10052purposes. @b{If you plan to use this regularly or on pages with significant
9640page views, you should install@footnote{Installation instructions can be 10053page views, you should install@footnote{Installation instructions can be
9641found on the MathJax website, see 10054found on the MathJax website, see
@@ -9701,10 +10114,10 @@ addition to any of the standard classes like for headlines, tables, etc.
9701@example 10114@example
9702p.author @r{author information, including email} 10115p.author @r{author information, including email}
9703p.date @r{publishing date} 10116p.date @r{publishing date}
9704p.creator @r{creator info, about org-mode version} 10117p.creator @r{creator info, about org mode version}
9705.title @r{document title} 10118.title @r{document title}
9706.todo @r{TODO keywords, all not-done states} 10119.todo @r{TODO keywords, all not-done states}
9707.done @r{the DONE keywords, all stated the count as done} 10120.done @r{the DONE keywords, all states that count as done}
9708.WAITING @r{each TODO keyword also uses a class named after itself} 10121.WAITING @r{each TODO keyword also uses a class named after itself}
9709.timestamp @r{timestamp} 10122.timestamp @r{timestamp}
9710.timestamp-kwd @r{keyword associated with a timestamp, like SCHEDULED} 10123.timestamp-kwd @r{keyword associated with a timestamp, like SCHEDULED}
@@ -9827,32 +10240,34 @@ You can choose default values for these options by customizing the variable
9827@code{org-infojs-options}. If you always want to apply the script to your 10240@code{org-infojs-options}. If you always want to apply the script to your
9828pages, configure the variable @code{org-export-html-use-infojs}. 10241pages, configure the variable @code{org-export-html-use-infojs}.
9829 10242
9830@node LaTeX and PDF export, DocBook export, HTML export, Exporting 10243@node @LaTeX{} and PDF export, DocBook export, HTML export, Exporting
9831@section @LaTeX{} and PDF export 10244@section @LaTeX{} and PDF export
9832@cindex @LaTeX{} export 10245@cindex @LaTeX{} export
9833@cindex PDF export 10246@cindex PDF export
9834@cindex Guerry, Bastien 10247@cindex Guerry, Bastien
9835 10248
9836Org-mode contains a @LaTeX{} exporter written by Bastien Guerry. With 10249Org mode contains a @LaTeX{} exporter written by Bastien Guerry. With
9837further processing@footnote{The default LaTeX output is designed for 10250further processing@footnote{The default @LaTeX{} output is designed for
9838processing with pdftex or latex. It includes packages that are not 10251processing with @code{pdftex} or @LaTeX{}. It includes packages that are not
9839compatible with xetex and possibly luatex. See the variables 10252compatible with @code{xetex} and possibly @code{luatex}. See the variables
9840@code{org-export-latex-default-packages-alist} and 10253@code{org-export-latex-default-packages-alist} and
9841@code{org-export-latex-packages-alist}.}, this backend is also used to 10254@code{org-export-latex-packages-alist}.}, this backend is also used to
9842produce PDF output. Since the @LaTeX{} output uses @file{hyperref} to 10255produce PDF output. Since the @LaTeX{} output uses @file{hyperref} to
9843implement links and cross references, the PDF output file will be fully 10256implement links and cross references, the PDF output file will be fully
9844linked. 10257linked. Beware of the fact that your @code{org} file has to be properly
10258structured in order to be correctly exported: respect the hierarchy of
10259sections.
9845 10260
9846@menu 10261@menu
9847* LaTeX/PDF export commands:: Which key invokes which commands 10262* @LaTeX{}/PDF export commands::
9848* Header and sectioning:: Setting up the export file structure 10263* Header and sectioning:: Setting up the export file structure
9849* Quoting LaTeX code:: Incorporating literal @LaTeX{} code 10264* Quoting @LaTeX{} code:: Incorporating literal @LaTeX{} code
9850* Tables in LaTeX export:: Options for exporting tables to @LaTeX{} 10265* Tables in @LaTeX{} export:: Options for exporting tables to @LaTeX{}
9851* Images in LaTeX export:: How to insert figures into @LaTeX{} output 10266* Images in @LaTeX{} export:: How to insert figures into @LaTeX{} output
9852* Beamer class export:: Turning the file into a presentation 10267* Beamer class export:: Turning the file into a presentation
9853@end menu 10268@end menu
9854 10269
9855@node LaTeX/PDF export commands, Header and sectioning, LaTeX and PDF export, LaTeX and PDF export 10270@node @LaTeX{}/PDF export commands, Header and sectioning, @LaTeX{} and PDF export, @LaTeX{} and PDF export
9856@subsection @LaTeX{} export commands 10271@subsection @LaTeX{} export commands
9857 10272
9858@cindex region, active 10273@cindex region, active
@@ -9861,24 +10276,24 @@ linked.
9861@table @kbd 10276@table @kbd
9862@orgcmd{C-c C-e l,org-export-as-latex} 10277@orgcmd{C-c C-e l,org-export-as-latex}
9863@cindex property EXPORT_FILE_NAME 10278@cindex property EXPORT_FILE_NAME
9864Export as @LaTeX{} file @file{myfile.tex}. For an Org file 10279Export as @LaTeX{} file. For an Org file
9865@file{myfile.org}, the ASCII file will be @file{myfile.tex}. The file will 10280@file{myfile.org}, the @LaTeX{} file will be @file{myfile.tex}. The file will
9866be overwritten without warning. If there is an active region@footnote{This 10281be overwritten without warning. If there is an active region@footnote{This
9867requires @code{transient-mark-mode} be turned on.}, only the region will be 10282requires @code{transient-mark-mode} be turned on.}, only the region will be
9868exported. If the selected region is a single tree@footnote{To select the 10283exported. If the selected region is a single tree@footnote{To select the
9869current subtree, use @kbd{C-c @@}.}, the tree head will become the document 10284current subtree, use @kbd{C-c @@}.}, the tree head will become the document
9870title. If the tree head entry has or inherits an @code{EXPORT_FILE_NAME} 10285title. If the tree head entry has or inherits an @code{EXPORT_FILE_NAME}
9871property, that name will be used for the export. 10286property, that name will be used for the export.
9872@orgcmd{C-c C-e L,org-export-as-latex-to-buffer} 10287@orgcmd{C-c C-e L,org-export-as-latex-to-buffer}
9873Export to a temporary buffer. Do not create a file. 10288Export to a temporary buffer. Do not create a file.
9874@item C-c C-e v l/L 10289@item C-c C-e v l/L
9875Export only the visible part of the document. 10290Export only the visible part of the document.
9876@item M-x org-export-region-as-latex 10291@item M-x org-export-region-as-latex
9877Convert the region to @LaTeX{} under the assumption that it was Org-mode 10292Convert the region to @LaTeX{} under the assumption that it was Org mode
9878syntax before. This is a global command that can be invoked in any 10293syntax before. This is a global command that can be invoked in any
9879buffer. 10294buffer.
9880@item M-x org-replace-region-by-latex 10295@item M-x org-replace-region-by-latex
9881Replace the active region (assumed to be in Org-mode syntax) by @LaTeX{} 10296Replace the active region (assumed to be in Org mode syntax) by @LaTeX{}
9882code. 10297code.
9883@orgcmd{C-c C-e p,org-export-as-pdf} 10298@orgcmd{C-c C-e p,org-export-as-pdf}
9884Export as @LaTeX{} and then process to PDF. 10299Export as @LaTeX{} and then process to PDF.
@@ -9895,7 +10310,7 @@ convert them to a custom string depending on
9895@code{org-latex-low-levels}. 10310@code{org-latex-low-levels}.
9896 10311
9897If you want that transition to occur at a different level, specify it 10312If you want that transition to occur at a different level, specify it
9898with a numeric prefix argument. For example, 10313with a numeric prefix argument. For example,
9899 10314
9900@example 10315@example
9901@kbd{C-2 C-c C-e l} 10316@kbd{C-2 C-c C-e l}
@@ -9904,13 +10319,13 @@ with a numeric prefix argument. For example,
9904@noindent 10319@noindent
9905creates two levels of headings and does the rest as items. 10320creates two levels of headings and does the rest as items.
9906 10321
9907@node Header and sectioning, Quoting LaTeX code, LaTeX/PDF export commands, LaTeX and PDF export 10322@node Header and sectioning, Quoting @LaTeX{} code, @LaTeX{}/PDF export commands, @LaTeX{} and PDF export
9908@subsection Header and sectioning structure 10323@subsection Header and sectioning structure
9909@cindex @LaTeX{} class 10324@cindex @LaTeX{} class
9910@cindex @LaTeX{} sectioning structure 10325@cindex @LaTeX{} sectioning structure
9911@cindex @LaTeX{} header 10326@cindex @LaTeX{} header
9912@cindex header, for LaTeX files 10327@cindex header, for @LaTeX{} files
9913@cindex sectioning structure, for LaTeX export 10328@cindex sectioning structure, for @LaTeX{} export
9914 10329
9915By default, the @LaTeX{} output uses the class @code{article}. 10330By default, the @LaTeX{} output uses the class @code{article}.
9916 10331
@@ -9938,10 +10353,10 @@ can also use @code{#+LATEX_HEADER: \usepackage@{xyz@}} to add lines to the
9938header. See the docstring of @code{org-export-latex-classes} for more 10353header. See the docstring of @code{org-export-latex-classes} for more
9939information. 10354information.
9940 10355
9941@node Quoting LaTeX code, Tables in LaTeX export, Header and sectioning, LaTeX and PDF export 10356@node Quoting @LaTeX{} code, Tables in @LaTeX{} export, Header and sectioning, @LaTeX{} and PDF export
9942@subsection Quoting @LaTeX{} code 10357@subsection Quoting @LaTeX{} code
9943 10358
9944Embedded @LaTeX{} as described in @ref{Embedded LaTeX}, will be correctly 10359Embedded @LaTeX{} as described in @ref{Embedded @LaTeX{}}, will be correctly
9945inserted into the @LaTeX{} file. This includes simple macros like 10360inserted into the @LaTeX{} file. This includes simple macros like
9946@samp{\ref@{LABEL@}} to create a cross reference to a figure. Furthermore, 10361@samp{\ref@{LABEL@}} to create a cross reference to a figure. Furthermore,
9947you can add special code that should only be present in @LaTeX{} export with 10362you can add special code that should only be present in @LaTeX{} export with
@@ -9950,7 +10365,7 @@ the following constructs:
9950@cindex #+LaTeX 10365@cindex #+LaTeX
9951@cindex #+BEGIN_LaTeX 10366@cindex #+BEGIN_LaTeX
9952@example 10367@example
9953#+LaTeX: Literal LaTeX code for export 10368#+LaTeX: Literal @LaTeX{} code for export
9954@end example 10369@end example
9955 10370
9956@noindent or 10371@noindent or
@@ -9963,16 +10378,18 @@ All lines between these markers are exported literally
9963@end example 10378@end example
9964 10379
9965 10380
9966@node Tables in LaTeX export, Images in LaTeX export, Quoting LaTeX code, LaTeX and PDF export 10381@node Tables in @LaTeX{} export, Images in @LaTeX{} export, Quoting @LaTeX{} code, @LaTeX{} and PDF export
9967@subsection Tables in @LaTeX{} export 10382@subsection Tables in @LaTeX{} export
9968@cindex tables, in @LaTeX{} export 10383@cindex tables, in @LaTeX{} export
9969 10384
9970For @LaTeX{} export of a table, you can specify a label and a caption 10385For @LaTeX{} export of a table, you can specify a label, a caption and
9971(@pxref{Images and tables}). You can also use the @code{ATTR_LaTeX} line to 10386placement options (@pxref{Images and tables}). You can also use the
9972request a @code{longtable} environment for the table, so that it may span 10387@code{ATTR_LaTeX} line to request a @code{longtable} environment for the
9973several pages, or provide the @code{multicolumn} keyword that will make the 10388table, so that it may span several pages, or to change the default table
9974table span the page in a multicolumn environment (@code{table*} environment). 10389environment from @code{table} to @code{table*} or to change the default inner
9975Finally, you can set the alignment string: 10390tabular environment to @code{tabularx} or @code{tabulary}. Finally, you can
10391set the alignment string, and (with @code{tabularx} or @code{tabulary}) the
10392width:
9976 10393
9977@cindex #+CAPTION 10394@cindex #+CAPTION
9978@cindex #+LABEL 10395@cindex #+LABEL
@@ -9985,8 +10402,20 @@ Finally, you can set the alignment string:
9985| ..... | ..... | 10402| ..... | ..... |
9986@end example 10403@end example
9987 10404
10405or to specify a multicolumn table with @code{tabulary}
10406
10407@cindex #+CAPTION
10408@cindex #+LABEL
10409@cindex #+ATTR_LaTeX
10410@example
10411#+CAPTION: A wide table with tabulary
10412#+LABEL: tbl:wide
10413#+ATTR_LaTeX: table* tabulary width=\textwidth
10414| ..... | ..... |
10415| ..... | ..... |
10416@end example
9988 10417
9989@node Images in LaTeX export, Beamer class export, Tables in LaTeX export, LaTeX and PDF export 10418@node Images in @LaTeX{} export, Beamer class export, Tables in @LaTeX{} export, @LaTeX{} and PDF export
9990@subsection Images in @LaTeX{} export 10419@subsection Images in @LaTeX{} export
9991@cindex images, inline in @LaTeX{} 10420@cindex images, inline in @LaTeX{}
9992@cindex inlining images in @LaTeX{} 10421@cindex inlining images in @LaTeX{}
@@ -9997,11 +10426,18 @@ output file resulting from @LaTeX{} processing. Org will use an
9997@code{\includegraphics} macro to insert the image. If you have specified a 10426@code{\includegraphics} macro to insert the image. If you have specified a
9998caption and/or a label as described in @ref{Images and tables}, the figure 10427caption and/or a label as described in @ref{Images and tables}, the figure
9999will be wrapped into a @code{figure} environment and thus become a floating 10428will be wrapped into a @code{figure} environment and thus become a floating
10000element. You can use an @code{#+ATTR_LaTeX:} line to specify the various 10429element. You can use an @code{#+ATTR_LaTeX:} line to specify various other
10001options that can be used in the optional argument of the 10430options. You can ask org to export an image as a float without specifying
10002@code{\includegraphics} macro. To modify the placement option of the 10431a label or a caption by using the keyword @code{float} in this line. Various
10003@code{figure} environment, add something like @samp{placement=[h!]} to the 10432optional arguments to the @code{\includegraphics} macro can also be specified
10004Attributes. 10433in this fashion. To modify the placement option of the floating environment,
10434add something like @samp{placement=[h!]} to the attributes. It is to be noted
10435this option can be used with tables as well@footnote{One can also take
10436advantage of this option to pass other, unrelated options into the figure or
10437table environment. For an example see the section ``Exporting org files'' in
10438@url{http://orgmode.org/worg/org-hacks.html}}. For example the
10439@code{#+ATTR_LaTeX:} line below is exported as the @code{figure} environment
10440below it.
10005 10441
10006If you would like to let text flow around the image, add the word @samp{wrap} 10442If you would like to let text flow around the image, add the word @samp{wrap}
10007to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left 10443to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
@@ -10023,17 +10459,21 @@ for @code{\includegraphics} and @code{wrapfigure}.
10023[[./img/hst.png]] 10459[[./img/hst.png]]
10024@end example 10460@end example
10025 10461
10462If you wish to include an image which spans multiple columns in a page, you
10463can use the keyword @code{multicolumn} in the @code{#+ATTR_LaTeX} line. This
10464will export the image wrapped in a @code{figure*} environment.
10465
10026If you need references to a label created in this way, write 10466If you need references to a label created in this way, write
10027@samp{\ref@{fig:SED-HR4049@}} just like in @LaTeX{}. 10467@samp{\ref@{fig:SED-HR4049@}} just like in @LaTeX{}.
10028 10468
10029@node Beamer class export, , Images in LaTeX export, LaTeX and PDF export 10469@node Beamer class export, , Images in @LaTeX{} export, @LaTeX{} and PDF export
10030@subsection Beamer class export 10470@subsection Beamer class export
10031 10471
10032The LaTeX class @file{beamer} allows production of high quality presentations 10472The @LaTeX{} class @file{beamer} allows production of high quality presentations
10033using LaTeX and pdf processing. Org-mode has special support for turning an 10473using @LaTeX{} and pdf processing. Org mode has special support for turning an
10034Org-mode file or tree into a @file{beamer} presentation. 10474Org mode file or tree into a @file{beamer} presentation.
10035 10475
10036When the LaTeX class for the current buffer (as set with @code{#+LaTeX_CLASS: 10476When the @LaTeX{} class for the current buffer (as set with @code{#+LaTeX_CLASS:
10037beamer}) or subtree (set with a @code{LaTeX_CLASS} property) is 10477beamer}) or subtree (set with a @code{LaTeX_CLASS} property) is
10038@code{beamer}, a special export mode will turn the file or tree into a beamer 10478@code{beamer}, a special export mode will turn the file or tree into a beamer
10039presentation. Any tree with not-too-deep level nesting should in principle be 10479presentation. Any tree with not-too-deep level nesting should in principle be
@@ -10153,7 +10593,7 @@ Here is a simple example Org document that is intended for beamer export.
10153 10593
10154For more information, see the documentation on Worg. 10594For more information, see the documentation on Worg.
10155 10595
10156@node DocBook export, TaskJuggler export, LaTeX and PDF export, Exporting 10596@node DocBook export, OpenDocument Text export, @LaTeX{} and PDF export, Exporting
10157@section DocBook export 10597@section DocBook export
10158@cindex DocBook export 10598@cindex DocBook export
10159@cindex PDF export 10599@cindex PDF export
@@ -10255,7 +10695,7 @@ exported DocBook XML files invalid by not quoting DocBook code correctly.
10255@cindex DocBook recursive sections 10695@cindex DocBook recursive sections
10256 10696
10257DocBook exporter exports Org files as articles using the @code{article} 10697DocBook exporter exports Org files as articles using the @code{article}
10258element in DocBook. Recursive sections, i.e. @code{section} elements, are 10698element in DocBook. Recursive sections, i.e.@: @code{section} elements, are
10259used in exported articles. Top level headlines in Org files are exported as 10699used in exported articles. Top level headlines in Org files are exported as
10260top level sections, and lower level headlines are exported as nested 10700top level sections, and lower level headlines are exported as nested
10261sections. The entire structure of Org files will be exported completely, no 10701sections. The entire structure of Org files will be exported completely, no
@@ -10309,7 +10749,7 @@ set:
10309@cindex #+LABEL 10749@cindex #+LABEL
10310@cindex #+ATTR_DOCBOOK 10750@cindex #+ATTR_DOCBOOK
10311@example 10751@example
10312#+CAPTION: The logo of Org-mode 10752#+CAPTION: The logo of Org mode
10313#+LABEL: unicorn-svg 10753#+LABEL: unicorn-svg
10314#+ATTR_DOCBOOK: scalefit="1" width="100%" depth="100%" 10754#+ATTR_DOCBOOK: scalefit="1" width="100%" depth="100%"
10315[[./img/org-mode-unicorn.svg]] 10755[[./img/org-mode-unicorn.svg]]
@@ -10350,7 +10790,840 @@ special characters included in XHTML entities:
10350" 10790"
10351@end example 10791@end example
10352 10792
10353@node TaskJuggler export, Freemind export, DocBook export, Exporting 10793@c begin opendocument
10794
10795@node OpenDocument Text export, TaskJuggler export, DocBook export, Exporting
10796@section OpenDocument Text export
10797@cindex K, Jambunathan
10798@cindex ODT
10799@cindex OpenDocument
10800@cindex export, OpenDocument
10801@cindex LibreOffice
10802@cindex org-odt.el
10803@cindex org-modules
10804
10805Orgmode@footnote{Versions 7.8 or later} supports export to OpenDocument Text
10806(@acronym{ODT}) format using the @file{org-odt.el} module. Documents created
10807by this exporter use the @cite{OpenDocument-v1.2
10808specification}@footnote{@url{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html,
10809Open Document Format for Office Applications (OpenDocument) Version 1.2}} and
10810are compatible with LibreOffice 3.4.
10811
10812@menu
10813* Pre-requisites for @acronym{ODT} export:: What packages @acronym{ODT} exporter relies on
10814* @acronym{ODT} export commands:: How to invoke @acronym{ODT} export
10815* Applying custom styles:: How to apply custom styles to the output
10816* Links in @acronym{ODT} export:: How links will be interpreted and formatted
10817* Tables in @acronym{ODT} export:: How Tables are exported
10818* Images in @acronym{ODT} export:: How to insert images
10819* Math formatting in @acronym{ODT} export:: How @LaTeX{} fragments are formatted
10820* Literal examples in @acronym{ODT} export:: How source and example blocks are formatted
10821* Advanced topics in @acronym{ODT} export:: Read this if you are a power user
10822@end menu
10823
10824@node Pre-requisites for @acronym{ODT} export, @acronym{ODT} export commands, OpenDocument Text export, OpenDocument Text export
10825@subsection Pre-requisites for @acronym{ODT} export
10826@cindex zip
10827The @acronym{ODT} exporter relies on the @file{zip} program to create the final
10828output. Check the availability of this program before proceeding further.
10829
10830@node @acronym{ODT} export commands, Applying custom styles, Pre-requisites for @acronym{ODT} export, OpenDocument Text export
10831@subsection @acronym{ODT} export commands
10832
10833@subsubheading Exporting to @acronym{ODT}
10834@anchor{x-export-to-odt}
10835
10836@cindex region, active
10837@cindex active region
10838@cindex transient-mark-mode
10839@table @kbd
10840@orgcmd{C-c C-e o,org-export-as-odt}
10841@cindex property EXPORT_FILE_NAME
10842
10843Export as OpenDocument Text file.
10844@vindex org-export-odt-preferred-output-format
10845If @code{org-export-odt-preferred-output-format} is specified, automatically
10846convert the exported file to that format.
10847@xref{x-export-to-other-formats,,Automatically exporting to other formats}.
10848
10849For an Org file @file{myfile.org}, the @acronym{ODT} file will be
10850@file{myfile.odt}. The file will be overwritten without warning. If there
10851is an active region,@footnote{This requires @code{transient-mark-mode} to be
10852turned on} only the region will be exported. If the selected region is a
10853single tree,@footnote{To select the current subtree, use @kbd{C-c @@}} the
10854tree head will become the document title. If the tree head entry has, or
10855inherits, an @code{EXPORT_FILE_NAME} property, that name will be used for the
10856export.
10857
10858@orgcmd{C-c C-e O,org-export-as-odt-and-open}
10859Export as OpenDocument Text file and open the resulting file.
10860@vindex org-export-odt-preferred-output-format
10861If @code{org-export-odt-preferred-output-format} is specified, open the
10862converted file instead.
10863@xref{x-export-to-other-formats,,Automatically exporting to other formats}.
10864@end table
10865
10866@subsubheading Automatically exporting to other formats
10867@anchor{x-export-to-other-formats}
10868@vindex org-export-odt-preferred-output-format
10869Very often, you will find yourself exporting to @acronym{ODT} format, only to
10870immediately save the exported document to a different format like @samp{pdf}.
10871In such cases, you will find it convenient to configure a converter
10872(@pxref{Exporting and converting to other formats}) and specify your
10873preferred output format by customizing the variable
10874@code{org-export-odt-preferred-output-format}. This way, the export commands
10875(@pxref{x-export-to-odt,,Exporting to ODT}) can be extended to also export to
10876the preferred format.
10877
10878@node Applying custom styles, Links in @acronym{ODT} export, @acronym{ODT} export commands, OpenDocument Text export
10879@subsection Applying custom styles
10880@cindex styles, custom
10881@cindex template, custom
10882
10883The @acronym{ODT} exporter ships with a set of OpenDocument styles
10884(@pxref{Working with OpenDocument style files}) that ensure a well-formatted
10885output. These factory styles, however, may not cater to your specific
10886tastes. To customize the output, you can either modify the above styles
10887files directly, or generate the required styles using an application like
10888LibreOffice. The latter method is suitable for expert and non-expert
10889users alike, and is described here.
10890
10891@subsubsection Applying custom styles - the easy way
10892
10893@enumerate
10894@item
10895Create a sample @file{example.org} file with the below settings and export it
10896to @acronym{ODT} format.
10897
10898@example
10899#+OPTIONS: H:10 num:t
10900@end example
10901
10902@item
10903Open the above @file{example.odt} using LibreOffice. Use the @file{Stylist}
10904to locate the target styles - these typically have the @samp{Org} prefix -
10905and modify those to your taste. Save the modified file either as an
10906OpenDocument Text (@file{.odt}) or OpenDocument Template (@file{.ott}) file.
10907
10908@item
10909@cindex #+ODT_STYLES_FILE
10910@vindex org-export-odt-styles-file
10911Customize the variable @code{org-export-odt-styles-file} and point it to the
10912newly created file. For additional configuration options
10913@pxref{x-overriding-factory-styles,,Overriding factory styles}.
10914
10915If you would like to choose a style on a per-file basis, you can use the
10916@code{#+ODT_STYLES_FILE} option. A typical setting will look like
10917
10918@example
10919#+ODT_STYLES_FILE: "/path/to/example.ott"
10920@end example
10921
10922or
10923
10924@example
10925#+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png"))
10926@end example
10927
10928@end enumerate
10929
10930@subsubsection Using third-party styles and templates
10931
10932You can use third-party styles and templates for customizing your output.
10933This will produce the desired output only if the template provides all
10934style names that the @samp{ODT} exporter relies on. Unless this condition is
10935met, the output is going to be less than satisfactory. So it is highly
10936recommended that you only work with templates that are directly derived from
10937the factory settings.
10938
10939@node Links in @acronym{ODT} export, Tables in @acronym{ODT} export, Applying custom styles, OpenDocument Text export
10940@subsection Links in @acronym{ODT} export
10941@cindex tables, in DocBook export
10942
10943The @acronym{ODT} exporter creates cross-references (aka bookmarks) for
10944internal links. It creates Internet-style links for all other links.
10945
10946@node Tables in @acronym{ODT} export, Images in @acronym{ODT} export, Links in @acronym{ODT} export, OpenDocument Text export
10947@subsection Tables in @acronym{ODT} export
10948@cindex tables, in DocBook export
10949
10950Export of native Org mode tables (@pxref{Tables}) and simple @file{table.el}
10951tables is supported. However, export of complex @file{table.el} tables -
10952tables that have column or row spans - is not supported. Such tables are
10953stripped from the exported document.
10954
10955By default, a table is exported with top and bottom frames and with
10956rules separating row and column groups (@pxref{Column groups}). If the table
10957specifies alignment and relative width for its columns (@pxref{Column width
10958and alignment}) then these are honored on export.@footnote{The column widths
10959are interpreted as weighted ratios with the default weight being 1}
10960
10961@cindex #+ATTR_ODT
10962If you are not satisfied with the default formatting of tables, you can
10963create custom table styles and associate them with a table using
10964the @code{#+ATTR_ODT} line. @xref{Customizing tables in @acronym{ODT} export}.
10965
10966@node Images in @acronym{ODT} export, Math formatting in @acronym{ODT} export, Tables in @acronym{ODT} export, OpenDocument Text export
10967@subsection Images in @acronym{ODT} export
10968@cindex images, embedding in @acronym{ODT}
10969@cindex embedding images in @acronym{ODT}
10970
10971@subsubheading Embedding images
10972You can embed images within the exported document by providing a link to the
10973desired image file with no link description. For example, to embed
10974@samp{img.png} do either of the following:
10975
10976@example
10977[[file:img.png]]
10978@end example
10979
10980@example
10981[[./img.png]]
10982@end example
10983
10984@subsubheading Embedding clickable images
10985You can create clickable images by providing a link whose description is a
10986link to an image file. For example, to embed a image
10987@file{org-mode-unicorn.png} which when clicked jumps to
10988@uref{http://Orgmode.org} website, do the following
10989
10990@example
10991[[http://orgmode.org][./org-mode-unicorn.png]]
10992@end example
10993
10994@subsubheading Sizing and scaling of embedded images
10995
10996You can control the size and scale of the embedded images using the
10997@code{#+ATTR_ODT} attribute.
10998
10999@vindex org-export-odt-pixels-per-inch
11000Note that the exporter specifies the desired size of the image in the final
11001document in units of centimeters. In order to scale the embedded images, the
11002exporter needs to compute the size of the image. This is done by retrieving
11003the image size in pixels and converting the pixel units to centimeters using
11004@code{org-export-odt-pixels-per-inch}. The default value of this variable is
11005set to @code{display-pixels-per-inch}. You can tweak this variable to
11006achieve the best results.
11007
11008The examples below illustrate the various possibilities.
11009
11010@table @asis
11011
11012@item Explicitly size the image
11013To embed @file{img.png} as a 10 cm x 10 cm image, do the following:
11014
11015@example
11016#+ATTR_ODT: :width 10 :height 10
11017[[./img.png]]
11018@end example
11019
11020@item Scale the image
11021To embed @file{img.png} at half its size, do the following:
11022
11023@example
11024#+ATTR_ODT: :scale 0.5
11025[[./img.png]]
11026@end example
11027
11028@item Scale the image to a specific width
11029To embed @file{img.png} with a width of 10 cm while retaining the original
11030height:width ratio, do the following:
11031
11032@example
11033#+ATTR_ODT: :width 10
11034[[./img.png]]
11035@end example
11036
11037@item Scale the image to a specific height
11038To embed @file{img.png} with a height of 10 cm while retaining the original
11039height:width ratio, do the following
11040
11041@example
11042#+ATTR_ODT: :height 10
11043[[./img.png]]
11044@end example
11045@end table
11046
11047@node Math formatting in @acronym{ODT} export, Literal examples in @acronym{ODT} export, Images in @acronym{ODT} export, OpenDocument Text export
11048@subsection Math formatting in @acronym{ODT} export
11049
11050The @acronym{ODT} exporter has special support for handling math.
11051
11052@menu
11053* Working with @LaTeX{} math snippets:: How to embed @LaTeX{} math fragments
11054* Working with MathML or OpenDocument formula files:: How to embed equations in native format
11055@end menu
11056
11057@node Working with @LaTeX{} math snippets, Working with MathML or OpenDocument formula files, Math formatting in @acronym{ODT} export, Math formatting in @acronym{ODT} export
11058@subsubsection Working with @LaTeX{} math snippets
11059
11060@LaTeX{} math snippets (@pxref{@LaTeX{} fragments}) can be embedded in the ODT
11061document in one of the following ways:
11062
11063@cindex MathML
11064@enumerate
11065@item MathML
11066
11067This option is activated on a per-file basis with
11068
11069@example
11070#+OPTIONS: LaTeX:t
11071@end example
11072
11073With this option, @LaTeX{} fragments are first converted into MathML
11074fragments using an external @LaTeX{}-to-MathML converter program. The
11075resulting MathML fragments are then embedded as an OpenDocument Formula in
11076the exported document.
11077
11078@vindex org-latex-to-mathml-convert-command
11079@vindex org-latex-to-mathml-jar-file
11080
11081You can specify the @LaTeX{}-to-MathML converter by customizing the variables
11082@code{org-latex-to-mathml-convert-command} and
11083@code{org-latex-to-mathml-jar-file}.
11084
11085If you prefer to use @file{MathToWeb}@footnote{See
11086@uref{http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl, MathToWeb}} as your
11087converter, you can configure the above variables as shown below.
11088
11089@lisp
11090(setq org-latex-to-mathml-convert-command
11091 "java -jar %j -unicode -force -df %o %I"
11092 org-latex-to-mathml-jar-file
11093 "/path/to/mathtoweb.jar")
11094@end lisp
11095
11096You can use the following commands to quickly verify the reliability of
11097the @LaTeX{}-to-MathML converter.
11098
11099@table @kbd
11100
11101@item M-x org-export-as-odf
11102Convert a @LaTeX{} math snippet to OpenDocument formula (@file{.odf}) file.
11103
11104@item M-x org-export-as-odf-and-open
11105Convert a @LaTeX{} math snippet to OpenDocument formula (@file{.odf}) file and
11106open the formula file with the system-registered application.
11107@end table
11108
11109@cindex dvipng
11110@item PNG images
11111
11112This option is activated on a per-file basis with
11113
11114@example
11115#+OPTIONS: LaTeX:dvipng
11116@end example
11117
11118With this option, @LaTeX{} fragments are processed into PNG images and the
11119resulting images are embedded in the exported document. This method requires
11120that the @file{dvipng} program be available on your system.
11121@end enumerate
11122
11123@node Working with MathML or OpenDocument formula files, , Working with @LaTeX{} math snippets, Math formatting in @acronym{ODT} export
11124@subsubsection Working with MathML or OpenDocument formula files
11125
11126For various reasons, you may find embedding @LaTeX{} math snippets in an
11127@acronym{ODT} document less than reliable. In that case, you can embed a
11128math equation by linking to its MathML(@file{.mml}) source or its
11129OpenDocument formula (@file{.odf}) file as shown below:
11130
11131@example
11132[[./equation.mml]]
11133@end example
11134
11135or
11136
11137@example
11138[[./equation.odf]]
11139@end example
11140
11141@node Literal examples in @acronym{ODT} export, Advanced topics in @acronym{ODT} export, Math formatting in @acronym{ODT} export, OpenDocument Text export
11142@subsection Literal examples in @acronym{ODT} export
11143
11144Export of literal examples (@pxref{Literal examples}) with full fontification
11145is supported. This feature is enabled by default and is activated
11146automatically if an enhanced version of @file{htmlfontify.el} is available in
11147the @code{load-path}.@footnote{The @file{htmlfontify.el} that ships with
11148standard Emacs <= 24.1 has no support for @acronym{ODT} fontification. A
11149copy of the proposed version is available as an attachment to
11150@url{http://debbugs.gnu.org/cgi/bugreport.cgi?msg=5;filename=htmlfontify.el;att=9;bug=9914,
11151Emacs Bug #9914}.}
11152
11153@vindex org-export-odt-fontify-srcblocks
11154
11155The character styles used for fontification of the literal blocks are
11156auto-generated by the exporter in conjunction with @file{htmlfontify.el}
11157library and need not be included in the default @file{styles.xml} file.
11158These auto-generated styles have the @samp{OrgSrc} prefix and inherit their color
11159based on the face used by Emacs @code{font-lock} library.
11160
11161@vindex org-export-odt-create-custom-styles-for-srcblocks
11162If you prefer to use your own custom styles for fontification and disable
11163their auto-generation altogether, you can do so by customizing the variable
11164@code{org-export-odt-create-custom-styles-for-srcblocks}.
11165
11166You can turn off fontification support for literal examples by customizing
11167the variable @code{org-export-odt-fontify-srcblocks}.
11168
11169
11170@node Advanced topics in @acronym{ODT} export, , Literal examples in @acronym{ODT} export, OpenDocument Text export
11171@subsection Advanced topics in @acronym{ODT} export
11172
11173If you rely heavily on @acronym{ODT} export, you may want to exploit the full
11174set of features that the exporter offers. This section describes features
11175that would be of interest to power users.
11176
11177@menu
11178* Exporting and converting to other formats:: How to produce @samp{pdf} and other formats
11179* Working with OpenDocument style files:: Explore the internals
11180* Creating one-off styles:: How to produce custom highlighting etc
11181* Customizing tables in @acronym{ODT} export:: How to define and use Table templates
11182* Validating OpenDocument XML:: How to debug corrupt OpenDocument files
11183@end menu
11184
11185@node Exporting and converting to other formats, Working with OpenDocument style files, Advanced topics in @acronym{ODT} export, Advanced topics in @acronym{ODT} export
11186@subsubsection Exporting and converting to other formats
11187@cindex convert
11188@cindex doc, docx
11189
11190The @acronym{ODT} exporter adds support for exporting Org outlines to formats
11191that are not supported natively by Org. It also adds support to convert
11192document from one format to another. To use these features, you need to
11193configure a command-line converter. Once a command-line converter is
11194configured you can use it to extend the list of formats to which Org can
11195export. @xref{x-export-to-other-formats,,Automatically exporting to other
11196formats}. You can also use it to perform one-off document conversion as
11197detailed below.
11198
11199@vindex org-export-odt-convert
11200@table @kbd
11201
11202@item M-x org-export-odt-convert
11203Convert an existing document from one format to another as determined by the
11204variable @code{org-export-odt-convert-capabilities}
11205(@pxref{x-odt-converter-capabilities,,Configure converter
11206capabilities}). @strong{Please note} that you can use this command to even
11207convert documents that are produced outside of Org and in other formats than
11208@acronym{ODT} format.
11209@end table
11210
11211@subsubheading Pre-configured converters
11212
11213@cindex converter
11214The @acronym{ODT} exporter supports two converters out of the box:
11215
11216@enumerate
11217
11218@cindex @file{unoconv}
11219@item @file{unoconv}
11220
11221This converter is available as an installable package in your favorite
11222distribution.
11223
11224@cindex @file{BasicODConverter}
11225@item @file{BasicODConverter}
11226
11227@vindex org-odt-data-dir
11228This converter is distributed as a LibreOffice extension and can be found in
11229your Org distribution. See the subdirectory pointed to by the variable
11230@code{org-odt-data-dir}.
11231
11232@end enumerate
11233
11234@subsubheading Installing a new converter
11235If you prefer to use a converter other than the two mentioned above, then you
11236may have to do additional configuration. You can proceed as follows:
11237
11238@enumerate
11239@item Register the converter
11240
11241@vindex org-export-odt-convert-processes
11242Name your converter and add it to the list of known converters by customizing
11243the variable @code{org-export-odt-convert-processes}. Also specify how the
11244converter can be invoked via command-line to effect the conversion.
11245
11246@item Configure its capabilities
11247@vindex org-export-odt-convert-capabilities
11248
11249@anchor{x-odt-converter-capabilities}
11250
11251Specify the set of formats the converter can handle by customizing the
11252variable @code{org-export-odt-convert-capabilities}. Use the default value
11253for this variable as a guide for configuring your converter. As suggested by
11254the default setting, you can specify the full set of formats supported by the
11255converter and not limit yourself to specifying formats that are related to
11256just the OpenDocument Text format.
11257
11258@item Choose the converter
11259
11260@vindex org-export-odt-convert-process
11261Select the newly added converter as the preferred one by customizing the
11262variable @code{org-export-odt-convert-process}.
11263@end enumerate
11264
11265@node Working with OpenDocument style files, Creating one-off styles, Exporting and converting to other formats, Advanced topics in @acronym{ODT} export
11266@subsubsection Working with OpenDocument style files
11267@cindex styles, custom
11268@cindex template, custom
11269
11270This section explores the internals of the @acronym{ODT} exporter and the
11271means by which it produces styled documents. Read this section if you are
11272interested in exploring the automatic and custom OpenDocument styles used by
11273the exporter.
11274
11275@anchor{x-factory-styles}
11276@subsubheading Factory styles
11277
11278The @acronym{ODT} exporter relies on two files for generating its output.
11279These files are bundled with the distribution under the directory pointed to
11280by the variable @code{org-odt-styles-dir}. The two files are:
11281
11282@itemize
11283@anchor{x-orgodtstyles-xml}
11284@item
11285@file{OrgOdtStyles.xml}
11286
11287This file contributes to the @file{styles.xml} file of the final @samp{ODT}
11288document. This file gets modified for the following purposes:
11289@enumerate
11290
11291@item
11292To control outline numbering based on user settings.
11293
11294@item
11295To add styles generated by @file{htmlfontify.el} for fontification of code
11296blocks.
11297@end enumerate
11298
11299@anchor{x-orgodtcontenttemplate-xml}
11300@item
11301@file{OrgOdtContentTemplate.xml}
11302
11303This file contributes to the @file{content.xml} file of the final @samp{ODT}
11304document. The contents of the Org outline are inserted between the
11305@samp{<office:text>}@dots{}@samp{</office:text>} elements of this file.
11306
11307Apart from serving as a template file for the final @file{content.xml}, the
11308file serves the following purposes:
11309@enumerate
11310
11311@item
11312It contains automatic styles for formatting of tables which are referenced by
11313the exporter.
11314
11315@item
11316It contains @samp{<text:sequence-decl>}@dots{}@samp{</text:sequence-decl>}
11317elements that control how various entities - tables, images, equations etc -
11318are numbered.
11319@end enumerate
11320@end itemize
11321
11322@anchor{x-overriding-factory-styles}
11323@subsubheading Overriding factory styles
11324The following two variables control the location from which the @acronym{ODT}
11325exporter picks up the custom styles and content template files. You can
11326customize these variables to override the factory styles used by the
11327exporter.
11328
11329@itemize
11330@anchor{x-org-export-odt-styles-file}
11331@item
11332@code{org-export-odt-styles-file}
11333
11334Use this variable to specify the @file{styles.xml} that will be used in the
11335final output. You can specify one of the following values:
11336
11337@enumerate
11338@item A @file{styles.xml} file
11339
11340Use this file instead of the default @file{styles.xml}
11341
11342@item A @file{.odt} or @file{.ott} file
11343
11344Use the @file{styles.xml} contained in the specified OpenDocument Text or
11345Template file
11346
11347@item A @file{.odt} or @file{.ott} file and a subset of files contained within them
11348
11349Use the @file{styles.xml} contained in the specified OpenDocument Text or
11350Template file. Additionally extract the specified member files and embed
11351those within the final @samp{ODT} document.
11352
11353Use this option if the @file{styles.xml} file references additional files
11354like header and footer images.
11355
11356@item @code{nil}
11357
11358Use the default @file{styles.xml}
11359@end enumerate
11360
11361@anchor{x-org-export-odt-content-template-file}
11362@item
11363@code{org-export-odt-content-template-file}
11364
11365Use this variable to specify the blank @file{content.xml} that will be used
11366in the final output.
11367@end itemize
11368
11369@node Creating one-off styles, Customizing tables in @acronym{ODT} export, Working with OpenDocument style files, Advanced topics in @acronym{ODT} export
11370@subsubsection Creating one-off styles
11371
11372There are times when you would want one-off formatting in the exported
11373document. You can achieve this by embedding raw OpenDocument XML in the Org
11374file. The use of this feature is better illustrated with couple of examples.
11375
11376@enumerate
11377@item Embedding ODT tags as part of regular text
11378
11379You can include simple OpenDocument tags by prefixing them with
11380@samp{@@}. For example, to highlight a region of text do the following:
11381
11382@example
11383@@<text:span text:style-name="Highlight">This is a
11384highlighted text@@</text:span>. But this is a
11385regular text.
11386@end example
11387
11388@strong{Hint:} To see the above example in action, edit your
11389@file{styles.xml}(@pxref{x-orgodtstyles-xml,,Factory styles}) and add a
11390custom @samp{Highlight} style as shown below.
11391
11392@example
11393<style:style style:name="Highlight" style:family="text">
11394 <style:text-properties fo:background-color="#ff0000"/>
11395</style:style>
11396@end example
11397
11398@item Embedding a one-line OpenDocument XML
11399
11400You can add a simple OpenDocument one-liner using the @code{#+ODT:}
11401directive. For example, to force a page break do the following:
11402
11403@example
11404#+ODT: <text:p text:style-name="PageBreak"/>
11405@end example
11406
11407@strong{Hint:} To see the above example in action, edit your
11408@file{styles.xml}(@pxref{x-orgodtstyles-xml,,Factory styles}) and add a
11409custom @samp{PageBreak} style as shown below.
11410
11411@example
11412<style:style style:name="PageBreak" style:family="paragraph"
11413 style:parent-style-name="Text_20_body">
11414 <style:paragraph-properties fo:break-before="page"/>
11415</style:style>
11416@end example
11417
11418@item Embedding a block of OpenDocument XML
11419
11420You can add a large block of OpenDocument XML using the
11421@code{#+BEGIN_ODT}@dots{}@code{#+END_ODT} construct.
11422
11423For example, to create a one-off paragraph that uses bold text, do the
11424following:
11425
11426@example
11427#+BEGIN_ODT
11428<text:p text:style-name="Text_20_body_20_bold">
11429This paragraph is specially formatted and uses bold text.
11430</text:p>
11431#+END_ODT
11432@end example
11433
11434@end enumerate
11435
11436@node Customizing tables in @acronym{ODT} export, Validating OpenDocument XML, Creating one-off styles, Advanced topics in @acronym{ODT} export
11437@subsubsection Customizing tables in @acronym{ODT} export
11438@cindex tables, in ODT export
11439
11440@cindex #+ATTR_ODT
11441You can override the default formatting of the table by specifying a custom
11442table style with the @code{#+ATTR_ODT} line. For a discussion on default
11443formatting of tables @pxref{Tables in @acronym{ODT} export}.
11444
11445This feature closely mimics the way table templates are defined in the
11446OpenDocument-v1.2
11447specification.@footnote{@url{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html,
11448OpenDocument-v1.2 Specification}}
11449
11450
11451
11452@subsubheading Custom table styles - an illustration
11453
11454To have a quick preview of this feature, install the below setting and export
11455the table that follows.
11456
11457@lisp
11458(setq org-export-odt-table-styles
11459 (append org-export-odt-table-styles
11460 '(("TableWithHeaderRowAndColumn" "Custom"
11461 ((use-first-row-styles . t)
11462 (use-first-column-styles . t)))
11463 ("TableWithFirstRowandLastRow" "Custom"
11464 ((use-first-row-styles . t)
11465 (use-last-row-styles . t))))))
11466@end lisp
11467
11468@example
11469#+ATTR_ODT: TableWithHeaderRowAndColumn
11470| Name | Phone | Age |
11471| Peter | 1234 | 17 |
11472| Anna | 4321 | 25 |
11473@end example
11474
11475In the above example, you used a template named @samp{Custom} and installed
11476two table styles with the names @samp{TableWithHeaderRowAndColumn} and
11477@samp{TableWithFirstRowandLastRow}. (@strong{Important:} The OpenDocument
11478styles needed for producing the above template have been pre-defined for you.
11479These styles are available under the section marked @samp{Custom Table
11480Template} in @file{OrgOdtContentTemplate.xml}
11481(@pxref{x-orgodtcontenttemplate-xml,,Factory styles}). If you need
11482additional templates you have to define these styles yourselves.
11483
11484@subsubheading Custom table styles - the nitty-gritty
11485To use this feature proceed as follows:
11486
11487@enumerate
11488@item
11489Create a table template@footnote{See the @code{<table:table-template>}
11490element of the OpenDocument-v1.2 specification}
11491
11492A table template is nothing but a set of @samp{table-cell} and
11493@samp{paragraph} styles for each of the following table cell categories:
11494
11495@itemize @minus
11496@item Body
11497@item First column
11498@item Last column
11499@item First row
11500@item Last row
11501@item Even row
11502@item Odd row
11503@item Even column
11504@item Odd Column
11505@end itemize
11506
11507The names for the above styles must be chosen based on the name of the table
11508template using a well-defined convention.
11509
11510The naming convention is better illustrated with an example. For a table
11511template with the name @samp{Custom}, the needed style names are listed in
11512the following table.
11513
11514@multitable {Table cell type} {CustomEvenColumnTableCell} {CustomEvenColumnTableParagraph}
11515@headitem Table cell type
11516@tab @code{table-cell} style
11517@tab @code{paragraph} style
11518@item
11519@tab
11520@tab
11521@item Body
11522@tab @samp{CustomTableCell}
11523@tab @samp{CustomTableParagraph}
11524@item First column
11525@tab @samp{CustomFirstColumnTableCell}
11526@tab @samp{CustomFirstColumnTableParagraph}
11527@item Last column
11528@tab @samp{CustomLastColumnTableCell}
11529@tab @samp{CustomLastColumnTableParagraph}
11530@item First row
11531@tab @samp{CustomFirstRowTableCell}
11532@tab @samp{CustomFirstRowTableParagraph}
11533@item Last row
11534@tab @samp{CustomLastRowTableCell}
11535@tab @samp{CustomLastRowTableParagraph}
11536@item Even row
11537@tab @samp{CustomEvenRowTableCell}
11538@tab @samp{CustomEvenRowTableParagraph}
11539@item Odd row
11540@tab @samp{CustomOddRowTableCell}
11541@tab @samp{CustomOddRowTableParagraph}
11542@item Even column
11543@tab @samp{CustomEvenColumnTableCell}
11544@tab @samp{CustomEvenColumnTableParagraph}
11545@item Odd column
11546@tab @samp{CustomOddColumnTableCell}
11547@tab @samp{CustomOddColumnTableParagraph}
11548@end multitable
11549
11550To create a table template with the name @samp{Custom}, define the above
11551styles in the
11552@code{<office:automatic-styles>}...@code{</office:automatic-styles>} element
11553of the content template file (@pxref{x-orgodtcontenttemplate-xml,,Factory
11554styles}).
11555
11556@item
11557Define a table style@footnote{See the attributes @code{table:template-name},
11558@code{table:use-first-row-styles}, @code{table:use-last-row-styles},
11559@code{table:use-first-column-styles}, @code{table:use-last-column-styles},
11560@code{table:use-banding-rows-styles}, and
11561@code{table:use-banding-column-styles} of the @code{<table:table>} element in
11562the OpenDocument-v1.2 specification}
11563
11564@vindex org-export-odt-table-styles
11565To define a table style, create an entry for the style in the variable
11566@code{org-export-odt-table-styles} and specify the following:
11567
11568@itemize @minus
11569@item the name of the table template created in step (1)
11570@item the set of cell styles in that template that are to be activated
11571@end itemize
11572
11573For example, the entry below defines two different table styles
11574@samp{TableWithHeaderRowsAndColumns} and @samp{TableWithHeaderColumns} based
11575on the same template @samp{Custom}. The styles achieve their intended effect
11576by selectively activating the individual cell styles in that template.
11577
11578@lisp
11579(setq org-export-odt-table-styles
11580 (append org-export-odt-table-styles
11581 '(("TableWithHeaderRowAndColumn" "Custom"
11582 ((use-first-row-styles . t)
11583 (use-first-column-styles . t)))
11584 ("TableWithFirstRowandLastRow" "Custom"
11585 ((use-first-row-styles . t)
11586 (use-last-row-styles . t))))))
11587@end lisp
11588
11589@item
11590Associate a table with the table style
11591
11592To do this, specify the table style created in step (2) as part of
11593the @code{ATTR_ODT} line as shown below.
11594
11595@example
11596#+ATTR_ODT: TableWithHeaderRowAndColumn
11597| Name | Phone | Age |
11598| Peter | 1234 | 17 |
11599| Anna | 4321 | 25 |
11600@end example
11601@end enumerate
11602
11603@node Validating OpenDocument XML, , Customizing tables in @acronym{ODT} export, Advanced topics in @acronym{ODT} export
11604@subsubsection Validating OpenDocument XML
11605
11606Occasionally, you will discover that the document created by the
11607@acronym{ODT} exporter cannot be opened by your favorite application. One of
11608the common reasons for this is that the @file{.odt} file is corrupt. In such
11609cases, you may want to validate the document against the OpenDocument RELAX
11610NG Compact Syntax (RNC) schema.
11611
11612For de-compressing the @file{.odt} file@footnote{@file{.odt} files are
11613nothing but @samp{zip} archives}: @inforef{File Archives,,emacs}. For
11614general help with validation (and schema-sensitive editing) of XML files:
11615@inforef{Introduction,,nxml-mode}.
11616
11617@vindex org-export-odt-schema-dir
11618If you have ready access to OpenDocument @file{.rnc} files and the needed
11619schema-locating rules in a single folder, you can customize the variable
11620@code{org-export-odt-schema-dir} to point to that directory. The
11621@acronym{ODT} exporter will take care of updating the
11622@code{rng-schema-locating-files} for you.
11623
11624@c end opendocument
11625
11626@node TaskJuggler export, Freemind export, OpenDocument Text export, Exporting
10354@section TaskJuggler export 11627@section TaskJuggler export
10355@cindex TaskJuggler export 11628@cindex TaskJuggler export
10356@cindex Project management 11629@cindex Project management
@@ -10361,12 +11634,12 @@ resource assignments based on the project outline and the constraints that
10361you have provided. 11634you have provided.
10362 11635
10363The TaskJuggler exporter is a bit different from other exporters, such as the 11636The TaskJuggler exporter is a bit different from other exporters, such as the
10364HTML and LaTeX exporters for example, in that it does not export all the 11637@code{HTML} and @LaTeX{} exporters for example, in that it does not export all the
10365nodes of a document or strictly follow the order of the nodes in the 11638nodes of a document or strictly follow the order of the nodes in the
10366document. 11639document.
10367 11640
10368Instead the TaskJuggler exporter looks for a tree that defines the tasks and 11641Instead the TaskJuggler exporter looks for a tree that defines the tasks and
10369a optionally tree that defines the resources for this project. It then 11642a optionally tree that defines the resources for this project. It then
10370creates a TaskJuggler file based on these trees and the attributes defined in 11643creates a TaskJuggler file based on these trees and the attributes defined in
10371all the nodes. 11644all the nodes.
10372 11645
@@ -10383,30 +11656,30 @@ Export as TaskJuggler file and then open the file with TaskJugglerUI.
10383@subsection Tasks 11656@subsection Tasks
10384 11657
10385@vindex org-export-taskjuggler-project-tag 11658@vindex org-export-taskjuggler-project-tag
10386Create your tasks as you usually do with Org-mode. Assign efforts to each 11659Create your tasks as you usually do with Org mode. Assign efforts to each
10387task using properties (it's easiest to do this in the column view). You 11660task using properties (it is easiest to do this in the column view). You
10388should end up with something similar to the example by Peter Jones in 11661should end up with something similar to the example by Peter Jones in
10389@url{http://www.contextualdevelopment.com/static/artifacts/articles/2008/project-planning/project-planning.org}. 11662@url{http://www.contextualdevelopment.com/static/artifacts/articles/2008/project-planning/project-planning.org}.
10390Now mark the top node of your tasks with a tag named 11663Now mark the top node of your tasks with a tag named
10391@code{:taskjuggler_project:} (or whatever you customized 11664@code{:taskjuggler_project:} (or whatever you customized
10392@code{org-export-taskjuggler-project-tag} to). You are now ready to export 11665@code{org-export-taskjuggler-project-tag} to). You are now ready to export
10393the project plan with @kbd{C-c C-e J} which will export the project plan and 11666the project plan with @kbd{C-c C-e J} which will export the project plan and
10394open a gantt chart in TaskJugglerUI. 11667open a gantt chart in TaskJugglerUI.
10395 11668
10396@subsection Resources 11669@subsection Resources
10397 11670
10398@vindex org-export-taskjuggler-resource-tag 11671@vindex org-export-taskjuggler-resource-tag
10399Next you can define resources and assign those to work on specific tasks. You 11672Next you can define resources and assign those to work on specific tasks. You
10400can group your resources hierarchically. Tag the top node of the resources 11673can group your resources hierarchically. Tag the top node of the resources
10401with @code{:taskjuggler_resource:} (or whatever you customized 11674with @code{:taskjuggler_resource:} (or whatever you customized
10402@code{org-export-taskjuggler-resource-tag} to). You can optionally assign an 11675@code{org-export-taskjuggler-resource-tag} to). You can optionally assign an
10403identifier (named @samp{resource_id}) to the resources (using the standard 11676identifier (named @samp{resource_id}) to the resources (using the standard
10404Org properties commands, @pxref{Property syntax}) or you can let the exporter 11677Org properties commands, @pxref{Property syntax}) or you can let the exporter
10405generate identifiers automatically (the exporter picks the first word of the 11678generate identifiers automatically (the exporter picks the first word of the
10406headline as the identifier as long as it is unique---see the documentation of 11679headline as the identifier as long as it is unique---see the documentation of
10407@code{org-taskjuggler-get-unique-id}). Using that identifier you can then 11680@code{org-taskjuggler-get-unique-id}). Using that identifier you can then
10408allocate resources to tasks. This is again done with the @samp{allocate} 11681allocate resources to tasks. This is again done with the @samp{allocate}
10409property on the tasks. Do this in column view or when on the task type 11682property on the tasks. Do this in column view or when on the task type
10410@kbd{C-c C-x p allocate @key{RET} <resource_id> @key{RET}}. 11683@kbd{C-c C-x p allocate @key{RET} <resource_id> @key{RET}}.
10411 11684
10412Once the allocations are done you can again export to TaskJuggler and check 11685Once the allocations are done you can again export to TaskJuggler and check
@@ -10415,9 +11688,9 @@ time.
10415 11688
10416@subsection Export of properties 11689@subsection Export of properties
10417 11690
10418The exporter also takes TODO state information into consideration, i.e. if a 11691The exporter also takes TODO state information into consideration, i.e.@: if a
10419task is marked as done it will have the corresponding attribute in 11692task is marked as done it will have the corresponding attribute in
10420TaskJuggler (@samp{complete 100}). Also it will export any property on a task 11693TaskJuggler (@samp{complete 100}). Also it will export any property on a task
10421resource or resource node which is known to TaskJuggler, such as 11694resource or resource node which is known to TaskJuggler, such as
10422@samp{limits}, @samp{vacation}, @samp{shift}, @samp{booking}, 11695@samp{limits}, @samp{vacation}, @samp{shift}, @samp{booking},
10423@samp{efficiency}, @samp{journalentry}, @samp{rate} for resources or 11696@samp{efficiency}, @samp{journalentry}, @samp{rate} for resources or
@@ -10430,12 +11703,12 @@ resource or resource node which is known to TaskJuggler, such as
10430The exporter will handle dependencies that are defined in the tasks either 11703The exporter will handle dependencies that are defined in the tasks either
10431with the @samp{ORDERED} attribute (@pxref{TODO dependencies}), with the 11704with the @samp{ORDERED} attribute (@pxref{TODO dependencies}), with the
10432@samp{BLOCKER} attribute (see @file{org-depend.el}) or alternatively with a 11705@samp{BLOCKER} attribute (see @file{org-depend.el}) or alternatively with a
10433@samp{depends} attribute. Both the @samp{BLOCKER} and the @samp{depends} 11706@samp{depends} attribute. Both the @samp{BLOCKER} and the @samp{depends}
10434attribute can be either @samp{previous-sibling} or a reference to an 11707attribute can be either @samp{previous-sibling} or a reference to an
10435identifier (named @samp{task_id}) which is defined for another task in the 11708identifier (named @samp{task_id}) which is defined for another task in the
10436project. @samp{BLOCKER} and the @samp{depends} attribute can define multiple 11709project. @samp{BLOCKER} and the @samp{depends} attribute can define multiple
10437dependencies separated by either space or comma. You can also specify 11710dependencies separated by either space or comma. You can also specify
10438optional attributes on the dependency by simply appending it. The following 11711optional attributes on the dependency by simply appending it. The following
10439examples should illustrate this: 11712examples should illustrate this:
10440 11713
10441@example 11714@example
@@ -10451,15 +11724,15 @@ examples should illustrate this:
10451 :END: 11724 :END:
10452** Markup Guidelines 11725** Markup Guidelines
10453 :PROPERTIES: 11726 :PROPERTIES:
10454 :Effort: 2.0 11727 :Effort: 2d
10455 :END: 11728 :END:
10456** Workflow Guidelines 11729** Workflow Guidelines
10457 :PROPERTIES: 11730 :PROPERTIES:
10458 :Effort: 2.0 11731 :Effort: 2d
10459 :END: 11732 :END:
10460* Presentation 11733* Presentation
10461 :PROPERTIES: 11734 :PROPERTIES:
10462 :Effort: 2.0 11735 :Effort: 2d
10463 :BLOCKER: training_material @{ gapduration 1d @} preparation 11736 :BLOCKER: training_material @{ gapduration 1d @} preparation
10464 :END: 11737 :END:
10465@end example 11738@end example
@@ -10467,16 +11740,16 @@ examples should illustrate this:
10467@subsection Reports 11740@subsection Reports
10468 11741
10469@vindex org-export-taskjuggler-default-reports 11742@vindex org-export-taskjuggler-default-reports
10470TaskJuggler can produce many kinds of reports (e.g. gantt chart, resource 11743TaskJuggler can produce many kinds of reports (e.g.@: gantt chart, resource
10471allocation, etc). The user defines what kind of reports should be generated 11744allocation, etc). The user defines what kind of reports should be generated
10472for a project in the TaskJuggler file. The exporter will automatically insert 11745for a project in the TaskJuggler file. The exporter will automatically insert
10473some default reports in the file. These defaults are defined in 11746some default reports in the file. These defaults are defined in
10474@code{org-export-taskjuggler-default-reports}. They can be modified using 11747@code{org-export-taskjuggler-default-reports}. They can be modified using
10475customize along with a number of other options. For a more complete list, see 11748customize along with a number of other options. For a more complete list, see
10476@kbd{M-x customize-group @key{RET} org-export-taskjuggler @key{RET}}. 11749@kbd{M-x customize-group @key{RET} org-export-taskjuggler @key{RET}}.
10477 11750
10478For more information and examples see the Org-taskjuggler tutorial at 11751For more information and examples see the Org-taskjuggler tutorial at
10479@uref{http://orgmode.org/worg/org-tutorials/org-taskjuggler.php}. 11752@uref{http://orgmode.org/worg/org-tutorials/org-taskjuggler.html}.
10480 11753
10481@node Freemind export, XOXO export, TaskJuggler export, Exporting 11754@node Freemind export, XOXO export, TaskJuggler export, Exporting
10482@section Freemind export 11755@section Freemind export
@@ -10487,20 +11760,22 @@ The Freemind exporter was written by Lennart Borgman.
10487 11760
10488@table @kbd 11761@table @kbd
10489@orgcmd{C-c C-e m,org-export-as-freemind} 11762@orgcmd{C-c C-e m,org-export-as-freemind}
10490Export as Freemind mind map @file{myfile.mm}. 11763Export as Freemind mind map. For an Org file @file{myfile.org}, the Freemind
11764file will be @file{myfile.mm}.
10491@end table 11765@end table
10492 11766
10493@node XOXO export, iCalendar export, Freemind export, Exporting 11767@node XOXO export, iCalendar export, Freemind export, Exporting
10494@section XOXO export 11768@section XOXO export
10495@cindex XOXO export 11769@cindex XOXO export
10496 11770
10497Org-mode contains an exporter that produces XOXO-style output. 11771Org mode contains an exporter that produces XOXO-style output.
10498Currently, this exporter only handles the general outline structure and 11772Currently, this exporter only handles the general outline structure and
10499does not interpret any additional Org-mode features. 11773does not interpret any additional Org mode features.
10500 11774
10501@table @kbd 11775@table @kbd
10502@orgcmd{C-c C-e x,org-export-as-xoxo} 11776@orgcmd{C-c C-e x,org-export-as-xoxo}
10503Export as XOXO file @file{myfile.html}. 11777Export as XOXO file. For an Org file @file{myfile.org}, the XOXO file will be
11778@file{myfile.html}.
10504@orgkey{C-c C-e v x} 11779@orgkey{C-c C-e v x}
10505Export only the visible part of the document. 11780Export only the visible part of the document.
10506@end table 11781@end table
@@ -10514,10 +11789,10 @@ Export only the visible part of the document.
10514@vindex org-icalendar-use-scheduled 11789@vindex org-icalendar-use-scheduled
10515@vindex org-icalendar-categories 11790@vindex org-icalendar-categories
10516@vindex org-icalendar-alarm-time 11791@vindex org-icalendar-alarm-time
10517Some people use Org-mode for keeping track of projects, but still prefer a 11792Some people use Org mode for keeping track of projects, but still prefer a
10518standard calendar application for anniversaries and appointments. In this 11793standard calendar application for anniversaries and appointments. In this
10519case it can be useful to show deadlines and other time-stamped items in Org 11794case it can be useful to show deadlines and other time-stamped items in Org
10520files in the calendar application. Org-mode can export calendar information 11795files in the calendar application. Org mode can export calendar information
10521in the standard iCalendar format. If you also want to have TODO entries 11796in the standard iCalendar format. If you also want to have TODO entries
10522included in the export, configure the variable 11797included in the export, configure the variable
10523@code{org-icalendar-include-todo}. Plain timestamps are exported as VEVENT, 11798@code{org-icalendar-include-todo}. Plain timestamps are exported as VEVENT,
@@ -10607,7 +11882,7 @@ and many other properties of a project.
10607* Sources and destinations:: From here to there 11882* Sources and destinations:: From here to there
10608* Selecting files:: What files are part of the project? 11883* Selecting files:: What files are part of the project?
10609* Publishing action:: Setting the function doing the publishing 11884* Publishing action:: Setting the function doing the publishing
10610* Publishing options:: Tweaking HTML export 11885* Publishing options:: Tweaking HTML/@LaTeX{} export
10611* Publishing links:: Which links keep working after publishing? 11886* Publishing links:: Which links keep working after publishing?
10612* Sitemap:: Generating a list of all pages 11887* Sitemap:: Generating a list of all pages
10613* Generating an index:: An index that reaches across pages 11888* Generating an index:: An index that reaches across pages
@@ -10624,8 +11899,8 @@ variable, called @code{org-publish-project-alist}. Each element of the list
10624configures one project, and may be in one of the two following forms: 11899configures one project, and may be in one of the two following forms:
10625 11900
10626@lisp 11901@lisp
10627 ("project-name" :property value :property value ...) 11902 ("project-name" :property value :property value ...)
10628 @r{i.e. a well-formed property list with alternating keys and values} 11903 @r{i.e.@: a well-formed property list with alternating keys and values}
10629@r{or} 11904@r{or}
10630 ("project-name" :components ("project-name" "project-name" ...)) 11905 ("project-name" :components ("project-name" "project-name" ...))
10631 11906
@@ -10762,6 +12037,8 @@ respective variable for details.
10762@vindex org-export-with-drawers 12037@vindex org-export-with-drawers
10763@vindex org-export-with-tags 12038@vindex org-export-with-tags
10764@vindex org-export-with-todo-keywords 12039@vindex org-export-with-todo-keywords
12040@vindex org-export-with-tasks
12041@vindex org-export-with-done-tasks
10765@vindex org-export-with-priority 12042@vindex org-export-with-priority
10766@vindex org-export-with-TeX-macros 12043@vindex org-export-with-TeX-macros
10767@vindex org-export-with-LaTeX-fragments 12044@vindex org-export-with-LaTeX-fragments
@@ -10769,11 +12046,13 @@ respective variable for details.
10769@vindex org-export-with-fixed-width 12046@vindex org-export-with-fixed-width
10770@vindex org-export-with-timestamps 12047@vindex org-export-with-timestamps
10771@vindex org-export-author-info 12048@vindex org-export-author-info
10772@vindex org-export-email 12049@vindex org-export-email-info
10773@vindex org-export-creator-info 12050@vindex org-export-creator-info
12051@vindex org-export-time-stamp-file
10774@vindex org-export-with-tables 12052@vindex org-export-with-tables
10775@vindex org-export-highlight-first-table-line 12053@vindex org-export-highlight-first-table-line
10776@vindex org-export-html-style-include-default 12054@vindex org-export-html-style-include-default
12055@vindex org-export-html-style-include-scripts
10777@vindex org-export-html-style 12056@vindex org-export-html-style
10778@vindex org-export-html-style-extra 12057@vindex org-export-html-style-extra
10779@vindex org-export-html-link-org-files-as-html 12058@vindex org-export-html-link-org-files-as-html
@@ -10785,8 +12064,6 @@ respective variable for details.
10785@vindex org-export-publishing-directory 12064@vindex org-export-publishing-directory
10786@vindex org-export-html-preamble 12065@vindex org-export-html-preamble
10787@vindex org-export-html-postamble 12066@vindex org-export-html-postamble
10788@vindex org-export-html-auto-preamble
10789@vindex org-export-html-auto-postamble
10790@vindex user-full-name 12067@vindex user-full-name
10791@vindex user-mail-address 12068@vindex user-mail-address
10792@vindex org-export-select-tags 12069@vindex org-export-select-tags
@@ -10810,6 +12087,7 @@ respective variable for details.
10810@item @code{:drawers} @tab @code{org-export-with-drawers} 12087@item @code{:drawers} @tab @code{org-export-with-drawers}
10811@item @code{:tags} @tab @code{org-export-with-tags} 12088@item @code{:tags} @tab @code{org-export-with-tags}
10812@item @code{:todo-keywords} @tab @code{org-export-with-todo-keywords} 12089@item @code{:todo-keywords} @tab @code{org-export-with-todo-keywords}
12090@item @code{:tasks} @tab @code{org-export-with-tasks}
10813@item @code{:priority} @tab @code{org-export-with-priority} 12091@item @code{:priority} @tab @code{org-export-with-priority}
10814@item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros} 12092@item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
10815@item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments} 12093@item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
@@ -10817,28 +12095,27 @@ respective variable for details.
10817@item @code{:skip-before-1st-heading} @tab @code{org-export-skip-text-before-1st-heading} 12095@item @code{:skip-before-1st-heading} @tab @code{org-export-skip-text-before-1st-heading}
10818@item @code{:fixed-width} @tab @code{org-export-with-fixed-width} 12096@item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
10819@item @code{:timestamps} @tab @code{org-export-with-timestamps} 12097@item @code{:timestamps} @tab @code{org-export-with-timestamps}
12098@item @code{:author} @tab @code{user-full-name}
12099@item @code{:email} @tab @code{user-mail-address} : @code{addr;addr;..}
10820@item @code{:author-info} @tab @code{org-export-author-info} 12100@item @code{:author-info} @tab @code{org-export-author-info}
10821@item @code{:email-info} @tab @code{org-export-email-info} 12101@item @code{:email-info} @tab @code{org-export-email-info}
10822@item @code{:creator-info} @tab @code{org-export-creator-info} 12102@item @code{:creator-info} @tab @code{org-export-creator-info}
10823@item @code{:tables} @tab @code{org-export-with-tables} 12103@item @code{:tables} @tab @code{org-export-with-tables}
10824@item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line} 12104@item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
10825@item @code{:style-include-default} @tab @code{org-export-html-style-include-default} 12105@item @code{:style-include-default} @tab @code{org-export-html-style-include-default}
12106@item @code{:style-include-scripts} @tab @code{org-export-html-style-include-scripts}
10826@item @code{:style} @tab @code{org-export-html-style} 12107@item @code{:style} @tab @code{org-export-html-style}
10827@item @code{:style-extra} @tab @code{org-export-html-style-extra} 12108@item @code{:style-extra} @tab @code{org-export-html-style-extra}
10828@item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html} 12109@item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
10829@item @code{:inline-images} @tab @code{org-export-html-inline-images} 12110@item @code{:inline-images} @tab @code{org-export-html-inline-images}
10830@item @code{:html-extension} @tab @code{org-export-html-extension} 12111@item @code{:html-extension} @tab @code{org-export-html-extension}
12112@item @code{:html-preamble} @tab @code{org-export-html-preamble}
12113@item @code{:html-postamble} @tab @code{org-export-html-postamble}
10831@item @code{:xml-declaration} @tab @code{org-export-html-xml-declaration} 12114@item @code{:xml-declaration} @tab @code{org-export-html-xml-declaration}
10832@item @code{:html-table-tag} @tab @code{org-export-html-table-tag} 12115@item @code{:html-table-tag} @tab @code{org-export-html-table-tag}
10833@item @code{:expand-quoted-html} @tab @code{org-export-html-expand} 12116@item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
10834@item @code{:timestamp} @tab @code{org-export-html-with-timestamp} 12117@item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
10835@item @code{:publishing-directory} @tab @code{org-export-publishing-directory} 12118@item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
10836@item @code{:preamble} @tab @code{org-export-html-preamble}
10837@item @code{:postamble} @tab @code{org-export-html-postamble}
10838@item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
10839@item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
10840@item @code{:author} @tab @code{user-full-name}
10841@item @code{:email} @tab @code{user-mail-address} : @code{addr;addr;..}
10842@item @code{:select-tags} @tab @code{org-export-select-tags} 12119@item @code{:select-tags} @tab @code{org-export-select-tags}
10843@item @code{:exclude-tags} @tab @code{org-export-exclude-tags} 12120@item @code{:exclude-tags} @tab @code{org-export-exclude-tags}
10844@item @code{:latex-image-options} @tab @code{org-export-latex-image-default-option} 12121@item @code{:latex-image-options} @tab @code{org-export-latex-image-default-option}
@@ -10846,8 +12123,11 @@ respective variable for details.
10846 12123
10847Most of the @code{org-export-with-*} variables have the same effect in 12124Most of the @code{org-export-with-*} variables have the same effect in
10848both HTML and @LaTeX{} exporters, except for @code{:TeX-macros} and 12125both HTML and @LaTeX{} exporters, except for @code{:TeX-macros} and
10849@code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the 12126@code{:LaTeX-fragments} options, respectively @code{nil} and @code{t} in the
10850@LaTeX{} export. 12127@LaTeX{} export. See @code{org-export-plist-vars} to check this list of
12128options.
12129
12130
10851 12131
10852@vindex org-publish-project-alist 12132@vindex org-publish-project-alist
10853When a property is given a value in @code{org-publish-project-alist}, 12133When a property is given a value in @code{org-publish-project-alist},
@@ -10869,9 +12149,9 @@ to link to that, use an @code{http:} link instead of a @code{file:} link,
10869because @code{file:} links are converted to link to the corresponding 12149because @code{file:} links are converted to link to the corresponding
10870@file{html} file. 12150@file{html} file.
10871 12151
10872You may also link to related files, such as images. Provided you are careful 12152You may also link to related files, such as images. Provided you are careful
10873with relative file names, and provided you have also configured Org to upload 12153with relative file names, and provided you have also configured Org to upload
10874the related files, these links will work too. See @ref{Complex example}, for 12154the related files, these links will work too. See @ref{Complex example}, for
10875an example of this usage. 12155an example of this usage.
10876 12156
10877Sometimes an Org file to be published may contain links that are 12157Sometimes an Org file to be published may contain links that are
@@ -10905,11 +12185,11 @@ a map of files for a given project.
10905or @code{org-publish-all}. 12185or @code{org-publish-all}.
10906 12186
10907@item @code{:sitemap-filename} 12187@item @code{:sitemap-filename}
10908@tab Filename for output of sitemap. Defaults to @file{sitemap.org} (which 12188@tab Filename for output of sitemap. Defaults to @file{sitemap.org} (which
10909becomes @file{sitemap.html}). 12189becomes @file{sitemap.html}).
10910 12190
10911@item @code{:sitemap-title} 12191@item @code{:sitemap-title}
10912@tab Title of sitemap page. Defaults to name of file. 12192@tab Title of sitemap page. Defaults to name of file.
10913 12193
10914@item @code{:sitemap-function} 12194@item @code{:sitemap-function}
10915@tab Plug-in function to use for generation of the sitemap. 12195@tab Plug-in function to use for generation of the sitemap.
@@ -10921,20 +12201,42 @@ of links to all files in the project.
10921(default) or @code{last} to display folders first or last, 12201(default) or @code{last} to display folders first or last,
10922respectively. Any other value will mix files and folders. 12202respectively. Any other value will mix files and folders.
10923 12203
10924@item @code{:sitemap-alphabetically} 12204@item @code{:sitemap-sort-files}
10925@tab The site map is normally sorted alphabetically. Set this explicitly to 12205@tab How the files are sorted in the site map. Set this to
10926@code{nil} to turn off sorting. 12206@code{alphabetically} (default), @code{chronologically} or
12207@code{anti-chronologically}. @code{chronologically} sorts the files with
12208older date first while @code{anti-chronologically} sorts the files with newer
12209date first. @code{alphabetically} sorts the files alphabetically. The date of
12210a file is retrieved with @code{org-publish-find-date}.
10927 12211
10928@item @code{:sitemap-ignore-case} 12212@item @code{:sitemap-ignore-case}
10929@tab Should sorting be case-sensitive? Default @code{nil}. 12213@tab Should sorting be case-sensitive? Default @code{nil}.
10930 12214
12215@item @code{:sitemap-file-entry-format}
12216@tab With this option one can tell how a sitemap's entry is formatted in the
12217sitemap. This is a format string with some escape sequences: @code{%t} stands
12218for the title of the file, @code{%a} stands for the author of the file and
12219@code{%d} stands for the date of the file. The date is retrieved with the
12220@code{org-publish-find-date} function and formatted with
12221@code{org-publish-sitemap-date-format}. Default @code{%t}.
12222
12223@item @code{:sitemap-date-format}
12224@tab Format string for the @code{format-time-string} function that tells how
12225a sitemap entry's date is to be formatted. This property bypasses
12226@code{org-publish-sitemap-date-format} which defaults to @code{%Y-%m-%d}.
12227
12228@item @code{:sitemap-sans-extension}
12229@tab When non-nil, remove filenames' extensions from the generated sitemap.
12230Useful to have cool URIs (see @uref{http://www.w3.org/Provider/Style/URI}).
12231Defaults to @code{nil}.
12232
10931@end multitable 12233@end multitable
10932 12234
10933@node Generating an index, , Sitemap, Configuration 12235@node Generating an index, , Sitemap, Configuration
10934@subsection Generating an index 12236@subsection Generating an index
10935@cindex index, in a publishing project 12237@cindex index, in a publishing project
10936 12238
10937Org-mode can generate an index across the files of a publishing project. 12239Org mode can generate an index across the files of a publishing project.
10938 12240
10939@multitable @columnfractions 0.25 0.75 12241@multitable @columnfractions 0.25 0.75
10940@item @code{:makeindex} 12242@item @code{:makeindex}
@@ -10942,10 +12244,10 @@ Org-mode can generate an index across the files of a publishing project.
10942publish it as @file{theindex.html}. 12244publish it as @file{theindex.html}.
10943@end multitable 12245@end multitable
10944 12246
10945The file will be create when first publishing a project with the 12247The file will be created when first publishing a project with the
10946@code{:makeindex} set. The file only contains a statement @code{#+include: 12248@code{:makeindex} set. The file only contains a statement @code{#+include:
10947"theindex.inc"}. You can then built around this include statement by adding 12249"theindex.inc"}. You can then build around this include statement by adding
10948a title, style information etc. 12250a title, style information, etc.
10949 12251
10950@node Uploading files, Sample configuration, Configuration, Publishing 12252@node Uploading files, Sample configuration, Configuration, Publishing
10951@section Uploading files 12253@section Uploading files
@@ -10954,7 +12256,7 @@ a title, style information etc.
10954 12256
10955For those people already utilizing third party sync tools such as 12257For those people already utilizing third party sync tools such as
10956@command{rsync} or @command{unison}, it might be preferable not to use the built in 12258@command{rsync} or @command{unison}, it might be preferable not to use the built in
10957@i{remote} publishing facilities of Org-mode which rely heavily on 12259@i{remote} publishing facilities of Org mode which rely heavily on
10958Tramp. Tramp, while very useful and powerful, tends not to be 12260Tramp. Tramp, while very useful and powerful, tends not to be
10959so efficient for multiple file transfer and has been known to cause problems 12261so efficient for multiple file transfer and has been known to cause problems
10960under heavy usage. 12262under heavy usage.
@@ -11015,12 +12317,12 @@ directory on the local machine.
11015 12317
11016This more complicated example publishes an entire website, including 12318This more complicated example publishes an entire website, including
11017Org files converted to HTML, image files, Emacs Lisp source code, and 12319Org files converted to HTML, image files, Emacs Lisp source code, and
11018style sheets. The publishing directory is remote and private files are 12320style sheets. The publishing directory is remote and private files are
11019excluded. 12321excluded.
11020 12322
11021To ensure that links are preserved, care should be taken to replicate 12323To ensure that links are preserved, care should be taken to replicate
11022your directory structure on the web server, and to use relative file 12324your directory structure on the web server, and to use relative file
11023paths. For example, if your Org files are kept in @file{~/org} and your 12325paths. For example, if your Org files are kept in @file{~/org} and your
11024publishable images in @file{~/images}, you would link to an image with 12326publishable images in @file{~/images}, you would link to an image with
11025@c 12327@c
11026@example 12328@example
@@ -11028,7 +12330,7 @@ file:../images/myimage.png
11028@end example 12330@end example
11029@c 12331@c
11030On the web server, the relative path to the image should be the 12332On the web server, the relative path to the image should be the
11031same. You can accomplish this by setting up an "images" folder in the 12333same. You can accomplish this by setting up an "images" folder in the
11032right place on the web server, and publishing images to it. 12334right place on the web server, and publishing images to it.
11033 12335
11034@lisp 12336@lisp
@@ -11044,8 +12346,7 @@ right place on the web server, and publishing images to it.
11044 :table-of-contents nil 12346 :table-of-contents nil
11045 :style "<link rel=\"stylesheet\" 12347 :style "<link rel=\"stylesheet\"
11046 href=\"../other/mystyle.css\" type=\"text/css\"/>" 12348 href=\"../other/mystyle.css\" type=\"text/css\"/>"
11047 :auto-preamble t 12349 :html-preamble t)
11048 :auto-postamble nil)
11049 12350
11050 ("images" 12351 ("images"
11051 :base-directory "~/images/" 12352 :base-directory "~/images/"
@@ -11078,8 +12379,8 @@ Publish every project.
11078@end table 12379@end table
11079 12380
11080@vindex org-publish-use-timestamps-flag 12381@vindex org-publish-use-timestamps-flag
11081Org uses timestamps to track when a file has changed. The above functions 12382Org uses timestamps to track when a file has changed. The above functions
11082normally only publish changed files. You can override this and force 12383normally only publish changed files. You can override this and force
11083publishing of all files by giving a prefix argument to any of the commands 12384publishing of all files by giving a prefix argument to any of the commands
11084above, or by customizing the variable @code{org-publish-use-timestamps-flag}. 12385above, or by customizing the variable @code{org-publish-use-timestamps-flag}.
11085This may be necessary in particular if files include other files via 12386This may be necessary in particular if files include other files via
@@ -11094,8 +12395,8 @@ This may be necessary in particular if files include other files via
11094@cindex Davison, Dan 12395@cindex Davison, Dan
11095@cindex source code, working with 12396@cindex source code, working with
11096 12397
11097Source code can be included in Org-mode documents using a @samp{src} block, 12398Source code can be included in Org mode documents using a @samp{src} block,
11098e.g. 12399e.g.@:
11099 12400
11100@example 12401@example
11101#+BEGIN_SRC emacs-lisp 12402#+BEGIN_SRC emacs-lisp
@@ -11105,25 +12406,26 @@ e.g.
11105#+END_SRC 12406#+END_SRC
11106@end example 12407@end example
11107 12408
11108Org-mode provides a number of features for working with live source code, 12409Org mode provides a number of features for working with live source code,
11109including editing of code blocks in their native major-mode, evaluation of 12410including editing of code blocks in their native major-mode, evaluation of
11110code blocks, tangling of code blocks, and exporting code blocks and their 12411code blocks, converting code blocks into source files (known as @dfn{tangling}
12412in literate programming), and exporting code blocks and their
11111results in several formats. This functionality was contributed by Eric 12413results in several formats. This functionality was contributed by Eric
11112Schulte and Dan Davison, and was originally named Org-babel. 12414Schulte and Dan Davison, and was originally named Org-babel.
11113 12415
11114The following sections describe Org-mode's code block handling facilities. 12416The following sections describe Org mode's code block handling facilities.
11115 12417
11116@menu 12418@menu
11117* Structure of code blocks:: Code block syntax described 12419* Structure of code blocks:: Code block syntax described
11118* Editing source code:: Language major-mode editing 12420* Editing source code:: Language major-mode editing
11119* Exporting code blocks:: Export contents and/or results 12421* Exporting code blocks:: Export contents and/or results
11120* Extracting source code:: Create pure source code files 12422* Extracting source code:: Create pure source code files
11121* Evaluating code blocks:: Place results of evaluation in the Org-mode buffer 12423* Evaluating code blocks:: Place results of evaluation in the Org mode buffer
11122* Library of Babel:: Use and contribute to a library of useful code blocks 12424* Library of Babel:: Use and contribute to a library of useful code blocks
11123* Languages:: List of supported code block languages 12425* Languages:: List of supported code block languages
11124* Header arguments:: Configure code block functionality 12426* Header arguments:: Configure code block functionality
11125* Results of evaluation:: How evaluation results are handled 12427* Results of evaluation:: How evaluation results are handled
11126* Noweb reference syntax:: Literate programming in Org-mode 12428* Noweb reference syntax:: Literate programming in Org mode
11127* Key bindings and useful functions:: Work quickly with code blocks 12429* Key bindings and useful functions:: Work quickly with code blocks
11128* Batch execution:: Call functions from the command line 12430* Batch execution:: Call functions from the command line
11129@end menu 12431@end menu
@@ -11135,17 +12437,26 @@ The following sections describe Org-mode's code block handling facilities.
11135@section Structure of code blocks 12437@section Structure of code blocks
11136@cindex code block, structure 12438@cindex code block, structure
11137@cindex source code, block structure 12439@cindex source code, block structure
12440@cindex #+NAME
12441@cindex #+BEGIN_SRC
11138 12442
11139The structure of code blocks is as follows: 12443Live code blocks can be specified with a @samp{src} block or
12444inline.@footnote{Note that @samp{src} blocks may be inserted using Org mode's
12445@ref{Easy Templates} system} The structure of a @samp{src} block is
11140 12446
11141@example 12447@example
11142#+srcname: <name> 12448#+NAME: <name>
11143#+begin_src <language> <switches> <header arguments> 12449#+BEGIN_SRC <language> <switches> <header arguments>
11144 <body> 12450 <body>
11145#+end_src 12451#+END_SRC
11146@end example 12452@end example
11147 12453
11148code blocks can also be embedded in text as so called inline code blocks as 12454The @code{#+NAME:} line is optional, and can be used to name the code
12455block. Live code blocks require that a language be specified on the
12456@code{#+BEGIN_SRC} line. Switches and header arguments are optional.
12457@cindex source code, inline
12458
12459Live code blocks can also be specified inline using
11149 12460
11150@example 12461@example
11151src_<language>@{<body>@} 12462src_<language>@{<body>@}
@@ -11158,24 +12469,30 @@ src_<language>[<header arguments>]@{<body>@}
11158@end example 12469@end example
11159 12470
11160@table @code 12471@table @code
11161@item <name> 12472@item <#+NAME: name>
11162This name is associated with the code block. This is similar to the 12473This line associates a name with the code block. This is similar to the
11163@samp{#+tblname} lines that can be used to name tables in Org-mode files. 12474@code{#+TBLNAME: NAME} lines that can be used to name tables in Org mode
11164Referencing the name of a code block makes it possible to evaluate the 12475files. Referencing the name of a code block makes it possible to evaluate
11165block from other places in the file, other files, or from Org-mode table 12476the block from other places in the file, from other files, or from Org mode
11166formulas (see @ref{The spreadsheet}). 12477table formulas (see @ref{The spreadsheet}). Names are assumed to be unique
12478and the behavior of Org mode when two or more blocks share the same name is
12479undefined.
12480@cindex #+NAME
11167@item <language> 12481@item <language>
11168The language of the code in the block. 12482The language of the code in the block (see @ref{Languages}).
12483@cindex source code, language
11169@item <switches> 12484@item <switches>
11170Switches controlling exportation of the code block (see switches discussion in 12485Optional switches control code block export (see the discussion of switches in
11171@ref{Literal examples}) 12486@ref{Literal examples})
12487@cindex source code, switches
11172@item <header arguments> 12488@item <header arguments>
11173Optional header arguments control many aspects of evaluation, export and 12489Optional header arguments control many aspects of evaluation, export and
11174tangling of code blocks. See the @ref{Header arguments} 12490tangling of code blocks (see @ref{Header arguments}).
11175section. Header arguments can also be set on a per-buffer or per-subtree 12491Header arguments can also be set on a per-buffer or per-subtree
11176basis using properties. 12492basis using properties.
12493@item source code, header arguments
11177@item <body> 12494@item <body>
11178The source code. 12495Source code in the specified language.
11179@end table 12496@end table
11180 12497
11181@comment node-name, next, previous, up 12498@comment node-name, next, previous, up
@@ -11187,21 +12504,21 @@ The source code.
11187@cindex source code, editing 12504@cindex source code, editing
11188 12505
11189@kindex C-c ' 12506@kindex C-c '
11190Use @kbd{C-c '} to edit the current code block. This brings up 12507Use @kbd{C-c '} to edit the current code block. This brings up
11191a language major-mode edit buffer containing the body of the code 12508a language major-mode edit buffer containing the body of the code
11192block. Saving this buffer will write the new contents back to the Org 12509block. Saving this buffer will write the new contents back to the Org
11193buffer. Use @kbd{C-c '} again to exit. 12510buffer. Use @kbd{C-c '} again to exit.
11194 12511
11195The @code{org-src-mode} minor mode will be active in the edit buffer. The 12512The @code{org-src-mode} minor mode will be active in the edit buffer. The
11196following variables can be used to configure the behavior of the edit 12513following variables can be used to configure the behavior of the edit
11197buffer. See also the customization group @code{org-edit-structure} for 12514buffer. See also the customization group @code{org-edit-structure} for
11198further configuration options. 12515further configuration options.
11199 12516
11200@table @code 12517@table @code
11201@item org-src-lang-modes 12518@item org-src-lang-modes
11202If an Emacs major-mode named @code{<lang>-mode} exists, where 12519If an Emacs major-mode named @code{<lang>-mode} exists, where
11203@code{<lang>} is the language named in the header line of the code block, 12520@code{<lang>} is the language named in the header line of the code block,
11204then the edit buffer will be placed in that major-mode. This variable 12521then the edit buffer will be placed in that major-mode. This variable
11205can be used to map arbitrary language names to existing major modes. 12522can be used to map arbitrary language names to existing major modes.
11206@item org-src-window-setup 12523@item org-src-window-setup
11207Controls the way Emacs windows are rearranged when the edit buffer is created. 12524Controls the way Emacs windows are rearranged when the edit buffer is created.
@@ -11209,10 +12526,13 @@ Controls the way Emacs windows are rearranged when the edit buffer is created.
11209This variable is especially useful for tangling languages such as 12526This variable is especially useful for tangling languages such as
11210Python, in which whitespace indentation in the output is critical. 12527Python, in which whitespace indentation in the output is critical.
11211@item org-src-ask-before-returning-to-edit-buffer 12528@item org-src-ask-before-returning-to-edit-buffer
11212By default, Org will ask before returning to an open edit buffer. Set 12529By default, Org will ask before returning to an open edit buffer. Set this
11213this variable to nil to switch without asking. 12530variable to nil to switch without asking.
11214@end table 12531@end table
11215 12532
12533To turn on native code fontification in the @emph{Org} buffer, configure the
12534variable @code{org-src-fontify-natively}.
12535
11216@comment node-name, next, previous, up 12536@comment node-name, next, previous, up
11217@comment Exporting code blocks, Extracting source code, Editing source code, Working With Source Code 12537@comment Exporting code blocks, Extracting source code, Editing source code, Working With Source Code
11218 12538
@@ -11221,12 +12541,12 @@ this variable to nil to switch without asking.
11221@cindex code block, exporting 12541@cindex code block, exporting
11222@cindex source code, exporting 12542@cindex source code, exporting
11223 12543
11224It is possible to export the @emph{contents} of code blocks, the 12544It is possible to export the @emph{code} of code blocks, the @emph{results}
11225@emph{results} of code block evaluation, @emph{neither}, or @emph{both}. For 12545of code block evaluation, @emph{both} the code and the results of code block
11226most languages, the default exports the contents of code blocks. However, for 12546evaluation, or @emph{none}. For most languages, the default exports code.
11227some languages (e.g. @code{ditaa}) the default exports the results of code 12547However, for some languages (e.g.@: @code{ditaa}) the default exports the
11228block evaluation. For information on exporting code block bodies, see 12548results of code block evaluation. For information on exporting code block
11229@ref{Literal examples}. 12549bodies, see @ref{Literal examples}.
11230 12550
11231The @code{:exports} header argument can be used to specify export 12551The @code{:exports} header argument can be used to specify export
11232behavior: 12552behavior:
@@ -11234,11 +12554,11 @@ behavior:
11234@subsubheading Header arguments: 12554@subsubheading Header arguments:
11235@table @code 12555@table @code
11236@item :exports code 12556@item :exports code
11237The default in most languages. The body of the code block is exported, as 12557The default in most languages. The body of the code block is exported, as
11238described in @ref{Literal examples}. 12558described in @ref{Literal examples}.
11239@item :exports results 12559@item :exports results
11240The code block will be evaluated and the results will be placed in the 12560The code block will be evaluated and the results will be placed in the
11241Org-mode buffer for export, either updating previous results of the code 12561Org mode buffer for export, either updating previous results of the code
11242block located anywhere in the buffer or, if no previous results exist, 12562block located anywhere in the buffer or, if no previous results exist,
11243placing the results immediately after the code block. The body of the code 12563placing the results immediately after the code block. The body of the code
11244block will not be exported. 12564block will not be exported.
@@ -11251,14 +12571,15 @@ Neither the code block nor its results will be exported.
11251It is possible to inhibit the evaluation of code blocks during export. 12571It is possible to inhibit the evaluation of code blocks during export.
11252Setting the @code{org-export-babel-evaluate} variable to @code{nil} will 12572Setting the @code{org-export-babel-evaluate} variable to @code{nil} will
11253ensure that no code blocks are evaluated as part of the export process. This 12573ensure that no code blocks are evaluated as part of the export process. This
11254can be useful in situations where potentially untrusted Org-mode files are 12574can be useful in situations where potentially untrusted Org mode files are
11255exported in an automated fashion, for example when Org-mode is used as the 12575exported in an automated fashion, for example when Org mode is used as the
11256markup language for a wiki. 12576markup language for a wiki.
11257 12577
11258@comment node-name, next, previous, up 12578@comment node-name, next, previous, up
11259@comment Extracting source code, Evaluating code blocks, Exporting code blocks, Working With Source Code 12579@comment Extracting source code, Evaluating code blocks, Exporting code blocks, Working With Source Code
11260@node Extracting source code, Evaluating code blocks, Exporting code blocks, Working With Source Code 12580@node Extracting source code, Evaluating code blocks, Exporting code blocks, Working With Source Code
11261@section Extracting source code 12581@section Extracting source code
12582@cindex tangling
11262@cindex source code, extracting 12583@cindex source code, extracting
11263@cindex code block, extracting source code 12584@cindex code block, extracting source code
11264 12585
@@ -11273,7 +12594,7 @@ using @code{org-babel-expand-src-block} which can expand both variable and
11273@item :tangle no 12594@item :tangle no
11274The default. The code block is not included in the tangled output. 12595The default. The code block is not included in the tangled output.
11275@item :tangle yes 12596@item :tangle yes
11276Include the code block in the tangled output. The output file name is the 12597Include the code block in the tangled output. The output file name is the
11277name of the org file with the extension @samp{.org} replaced by the extension 12598name of the org file with the extension @samp{.org} replaced by the extension
11278for the block language. 12599for the block language.
11279@item :tangle filename 12600@item :tangle filename
@@ -11283,10 +12604,10 @@ Include the code block in the tangled output to file @samp{filename}.
11283@kindex C-c C-v t 12604@kindex C-c C-v t
11284@subsubheading Functions 12605@subsubheading Functions
11285@table @code 12606@table @code
11286@item org-babel-tangle 12607@item org-babel-tangle
11287Tangle the current file. Bound to @kbd{C-c C-v t}. 12608Tangle the current file. Bound to @kbd{C-c C-v t}.
11288@item org-babel-tangle-file 12609@item org-babel-tangle-file
11289Choose a file to tangle. Bound to @kbd{C-c C-v f}. 12610Choose a file to tangle. Bound to @kbd{C-c C-v f}.
11290@end table 12611@end table
11291 12612
11292@subsubheading Hooks 12613@subsubheading Hooks
@@ -11303,14 +12624,15 @@ of tangled code files.
11303@cindex source code, evaluating 12624@cindex source code, evaluating
11304 12625
11305Code blocks can be evaluated@footnote{Whenever code is evaluated there is a 12626Code blocks can be evaluated@footnote{Whenever code is evaluated there is a
11306potential for that code to do harm. Org-mode provides a number of safeguards 12627potential for that code to do harm. Org mode provides safeguards to ensure
11307to ensure that it only evaluates code with explicit confirmation from the 12628that code is only evaluated after explicit confirmation from the user. For
11308user. For information on these safeguards (and on how to disable them) see 12629information on these safeguards (and on how to disable them) see @ref{Code
11309@ref{Code evaluation security}.} and the results placed in the Org-mode 12630evaluation security}.} and the results of evaluation optionally placed in the
11310buffer. By default, evaluation is only turned on for @code{emacs-lisp} code 12631Org mode buffer. By default, the evaluation facility is only enabled for
11311blocks, however support exists for evaluating blocks in many languages. See 12632Lisp code blocks specified as @code{emacs-lisp}. However, source code blocks
11312@ref{Languages} for a list of supported languages. See @ref{Structure of 12633in many languages can be evaluated within Org mode (see @ref{Languages} for a
11313code blocks} for information on the syntax used to define a code block. 12634list of supported languages and @ref{Structure of code blocks} for
12635information on the syntax used to define a code block).
11314 12636
11315@kindex C-c C-c 12637@kindex C-c C-c
11316There are a number of ways to evaluate code blocks. The simplest is to press 12638There are a number of ways to evaluate code blocks. The simplest is to press
@@ -11318,49 +12640,77 @@ There are a number of ways to evaluate code blocks. The simplest is to press
11318@code{org-babel-no-eval-on-ctrl-c-ctrl-c} variable can be used to remove code 12640@code{org-babel-no-eval-on-ctrl-c-ctrl-c} variable can be used to remove code
11319evaluation from the @kbd{C-c C-c} key binding.}. This will call the 12641evaluation from the @kbd{C-c C-c} key binding.}. This will call the
11320@code{org-babel-execute-src-block} function to evaluate the block and insert 12642@code{org-babel-execute-src-block} function to evaluate the block and insert
11321its results into the Org-mode buffer. 12643its results into the Org mode buffer.
12644@cindex #+CALL
11322 12645
11323It is also possible to evaluate named code blocks from anywhere in an 12646It is also possible to evaluate named code blocks from anywhere in an
11324Org-mode buffer or an Org-mode table. @code{#+call} (or synonymously 12647Org mode buffer or an Org mode table. Live code blocks located in the current
11325@code{#+function} or @code{#+lob}) lines can be used to remotely execute code 12648Org mode buffer or in the ``Library of Babel'' (see @ref{Library of Babel})
11326blocks located in the current Org-mode buffer or in the ``Library of Babel'' 12649can be executed. Named code blocks can be executed with a separate
11327(see @ref{Library of Babel}). These lines use the following syntax. 12650@code{#+CALL:} line or inline within a block of text.
12651
12652The syntax of the @code{#+CALL:} line is
11328 12653
11329@example 12654@example
11330#+call: <name>(<arguments>) <header arguments> 12655#+CALL: <name>(<arguments>)
11331#+function: <name>(<arguments>) <header arguments> 12656#+CALL: <name>[<inside header arguments>](<arguments>) <end header arguments>
11332#+lob: <name>(<arguments>) <header arguments> 12657@end example
12658
12659The syntax for inline evaluation of named code blocks is
12660
12661@example
12662... call_<name>(<arguments>) ...
12663... call_<name>[<inside header arguments>](<arguments>)[<end header arguments>] ...
11333@end example 12664@end example
11334 12665
11335@table @code 12666@table @code
11336@item <name> 12667@item <name>
11337The name of the code block to be evaluated. 12668The name of the code block to be evaluated (see @ref{Structure of code blocks}).
11338@item <arguments> 12669@item <arguments>
11339Arguments specified in this section will be passed to the code block. 12670Arguments specified in this section will be passed to the code block. These
11340@item <header arguments> 12671arguments use standard function call syntax, rather than
11341Header arguments can be placed after the function invocation. See 12672header argument syntax. For example, a @code{#+CALL:} line that passes the
11342@ref{Header arguments} for more information on header arguments. 12673number four to a code block named @code{double}, which declares the header
12674argument @code{:var n=2}, would be written as @code{#+CALL: double(n=4)}.
12675@item <inside header arguments>
12676Inside header arguments are passed through and applied to the named code
12677block. These arguments use header argument syntax rather than standard
12678function call syntax. Inside header arguments affect how the code block is
12679evaluated. For example, @code{[:results output]} will collect the results of
12680everything printed to @code{STDOUT} during execution of the code block.
12681@item <end header arguments>
12682End header arguments are applied to the calling instance and do not affect
12683evaluation of the named code block. They affect how the results are
12684incorporated into the Org mode buffer and how the call line is exported. For
12685example, @code{:results html} will insert the results of the call line
12686evaluation in the Org buffer, wrapped in a @code{BEGIN_HTML:} block.
12687
12688For more examples of passing header arguments to @code{#+CALL:} lines see
12689@ref{Header arguments in function calls}.
11343@end table 12690@end table
11344 12691
11345
11346@node Library of Babel, Languages, Evaluating code blocks, Working With Source Code 12692@node Library of Babel, Languages, Evaluating code blocks, Working With Source Code
11347@section Library of Babel 12693@section Library of Babel
11348@cindex babel, library of 12694@cindex babel, library of
11349@cindex source code, library 12695@cindex source code, library
11350@cindex code block, library 12696@cindex code block, library
11351 12697
11352The ``Library of Babel'' is a library of code blocks 12698The ``Library of Babel'' consists of code blocks that can be called from any
11353that can be called from any Org-mode file. The library is housed in an 12699Org mode file. Code blocks defined in the ``Library of Babel'' can be called
11354Org-mode file located in the @samp{contrib} directory of Org-mode. 12700remotely as if they were in the current Org mode buffer (see @ref{Evaluating
11355Org-mode users can deposit functions they believe to be generally 12701code blocks} for information on the syntax of remote code block evaluation).
11356useful in the library. 12702
12703
12704The central repository of code blocks in the ``Library of Babel'' is housed
12705in an Org mode file located in the @samp{contrib} directory of Org mode.
12706
12707Users can add code blocks they believe to be generally useful to their
12708``Library of Babel.'' The code blocks can be stored in any Org mode file and
12709then loaded into the library with @code{org-babel-lob-ingest}.
11357 12710
11358Code blocks defined in the ``Library of Babel'' can be called remotely as if
11359they were in the current Org-mode buffer (see @ref{Evaluating code blocks}
11360for information on the syntax of remote code block evaluation).
11361 12711
11362@kindex C-c C-v i 12712@kindex C-c C-v i
11363Code blocks located in any Org-mode file can be loaded into the ``Library of 12713Code blocks located in any Org mode file can be loaded into the ``Library of
11364Babel'' with the @code{org-babel-lob-ingest} function, bound to @kbd{C-c C-v 12714Babel'' with the @code{org-babel-lob-ingest} function, bound to @kbd{C-c C-v
11365i}. 12715i}.
11366 12716
@@ -11374,19 +12724,24 @@ Code blocks in the following languages are supported.
11374 12724
11375@multitable @columnfractions 0.28 0.3 0.22 0.2 12725@multitable @columnfractions 0.28 0.3 0.22 0.2
11376@item @b{Language} @tab @b{Identifier} @tab @b{Language} @tab @b{Identifier} 12726@item @b{Language} @tab @b{Identifier} @tab @b{Language} @tab @b{Identifier}
11377@item Asymptote @tab asymptote @tab C @tab C 12727@item Asymptote @tab asymptote @tab Awk @tab awk
12728@item Emacs Calc @tab calc @tab C @tab C
11378@item C++ @tab C++ @tab Clojure @tab clojure 12729@item C++ @tab C++ @tab Clojure @tab clojure
11379@item CSS @tab css @tab ditaa @tab ditaa 12730@item CSS @tab css @tab ditaa @tab ditaa
11380@item Graphviz @tab dot @tab Emacs Lisp @tab emacs-lisp 12731@item Graphviz @tab dot @tab Emacs Lisp @tab emacs-lisp
11381@item gnuplot @tab gnuplot @tab Haskell @tab haskell 12732@item gnuplot @tab gnuplot @tab Haskell @tab haskell
11382@item LaTeX @tab latex @tab MATLAB @tab matlab 12733@item Java @tab java @tab @tab
12734@item Javascript @tab js @tab LaTeX @tab latex
12735@item Ledger @tab ledger @tab Lisp @tab lisp
12736@item Lilypond @tab lilypond @tab MATLAB @tab matlab
11383@item Mscgen @tab mscgen @tab Objective Caml @tab ocaml 12737@item Mscgen @tab mscgen @tab Objective Caml @tab ocaml
11384@item Octave @tab octave @tab Oz @tab oz 12738@item Octave @tab octave @tab Org mode @tab org
11385@item Perl @tab perl @tab Python @tab python 12739@item Oz @tab oz @tab Perl @tab perl
12740@item Plantuml @tab plantuml @tab Python @tab python
11386@item R @tab R @tab Ruby @tab ruby 12741@item R @tab R @tab Ruby @tab ruby
11387@item Sass @tab sass @tab GNU Screen @tab screen 12742@item Sass @tab sass @tab Scheme @tab scheme
11388@item shell @tab sh @tab SQL @tab sql 12743@item GNU Screen @tab screen @tab shell @tab sh
11389@item SQLite @tab sqlite 12744@item SQL @tab sql @tab SQLite @tab sqlite
11390@end multitable 12745@end multitable
11391 12746
11392Language-specific documentation is available for some languages. If 12747Language-specific documentation is available for some languages. If
@@ -11444,7 +12799,7 @@ specific (and having higher priority) than the last.
11444* System-wide header arguments:: Set global default values 12799* System-wide header arguments:: Set global default values
11445* Language-specific header arguments:: Set default values by language 12800* Language-specific header arguments:: Set default values by language
11446* Buffer-wide header arguments:: Set default values for a specific buffer 12801* Buffer-wide header arguments:: Set default values for a specific buffer
11447* Header arguments in Org-mode properties:: Set default values for a buffer or heading 12802* Header arguments in Org mode properties:: Set default values for a buffer or heading
11448* Code block specific header arguments:: The most common way to set values 12803* Code block specific header arguments:: The most common way to set values
11449* Header arguments in function calls:: The most specific level 12804* Header arguments in function calls:: The most specific level
11450@end menu 12805@end menu
@@ -11495,12 +12850,11 @@ Each language can define its own set of default header arguments. See the
11495language-specific documentation available online at 12850language-specific documentation available online at
11496@uref{http://orgmode.org/worg/org-contrib/babel}. 12851@uref{http://orgmode.org/worg/org-contrib/babel}.
11497 12852
11498@node Buffer-wide header arguments, Header arguments in Org-mode properties, Language-specific header arguments, Using header arguments 12853@node Buffer-wide header arguments, Header arguments in Org mode properties, Language-specific header arguments, Using header arguments
11499@subsubheading Buffer-wide header arguments 12854@subsubheading Buffer-wide header arguments
11500Buffer-wide header arguments may be specified through the use of a special 12855Buffer-wide header arguments may be specified as properties through the use
11501line placed anywhere in an Org-mode file. The line consists of the 12856of @code{#+PROPERTY:} lines placed anywhere in an Org mode file (see
11502@code{#+BABEL:} keyword followed by a series of header arguments which may be 12857@ref{Property syntax}).
11503specified using the standard header argument syntax.
11504 12858
11505For example the following would set @code{session} to @code{*R*}, and 12859For example the following would set @code{session} to @code{*R*}, and
11506@code{results} to @code{silent} for every code block in the buffer, ensuring 12860@code{results} to @code{silent} for every code block in the buffer, ensuring
@@ -11508,24 +12862,27 @@ that all execution took place in the same session, and no results would be
11508inserted into the buffer. 12862inserted into the buffer.
11509 12863
11510@example 12864@example
11511#+BABEL: :session *R* :results silent 12865#+PROPERTY: session *R*
12866#+PROPERTY: results silent
11512@end example 12867@end example
11513 12868
11514@node Header arguments in Org-mode properties, Code block specific header arguments, Buffer-wide header arguments, Using header arguments 12869@node Header arguments in Org mode properties, Code block specific header arguments, Buffer-wide header arguments, Using header arguments
11515@subsubheading Header arguments in Org-mode properties 12870@subsubheading Header arguments in Org mode properties
11516 12871
11517Header arguments are also read from Org-mode properties (see @ref{Property 12872Header arguments are also read from Org mode properties (see @ref{Property
11518syntax}), which can be set on a buffer-wide or per-heading basis. An example 12873syntax}), which can be set on a buffer-wide or per-heading basis. An example
11519of setting a header argument for all code blocks in a buffer is 12874of setting a header argument for all code blocks in a buffer is
11520 12875
11521@example 12876@example
11522#+property: tangle yes 12877#+PROPERTY: tangle yes
11523@end example 12878@end example
11524 12879
12880@vindex org-use-property-inheritance
11525When properties are used to set default header arguments, they are looked up 12881When properties are used to set default header arguments, they are looked up
11526with inheritance, so the value of the @code{:cache} header argument will default 12882with inheritance, regardless of the value of
11527to @code{yes} in all code blocks in the subtree rooted at the following 12883@code{org-use-property-inheritance}. In the following example the value of
11528heading: 12884the @code{:cache} header argument will default to @code{yes} in all code
12885blocks in the subtree rooted at the following heading:
11529 12886
11530@example 12887@example
11531* outline header 12888* outline header
@@ -11539,49 +12896,89 @@ heading:
11539Properties defined in this way override the properties set in 12896Properties defined in this way override the properties set in
11540@code{org-babel-default-header-args}. It is convenient to use the 12897@code{org-babel-default-header-args}. It is convenient to use the
11541@code{org-set-property} function bound to @kbd{C-c C-x p} to set properties 12898@code{org-set-property} function bound to @kbd{C-c C-x p} to set properties
11542in Org-mode documents. 12899in Org mode documents.
11543 12900
11544@node Code block specific header arguments, Header arguments in function calls, Header arguments in Org-mode properties, Using header arguments 12901@node Code block specific header arguments, Header arguments in function calls, Header arguments in Org mode properties, Using header arguments
11545@subsubheading Code block specific header arguments 12902@subsubheading Code block specific header arguments
11546 12903
11547The most common way to assign values to header arguments is at the 12904The most common way to assign values to header arguments is at the
11548code block level. This can be done by listing a sequence of header 12905code block level. This can be done by listing a sequence of header
11549arguments and their values as part of the @code{#+begin_src} line. 12906arguments and their values as part of the @code{#+BEGIN_SRC} line.
11550Properties set in this way override both the values of 12907Properties set in this way override both the values of
11551@code{org-babel-default-header-args} and header arguments specified as 12908@code{org-babel-default-header-args} and header arguments specified as
11552properties. In the following example, the @code{:results} header argument 12909properties. In the following example, the @code{:results} header argument
11553is set to @code{silent}, meaning the results of execution will not be 12910is set to @code{silent}, meaning the results of execution will not be
11554inserted in the buffer, and the @code{:exports} header argument is set to 12911inserted in the buffer, and the @code{:exports} header argument is set to
11555@code{code}, meaning only the body of the code block will be 12912@code{code}, meaning only the body of the code block will be
11556preserved on export to HTML or LaTeX. 12913preserved on export to HTML or @LaTeX{}.
11557 12914
11558@example 12915@example
11559#+source: factorial 12916#+NAME: factorial
11560#+begin_src haskell :results silent :exports code :var n=0 12917#+BEGIN_SRC haskell :results silent :exports code :var n=0
11561fac 0 = 1 12918fac 0 = 1
11562fac n = n * fac (n-1) 12919fac n = n * fac (n-1)
11563#+end_src 12920#+END_SRC
11564@end example 12921@end example
11565Similarly, it is possible to set header arguments for inline code blocks: 12922Similarly, it is possible to set header arguments for inline code blocks
11566 12923
11567@example 12924@example
11568src_haskell[:exports both]@{fac 5@} 12925src_haskell[:exports both]@{fac 5@}
11569@end example 12926@end example
11570 12927
12928Code block header arguments can span multiple lines using @code{#+HEADER:} or
12929@code{#+HEADERS:} lines preceding a code block or nested between the
12930@code{#+NAME:} line and the @code{#+BEGIN_SRC} line of a named code block.
12931@cindex #+HEADER:
12932@cindex #+HEADERS:
12933
12934Multi-line header arguments on an un-named code block:
12935@example
12936 #+HEADERS: :var data1=1
12937 #+BEGIN_SRC emacs-lisp :var data2=2
12938 (message "data1:%S, data2:%S" data1 data2)
12939 #+END_SRC
12940
12941 #+results:
12942 : data1:1, data2:2
12943@end example
12944
12945Multi-line header arguments on a named code block:
12946@example
12947 #+NAME: named-block
12948 #+HEADER: :var data=2
12949 #+BEGIN_SRC emacs-lisp
12950 (message "data:%S" data)
12951 #+END_SRC
12952
12953 #+results: named-block
12954 : data:2
12955@end example
12956
11571@node Header arguments in function calls, , Code block specific header arguments, Using header arguments 12957@node Header arguments in function calls, , Code block specific header arguments, Using header arguments
11572@comment node-name, next, previous, up 12958@comment node-name, next, previous, up
11573@subsubheading Header arguments in function calls 12959@subsubheading Header arguments in function calls
11574 12960
11575At the most specific level, header arguments for ``Library of Babel'' or 12961At the most specific level, header arguments for ``Library of Babel'' or
11576function call lines can be set as shown below: 12962@code{#+CALL:} lines can be set as shown in the two examples below. For more
12963information on the structure of @code{#+CALL:} lines see @ref{Evaluating code
12964blocks}.
12965
12966The following will apply the @code{:exports results} header argument to the
12967evaluation of the @code{#+CALL:} line.
12968@example
12969#+CALL: factorial(n=5) :exports results
12970@end example
11577 12971
12972The following will apply the @code{:session special} header argument to the
12973evaluation of the @code{factorial} code block.
11578@example 12974@example
11579#+call: factorial(n=5) :exports results 12975#+CALL: factorial[:session special](n=5)
11580@end example 12976@end example
11581 12977
11582@node Specific header arguments, , Using header arguments, Header arguments 12978@node Specific header arguments, , Using header arguments, Header arguments
11583@subsection Specific header arguments 12979@subsection Specific header arguments
11584The following header arguments are defined: 12980Header arguments consist of an initial colon followed by the name of the
12981argument in lowercase letters. The following header arguments are defined:
11585 12982
11586@menu 12983@menu
11587* var:: Pass arguments to code blocks 12984* var:: Pass arguments to code blocks
@@ -11592,13 +12989,19 @@ The following header arguments are defined:
11592 directory for code block execution 12989 directory for code block execution
11593* exports:: Export code and/or results 12990* exports:: Export code and/or results
11594* tangle:: Toggle tangling and specify file name 12991* tangle:: Toggle tangling and specify file name
12992* mkdirp:: Toggle creation of parent directories of target
12993 files during tangling
11595* comments:: Toggle insertion of comments in tangled 12994* comments:: Toggle insertion of comments in tangled
11596 code files 12995 code files
12996* padline:: Control insertion of padding lines in tangled
12997 code files
11597* no-expand:: Turn off variable assignment and noweb 12998* no-expand:: Turn off variable assignment and noweb
11598 expansion during tangling 12999 expansion during tangling
11599* session:: Preserve the state of code evaluation 13000* session:: Preserve the state of code evaluation
11600* noweb:: Toggle expansion of noweb references 13001* noweb:: Toggle expansion of noweb references
13002* noweb-ref:: Specify block's noweb reference resolution target
11601* cache:: Avoid re-evaluating unchanged code blocks 13003* cache:: Avoid re-evaluating unchanged code blocks
13004* sep:: Delimiter for writing tabular results outside Org
11602* hlines:: Handle horizontal lines in tables 13005* hlines:: Handle horizontal lines in tables
11603* colnames:: Handle column names in tables 13006* colnames:: Handle column names in tables
11604* rownames:: Handle row names in tables 13007* rownames:: Handle row names in tables
@@ -11606,17 +13009,26 @@ The following header arguments are defined:
11606* eval:: Limit evaluation of specific code blocks 13009* eval:: Limit evaluation of specific code blocks
11607@end menu 13010@end menu
11608 13011
13012Additional header arguments are defined on a language-specific basis, see
13013@ref{Languages}.
13014
11609@node var, results, Specific header arguments, Specific header arguments 13015@node var, results, Specific header arguments, Specific header arguments
11610@subsubsection @code{:var} 13016@subsubsection @code{:var}
11611The @code{:var} header argument is used to pass arguments to code blocks. 13017The @code{:var} header argument is used to pass arguments to code blocks.
11612The specifics of how arguments are included in a code block vary by language; 13018The specifics of how arguments are included in a code block vary by language;
11613these are addressed in the language-specific documentation. However, the 13019these are addressed in the language-specific documentation. However, the
11614syntax used to specify arguments is the same across all languages. The 13020syntax used to specify arguments is the same across all languages. In every
11615values passed to arguments can be literal values, values from org-mode tables 13021case, variables require a default value when they are declared.
11616and literal example blocks, or the results of other code blocks. 13022
13023The values passed to arguments can either be literal values, references, or
13024Emacs Lisp code (see @ref{var, Emacs Lisp evaluation of variables}). References
13025include anything in the Org mode file that takes a @code{#+NAME:},
13026@code{#+TBLNAME:}, or @code{#+RESULTS:} line. This includes tables, lists,
13027@code{#+BEGIN_EXAMPLE} blocks, other code blocks, and the results of other
13028code blocks.
11617 13029
11618These values can be indexed in a manner similar to arrays---see the 13030Argument values can be indexed in a manner similar to arrays (see @ref{var,
11619``indexable variable values'' heading below. 13031Indexable variable values}).
11620 13032
11621The following syntax is used to pass arguments to code blocks using the 13033The following syntax is used to pass arguments to code blocks using the
11622@code{:var} header argument. 13034@code{:var} header argument.
@@ -11625,96 +13037,144 @@ The following syntax is used to pass arguments to code blocks using the
11625:var name=assign 13037:var name=assign
11626@end example 13038@end example
11627 13039
11628where @code{assign} can take one of the following forms 13040The argument, @code{assign}, can either be a literal value, such as a string
13041@samp{"string"} or a number @samp{9}, or a reference to a table, a list, a
13042literal example, another code block (with or without arguments), or the
13043results of evaluating another code block.
11629 13044
11630@itemize @bullet 13045Here are examples of passing values by reference:
11631@item literal value 13046
11632either a string @code{"string"} or a number @code{9}. 13047@table @dfn
11633@item reference
11634a table name:
11635 13048
13049@item table
13050an Org mode table named with either a @code{#+NAME:} or @code{#+TBLNAME:} line
11636@example 13051@example
11637#+tblname: example-table 13052#+TBLNAME: example-table
11638| 1 | 13053| 1 |
11639| 2 | 13054| 2 |
11640| 3 | 13055| 3 |
11641| 4 | 13056| 4 |
11642 13057
11643#+source: table-length 13058#+NAME: table-length
11644#+begin_src emacs-lisp :var table=example-table 13059#+BEGIN_SRC emacs-lisp :var table=example-table
11645(length table) 13060(length table)
11646#+end_src 13061#+END_SRC
11647 13062
11648#+results: table-length 13063#+results: table-length
11649: 4 13064: 4
11650@end example 13065@end example
11651 13066
11652a code block name, as assigned by @code{#+srcname:}, followed by 13067@item list
11653parentheses: 13068a simple list named with a @code{#+NAME:} line (note that nesting is not
13069carried through to the source code block)
13070
13071@example
13072#+NAME: example-list
13073 - simple
13074 - not
13075 - nested
13076 - list
13077
13078#+BEGIN_SRC emacs-lisp :var x=example-list
13079 (print x)
13080#+END_SRC
13081
13082#+results:
13083| simple | list |
13084@end example
13085
13086@item code block without arguments
13087a code block name (from the example above), as assigned by @code{#+NAME:},
13088optionally followed by parentheses
11654 13089
11655@example 13090@example
11656#+begin_src emacs-lisp :var length=table-length() 13091#+BEGIN_SRC emacs-lisp :var length=table-length()
11657(* 2 length) 13092(* 2 length)
11658#+end_src 13093#+END_SRC
11659 13094
11660#+results: 13095#+results:
11661: 8 13096: 8
11662@end example 13097@end example
11663 13098
11664In addition, an argument can be passed to the code block referenced 13099@item code block with arguments
11665by @code{:var}. The argument is passed within the parentheses following the 13100a code block name, as assigned by @code{#+NAME:}, followed by parentheses and
11666code block name: 13101optional arguments passed within the parentheses following the
13102code block name using standard function call syntax
11667 13103
11668@example 13104@example
11669#+source: double 13105#+NAME: double
11670#+begin_src emacs-lisp :var input=8 13106#+BEGIN_SRC emacs-lisp :var input=8
11671(* 2 input) 13107(* 2 input)
11672#+end_src 13108#+END_SRC
11673 13109
11674#+results: double 13110#+results: double
11675: 16 13111: 16
11676 13112
11677#+source: squared 13113#+NAME: squared
11678#+begin_src emacs-lisp :var input=double(input=1) 13114#+BEGIN_SRC emacs-lisp :var input=double(input=1)
11679(* input input) 13115(* input input)
11680#+end_src 13116#+END_SRC
11681 13117
11682#+results: squared 13118#+results: squared
11683: 4 13119: 4
11684@end example 13120@end example
11685@end itemize 13121
13122@item literal example
13123a literal example block named with a @code{#+NAME:} line
13124
13125@example
13126#+NAME: literal-example
13127#+BEGIN_EXAMPLE
13128A literal example
13129on two lines
13130#+END_EXAMPLE
13131
13132#+NAME: read-literal-example
13133#+BEGIN_SRC emacs-lisp :var x=literal-example
13134 (concatenate 'string x " for you.")
13135#+END_SRC
13136
13137#+results: read-literal-example
13138: A literal example
13139: on two lines for you.
13140
13141@end example
13142
13143@end table
11686 13144
11687@subsubheading Alternate argument syntax 13145@subsubheading Alternate argument syntax
11688It is also possible to specify arguments in a potentially more natural way 13146It is also possible to specify arguments in a potentially more natural way
11689using the @code{#+source:} line of a code block. As in the following 13147using the @code{#+NAME:} line of a code block. As in the following
11690example arguments can be packed inside of parenthesis, separated by commas, 13148example, arguments can be packed inside of parentheses, separated by commas,
11691following the source name. 13149following the source name.
11692 13150
11693@example 13151@example
11694#+source: double(input=0, x=2) 13152#+NAME: double(input=0, x=2)
11695#+begin_src emacs-lisp 13153#+BEGIN_SRC emacs-lisp
11696(* 2 (+ input x)) 13154(* 2 (+ input x))
11697#+end_src 13155#+END_SRC
11698@end example 13156@end example
11699 13157
11700@subsubheading Indexable variable values 13158@subsubheading Indexable variable values
11701It is possible to reference portions of variable values by ``indexing'' into 13159It is possible to reference portions of variable values by ``indexing'' into
11702the variables. Indexes are 0 based with negative values counting back from 13160the variables. Indexes are 0 based with negative values counting back from
11703the end. If an index is separated by @code{,}s then each subsequent section 13161the end. If an index is separated by @code{,}s then each subsequent section
11704will index into the next deepest nesting or dimension of the value. The 13162will index into the next deepest nesting or dimension of the value. Note
13163that this indexing occurs @emph{before} other table related header arguments
13164like @code{:hlines}, @code{:colnames} and @code{:rownames} are applied. The
11705following example assigns the last cell of the first row the table 13165following example assigns the last cell of the first row the table
11706@code{example-table} to the variable @code{data}: 13166@code{example-table} to the variable @code{data}:
11707 13167
11708@example 13168@example
11709#+results: example-table 13169#+NAME: example-table
11710| 1 | a | 13170| 1 | a |
11711| 2 | b | 13171| 2 | b |
11712| 3 | c | 13172| 3 | c |
11713| 4 | d | 13173| 4 | d |
11714 13174
11715#+begin_src emacs-lisp :var data=example-table[0,-1] 13175#+BEGIN_SRC emacs-lisp :var data=example-table[0,-1]
11716 data 13176 data
11717#+end_src 13177#+END_SRC
11718 13178
11719#+results: 13179#+results:
11720: a 13180: a
@@ -11726,16 +13186,16 @@ example the following assigns the middle three rows of @code{example-table}
11726to @code{data}. 13186to @code{data}.
11727 13187
11728@example 13188@example
11729#+results: example-table 13189#+NAME: example-table
11730| 1 | a | 13190| 1 | a |
11731| 2 | b | 13191| 2 | b |
11732| 3 | c | 13192| 3 | c |
11733| 4 | d | 13193| 4 | d |
11734| 5 | 3 | 13194| 5 | 3 |
11735 13195
11736#+begin_src emacs-lisp :var data=example-table[1:3] 13196#+BEGIN_SRC emacs-lisp :var data=example-table[1:3]
11737 data 13197 data
11738#+end_src 13198#+END_SRC
11739 13199
11740#+results: 13200#+results:
11741| 2 | b | 13201| 2 | b |
@@ -11749,15 +13209,15 @@ interpreted to mean the entire range and as such are equivalent to
11749column is referenced. 13209column is referenced.
11750 13210
11751@example 13211@example
11752#+results: example-table 13212#+NAME: example-table
11753| 1 | a | 13213| 1 | a |
11754| 2 | b | 13214| 2 | b |
11755| 3 | c | 13215| 3 | c |
11756| 4 | d | 13216| 4 | d |
11757 13217
11758#+begin_src emacs-lisp :var data=example-table[,0] 13218#+BEGIN_SRC emacs-lisp :var data=example-table[,0]
11759 data 13219 data
11760#+end_src 13220#+END_SRC
11761 13221
11762#+results: 13222#+results:
11763| 1 | 2 | 3 | 4 | 13223| 1 | 2 | 3 | 4 |
@@ -11768,21 +13228,54 @@ Any number of dimensions can be indexed. Dimensions are separated from one
11768another by commas, as shown in the following example. 13228another by commas, as shown in the following example.
11769 13229
11770@example 13230@example
11771#+source: 3D 13231#+NAME: 3D
11772#+begin_src emacs-lisp 13232#+BEGIN_SRC emacs-lisp
11773 '(((1 2 3) (4 5 6) (7 8 9)) 13233 '(((1 2 3) (4 5 6) (7 8 9))
11774 ((10 11 12) (13 14 15) (16 17 18)) 13234 ((10 11 12) (13 14 15) (16 17 18))
11775 ((19 20 21) (22 23 24) (25 26 27))) 13235 ((19 20 21) (22 23 24) (25 26 27)))
11776#+end_src 13236#+END_SRC
11777 13237
11778#+begin_src emacs-lisp :var data=3D[1,,1] 13238#+BEGIN_SRC emacs-lisp :var data=3D[1,,1]
11779 data 13239 data
11780#+end_src 13240#+END_SRC
11781 13241
11782#+results: 13242#+results:
11783| 11 | 14 | 17 | 13243| 11 | 14 | 17 |
11784@end example 13244@end example
11785 13245
13246@subsubheading Emacs Lisp evaluation of variables
13247
13248Emacs lisp code can be used to initialize variable values. When a variable
13249value starts with @code{(}, @code{[}, @code{'} or @code{`} it will be
13250evaluated as Emacs Lisp and the result of the evaluation will be assigned as
13251the variable value. The following example demonstrates use of this
13252evaluation to reliably pass the file-name of the Org mode buffer to a code
13253block---note that evaluation of header arguments is guaranteed to take place
13254in the original Org mode file, while there is no such guarantee for
13255evaluation of the code block body.
13256
13257@example
13258#+BEGIN_SRC sh :var filename=(buffer-file-name) :exports both
13259 wc -w $filename
13260#+END_SRC
13261@end example
13262
13263Note that values read from tables and lists will not be evaluated as
13264Emacs Lisp, as shown in the following example.
13265
13266@example
13267#+NAME: table
13268| (a b c) |
13269
13270#+HEADERS: :var data=table[0,0]
13271#+BEGIN_SRC perl
13272 $data
13273#+END_SRC
13274
13275#+results:
13276: (a b c)
13277@end example
13278
11786@node results, file, var, Specific header arguments 13279@node results, file, var, Specific header arguments
11787@subsubsection @code{:results} 13280@subsubsection @code{:results}
11788 13281
@@ -11796,7 +13289,7 @@ from the code block
11796@item 13289@item
11797@b{type} header arguments specify what type of result the code block will 13290@b{type} header arguments specify what type of result the code block will
11798return---which has implications for how they will be inserted into the 13291return---which has implications for how they will be inserted into the
11799Org-mode buffer 13292Org mode buffer
11800@item 13293@item
11801@b{handling} header arguments specify how the results of evaluating the code 13294@b{handling} header arguments specify how the results of evaluating the code
11802block should be handled. 13295block should be handled.
@@ -11812,7 +13305,7 @@ This is the default. The result is the value of the last statement in the
11812code block. This header argument places the evaluation in functional 13305code block. This header argument places the evaluation in functional
11813mode. Note that in some languages, e.g., Python, use of this result type 13306mode. Note that in some languages, e.g., Python, use of this result type
11814requires that a @code{return} statement be included in the body of the source 13307requires that a @code{return} statement be included in the body of the source
11815code block. E.g., @code{:results value}. 13308code block. E.g., @code{:results value}.
11816@item @code{output} 13309@item @code{output}
11817The result is the collection of everything printed to STDOUT during the 13310The result is the collection of everything printed to STDOUT during the
11818execution of the code block. This header argument places the 13311execution of the code block. This header argument places the
@@ -11827,36 +13320,40 @@ table or scalar depending on their value.
11827 13320
11828@itemize @bullet 13321@itemize @bullet
11829@item @code{table}, @code{vector} 13322@item @code{table}, @code{vector}
11830The results should be interpreted as an Org-mode table. If a single value is 13323The results should be interpreted as an Org mode table. If a single value is
11831returned, it will be converted into a table with one row and one column. 13324returned, it will be converted into a table with one row and one column.
11832E.g., @code{:results value table}. 13325E.g., @code{:results value table}.
11833@item @code{list} 13326@item @code{list}
11834The results should be interpreted as an Org-mode list. If a single scalar 13327The results should be interpreted as an Org mode list. If a single scalar
11835value is returned it will be converted into a list with only one element. 13328value is returned it will be converted into a list with only one element.
11836@item @code{scalar}, @code{verbatim} 13329@item @code{scalar}, @code{verbatim}
11837The results should be interpreted literally---they will not be 13330The results should be interpreted literally---they will not be
11838converted into a table. The results will be inserted into the Org-mode 13331converted into a table. The results will be inserted into the Org mode
11839buffer as quoted text. E.g., @code{:results value verbatim}. 13332buffer as quoted text. E.g., @code{:results value verbatim}.
11840@item @code{file} 13333@item @code{file}
11841The results will be interpreted as the path to a file, and will be inserted 13334The results will be interpreted as the path to a file, and will be inserted
11842into the Org-mode buffer as a file link. E.g., @code{:results value file}. 13335into the Org mode buffer as a file link. E.g., @code{:results value file}.
11843@item @code{raw}, @code{org} 13336@item @code{raw}, @code{org}
11844The results are interpreted as raw Org-mode code and are inserted directly 13337The results are interpreted as raw Org mode code and are inserted directly
11845into the buffer. If the results look like a table they will be aligned as 13338into the buffer. If the results look like a table they will be aligned as
11846such by Org-mode. E.g., @code{:results value raw}. 13339such by Org mode. E.g., @code{:results value raw}.
11847@item @code{html} 13340@item @code{html}
11848Results are assumed to be HTML and will be enclosed in a @code{begin_html} 13341Results are assumed to be HTML and will be enclosed in a @code{begin_html}
11849block. E.g., @code{:results value html}. 13342block. E.g., @code{:results value html}.
11850@item @code{latex} 13343@item @code{latex}
11851Results assumed to be LaTeX and are enclosed in a @code{begin_latex} block. 13344Results assumed to be @LaTeX{} and are enclosed in a @code{begin_latex} block.
11852E.g., @code{:results value latex}. 13345E.g., @code{:results value latex}.
11853@item @code{code} 13346@item @code{code}
11854Result are assumed to be parseable code and are enclosed in a code block. 13347Result are assumed to be parsable code and are enclosed in a code block.
11855E.g., @code{:results value code}. 13348E.g., @code{:results value code}.
11856@item @code{pp} 13349@item @code{pp}
11857The result is converted to pretty-printed code and is enclosed in a code 13350The result is converted to pretty-printed code and is enclosed in a code
11858block. This option currently supports Emacs Lisp, Python, and Ruby. E.g., 13351block. This option currently supports Emacs Lisp, Python, and Ruby. E.g.,
11859@code{:results value pp}. 13352@code{:results value pp}.
13353@item @code{wrap}
13354The result is wrapped in a @code{begin_result} block. This can be useful for
13355inserting @code{raw} or @code{org} syntax results in such a way that their
13356extend is known and they can be automatically removed or replaced.
11860@end itemize 13357@end itemize
11861 13358
11862@subsubheading Handling 13359@subsubheading Handling
@@ -11866,10 +13363,10 @@ results once they are collected.
11866@itemize @bullet 13363@itemize @bullet
11867@item @code{silent} 13364@item @code{silent}
11868The results will be echoed in the minibuffer but will not be inserted into 13365The results will be echoed in the minibuffer but will not be inserted into
11869the Org-mode buffer. E.g., @code{:results output silent}. 13366the Org mode buffer. E.g., @code{:results output silent}.
11870@item @code{replace} 13367@item @code{replace}
11871The default value. Any existing results will be removed, and the new results 13368The default value. Any existing results will be removed, and the new results
11872will be inserted into the Org-mode buffer in their place. E.g., 13369will be inserted into the Org mode buffer in their place. E.g.,
11873@code{:results output replace}. 13370@code{:results output replace}.
11874@item @code{append} 13371@item @code{append}
11875If there are pre-existing results of the code block then the new results will 13372If there are pre-existing results of the code block then the new results will
@@ -11884,56 +13381,56 @@ inserted as with @code{replace}.
11884@node file, dir, results, Specific header arguments 13381@node file, dir, results, Specific header arguments
11885@subsubsection @code{:file} 13382@subsubsection @code{:file}
11886 13383
11887The header argument @code{:file} is used to specify a path for file output. 13384The header argument @code{:file} is used to specify an external file in which
11888An Org-mode style @code{file:} link is inserted into the buffer as the result 13385to save code block results. After code block evaluation an Org mode style
11889(see @ref{Link format}). Common examples are graphical output from R, 13386@code{[[file:]]} link (see @ref{Link format}) to the file will be inserted
11890gnuplot, ditaa and LaTeX code blocks. 13387into the Org mode buffer. Some languages including R, gnuplot, dot, and
11891 13388ditaa provide special handling of the @code{:file} header argument
11892Note that for some languages, including R, gnuplot, LaTeX and ditaa, 13389automatically wrapping the code block body in the boilerplate code required
11893graphical output is sent to the specified file without the file being 13390to save output to the specified file. This is often useful for saving
11894referenced explicitly in the code block. See the documentation for the 13391graphical output of a code block to the specified file.
11895individual languages for details. In contrast, general purpose languages such
11896as Python and Ruby require that the code explicitly create output
11897corresponding to the path indicated by @code{:file}.
11898 13392
13393The argument to @code{:file} should be either a string specifying the path to
13394a file, or a list of two strings in which case the first element of the list
13395should be the path to a file and the second a description for the link.
11899 13396
11900@node dir, exports, file, Specific header arguments 13397@node dir, exports, file, Specific header arguments
11901@subsubsection @code{:dir} and remote execution 13398@subsubsection @code{:dir} and remote execution
11902 13399
11903While the @code{:file} header argument can be used to specify the path to the 13400While the @code{:file} header argument can be used to specify the path to the
11904output file, @code{:dir} specifies the default directory during code block 13401output file, @code{:dir} specifies the default directory during code block
11905execution. If it is absent, then the directory associated with the current 13402execution. If it is absent, then the directory associated with the current
11906buffer is used. In other words, supplying @code{:dir path} temporarily has 13403buffer is used. In other words, supplying @code{:dir path} temporarily has
11907the same effect as changing the current directory with @kbd{M-x cd path}, and 13404the same effect as changing the current directory with @kbd{M-x cd path}, and
11908then not supplying @code{:dir}. Under the surface, @code{:dir} simply sets 13405then not supplying @code{:dir}. Under the surface, @code{:dir} simply sets
11909the value of the Emacs variable @code{default-directory}. 13406the value of the Emacs variable @code{default-directory}.
11910 13407
11911When using @code{:dir}, you should supply a relative path for file output 13408When using @code{:dir}, you should supply a relative path for file output
11912(e.g. @code{:file myfile.jpg} or @code{:file results/myfile.jpg}) in which 13409(e.g.@: @code{:file myfile.jpg} or @code{:file results/myfile.jpg}) in which
11913case that path will be interpreted relative to the default directory. 13410case that path will be interpreted relative to the default directory.
11914 13411
11915In other words, if you want your plot to go into a folder called @file{Work} 13412In other words, if you want your plot to go into a folder called @file{Work}
11916in your home directory, you could use 13413in your home directory, you could use
11917 13414
11918@example 13415@example
11919#+begin_src R :file myplot.png :dir ~/Work 13416#+BEGIN_SRC R :file myplot.png :dir ~/Work
11920matplot(matrix(rnorm(100), 10), type="l") 13417matplot(matrix(rnorm(100), 10), type="l")
11921#+end_src 13418#+END_SRC
11922@end example 13419@end example
11923 13420
11924@subsubheading Remote execution 13421@subsubheading Remote execution
11925A directory on a remote machine can be specified using tramp file syntax, in 13422A directory on a remote machine can be specified using tramp file syntax, in
11926which case the code will be evaluated on the remote machine. An example is 13423which case the code will be evaluated on the remote machine. An example is
11927 13424
11928@example 13425@example
11929#+begin_src R :file plot.png :dir /dand@@yakuba.princeton.edu: 13426#+BEGIN_SRC R :file plot.png :dir /dand@@yakuba.princeton.edu:
11930plot(1:10, main=system("hostname", intern=TRUE)) 13427plot(1:10, main=system("hostname", intern=TRUE))
11931#+end_src 13428#+END_SRC
11932@end example 13429@end example
11933 13430
11934Text results will be returned to the local Org-mode buffer as usual, and file 13431Text results will be returned to the local Org mode buffer as usual, and file
11935output will be created on the remote machine with relative paths interpreted 13432output will be created on the remote machine with relative paths interpreted
11936relative to the remote directory. An Org-mode link to the remote file will be 13433relative to the remote directory. An Org mode link to the remote file will be
11937created. 13434created.
11938 13435
11939So, in the above example a plot will be created on the remote machine, 13436So, in the above example a plot will be created on the remote machine,
@@ -11945,7 +13442,7 @@ and a link of the following form will be inserted in the org buffer:
11945 13442
11946Most of this functionality follows immediately from the fact that @code{:dir} 13443Most of this functionality follows immediately from the fact that @code{:dir}
11947sets the value of the Emacs variable @code{default-directory}, thanks to 13444sets the value of the Emacs variable @code{default-directory}, thanks to
11948tramp. Those using XEmacs, or GNU Emacs prior to version 23 may need to 13445tramp. Those using XEmacs, or GNU Emacs prior to version 23 may need to
11949install tramp separately in order for these features to work correctly. 13446install tramp separately in order for these features to work correctly.
11950 13447
11951@subsubheading Further points 13448@subsubheading Further points
@@ -11957,10 +13454,10 @@ determine the starting directory for a new session as expected, no attempt is
11957currently made to alter the directory associated with an existing session. 13454currently made to alter the directory associated with an existing session.
11958@item 13455@item
11959@code{:dir} should typically not be used to create files during export with 13456@code{:dir} should typically not be used to create files during export with
11960@code{:exports results} or @code{:exports both}. The reason is that, in order 13457@code{:exports results} or @code{:exports both}. The reason is that, in order
11961to retain portability of exported material between machines, during export 13458to retain portability of exported material between machines, during export
11962links inserted into the buffer will *not* be expanded against @code{default 13459links inserted into the buffer will @emph{not} be expanded against @code{default
11963directory}. Therefore, if @code{default-directory} is altered using 13460directory}. Therefore, if @code{default-directory} is altered using
11964@code{:dir}, it is probable that the file will be created in a location to 13461@code{:dir}, it is probable that the file will be created in a location to
11965which the link does not point. 13462which the link does not point.
11966@end itemize 13463@end itemize
@@ -11969,23 +13466,23 @@ which the link does not point.
11969@subsubsection @code{:exports} 13466@subsubsection @code{:exports}
11970 13467
11971The @code{:exports} header argument specifies what should be included in HTML 13468The @code{:exports} header argument specifies what should be included in HTML
11972or LaTeX exports of the Org-mode file. 13469or @LaTeX{} exports of the Org mode file.
11973 13470
11974@itemize @bullet 13471@itemize @bullet
11975@item @code{code} 13472@item @code{code}
11976The default. The body of code is included into the exported file. E.g., 13473The default. The body of code is included into the exported file. E.g.,
11977@code{:exports code}. 13474@code{:exports code}.
11978@item @code{results} 13475@item @code{results}
11979The result of evaluating the code is included in the exported file. E.g., 13476The result of evaluating the code is included in the exported file. E.g.,
11980@code{:exports results}. 13477@code{:exports results}.
11981@item @code{both} 13478@item @code{both}
11982Both the code and results are included in the exported file. E.g., 13479Both the code and results are included in the exported file. E.g.,
11983@code{:exports both}. 13480@code{:exports both}.
11984@item @code{none} 13481@item @code{none}
11985Nothing is included in the exported file. E.g., @code{:exports none}. 13482Nothing is included in the exported file. E.g., @code{:exports none}.
11986@end itemize 13483@end itemize
11987 13484
11988@node tangle, comments, exports, Specific header arguments 13485@node tangle, mkdirp, exports, Specific header arguments
11989@subsubsection @code{:tangle} 13486@subsubsection @code{:tangle}
11990 13487
11991The @code{:tangle} header argument specifies whether or not the code 13488The @code{:tangle} header argument specifies whether or not the code
@@ -11993,19 +13490,26 @@ block should be included in tangled extraction of source code files.
11993 13490
11994@itemize @bullet 13491@itemize @bullet
11995@item @code{tangle} 13492@item @code{tangle}
11996The code block is exported to a source code file named after the 13493The code block is exported to a source code file named after the full path
11997basename (name w/o extension) of the Org-mode file. E.g., @code{:tangle 13494(including the directory) and file name (w/o extension) of the Org mode file.
11998yes}. 13495E.g., @code{:tangle yes}.
11999@item @code{no} 13496@item @code{no}
12000The default. The code block is not exported to a source code file. 13497The default. The code block is not exported to a source code file.
12001E.g., @code{:tangle no}. 13498E.g., @code{:tangle no}.
12002@item other 13499@item other
12003Any other string passed to the @code{:tangle} header argument is interpreted 13500Any other string passed to the @code{:tangle} header argument is interpreted
12004as a file basename to which the block will be exported. E.g., @code{:tangle 13501as a path (directory and file name relative to the directory of the Org mode
12005basename}. 13502file) to which the block will be exported. E.g., @code{:tangle path}.
12006@end itemize 13503@end itemize
12007 13504
12008@node comments, no-expand, tangle, Specific header arguments 13505@node mkdirp, comments, tangle, Specific header arguments
13506@subsubsection @code{:mkdirp}
13507
13508The @code{:mkdirp} header argument can be used to create parent directories
13509of tangled files when missing. This can be set to @code{yes} to enable
13510directory creation or to @code{no} to inhibit directory creation.
13511
13512@node comments, padline, mkdirp, Specific header arguments
12009@subsubsection @code{:comments} 13513@subsubsection @code{:comments}
12010By default code blocks are tangled to source-code files without any insertion 13514By default code blocks are tangled to source-code files without any insertion
12011of comments beyond those which may already exist in the body of the code 13515of comments beyond those which may already exist in the body of the code
@@ -12021,15 +13525,32 @@ original Org file from which the code was tangled.
12021@item @code{yes} 13525@item @code{yes}
12022A synonym for ``link'' to maintain backwards compatibility. 13526A synonym for ``link'' to maintain backwards compatibility.
12023@item @code{org} 13527@item @code{org}
12024Include text from the org-mode file as a comment. 13528Include text from the Org mode file as a comment.
12025 13529
12026The text is picked from the leading context of the tangled code and is 13530The text is picked from the leading context of the tangled code and is
12027limited by the nearest headline or source block as the case may be. 13531limited by the nearest headline or source block as the case may be.
12028@item @code{both} 13532@item @code{both}
12029Turns on both the ``link'' and ``org'' comment options. 13533Turns on both the ``link'' and ``org'' comment options.
13534@item @code{noweb}
13535Turns on the ``link'' comment option, and additionally wraps expanded noweb
13536references in the code block body in link comments.
12030@end itemize 13537@end itemize
12031 13538
12032@node no-expand, session, comments, Specific header arguments 13539@node padline, no-expand, comments, Specific header arguments
13540@subsubsection @code{:padline}
13541Control in insertion of padding lines around code block bodies in tangled
13542code files. The default value is @code{yes} which results in insertion of
13543newlines before and after each tangled code block. The following arguments
13544are accepted.
13545
13546@itemize @bullet
13547@item @code{yes}
13548Insert newlines before and after each code block body in tangled code files.
13549@item @code{no}
13550Do not insert any newline padding in tangled output.
13551@end itemize
13552
13553@node no-expand, session, padline, Specific header arguments
12033@subsubsection @code{:no-expand} 13554@subsubsection @code{:no-expand}
12034 13555
12035By default, code blocks are expanded with @code{org-babel-expand-src-block} 13556By default, code blocks are expanded with @code{org-babel-expand-src-block}
@@ -12050,12 +13571,12 @@ A string passed to the @code{:session} header argument will give the session
12050a name. This makes it possible to run concurrent sessions for each 13571a name. This makes it possible to run concurrent sessions for each
12051interpreted language. 13572interpreted language.
12052 13573
12053@node noweb, cache, session, Specific header arguments 13574@node noweb, noweb-ref, session, Specific header arguments
12054@subsubsection @code{:noweb} 13575@subsubsection @code{:noweb}
12055 13576
12056The @code{:noweb} header argument controls expansion of ``noweb'' style (see 13577The @code{:noweb} header argument controls expansion of ``noweb'' style (see
12057@ref{Noweb reference syntax}) references in a code block. This header 13578@ref{Noweb reference syntax}) references in a code block. This header
12058argument can have one of three values: @code{yes} @code{no} or @code{tangle}. 13579argument can have one of three values: @code{yes}, @code{no}, or @code{tangle}.
12059 13580
12060@itemize @bullet 13581@itemize @bullet
12061@item @code{yes} 13582@item @code{yes}
@@ -12096,7 +13617,51 @@ Note that noweb replacement text that does not contain any newlines will not
12096be affected by this change, so it is still possible to use inline noweb 13617be affected by this change, so it is still possible to use inline noweb
12097references. 13618references.
12098 13619
12099@node cache, hlines, noweb, Specific header arguments 13620@node noweb-ref, cache, noweb, Specific header arguments
13621@subsubsection @code{:noweb-ref}
13622When expanding ``noweb'' style references the bodies of all code block with
13623@emph{either} a block name matching the reference name @emph{or} a
13624@code{:noweb-ref} header argument matching the reference name will be
13625concatenated together to form the replacement text.
13626
13627By setting this header argument at the sub-tree or file level, simple code
13628block concatenation may be achieved. For example, when tangling the
13629following Org mode file, the bodies of code blocks will be concatenated into
13630the resulting pure code file@footnote{(The example needs property inheritance
13631to be turned on for the @code{noweb-ref} property, see @ref{Property
13632inheritance}).}.
13633
13634@example
13635 #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh
13636 <<fullest-disk>>
13637 #+END_SRC
13638 * the mount point of the fullest disk
13639 :PROPERTIES:
13640 :noweb-ref: fullest-disk
13641 :END:
13642
13643 ** query all mounted disks
13644 #+BEGIN_SRC sh
13645 df \
13646 #+END_SRC
13647
13648 ** strip the header row
13649 #+BEGIN_SRC sh
13650 |sed '1d' \
13651 #+END_SRC
13652
13653 ** sort by the percent full
13654 #+BEGIN_SRC sh
13655 |awk '@{print $5 " " $6@}'|sort -n |tail -1 \
13656 #+END_SRC
13657
13658 ** extract the mount point
13659 #+BEGIN_SRC sh
13660 |awk '@{print $2@}'
13661 #+END_SRC
13662@end example
13663
13664@node cache, sep, noweb-ref, Specific header arguments
12100@subsubsection @code{:cache} 13665@subsubsection @code{:cache}
12101 13666
12102The @code{:cache} header argument controls the use of in-buffer caching of 13667The @code{:cache} header argument controls the use of in-buffer caching of
@@ -12116,7 +13681,44 @@ executions of the code block. If the code block has not
12116changed since the last time it was evaluated, it will not be re-evaluated. 13681changed since the last time it was evaluated, it will not be re-evaluated.
12117@end itemize 13682@end itemize
12118 13683
12119@node hlines, colnames, cache, Specific header arguments 13684Code block caches notice if the value of a variable argument
13685to the code block has changed. If this is the case, the cache is
13686invalidated and the code block is re-run. In the following example,
13687@code{caller} will not be re-run unless the results of @code{random} have
13688changed since it was last run.
13689
13690@example
13691 #+NAME: random
13692 #+BEGIN_SRC R :cache yes
13693 runif(1)
13694 #+END_SRC
13695
13696 #+results[a2a72cd647ad44515fab62e144796432793d68e1]: random
13697 0.4659510825295
13698
13699 #+NAME: caller
13700 #+BEGIN_SRC emacs-lisp :var x=random :cache yes
13701 x
13702 #+END_SRC
13703
13704 #+results[bec9c8724e397d5df3b696502df3ed7892fc4f5f]: caller
13705 0.254227238707244
13706@end example
13707
13708@node sep, hlines, cache, Specific header arguments
13709@subsubsection @code{:sep}
13710
13711The @code{:sep} header argument can be used to control the delimiter used
13712when writing tabular results out to files external to Org mode. This is used
13713either when opening tabular results of a code block by calling the
13714@code{org-open-at-point} function bound to @kbd{C-c C-o} on the code block,
13715or when writing code block results to an external file (see @ref{file})
13716header argument.
13717
13718By default, when @code{:sep} is not specified output tables are tab
13719delimited.
13720
13721@node hlines, colnames, sep, Specific header arguments
12120@subsubsection @code{:hlines} 13722@subsubsection @code{:hlines}
12121 13723
12122Tables are frequently represented with one or more horizontal lines, or 13724Tables are frequently represented with one or more horizontal lines, or
@@ -12131,17 +13733,17 @@ variable and raises an error. Setting @code{:hlines no} or relying on the
12131default value yields the following results. 13733default value yields the following results.
12132 13734
12133@example 13735@example
12134#+tblname: many-cols 13736#+TBLNAME: many-cols
12135| a | b | c | 13737| a | b | c |
12136|---+---+---| 13738|---+---+---|
12137| d | e | f | 13739| d | e | f |
12138|---+---+---| 13740|---+---+---|
12139| g | h | i | 13741| g | h | i |
12140 13742
12141#+source: echo-table 13743#+NAME: echo-table
12142#+begin_src python :var tab=many-cols 13744#+BEGIN_SRC python :var tab=many-cols
12143 return tab 13745 return tab
12144#+end_src 13746#+END_SRC
12145 13747
12146#+results: echo-table 13748#+results: echo-table
12147| a | b | c | 13749| a | b | c |
@@ -12150,20 +13752,20 @@ default value yields the following results.
12150@end example 13752@end example
12151 13753
12152@item @code{yes} 13754@item @code{yes}
12153Leaves hlines in the table. Setting @code{:hlines yes} has this effect. 13755Leaves hlines in the table. Setting @code{:hlines yes} has this effect.
12154 13756
12155@example 13757@example
12156#+tblname: many-cols 13758#+TBLNAME: many-cols
12157| a | b | c | 13759| a | b | c |
12158|---+---+---| 13760|---+---+---|
12159| d | e | f | 13761| d | e | f |
12160|---+---+---| 13762|---+---+---|
12161| g | h | i | 13763| g | h | i |
12162 13764
12163#+source: echo-table 13765#+NAME: echo-table
12164#+begin_src python :var tab=many-cols :hlines yes 13766#+BEGIN_SRC python :var tab=many-cols :hlines yes
12165 return tab 13767 return tab
12166#+end_src 13768#+END_SRC
12167 13769
12168#+results: echo-table 13770#+results: echo-table
12169| a | b | c | 13771| a | b | c |
@@ -12179,6 +13781,10 @@ Leaves hlines in the table. Setting @code{:hlines yes} has this effect.
12179 13781
12180The @code{:colnames} header argument accepts the values @code{yes}, 13782The @code{:colnames} header argument accepts the values @code{yes},
12181@code{no}, or @code{nil} for unassigned. The default value is @code{nil}. 13783@code{no}, or @code{nil} for unassigned. The default value is @code{nil}.
13784Note that the behavior of the @code{:colnames} header argument may differ
13785across languages. For example Emacs Lisp code blocks ignore the
13786@code{:colnames} header argument entirely given the ease with which tables
13787with column names may be handled directly in Emacs Lisp.
12182 13788
12183@itemize @bullet 13789@itemize @bullet
12184@item @code{nil} 13790@item @code{nil}
@@ -12188,16 +13794,16 @@ names will be removed from the table before
12188processing, then reapplied to the results. 13794processing, then reapplied to the results.
12189 13795
12190@example 13796@example
12191#+tblname: less-cols 13797#+TBLNAME: less-cols
12192| a | 13798| a |
12193|---| 13799|---|
12194| b | 13800| b |
12195| c | 13801| c |
12196 13802
12197#+srcname: echo-table-again 13803#+NAME: echo-table-again
12198#+begin_src python :var tab=less-cols 13804#+BEGIN_SRC python :var tab=less-cols
12199 return [[val + '*' for val in row] for row in tab] 13805 return [[val + '*' for val in row] for row in tab]
12200#+end_src 13806#+END_SRC
12201 13807
12202#+results: echo-table-again 13808#+results: echo-table-again
12203| a | 13809| a |
@@ -12206,12 +13812,15 @@ processing, then reapplied to the results.
12206| c* | 13812| c* |
12207@end example 13813@end example
12208 13814
13815Please note that column names are not removed before the table is indexed
13816using variable indexing @xref{var, Indexable variable values}.
13817
12209@item @code{no} 13818@item @code{no}
12210No column name pre-processing takes place 13819No column name pre-processing takes place
12211 13820
12212@item @code{yes} 13821@item @code{yes}
12213Column names are removed and reapplied as with @code{nil} even if the table 13822Column names are removed and reapplied as with @code{nil} even if the table
12214does not ``look like'' it has column names (i.e. the second row is not an 13823does not ``look like'' it has column names (i.e.@: the second row is not an
12215hline) 13824hline)
12216@end itemize 13825@end itemize
12217 13826
@@ -12230,38 +13839,57 @@ The first column of the table is removed from the table before processing,
12230and is then reapplied to the results. 13839and is then reapplied to the results.
12231 13840
12232@example 13841@example
12233#+tblname: with-rownames 13842#+TBLNAME: with-rownames
12234| one | 1 | 2 | 3 | 4 | 5 | 13843| one | 1 | 2 | 3 | 4 | 5 |
12235| two | 6 | 7 | 8 | 9 | 10 | 13844| two | 6 | 7 | 8 | 9 | 10 |
12236 13845
12237#+srcname: echo-table-once-again 13846#+NAME: echo-table-once-again
12238#+begin_src python :var tab=with-rownames :rownames yes 13847#+BEGIN_SRC python :var tab=with-rownames :rownames yes
12239 return [[val + 10 for val in row] for row in tab] 13848 return [[val + 10 for val in row] for row in tab]
12240#+end_src 13849#+END_SRC
12241 13850
12242#+results: echo-table-once-again 13851#+results: echo-table-once-again
12243| one | 11 | 12 | 13 | 14 | 15 | 13852| one | 11 | 12 | 13 | 14 | 15 |
12244| two | 16 | 17 | 18 | 19 | 20 | 13853| two | 16 | 17 | 18 | 19 | 20 |
12245@end example 13854@end example
13855
13856Please note that row names are not removed before the table is indexed using
13857variable indexing @xref{var, Indexable variable values}.
13858
12246@end itemize 13859@end itemize
12247 13860
12248@node shebang, eval, rownames, Specific header arguments 13861@node shebang, eval, rownames, Specific header arguments
12249@subsubsection @code{:shebang} 13862@subsubsection @code{:shebang}
12250 13863
12251Setting the @code{:shebang} header argument to a string value 13864Setting the @code{:shebang} header argument to a string value
12252(e.g. @code{:shebang "#!/bin/bash"}) causes the string to be inserted as the 13865(e.g.@: @code{:shebang "#!/bin/bash"}) causes the string to be inserted as the
12253first line of any tangled file holding the code block, and the file 13866first line of any tangled file holding the code block, and the file
12254permissions of the tangled file are set to make it executable. 13867permissions of the tangled file are set to make it executable.
12255 13868
12256@node eval, , shebang, Specific header arguments 13869@node eval, , shebang, Specific header arguments
12257@subsubsection @code{:eval} 13870@subsubsection @code{:eval}
12258The @code{:eval} header argument can be used to limit the evaluation of 13871The @code{:eval} header argument can be used to limit the evaluation of
12259specific code blocks. @code{:eval} accepts two arguments ``never'' and 13872specific code blocks. The @code{:eval} header argument can be useful for
12260``query''. @code{:eval never} will ensure that a code block is never 13873protecting against the evaluation of dangerous code blocks or to ensure that
12261evaluated, this can be useful for protecting against the evaluation of 13874evaluation will require a query regardless of the value of the
12262dangerous code blocks. @code{:eval query} will require a query for every 13875@code{org-confirm-babel-evaluate} variable. The possible values of
12263execution of a code block regardless of the value of the 13876@code{:eval} and their effects are shown below.
12264@code{org-confirm-babel-evaluate} variable. 13877
13878@table @code
13879@item never or no
13880The code block will not be evaluated under any circumstances.
13881@item query
13882Evaluation of the code block will require a query.
13883@item never-export or no-export
13884The code block will not be evaluated during export but may still be called
13885interactively.
13886@item query-export
13887Evaluation of the code block during export will require a query.
13888@end table
13889
13890If this header argument is not set then evaluation is determined by the value
13891of the @code{org-confirm-babel-evaluate} variable see @ref{Code evaluation
13892security}.
12265 13893
12266@node Results of evaluation, Noweb reference syntax, Header arguments, Working With Source Code 13894@node Results of evaluation, Noweb reference syntax, Header arguments, Working With Source Code
12267@section Results of evaluation 13895@section Results of evaluation
@@ -12270,7 +13898,8 @@ execution of a code block regardless of the value of the
12270 13898
12271The way in which results are handled depends on whether a session is invoked, 13899The way in which results are handled depends on whether a session is invoked,
12272as well as on whether @code{:results value} or @code{:results output} is 13900as well as on whether @code{:results value} or @code{:results output} is
12273used. The following table shows the possibilities: 13901used. The following table shows the table possibilities. For a full listing
13902of the possible results header arguments see @ref{results}.
12274 13903
12275@multitable @columnfractions 0.26 0.33 0.41 13904@multitable @columnfractions 0.26 0.33 0.41
12276@item @tab @b{Non-session} @tab @b{Session} 13905@item @tab @b{Non-session} @tab @b{Session}
@@ -12279,15 +13908,15 @@ used. The following table shows the possibilities:
12279@end multitable 13908@end multitable
12280 13909
12281Note: With @code{:results value}, the result in both @code{:session} and 13910Note: With @code{:results value}, the result in both @code{:session} and
12282non-session is returned to Org-mode as a table (a one- or two-dimensional 13911non-session is returned to Org mode as a table (a one- or two-dimensional
12283vector of strings or numbers) when appropriate. 13912vector of strings or numbers) when appropriate.
12284 13913
12285@subsection Non-session 13914@subsection Non-session
12286@subsubsection @code{:results value} 13915@subsubsection @code{:results value}
12287This is the default. Internally, the value is obtained by wrapping the code 13916This is the default. Internally, the value is obtained by wrapping the code
12288in a function definition in the external language, and evaluating that 13917in a function definition in the external language, and evaluating that
12289function. Therefore, code should be written as if it were the body of such a 13918function. Therefore, code should be written as if it were the body of such a
12290function. In particular, note that Python does not automatically return a 13919function. In particular, note that Python does not automatically return a
12291value from a function unless a @code{return} statement is present, and so a 13920value from a function unless a @code{return} statement is present, and so a
12292@samp{return} statement will usually be required in Python. 13921@samp{return} statement will usually be required in Python.
12293 13922
@@ -12296,54 +13925,62 @@ automatically wrapped in a function definition.
12296 13925
12297@subsubsection @code{:results output} 13926@subsubsection @code{:results output}
12298The code is passed to the interpreter as an external process, and the 13927The code is passed to the interpreter as an external process, and the
12299contents of the standard output stream are returned as text. (In certain 13928contents of the standard output stream are returned as text. (In certain
12300languages this also contains the error output stream; this is an area for 13929languages this also contains the error output stream; this is an area for
12301future work.) 13930future work.)
12302 13931
12303@subsection Session 13932@subsection Session
12304@subsubsection @code{:results value} 13933@subsubsection @code{:results value}
12305The code is passed to the interpreter running as an interactive Emacs 13934The code is passed to an interpreter running as an interactive Emacs inferior
12306inferior process. The result returned is the result of the last evaluation 13935process. Only languages which provide tools for interactive evaluation of
12307performed by the interpreter. (This is obtained in a language-specific 13936code have session support, so some language (e.g., C and ditaa) do not
12308manner: the value of the variable @code{_} in Python and Ruby, and the value 13937support the @code{:session} header argument, and in other languages (e.g.,
12309of @code{.Last.value} in R). 13938Python and Haskell) which have limitations on the code which may be entered
13939into interactive sessions, those limitations apply to the code in code blocks
13940using the @code{:session} header argument as well.
13941
13942Unless the @code{:results output} option is supplied (see below) the result
13943returned is the result of the last evaluation performed by the
13944interpreter. (This is obtained in a language-specific manner: the value of
13945the variable @code{_} in Python and Ruby, and the value of @code{.Last.value}
13946in R).
12310 13947
12311@subsubsection @code{:results output} 13948@subsubsection @code{:results output}
12312The code is passed to the interpreter running as an interactive Emacs 13949The code is passed to the interpreter running as an interactive Emacs
12313inferior process. The result returned is the concatenation of the sequence of 13950inferior process. The result returned is the concatenation of the sequence of
12314(text) output from the interactive interpreter. Notice that this is not 13951(text) output from the interactive interpreter. Notice that this is not
12315necessarily the same as what would be sent to @code{STDOUT} if the same code 13952necessarily the same as what would be sent to @code{STDOUT} if the same code
12316were passed to a non-interactive interpreter running as an external 13953were passed to a non-interactive interpreter running as an external
12317process. For example, compare the following two blocks: 13954process. For example, compare the following two blocks:
12318 13955
12319@example 13956@example
12320#+begin_src python :results output 13957#+BEGIN_SRC python :results output
12321 print "hello" 13958 print "hello"
12322 2 13959 2
12323 print "bye" 13960 print "bye"
12324#+end_src 13961#+END_SRC
12325 13962
12326#+resname: 13963#+results:
12327: hello 13964: hello
12328: bye 13965: bye
12329@end example 13966@end example
12330 13967
12331In non-session mode, the `2' is not printed and does not appear. 13968In non-session mode, the `2' is not printed and does not appear.
12332@example 13969@example
12333#+begin_src python :results output :session 13970#+BEGIN_SRC python :results output :session
12334 print "hello" 13971 print "hello"
12335 2 13972 2
12336 print "bye" 13973 print "bye"
12337#+end_src 13974#+END_SRC
12338 13975
12339#+resname: 13976#+results:
12340: hello 13977: hello
12341: 2 13978: 2
12342: bye 13979: bye
12343@end example 13980@end example
12344 13981
12345But in @code{:session} mode, the interactive interpreter receives input `2' 13982But in @code{:session} mode, the interactive interpreter receives input `2'
12346and prints out its value, `2'. (Indeed, the other print statements are 13983and prints out its value, `2'. (Indeed, the other print statements are
12347unnecessary here). 13984unnecessary here).
12348 13985
12349@node Noweb reference syntax, Key bindings and useful functions, Results of evaluation, Working With Source Code 13986@node Noweb reference syntax, Key bindings and useful functions, Results of evaluation, Working With Source Code
@@ -12364,7 +14001,8 @@ When a code block is tangled or evaluated, whether or not ``noweb''
12364references are expanded depends upon the value of the @code{:noweb} header 14001references are expanded depends upon the value of the @code{:noweb} header
12365argument. If @code{:noweb yes}, then a Noweb reference is expanded before 14002argument. If @code{:noweb yes}, then a Noweb reference is expanded before
12366evaluation. If @code{:noweb no}, the default, then the reference is not 14003evaluation. If @code{:noweb no}, the default, then the reference is not
12367expanded before evaluation. 14004expanded before evaluation. See the @ref{noweb-ref} header argument for
14005a more flexible way to resolve noweb references.
12368 14006
12369Note: the default value, @code{:noweb no}, was chosen to ensure that 14007Note: the default value, @code{:noweb no}, was chosen to ensure that
12370correct code is not broken in a language, such as Ruby, where 14008correct code is not broken in a language, such as Ruby, where
@@ -12372,11 +14010,17 @@ correct code is not broken in a language, such as Ruby, where
12372syntactically valid in languages that you use, then please consider setting 14010syntactically valid in languages that you use, then please consider setting
12373the default value. 14011the default value.
12374 14012
14013Note: if noweb tangling is slow in large Org-mode files consider setting the
14014@code{*org-babel-use-quick-and-dirty-noweb-expansion*} variable to true.
14015This will result in faster noweb reference resolution at the expense of not
14016correctly resolving inherited values of the @code{:noweb-ref} header
14017argument.
14018
12375@node Key bindings and useful functions, Batch execution, Noweb reference syntax, Working With Source Code 14019@node Key bindings and useful functions, Batch execution, Noweb reference syntax, Working With Source Code
12376@section Key bindings and useful functions 14020@section Key bindings and useful functions
12377@cindex code block, key bindings 14021@cindex code block, key bindings
12378 14022
12379Many common Org-mode key sequences are re-bound depending on 14023Many common Org mode key sequences are re-bound depending on
12380the context. 14024the context.
12381 14025
12382Within a code block, the following key bindings 14026Within a code block, the following key bindings
@@ -12384,60 +14028,60 @@ are active:
12384 14028
12385@multitable @columnfractions 0.25 0.75 14029@multitable @columnfractions 0.25 0.75
12386@kindex C-c C-c 14030@kindex C-c C-c
12387@item @kbd{C-c C-c} @tab org-babel-execute-src-block 14031@item @kbd{C-c C-c} @tab @code{org-babel-execute-src-block}
12388@kindex C-c C-o 14032@kindex C-c C-o
12389@item @kbd{C-c C-o} @tab org-babel-open-src-block-result 14033@item @kbd{C-c C-o} @tab @code{org-babel-open-src-block-result}
12390@kindex C-up 14034@kindex C-up
12391@item @kbd{C-@key{up}} @tab org-babel-load-in-session 14035@item @kbd{C-@key{up}} @tab @code{org-babel-load-in-session}
12392@kindex M-down 14036@kindex M-down
12393@item @kbd{M-@key{down}} @tab org-babel-pop-to-session 14037@item @kbd{M-@key{down}} @tab @code{org-babel-pop-to-session}
12394@end multitable 14038@end multitable
12395 14039
12396In an Org-mode buffer, the following key bindings are active: 14040In an Org mode buffer, the following key bindings are active:
12397 14041
12398@multitable @columnfractions 0.45 0.55 14042@multitable @columnfractions 0.45 0.55
12399@kindex C-c C-v a 14043@kindex C-c C-v a
12400@kindex C-c C-v C-a 14044@kindex C-c C-v C-a
12401@item @kbd{C-c C-v a} @ @ @r{or} @ @ @kbd{C-c C-v C-a} @tab org-babel-sha1-hash 14045@item @kbd{C-c C-v a} @ @ @r{or} @ @ @kbd{C-c C-v C-a} @tab @code{org-babel-sha1-hash}
12402@kindex C-c C-v b 14046@kindex C-c C-v b
12403@kindex C-c C-v C-b 14047@kindex C-c C-v C-b
12404@item @kbd{C-c C-v b} @ @ @r{or} @ @ @kbd{C-c C-v C-b} @tab org-babel-execute-buffer 14048@item @kbd{C-c C-v b} @ @ @r{or} @ @ @kbd{C-c C-v C-b} @tab @code{org-babel-execute-buffer}
12405@kindex C-c C-v f 14049@kindex C-c C-v f
12406@kindex C-c C-v C-f 14050@kindex C-c C-v C-f
12407@item @kbd{C-c C-v f} @ @ @r{or} @ @ @kbd{C-c C-v C-f} @tab org-babel-tangle-file 14051@item @kbd{C-c C-v f} @ @ @r{or} @ @ @kbd{C-c C-v C-f} @tab @code{org-babel-tangle-file}
12408@kindex C-c C-v g 14052@kindex C-c C-v g
12409@item @kbd{C-c C-v g} @tab org-babel-goto-named-source-block 14053@item @kbd{C-c C-v g} @tab @code{org-babel-goto-named-source-block}
12410@kindex C-c C-v h 14054@kindex C-c C-v h
12411@item @kbd{C-c C-v h} @tab org-babel-describe-bindings 14055@item @kbd{C-c C-v h} @tab @code{org-babel-describe-bindings}
12412@kindex C-c C-v l 14056@kindex C-c C-v l
12413@kindex C-c C-v C-l 14057@kindex C-c C-v C-l
12414@item @kbd{C-c C-v l} @ @ @r{or} @ @ @kbd{C-c C-v C-l} @tab org-babel-lob-ingest 14058@item @kbd{C-c C-v l} @ @ @r{or} @ @ @kbd{C-c C-v C-l} @tab @code{org-babel-lob-ingest}
12415@kindex C-c C-v p 14059@kindex C-c C-v p
12416@kindex C-c C-v C-p 14060@kindex C-c C-v C-p
12417@item @kbd{C-c C-v p} @ @ @r{or} @ @ @kbd{C-c C-v C-p} @tab org-babel-expand-src-block 14061@item @kbd{C-c C-v p} @ @ @r{or} @ @ @kbd{C-c C-v C-p} @tab @code{org-babel-expand-src-block}
12418@kindex C-c C-v s 14062@kindex C-c C-v s
12419@kindex C-c C-v C-s 14063@kindex C-c C-v C-s
12420@item @kbd{C-c C-v s} @ @ @r{or} @ @ @kbd{C-c C-v C-s} @tab org-babel-execute-subtree 14064@item @kbd{C-c C-v s} @ @ @r{or} @ @ @kbd{C-c C-v C-s} @tab @code{org-babel-execute-subtree}
12421@kindex C-c C-v t 14065@kindex C-c C-v t
12422@kindex C-c C-v C-t 14066@kindex C-c C-v C-t
12423@item @kbd{C-c C-v t} @ @ @r{or} @ @ @kbd{C-c C-v C-t} @tab org-babel-tangle 14067@item @kbd{C-c C-v t} @ @ @r{or} @ @ @kbd{C-c C-v C-t} @tab @code{org-babel-tangle}
12424@kindex C-c C-v z 14068@kindex C-c C-v z
12425@kindex C-c C-v C-z 14069@kindex C-c C-v C-z
12426@item @kbd{C-c C-v z} @ @ @r{or} @ @ @kbd{C-c C-v C-z} @tab org-babel-switch-to-session 14070@item @kbd{C-c C-v z} @ @ @r{or} @ @ @kbd{C-c C-v C-z} @tab @code{org-babel-switch-to-session}
12427@end multitable 14071@end multitable
12428 14072
12429@c When possible these keybindings were extended to work when the control key is 14073@c When possible these keybindings were extended to work when the control key is
12430@c kept pressed, resulting in the following additional keybindings. 14074@c kept pressed, resulting in the following additional keybindings.
12431 14075
12432@c @multitable @columnfractions 0.25 0.75 14076@c @multitable @columnfractions 0.25 0.75
12433@c @item @kbd{C-c C-v C-a} @tab org-babel-sha1-hash 14077@c @item @kbd{C-c C-v C-a} @tab @code{org-babel-sha1-hash}
12434@c @item @kbd{C-c C-v C-b} @tab org-babel-execute-buffer 14078@c @item @kbd{C-c C-v C-b} @tab @code{org-babel-execute-buffer}
12435@c @item @kbd{C-c C-v C-f} @tab org-babel-tangle-file 14079@c @item @kbd{C-c C-v C-f} @tab @code{org-babel-tangle-file}
12436@c @item @kbd{C-c C-v C-l} @tab org-babel-lob-ingest 14080@c @item @kbd{C-c C-v C-l} @tab @code{org-babel-lob-ingest}
12437@c @item @kbd{C-c C-v C-p} @tab org-babel-expand-src-block 14081@c @item @kbd{C-c C-v C-p} @tab @code{org-babel-expand-src-block}
12438@c @item @kbd{C-c C-v C-s} @tab org-babel-execute-subtree 14082@c @item @kbd{C-c C-v C-s} @tab @code{org-babel-execute-subtree}
12439@c @item @kbd{C-c C-v C-t} @tab org-babel-tangle 14083@c @item @kbd{C-c C-v C-t} @tab @code{org-babel-tangle}
12440@c @item @kbd{C-c C-v C-z} @tab org-babel-switch-to-session 14084@c @item @kbd{C-c C-v C-z} @tab @code{org-babel-switch-to-session}
12441@c @end multitable 14085@c @end multitable
12442 14086
12443@node Batch execution, , Key bindings and useful functions, Working With Source Code 14087@node Batch execution, , Key bindings and useful functions, Working With Source Code
@@ -12490,6 +14134,7 @@ emacs -Q --batch -l $ORGINSTALL \
12490* Clean view:: Getting rid of leading stars in the outline 14134* Clean view:: Getting rid of leading stars in the outline
12491* TTY keys:: Using Org on a tty 14135* TTY keys:: Using Org on a tty
12492* Interaction:: Other Emacs packages 14136* Interaction:: Other Emacs packages
14137* org-crypt.el:: Encrypting Org files
12493@end menu 14138@end menu
12494 14139
12495 14140
@@ -12509,7 +14154,7 @@ emacs -Q --batch -l $ORGINSTALL \
12509@cindex tag completion 14154@cindex tag completion
12510@cindex link abbreviations, completion of 14155@cindex link abbreviations, completion of
12511 14156
12512Emacs would not be Emacs without completion, and Org-mode uses it whenever it 14157Emacs would not be Emacs without completion, and Org mode uses it whenever it
12513makes sense. If you prefer an @i{iswitchb}- or @i{ido}-like interface for 14158makes sense. If you prefer an @i{iswitchb}- or @i{ido}-like interface for
12514some of the completion prompts, you can specify your preference by setting at 14159some of the completion prompts, you can specify your preference by setting at
12515most one of the variables @code{org-completion-use-iswitchb} 14160most one of the variables @code{org-completion-use-iswitchb}
@@ -12544,12 +14189,12 @@ buffer.
12544After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}). 14189After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
12545@item 14190@item
12546After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or 14191After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
12547@samp{OPTIONS} which set file-specific options for Org-mode. When the 14192@samp{OPTIONS} which set file-specific options for Org mode. When the
12548option keyword is already complete, pressing @kbd{M-@key{TAB}} again 14193option keyword is already complete, pressing @kbd{M-@key{TAB}} again
12549will insert example settings for this keyword. 14194will insert example settings for this keyword.
12550@item 14195@item
12551In the line after @samp{#+STARTUP: }, complete startup keywords, 14196In the line after @samp{#+STARTUP: }, complete startup keywords,
12552i.e. valid keys for this line. 14197i.e.@: valid keys for this line.
12553@item 14198@item
12554Elsewhere, complete dictionary words using Ispell. 14199Elsewhere, complete dictionary words using Ispell.
12555@end itemize 14200@end itemize
@@ -12560,7 +14205,7 @@ Elsewhere, complete dictionary words using Ispell.
12560@cindex template insertion 14205@cindex template insertion
12561@cindex insertion, of templates 14206@cindex insertion, of templates
12562 14207
12563Org-mode supports insertion of empty structural elements (like 14208Org mode supports insertion of empty structural elements (like
12564@code{#+BEGIN_SRC} and @code{#+END_SRC} pairs) with just a few key 14209@code{#+BEGIN_SRC} and @code{#+END_SRC} pairs) with just a few key
12565strokes. This is achieved through a native template expansion mechanism. 14210strokes. This is achieved through a native template expansion mechanism.
12566Note that Emacs has several other template mechanisms which could be used in 14211Note that Emacs has several other template mechanisms which could be used in
@@ -12584,14 +14229,15 @@ The following template selectors are currently supported.
12584@item @kbd{H} @tab @code{#+html:} 14229@item @kbd{H} @tab @code{#+html:}
12585@item @kbd{a} @tab @code{#+begin_ascii ... #+end_ascii} 14230@item @kbd{a} @tab @code{#+begin_ascii ... #+end_ascii}
12586@item @kbd{A} @tab @code{#+ascii:} 14231@item @kbd{A} @tab @code{#+ascii:}
12587@item @kbd{i} @tab @code{#+include:} line 14232@item @kbd{i} @tab @code{#+index:} line
14233@item @kbd{I} @tab @code{#+include:} line
12588@end multitable 14234@end multitable
12589 14235
12590For example, on an empty line, typing "<e" and then pressing TAB, will expand 14236For example, on an empty line, typing "<e" and then pressing TAB, will expand
12591into a complete EXAMPLE template. 14237into a complete EXAMPLE template.
12592 14238
12593You can install additional templates by customizing the variable 14239You can install additional templates by customizing the variable
12594@code{org-structure-template-alist}. See the docstring of the variable for 14240@code{org-structure-template-alist}. See the docstring of the variable for
12595additional details. 14241additional details.
12596 14242
12597@node Speed keys, Code evaluation security, Easy Templates, Miscellaneous 14243@node Speed keys, Code evaluation security, Easy Templates, Miscellaneous
@@ -12601,7 +14247,7 @@ additional details.
12601@vindex org-speed-commands-user 14247@vindex org-speed-commands-user
12602 14248
12603Single keys can be made to execute commands when the cursor is at the 14249Single keys can be made to execute commands when the cursor is at the
12604beginning of a headline, i.e. before the first star. Configure the variable 14250beginning of a headline, i.e.@: before the first star. Configure the variable
12605@code{org-use-speed-commands} to activate this feature. There is a 14251@code{org-use-speed-commands} to activate this feature. There is a
12606pre-defined list of commands, and you can add more such commands using the 14252pre-defined list of commands, and you can add more such commands using the
12607variable @code{org-speed-commands-user}. Speed keys do not only speed up 14253variable @code{org-speed-commands-user}. Speed keys do not only speed up
@@ -12641,9 +14287,20 @@ Make sure you know what you are doing before customizing the variables
12641which take off the default security brakes. 14287which take off the default security brakes.
12642 14288
12643@defopt org-confirm-babel-evaluate 14289@defopt org-confirm-babel-evaluate
12644When set to t user is queried before code block evaluation 14290When t (the default), the user is asked before every code block evaluation.
14291When nil, the user is not asked. When set to a function, it is called with
14292two arguments (language and body of the code block) and should return t to
14293ask and nil not to ask.
12645@end defopt 14294@end defopt
12646 14295
14296For example, here is how to execute "ditaa" code (which is considered safe)
14297without asking:
14298@example
14299(defun my-org-confirm-babel-evaluate (lang body)
14300 (not (string= lang "ditaa"))) ; don't ask for ditaa
14301(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
14302@end example
14303
12647@item Following @code{shell} and @code{elisp} links 14304@item Following @code{shell} and @code{elisp} links
12648Org has two link types that can directly evaluate code (@pxref{External 14305Org has two link types that can directly evaluate code (@pxref{External
12649links}). These links can be problematic because the code to be evaluated is 14306links}). These links can be problematic because the code to be evaluated is
@@ -12680,7 +14337,7 @@ lines into the buffer (@pxref{In-buffer settings}).
12680@cindex in-buffer settings 14337@cindex in-buffer settings
12681@cindex special keywords 14338@cindex special keywords
12682 14339
12683Org-mode uses special lines in the buffer to define settings on a 14340Org mode uses special lines in the buffer to define settings on a
12684per-file basis. These lines start with a @samp{#+} followed by a 14341per-file basis. These lines start with a @samp{#+} followed by a
12685keyword, a colon, and then individual words defining a setting. Several 14342keyword, a colon, and then individual words defining a setting. Several
12686setting words can be in the same line, but you can also have multiple 14343setting words can be in the same line, but you can also have multiple
@@ -12739,14 +14396,14 @@ buffer, most useful for specifying the allowed values of a property.
12739@item #+SETUPFILE: file 14396@item #+SETUPFILE: file
12740This line defines a file that holds more in-buffer setup. Normally this is 14397This line defines a file that holds more in-buffer setup. Normally this is
12741entirely ignored. Only when the buffer is parsed for option-setting lines 14398entirely ignored. Only when the buffer is parsed for option-setting lines
12742(i.e. when starting Org-mode for a file, when pressing @kbd{C-c C-c} in a 14399(i.e.@: when starting Org mode for a file, when pressing @kbd{C-c C-c} in a
12743settings line, or when exporting), then the contents of this file are parsed 14400settings line, or when exporting), then the contents of this file are parsed
12744as if they had been included in the buffer. In particular, the file can be 14401as if they had been included in the buffer. In particular, the file can be
12745any other Org-mode file with internal setup. You can visit the file the 14402any other Org mode file with internal setup. You can visit the file the
12746cursor is in the line with @kbd{C-c '}. 14403cursor is in the line with @kbd{C-c '}.
12747@item #+STARTUP: 14404@item #+STARTUP:
12748@cindex #+STARTUP: 14405@cindex #+STARTUP:
12749This line sets options to be used at startup of Org-mode, when an 14406This line sets options to be used at startup of Org mode, when an
12750Org file is being visited. 14407Org file is being visited.
12751 14408
12752The first set of options deals with the initial visibility of the outline 14409The first set of options deals with the initial visibility of the outline
@@ -12769,7 +14426,7 @@ showeverything @r{show even drawer contents}
12769@cindex @code{indent}, STARTUP keyword 14426@cindex @code{indent}, STARTUP keyword
12770@cindex @code{noindent}, STARTUP keyword 14427@cindex @code{noindent}, STARTUP keyword
12771Dynamic virtual indentation is controlled by the variable 14428Dynamic virtual indentation is controlled by the variable
12772@code{org-startup-indented}@footnote{Emacs 23 and Org-mode 6.29 are required} 14429@code{org-startup-indented}@footnote{Emacs 23 and Org mode 6.29 are required}
12773@example 14430@example
12774indent @r{start with @code{org-indent-mode} turned on} 14431indent @r{start with @code{org-indent-mode} turned on}
12775noindent @r{start with @code{org-indent-mode} turned off} 14432noindent @r{start with @code{org-indent-mode} turned off}
@@ -12896,14 +14553,14 @@ fninline @r{define footnotes inline}
12896fnnoinline @r{define footnotes in separate section} 14553fnnoinline @r{define footnotes in separate section}
12897fnlocal @r{define footnotes near first reference, but not inline} 14554fnlocal @r{define footnotes near first reference, but not inline}
12898fnprompt @r{prompt for footnote labels} 14555fnprompt @r{prompt for footnote labels}
12899fnauto @r{create [fn:1]-like labels automatically (default)} 14556fnauto @r{create @code{[fn:1]}-like labels automatically (default)}
12900fnconfirm @r{offer automatic label for editing or confirmation} 14557fnconfirm @r{offer automatic label for editing or confirmation}
12901fnplain @r{create [1]-like labels automatically} 14558fnplain @r{create @code{[1]}-like labels automatically}
12902fnadjust @r{automatically renumber and sort footnotes} 14559fnadjust @r{automatically renumber and sort footnotes}
12903nofnadjust @r{do not renumber and sort automatically} 14560nofnadjust @r{do not renumber and sort automatically}
12904@end example 14561@end example
12905@cindex org-hide-block-startup 14562@cindex org-hide-block-startup
12906To hide blocks on startup, use these keywords. The corresponding variable is 14563To hide blocks on startup, use these keywords. The corresponding variable is
12907@code{org-hide-block-startup}. 14564@code{org-hide-block-startup}.
12908@cindex @code{hideblocks}, STARTUP keyword 14565@cindex @code{hideblocks}, STARTUP keyword
12909@cindex @code{nohideblocks}, STARTUP keyword 14566@cindex @code{nohideblocks}, STARTUP keyword
@@ -12990,6 +14647,8 @@ ordered list.
12990@item 14647@item
12991If the cursor is on the @code{#+BEGIN} line of a dynamic block, the 14648If the cursor is on the @code{#+BEGIN} line of a dynamic block, the
12992block is updated. 14649block is updated.
14650@item
14651If the cursor is at a timestamp, fix the day name in the timestamp.
12993@end itemize 14652@end itemize
12994 14653
12995@node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous 14654@node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
@@ -13155,7 +14814,7 @@ tty you would rather use @kbd{C-c .} to re-insert the timestamp.
13155@end multitable 14814@end multitable
13156 14815
13157 14816
13158@node Interaction, , TTY keys, Miscellaneous 14817@node Interaction, org-crypt.el, TTY keys, Miscellaneous
13159@section Interaction with other packages 14818@section Interaction with other packages
13160@cindex packages, interaction with other 14819@cindex packages, interaction with other
13161Org lives in the world of GNU Emacs and interacts in various ways 14820Org lives in the world of GNU Emacs and interacts in various ways
@@ -13179,7 +14838,7 @@ checks for the availability of Calc by looking for the function
13179@code{calc-eval} which will have been autoloaded during setup if Calc has 14838@code{calc-eval} which will have been autoloaded during setup if Calc has
13180been installed properly. As of Emacs 22, Calc is part of the Emacs 14839been installed properly. As of Emacs 22, Calc is part of the Emacs
13181distribution. Another possibility for interaction between the two 14840distribution. Another possibility for interaction between the two
13182packages is using Calc for embedded calculations. @xref{Embedded Mode, 14841packages is using Calc for embedded calculations. @xref{Embedded Mode,
13183, Embedded Mode, Calc, GNU Emacs Calc Manual}. 14842, Embedded Mode, Calc, GNU Emacs Calc Manual}.
13184@item @file{constants.el} by Carsten Dominik 14843@item @file{constants.el} by Carsten Dominik
13185@cindex @file{constants.el} 14844@cindex @file{constants.el}
@@ -13191,18 +14850,18 @@ constants in the variable @code{org-table-formula-constants}, install
13191the @file{constants} package which defines a large number of constants 14850the @file{constants} package which defines a large number of constants
13192and units, and lets you use unit prefixes like @samp{M} for 14851and units, and lets you use unit prefixes like @samp{M} for
13193@samp{Mega}, etc@. You will need version 2.0 of this package, available 14852@samp{Mega}, etc@. You will need version 2.0 of this package, available
13194at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for 14853at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
13195the function @code{constants-get}, which has to be autoloaded in your 14854the function @code{constants-get}, which has to be autoloaded in your
13196setup. See the installation instructions in the file 14855setup. See the installation instructions in the file
13197@file{constants.el}. 14856@file{constants.el}.
13198@item @file{cdlatex.el} by Carsten Dominik 14857@item @file{cdlatex.el} by Carsten Dominik
13199@cindex @file{cdlatex.el} 14858@cindex @file{cdlatex.el}
13200@cindex Dominik, Carsten 14859@cindex Dominik, Carsten
13201Org-mode can make use of the CDLa@TeX{} package to efficiently enter 14860Org mode can make use of the CD@LaTeX{} package to efficiently enter
13202@LaTeX{} fragments into Org files. See @ref{CDLaTeX mode}. 14861@LaTeX{} fragments into Org files. See @ref{CDLaTeX mode}.
13203@item @file{imenu.el} by Ake Stenhoff and Lars Lindberg 14862@item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
13204@cindex @file{imenu.el} 14863@cindex @file{imenu.el}
13205Imenu allows menu access to an index of items in a file. Org-mode 14864Imenu allows menu access to an index of items in a file. Org mode
13206supports Imenu---all you need to do to get the index is the following: 14865supports Imenu---all you need to do to get the index is the following:
13207@lisp 14866@lisp
13208(add-hook 'org-mode-hook 14867(add-hook 'org-mode-hook
@@ -13219,7 +14878,7 @@ Org used to use this package for capture, but no longer does.
13219@cindex @file{speedbar.el} 14878@cindex @file{speedbar.el}
13220@cindex Ludlam, Eric M. 14879@cindex Ludlam, Eric M.
13221Speedbar is a package that creates a special frame displaying files and 14880Speedbar is a package that creates a special frame displaying files and
13222index items in files. Org-mode supports Speedbar and allows you to 14881index items in files. Org mode supports Speedbar and allows you to
13223drill into Org files directly from the Speedbar. It also allows you to 14882drill into Org files directly from the Speedbar. It also allows you to
13224restrict the scope of agenda commands to a file or a subtree by using 14883restrict the scope of agenda commands to a file or a subtree by using
13225the command @kbd{<} in the Speedbar frame. 14884the command @kbd{<} in the Speedbar frame.
@@ -13233,8 +14892,8 @@ the command @kbd{<} in the Speedbar frame.
13233Complex ASCII tables with automatic line wrapping, column- and row-spanning, 14892Complex ASCII tables with automatic line wrapping, column- and row-spanning,
13234and alignment can be created using the Emacs table package by Takaaki Ota 14893and alignment can be created using the Emacs table package by Takaaki Ota
13235(@uref{http://sourceforge.net/projects/table}, and also part of Emacs 22). 14894(@uref{http://sourceforge.net/projects/table}, and also part of Emacs 22).
13236Org-mode will recognize these tables and export them properly. Because of 14895Org mode will recognize these tables and export them properly. Because of
13237interference with other Org-mode functionality, you unfortunately cannot edit 14896interference with other Org mode functionality, you unfortunately cannot edit
13238these tables directly in the buffer. Instead, you need to use the command 14897these tables directly in the buffer. Instead, you need to use the command
13239@kbd{C-c '} to edit them, similar to source code snippets. 14898@kbd{C-c '} to edit them, similar to source code snippets.
13240 14899
@@ -13244,7 +14903,7 @@ Edit a @file{table.el} table. Works when the cursor is in a table.el table.
13244@c 14903@c
13245@orgcmd{C-c ~,org-table-create-with-table.el} 14904@orgcmd{C-c ~,org-table-create-with-table.el}
13246Insert a @file{table.el} table. If there is already a table at point, this 14905Insert a @file{table.el} table. If there is already a table at point, this
13247command converts it between the @file{table.el} format and the Org-mode 14906command converts it between the @file{table.el} format and the Org mode
13248format. See the documentation string of the command 14907format. See the documentation string of the command
13249@code{org-convert-table} for the restrictions under which this is 14908@code{org-convert-table} for the restrictions under which this is
13250possible. 14909possible.
@@ -13253,13 +14912,13 @@ possible.
13253@item @file{footnote.el} by Steven L. Baur 14912@item @file{footnote.el} by Steven L. Baur
13254@cindex @file{footnote.el} 14913@cindex @file{footnote.el}
13255@cindex Baur, Steven L. 14914@cindex Baur, Steven L.
13256Org-mode recognizes numerical footnotes as provided by this package. 14915Org mode recognizes numerical footnotes as provided by this package.
13257However, Org-mode also has its own footnote support (@pxref{Footnotes}), 14916However, Org mode also has its own footnote support (@pxref{Footnotes}),
13258which makes using @file{footnote.el} unnecessary. 14917which makes using @file{footnote.el} unnecessary.
13259@end table 14918@end table
13260 14919
13261@node Conflicts, , Cooperation, Interaction 14920@node Conflicts, , Cooperation, Interaction
13262@subsection Packages that lead to conflicts with Org-mode 14921@subsection Packages that lead to conflicts with Org mode
13263 14922
13264@table @asis 14923@table @asis
13265 14924
@@ -13271,7 +14930,7 @@ This conflicts with the use of @kbd{S-@key{cursor}} commands in Org to change
13271timestamps, TODO keywords, priorities, and item bullet types if the cursor is 14930timestamps, TODO keywords, priorities, and item bullet types if the cursor is
13272at such a location. By default, @kbd{S-@key{cursor}} commands outside 14931at such a location. By default, @kbd{S-@key{cursor}} commands outside
13273special contexts don't do anything, but you can customize the variable 14932special contexts don't do anything, but you can customize the variable
13274@code{org-support-shift-select}. Org-mode then tries to accommodate shift 14933@code{org-support-shift-select}. Org mode then tries to accommodate shift
13275selection by (i) using it outside of the special contexts where special 14934selection by (i) using it outside of the special contexts where special
13276commands apply, and by (ii) extending an existing active region even if the 14935commands apply, and by (ii) extending an existing active region even if the
13277cursor moves across a special context. 14936cursor moves across a special context.
@@ -13286,14 +14945,14 @@ region. In fact, Emacs 23 has this built-in in the form of
13286@code{shift-selection-mode}, see previous paragraph. If you are using Emacs 14945@code{shift-selection-mode}, see previous paragraph. If you are using Emacs
1328723, you probably don't want to use another package for this purpose. However, 1494623, you probably don't want to use another package for this purpose. However,
13288if you prefer to leave these keys to a different package while working in 14947if you prefer to leave these keys to a different package while working in
13289Org-mode, configure the variable @code{org-replace-disputed-keys}. When set, 14948Org mode, configure the variable @code{org-replace-disputed-keys}. When set,
13290Org will move the following key bindings in Org files, and in the agenda 14949Org will move the following key bindings in Org files, and in the agenda
13291buffer (but not during date selection). 14950buffer (but not during date selection).
13292 14951
13293@example 14952@example
13294S-UP -> M-p S-DOWN -> M-n 14953S-UP @result{} M-p S-DOWN @result{} M-n
13295S-LEFT -> M-- S-RIGHT -> M-+ 14954S-LEFT @result{} M-- S-RIGHT @result{} M-+
13296C-S-LEFT -> M-S-- C-S-RIGHT -> M-S-+ 14955C-S-LEFT @result{} M-S-- C-S-RIGHT @result{} M-S-+
13297@end example 14956@end example
13298 14957
13299@vindex org-disputed-keys 14958@vindex org-disputed-keys
@@ -13303,7 +14962,7 @@ to have other replacement keys, look at the variable
13303 14962
13304@item @file{yasnippet.el} 14963@item @file{yasnippet.el}
13305@cindex @file{yasnippet.el} 14964@cindex @file{yasnippet.el}
13306The way Org-mode binds the TAB key (binding to @code{[tab]} instead of 14965The way Org mode binds the TAB key (binding to @code{[tab]} instead of
13307@code{"\t"}) overrules YASnippet's access to this key. The following code 14966@code{"\t"}) overrules YASnippet's access to this key. The following code
13308fixed this problem: 14967fixed this problem:
13309 14968
@@ -13311,14 +14970,34 @@ fixed this problem:
13311(add-hook 'org-mode-hook 14970(add-hook 'org-mode-hook
13312 (lambda () 14971 (lambda ()
13313 (org-set-local 'yas/trigger-key [tab]) 14972 (org-set-local 'yas/trigger-key [tab])
13314 (define-key yas/keymap [tab] 'yas/next-field-group))) 14973 (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand)))
14974@end lisp
14975
14976The latest version of yasnippet doesn't play well with Org mode. If the
14977above code does not fix the conflict, start by defining the following
14978function:
14979
14980@lisp
14981(defun yas/org-very-safe-expand ()
14982 (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
14983@end lisp
14984
14985Then, tell Org mode what to do with the new function:
14986
14987@lisp
14988(add-hook 'org-mode-hook
14989 (lambda ()
14990 (make-variable-buffer-local 'yas/trigger-key)
14991 (setq yas/trigger-key [tab])
14992 (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
14993 (define-key yas/keymap [tab] 'yas/next-field)))
13315@end lisp 14994@end lisp
13316 14995
13317@item @file{windmove.el} by Hovav Shacham 14996@item @file{windmove.el} by Hovav Shacham
13318@cindex @file{windmove.el} 14997@cindex @file{windmove.el}
13319This package also uses the @kbd{S-<cursor>} keys, so everything written 14998This package also uses the @kbd{S-<cursor>} keys, so everything written
13320in the paragraph above about CUA mode also applies here. If you want make 14999in the paragraph above about CUA mode also applies here. If you want make
13321the windmove function active in locations where Org-mode does not have 15000the windmove function active in locations where Org mode does not have
13322special functionality on @kbd{S-@key{cursor}}, add this to your 15001special functionality on @kbd{S-@key{cursor}}, add this to your
13323configuration: 15002configuration:
13324 15003
@@ -13334,7 +15013,7 @@ configuration:
13334@cindex @file{viper.el} 15013@cindex @file{viper.el}
13335@kindex C-c / 15014@kindex C-c /
13336Viper uses @kbd{C-c /} and therefore makes this key not access the 15015Viper uses @kbd{C-c /} and therefore makes this key not access the
13337corresponding Org-mode command @code{org-sparse-tree}. You need to find 15016corresponding Org mode command @code{org-sparse-tree}. You need to find
13338another key for this command, or override the key in 15017another key for this command, or override the key in
13339@code{viper-vi-global-user-map} with 15018@code{viper-vi-global-user-map} with
13340 15019
@@ -13344,6 +15023,44 @@ another key for this command, or override the key in
13344 15023
13345@end table 15024@end table
13346 15025
15026@node org-crypt.el, , Interaction, Miscellaneous
15027@section org-crypt.el
15028@cindex @file{org-crypt.el}
15029@cindex @code{org-decrypt-entry}
15030
15031Org-crypt will encrypt the text of an entry, but not the headline, or
15032properties. Org-crypt uses the Emacs EasyPG library to encrypt and decrypt
15033files.
15034
15035Any text below a headline that has a @samp{:crypt:} tag will be automatically
15036be encrypted when the file is saved. If you want to use a different tag just
15037customize the @code{org-crypt-tag-matcher} setting.
15038
15039To use org-crypt it is suggested that you have the following in your
15040@file{.emacs}:
15041
15042@example
15043(require 'org-crypt)
15044(org-crypt-use-before-save-magic)
15045(setq org-tags-exclude-from-inheritance (quote ("crypt")))
15046
15047(setq org-crypt-key nil)
15048 ;; GPG key to use for encryption
15049 ;; Either the Key ID or set to nil to use symmetric encryption.
15050
15051(setq auto-save-default nil)
15052 ;; Auto-saving does not cooperate with org-crypt.el: so you need
15053 ;; to turn it off if you plan to use org-crypt.el quite often.
15054 ;; Otherwise, you'll get an (annoying) message each time you
15055 ;; start Org.
15056
15057 ;; To turn it off only locally, you can insert this:
15058 ;;
15059 ;; # -*- buffer-auto-save-file-name: nil; -*-
15060@end example
15061
15062Excluding the crypt tag from inheritance prevents already encrypted text
15063being encrypted again.
13347 15064
13348@node Hacking, MobileOrg, Miscellaneous, Top 15065@node Hacking, MobileOrg, Miscellaneous, Top
13349@appendix Hacking 15066@appendix Hacking
@@ -13381,7 +15098,7 @@ maintained by the Worg project and can be found at
13381 15098
13382A large number of add-on packages have been written by various authors. 15099A large number of add-on packages have been written by various authors.
13383These packages are not part of Emacs, but they are distributed as contributed 15100These packages are not part of Emacs, but they are distributed as contributed
13384packages with the separate release available at the Org-mode home page at 15101packages with the separate release available at the Org mode home page at
13385@uref{http://orgmode.org}. The list of contributed packages, along with 15102@uref{http://orgmode.org}. The list of contributed packages, along with
13386documentation about each package, is maintained by the Worg project at 15103documentation about each package, is maintained by the Worg project at
13387@uref{http://orgmode.org/worg/org-contrib/}. 15104@uref{http://orgmode.org/worg/org-contrib/}.
@@ -13487,7 +15204,7 @@ the link description when the link is later inserted into an Org
13487buffer with @kbd{C-c C-l}. 15204buffer with @kbd{C-c C-l}.
13488 15205
13489When it makes sense for your new link type, you may also define a function 15206When it makes sense for your new link type, you may also define a function
13490@code{org-PREFIX-complete-link} that implements special (e.g. completion) 15207@code{org-PREFIX-complete-link} that implements special (e.g.@: completion)
13491support for inserting such a link with @kbd{C-c C-l}. Such a function should 15208support for inserting such a link with @kbd{C-c C-l}. Such a function should
13492not accept any arguments, and return the full link with prefix. 15209not accept any arguments, and return the full link with prefix.
13493 15210
@@ -13505,7 +15222,7 @@ Add-ons can tap into this functionality by providing a function that detects
13505special context for that add-on and executes functionality appropriate for 15222special context for that add-on and executes functionality appropriate for
13506the context. Here is an example from Dan Davison's @file{org-R.el} which 15223the context. Here is an example from Dan Davison's @file{org-R.el} which
13507allows you to evaluate commands based on the @file{R} programming language 15224allows you to evaluate commands based on the @file{R} programming language
13508@footnote{@file{org-R.el} has been replaced by the org-mode functionality 15225@footnote{@file{org-R.el} has been replaced by the Org mode functionality
13509described in @ref{Working With Source Code} and is now obsolete.}. For this 15226described in @ref{Working With Source Code} and is now obsolete.}. For this
13510package, special contexts are lines that start with @code{#+R:} or 15227package, special contexts are lines that start with @code{#+R:} or
13511@code{#+RR:}. 15228@code{#+RR:}.
@@ -13526,7 +15243,8 @@ package, special contexts are lines that start with @code{#+R:} or
13526The function first checks if the cursor is in such a line. If that is the 15243The function first checks if the cursor is in such a line. If that is the
13527case, @code{org-R-apply} is called and the function returns @code{t} to 15244case, @code{org-R-apply} is called and the function returns @code{t} to
13528signal that action was taken, and @kbd{C-c C-c} will stop looking for other 15245signal that action was taken, and @kbd{C-c C-c} will stop looking for other
13529contexts. If the function finds it should do nothing locally, it returns @code{nil} so that other, similar functions can have a try. 15246contexts. If the function finds it should do nothing locally, it returns
15247@code{nil} so that other, similar functions can have a try.
13530 15248
13531 15249
13532@node Tables in arbitrary syntax, Dynamic blocks, Context-sensitive commands, Hacking 15250@node Tables in arbitrary syntax, Dynamic blocks, Context-sensitive commands, Hacking
@@ -13539,7 +15257,7 @@ Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
13539frequent feature request has been to make it work with native tables in 15257frequent feature request has been to make it work with native tables in
13540specific languages, for example @LaTeX{}. However, this is extremely 15258specific languages, for example @LaTeX{}. However, this is extremely
13541hard to do in a general way, would lead to a customization nightmare, 15259hard to do in a general way, would lead to a customization nightmare,
13542and would take away much of the simplicity of the Orgtbl-mode table 15260and would take away much of the simplicity of the Orgtbl mode table
13543editor. 15261editor.
13544 15262
13545This appendix describes a different approach. We keep the Orgtbl mode 15263This appendix describes a different approach. We keep the Orgtbl mode
@@ -13557,12 +15275,12 @@ can use Org's facilities to edit and structure lists by turning
13557 15275
13558@menu 15276@menu
13559* Radio tables:: Sending and receiving radio tables 15277* Radio tables:: Sending and receiving radio tables
13560* A LaTeX example:: Step by step, almost a tutorial 15278* A @LaTeX{} example:: Step by step, almost a tutorial
13561* Translator functions:: Copy and modify 15279* Translator functions:: Copy and modify
13562* Radio lists:: Doing the same for lists 15280* Radio lists:: Doing the same for lists
13563@end menu 15281@end menu
13564 15282
13565@node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax 15283@node Radio tables, A @LaTeX{} example, Tables in arbitrary syntax, Tables in arbitrary syntax
13566@subsection Radio tables 15284@subsection Radio tables
13567@cindex radio tables 15285@cindex radio tables
13568 15286
@@ -13587,7 +15305,7 @@ example:
13587 15305
13588@noindent 15306@noindent
13589@code{table_name} is the reference name for the table that is also used 15307@code{table_name} is the reference name for the table that is also used
13590in the receiver lines. @code{translation_function} is the Lisp function 15308in the receiver lines. @code{translation_function} is the Lisp function
13591that does the translation. Furthermore, the line can contain a list of 15309that does the translation. Furthermore, the line can contain a list of
13592arguments (alternating key and value) at the end. The arguments will be 15310arguments (alternating key and value) at the end. The arguments will be
13593passed as a property list to the translation function for 15311passed as a property list to the translation function for
@@ -13630,7 +15348,7 @@ makes this comment-toggling very easy, in particular if you bind it to a
13630key. 15348key.
13631@end itemize 15349@end itemize
13632 15350
13633@node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax 15351@node A @LaTeX{} example, Translator functions, Radio tables, Tables in arbitrary syntax
13634@subsection A @LaTeX{} example of radio tables 15352@subsection A @LaTeX{} example of radio tables
13635@cindex @LaTeX{}, and Orgtbl mode 15353@cindex @LaTeX{}, and Orgtbl mode
13636 15354
@@ -13690,7 +15408,7 @@ table inserted between the two marker lines.
13690Now let's assume you want to make the table header by hand, because you 15408Now let's assume you want to make the table header by hand, because you
13691want to control how columns are aligned, etc@. In this case we make sure 15409want to control how columns are aligned, etc@. In this case we make sure
13692that the table translator skips the first 2 lines of the source 15410that the table translator skips the first 2 lines of the source
13693table, and tell the command to work as a @i{splice}, i.e. to not produce 15411table, and tell the command to work as a @i{splice}, i.e.@: to not produce
13694header and footer commands of the target table: 15412header and footer commands of the target table:
13695 15413
13696@example 15414@example
@@ -13725,7 +15443,7 @@ tabular environment. Default is nil.
13725A format to be used to wrap each field, it should contain @code{%s} for the 15443A format to be used to wrap each field, it should contain @code{%s} for the
13726original field value. For example, to wrap each field value in dollars, 15444original field value. For example, to wrap each field value in dollars,
13727you could use @code{:fmt "$%s$"}. This may also be a property list with 15445you could use @code{:fmt "$%s$"}. This may also be a property list with
13728column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}. 15446column numbers and formats, for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
13729A function of one argument can be used in place of the strings; the 15447A function of one argument can be used in place of the strings; the
13730function must return a formatted string. 15448function must return a formatted string.
13731 15449
@@ -13740,7 +15458,7 @@ applied. Similar to @code{fmt}, functions of two arguments can be
13740supplied instead of strings. 15458supplied instead of strings.
13741@end table 15459@end table
13742 15460
13743@node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax 15461@node Translator functions, Radio lists, A @LaTeX{} example, Tables in arbitrary syntax
13744@subsection Translator functions 15462@subsection Translator functions
13745@cindex HTML, and Orgtbl mode 15463@cindex HTML, and Orgtbl mode
13746@cindex translator function 15464@cindex translator function
@@ -13773,7 +15491,7 @@ hands processing over to the generic translator. Here is the entire code:
13773 15491
13774As you can see, the properties passed into the function (variable 15492As you can see, the properties passed into the function (variable
13775@var{PARAMS}) are combined with the ones newly defined in the function 15493@var{PARAMS}) are combined with the ones newly defined in the function
13776(variable @var{PARAMS2}). The ones passed into the function (i.e. the 15494(variable @var{PARAMS2}). The ones passed into the function (i.e.@: the
13777ones set by the @samp{ORGTBL SEND} line) take precedence. So if you 15495ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
13778would like to use the @LaTeX{} translator, but wanted the line endings to 15496would like to use the @LaTeX{} translator, but wanted the line endings to
13779be @samp{\\[2mm]} instead of the default @samp{\\}, you could just 15497be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
@@ -13920,15 +15638,24 @@ example @code{before-save-hook}. @code{org-update-all-dblocks} is
13920written in a way such that it does nothing in buffers that are not in 15638written in a way such that it does nothing in buffers that are not in
13921@code{org-mode}. 15639@code{org-mode}.
13922 15640
15641You can narrow the current buffer to the current dynamic block (like any
15642other block) with @code{org-narrow-to-block}.
15643
13923@node Special agenda views, Extracting agenda information, Dynamic blocks, Hacking 15644@node Special agenda views, Extracting agenda information, Dynamic blocks, Hacking
13924@section Special agenda views 15645@section Special agenda views
13925@cindex agenda views, user-defined 15646@cindex agenda views, user-defined
13926 15647
15648@vindex org-agenda-skip-function
15649@vindex org-agenda-skip-function-global
13927Org provides a special hook that can be used to narrow down the selection 15650Org provides a special hook that can be used to narrow down the selection
13928made by these agenda views: @code{todo}, @code{alltodo}, @code{tags}, @code{tags-todo}, 15651made by these agenda views: @code{agenda}, @code{todo}, @code{alltodo},
13929@code{tags-tree}. You may specify a function that is used at each match to verify 15652@code{tags}, @code{tags-todo}, @code{tags-tree}. You may specify a function
13930if the match should indeed be part of the agenda view, and if not, how 15653that is used at each match to verify if the match should indeed be part of
13931much should be skipped. 15654the agenda view, and if not, how much should be skipped. You can specify a
15655global condition that will be applied to all agenda views, this condition
15656would be stored in the variable @code{org-agenda-skip-function-global}. More
15657commonly, such a definition is applied only to specific custom searches,
15658using @code{org-agenda-skip-function}.
13932 15659
13933Let's say you want to produce a list of projects that contain a WAITING 15660Let's say you want to produce a list of projects that contain a WAITING
13934tag anywhere in the project tree. Let's further assume that you have 15661tag anywhere in the project tree. Let's further assume that you have
@@ -13981,25 +15708,25 @@ particular, you may use the functions @code{org-agenda-skip-entry-if}
13981and @code{org-agenda-skip-subtree-if} in this form, for example: 15708and @code{org-agenda-skip-subtree-if} in this form, for example:
13982 15709
13983@table @code 15710@table @code
13984@item '(org-agenda-skip-entry-if 'scheduled) 15711@item (org-agenda-skip-entry-if 'scheduled)
13985Skip current entry if it has been scheduled. 15712Skip current entry if it has been scheduled.
13986@item '(org-agenda-skip-entry-if 'notscheduled) 15713@item (org-agenda-skip-entry-if 'notscheduled)
13987Skip current entry if it has not been scheduled. 15714Skip current entry if it has not been scheduled.
13988@item '(org-agenda-skip-entry-if 'deadline) 15715@item (org-agenda-skip-entry-if 'deadline)
13989Skip current entry if it has a deadline. 15716Skip current entry if it has a deadline.
13990@item '(org-agenda-skip-entry-if 'scheduled 'deadline) 15717@item (org-agenda-skip-entry-if 'scheduled 'deadline)
13991Skip current entry if it has a deadline, or if it is scheduled. 15718Skip current entry if it has a deadline, or if it is scheduled.
13992@item '(org-agenda-skip-entry-if 'todo '("TODO" "WAITING")) 15719@item (org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))
13993Skip current entry if the TODO keyword is TODO or WAITING. 15720Skip current entry if the TODO keyword is TODO or WAITING.
13994@item '(org-agenda-skip-entry-if 'todo 'done) 15721@item (org-agenda-skip-entry-if 'todo 'done)
13995Skip current entry if the TODO keyword marks a DONE state. 15722Skip current entry if the TODO keyword marks a DONE state.
13996@item '(org-agenda-skip-entry-if 'timestamp) 15723@item (org-agenda-skip-entry-if 'timestamp)
13997Skip current entry if it has any timestamp, may also be deadline or scheduled. 15724Skip current entry if it has any timestamp, may also be deadline or scheduled.
13998@item '(org-agenda-skip-entry 'regexp "regular expression") 15725@item (org-agenda-skip-entry 'regexp "regular expression")
13999Skip current entry if the regular expression matches in the entry. 15726Skip current entry if the regular expression matches in the entry.
14000@item '(org-agenda-skip-entry 'notregexp "regular expression") 15727@item (org-agenda-skip-entry 'notregexp "regular expression")
14001Skip current entry unless the regular expression matches. 15728Skip current entry unless the regular expression matches.
14002@item '(org-agenda-skip-subtree-if 'regexp "regular expression") 15729@item (org-agenda-skip-subtree-if 'regexp "regular expression")
14003Same as above, but check and skip the entire subtree. 15730Same as above, but check and skip the entire subtree.
14004@end table 15731@end table
14005 15732
@@ -14051,7 +15778,7 @@ You may also modify parameters on the fly like this:
14051@example 15778@example
14052emacs -batch -l ~/.emacs \ 15779emacs -batch -l ~/.emacs \
14053 -eval '(org-batch-agenda "a" \ 15780 -eval '(org-batch-agenda "a" \
14054 org-agenda-span month \ 15781 org-agenda-span (quote month) \
14055 org-agenda-include-diary nil \ 15782 org-agenda-include-diary nil \
14056 org-agenda-files (quote ("~/org/project.org")))' \ 15783 org-agenda-files (quote ("~/org/project.org")))' \
14057 | lpr 15784 | lpr
@@ -14219,7 +15946,7 @@ does not need to preserve point. After evaluation, the cursor will be
14219moved to the end of the line (presumably of the headline of the 15946moved to the end of the line (presumably of the headline of the
14220processed entry) and search continues from there. Under some 15947processed entry) and search continues from there. Under some
14221circumstances, this may not produce the wanted results. For example, 15948circumstances, this may not produce the wanted results. For example,
14222if you have removed (e.g. archived) the current (sub)tree it could 15949if you have removed (e.g.@: archived) the current (sub)tree it could
14223mean that the next entry will be skipped entirely. In such cases, you 15950mean that the next entry will be skipped entirely. In such cases, you
14224can specify the position from where search should continue by making 15951can specify the position from where search should continue by making
14225FUNC set the variable `org-map-continue-from' to the desired buffer 15952FUNC set the variable `org-map-continue-from' to the desired buffer
@@ -14235,6 +15962,7 @@ SCOPE determines the scope of this command. It can be any of:
14235@example 15962@example
14236nil @r{the current buffer, respecting the restriction if any} 15963nil @r{the current buffer, respecting the restriction if any}
14237tree @r{the subtree started with the entry at point} 15964tree @r{the subtree started with the entry at point}
15965region @r{The entries within the active region, if any}
14238file @r{the current buffer, without restriction} 15966file @r{the current buffer, without restriction}
14239file-with-archives 15967file-with-archives
14240 @r{the current buffer, and any archives associated with it} 15968 @r{the current buffer, and any archives associated with it}
@@ -14312,7 +16040,7 @@ The following example counts the number of entries with TODO keyword
14312 16040
14313@uref{http://mobileorg.ncogni.to/, MobileOrg} is an application for the 16041@uref{http://mobileorg.ncogni.to/, MobileOrg} is an application for the
14314@i{iPhone/iPod Touch} series of devices, developed by Richard Moreland. 16042@i{iPhone/iPod Touch} series of devices, developed by Richard Moreland.
14315@i{MobileOrg} offers offline viewing and capture support for an Org-mode 16043@i{MobileOrg} offers offline viewing and capture support for an Org mode
14316system rooted on a ``real'' computer. It does also allow you to record 16044system rooted on a ``real'' computer. It does also allow you to record
14317changes to existing entries. Android users should check out 16045changes to existing entries. Android users should check out
14318@uref{http://wiki.github.com/matburt/mobileorg-android/, MobileOrg Android} 16046@uref{http://wiki.github.com/matburt/mobileorg-android/, MobileOrg Android}
@@ -14341,7 +16069,7 @@ in-buffer settings, but it will understand the logistics of TODO state
14341 16069
14342MobileOrg needs to interact with Emacs through a directory on a server. If you 16070MobileOrg needs to interact with Emacs through a directory on a server. If you
14343are using a public server, you should consider to encrypt the files that are 16071are using a public server, you should consider to encrypt the files that are
14344uploaded to the server. This can be done with Org-mode 7.02 and with 16072uploaded to the server. This can be done with Org mode 7.02 and with
14345@i{MobileOrg 1.5} (iPhone version), and you need an @file{openssl} 16073@i{MobileOrg 1.5} (iPhone version), and you need an @file{openssl}
14346installation on your system. To turn on encryption, set a password in 16074installation on your system. To turn on encryption, set a password in
14347@i{MobileOrg} and, on the Emacs side, configure the variable 16075@i{MobileOrg} and, on the Emacs side, configure the variable
@@ -14355,7 +16083,7 @@ The easiest way to create that directory is to use a free
14355@uref{http://dropbox.com,Dropbox.com} account@footnote{If you cannot use 16083@uref{http://dropbox.com,Dropbox.com} account@footnote{If you cannot use
14356Dropbox, or if your version of MobileOrg does not support it, you can use a 16084Dropbox, or if your version of MobileOrg does not support it, you can use a
14357webdav server. For more information, check out the documentation of MobileOrg and also this 16085webdav server. For more information, check out the documentation of MobileOrg and also this
14358@uref{http://orgmode.org/worg/org-faq.php#mobileorg_webdav, FAQ entry}.}. 16086@uref{http://orgmode.org/worg/org-faq.html#mobileorg_webdav, FAQ entry}.}.
14359When MobileOrg first connects to your Dropbox, it will create a directory 16087When MobileOrg first connects to your Dropbox, it will create a directory
14360@i{MobileOrg} inside the Dropbox. After the directory has been created, tell 16088@i{MobileOrg} inside the Dropbox. After the directory has been created, tell
14361Emacs about it: 16089Emacs about it:
@@ -14364,7 +16092,7 @@ Emacs about it:
14364(setq org-mobile-directory "~/Dropbox/MobileOrg") 16092(setq org-mobile-directory "~/Dropbox/MobileOrg")
14365@end lisp 16093@end lisp
14366 16094
14367Org-mode has commands to put files for @i{MobileOrg} into that directory, 16095Org mode has commands to put files for @i{MobileOrg} into that directory,
14368and to read captured notes from there. 16096and to read captured notes from there.
14369 16097
14370@node Pushing to MobileOrg, Pulling from MobileOrg, Setting up the staging area, MobileOrg 16098@node Pushing to MobileOrg, Pulling from MobileOrg, Setting up the staging area, MobileOrg
@@ -14373,11 +16101,11 @@ and to read captured notes from there.
14373This operation copies all files currently listed in @code{org-mobile-files} 16101This operation copies all files currently listed in @code{org-mobile-files}
14374to the directory @code{org-mobile-directory}. By default this list contains 16102to the directory @code{org-mobile-directory}. By default this list contains
14375all agenda files (as listed in @code{org-agenda-files}), but additional files 16103all agenda files (as listed in @code{org-agenda-files}), but additional files
14376can be included by customizing @code{org-mobiles-files}. File names will be 16104can be included by customizing @code{org-mobile-files}. File names will be
14377staged with paths relative to @code{org-directory}, so all files should be 16105staged with paths relative to @code{org-directory}, so all files should be
14378inside this directory. The push operation also creates a special Org file 16106inside this directory. The push operation also creates a special Org file
14379@file{agendas.org} with all custom agenda view defined by the 16107@file{agendas.org} with all custom agenda view defined by the
14380user@footnote{While creating the agendas, Org-mode will force ID properties 16108user@footnote{While creating the agendas, Org mode will force ID properties
14381on all referenced entries, so that these entries can be uniquely identified 16109on all referenced entries, so that these entries can be uniquely identified
14382if @i{MobileOrg} flags them for further action. If you do not want to get 16110if @i{MobileOrg} flags them for further action. If you do not want to get
14383these properties in so many entries, you can set the variable 16111these properties in so many entries, you can set the variable
@@ -14478,7 +16206,7 @@ Before I get to this list, a few special mentions are in order:
14478@table @i 16206@table @i
14479@item Bastien Guerry 16207@item Bastien Guerry
14480Bastien has written a large number of extensions to Org (most of them 16208Bastien has written a large number of extensions to Org (most of them
14481integrated into the core by now), including the LaTeX exporter and the plain 16209integrated into the core by now), including the @LaTeX{} exporter and the plain
14482list parser. His support during the early days, when he basically acted as 16210list parser. His support during the early days, when he basically acted as
14483co-maintainer, was central to the success of this project. Bastien also 16211co-maintainer, was central to the success of this project. Bastien also
14484invented Worg, helped establishing the Web presence of Org, and sponsors 16212invented Worg, helped establishing the Web presence of Org, and sponsors
@@ -14513,13 +16241,13 @@ know what I am missing here!
14513@i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}. 16241@i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
14514@item 16242@item
14515@i{Christophe Bataillon} created the great unicorn logo that we use on the 16243@i{Christophe Bataillon} created the great unicorn logo that we use on the
14516Org-mode website. 16244Org mode website.
14517@item 16245@item
14518@i{Alex Bochannek} provided a patch for rounding timestamps. 16246@i{Alex Bochannek} provided a patch for rounding timestamps.
14519@item 16247@item
14520@i{Jan Böcker} wrote @file{org-docview.el}. 16248@i{Jan Böcker} wrote @file{org-docview.el}.
14521@item 16249@item
14522@i{Brad Bozarth} showed how to pull RSS feed data into Org-mode files. 16250@i{Brad Bozarth} showed how to pull RSS feed data into Org mode files.
14523@item 16251@item
14524@i{Tom Breton} wrote @file{org-choose.el}. 16252@i{Tom Breton} wrote @file{org-choose.el}.
14525@item 16253@item
@@ -14695,7 +16423,7 @@ tweaks and features.
14695extension system, added support for mairix, and proposed the mapping API. 16423extension system, added support for mairix, and proposed the mapping API.
14696@item 16424@item
14697@i{Ulf Stegemann} created the table to translate special symbols to HTML, 16425@i{Ulf Stegemann} created the table to translate special symbols to HTML,
14698LaTeX, UTF-8, Latin-1 and ASCII. 16426@LaTeX{}, UTF-8, Latin-1 and ASCII.
14699@item 16427@item
14700@i{Andy Stewart} contributed code to @file{org-w3m.el}, to copy HTML content 16428@i{Andy Stewart} contributed code to @file{org-w3m.el}, to copy HTML content
14701with links transformation to Org syntax. 16429with links transformation to Org syntax.
@@ -14703,8 +16431,10 @@ with links transformation to Org syntax.
14703@i{David O'Toole} wrote @file{org-publish.el} and drafted the manual 16431@i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
14704chapter about publishing. 16432chapter about publishing.
14705@item 16433@item
14706@i{Sebastien Vauban} reported many issues with LaTeX and BEAMER export and 16434@i{Jambunathan K} contributed the @acronym{ODT} exporter.
14707enabled source code highlighling in Gnus. 16435@item
16436@i{Sebastien Vauban} reported many issues with @LaTeX{} and BEAMER export and
16437enabled source code highlighting in Gnus.
14708@item 16438@item
14709@i{Stefan Vollmar} organized a video-recorded talk at the 16439@i{Stefan Vollmar} organized a video-recorded talk at the
14710Max-Planck-Institute for Neurology. He also inspired the creation of a 16440Max-Planck-Institute for Neurology. He also inspired the creation of a
@@ -14729,6 +16459,7 @@ work on a tty.
14729@item 16459@item
14730@i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks 16460@i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
14731and contributed various ideas and code snippets. 16461and contributed various ideas and code snippets.
16462@item
14732@end itemize 16463@end itemize
14733 16464
14734 16465