org.texi 131 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545
  1. \input texinfo
  2. @c %**start of header
  3. @setfilename org
  4. @c @setfilename ../info/org
  5. @settitle Org Mode Manual
  6. @set VERSION 4.13
  7. @set DATE March 2006
  8. @dircategory Emacs
  9. @direntry
  10. * Org Mode: (org). outline-based notes management and organizer
  11. @end direntry
  12. @c Version and Contact Info
  13. @set MAINTAINERSITE @uref{http://www.astro.uva.nl/~dominik/Tools/org/,maintainers webpage}
  14. @set MAINTAINER Carsten Dominik
  15. @set MAINTAINEREMAIL @email{dominik@@science.uva.nl}
  16. @set MAINTAINERCONTACT @uref{mailto:dominik@@science.uva.nl,contact the maintainer}
  17. @c %**end of header
  18. @finalout
  19. @c Macro definitions
  20. @c FIXME: does not look good in html
  21. @c Subheadings inside a table. Need a difference between info and the rest.
  22. @macro tsubheading{text}
  23. @ifinfo
  24. @subsubheading \text\
  25. @end ifinfo
  26. @ifnotinfo
  27. @item @b{\text\}
  28. @end ifnotinfo
  29. @end macro
  30. @copying
  31. This manual is for Org-mode (version @value{VERSION}).
  32. Copyright @copyright{} 2004, 2005, 2006 Free Software Foundation
  33. @quotation
  34. Permission is granted to copy, distribute and/or modify this document
  35. under the terms of the GNU Free Documentation License, Version 1.1 or
  36. any later version published by the Free Software Foundation; with no
  37. Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
  38. and with the Back-Cover Texts as in (a) below. A copy of the
  39. license is included in the section entitled ``GNU Free Documentation
  40. License.''
  41. (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
  42. this GNU Manual, like GNU software. Copies published by the Free
  43. Software Foundation raise funds for GNU development.''
  44. @end quotation
  45. @end copying
  46. @titlepage
  47. @title Org Mode Manual
  48. @subtitle Release @value{VERSION}
  49. @author by Carsten Dominik
  50. @c The following two commands start the copyright page.
  51. @page
  52. @vskip 0pt plus 1filll
  53. @insertcopying
  54. @end titlepage
  55. @c Output the table of contents at the beginning.
  56. @contents
  57. @ifnottex
  58. @node Top, Introduction, (dir), (dir)
  59. @top Org Mode Manual
  60. @insertcopying
  61. @end ifnottex
  62. @menu
  63. * Introduction:: Getting started
  64. * Document Structure:: A tree works like your brain
  65. * Tables:: Pure magic for quick formatting
  66. * Hyperlinks:: Notes in context
  67. * TODO items:: Every tree branch can be a TODO item
  68. * Timestamps:: Assign date and time to items
  69. * Agenda Views:: Collecting information into views
  70. * Exporting:: Sharing and publishing of notes
  71. * Miscellaneous:: All the rest which did not fit elsewhere
  72. * Index:: The fast road to specific information
  73. * Key Index:: Key bindings and where they are described
  74. @detailmenu
  75. --- The Detailed Node Listing ---
  76. Introduction
  77. * Summary:: Brief summary of what Org-mode does
  78. * Installation and activation:: How to install Org-mode
  79. * Feedback:: Bug reports, ideas, patches etc.
  80. Document Structure
  81. * Outlines:: Org-mode is based on outline-mode
  82. * Headlines:: How to typeset org-tree headlines
  83. * Visibility cycling:: Show and hide, much simplified
  84. * Motion:: Jumping to other headlines
  85. * Structure editing:: Changing sequence and level of headlines
  86. * Archiving:: Move done task trees to a different place
  87. * Sparse trees:: Matches embedded in context
  88. * Tags:: Tagging headlines and matching sets of tags
  89. * Plain Lists:: Editing hand-formatted lists
  90. Tables
  91. * Built-in table editor:: Simple tables
  92. * Table calculations:: Compute a field from other fields
  93. * orgtbl-mode:: The table editor as minor mode
  94. * table.el:: Complex tables
  95. Calculations in tables
  96. * Formula syntax:: How to write a formula
  97. * Column formulas:: Formulas valid for all fields in a column
  98. * Advanced features:: Field names, parameters and automatic recalc
  99. * Named-field formulas:: Formulas valid in single fields
  100. * Editing/debugging formulas:: Changing a stored formula
  101. * Appetizer:: Taste the power of calc
  102. Hyperlinks
  103. * Internal links:: Links to other places in the current file
  104. * External links:: URL-like links to the world
  105. * Managing links:: Creating, inserting and following
  106. * Search Options:: Linking to a specific location
  107. * Remember:: Org-trees store quick notes
  108. Internal links
  109. * Radio targets:: Make targets trigger links in plain text.
  110. * CamelCase links:: Activating CamelCase words as links
  111. TODO items
  112. * TODO basics:: Marking and displaying TODO entries
  113. * Progress logging:: Document your productivity
  114. * TODO extensions:: Workflow and assignments
  115. * Priorities:: Some things are more important than others
  116. Extended use of TODO keywords
  117. * Workflow states:: From TODO to DONE in steps
  118. * TODO types:: I do this, Fred the rest
  119. * Per file keywords:: Different files, different requirements
  120. Timestamps
  121. * Time stamps:: Assigning a time to a tree entry
  122. * Creating timestamps:: Commands which insert timestamps
  123. Agenda Views
  124. * Agenda files:: Files being searched for agenda information
  125. * Agenda dispatcher:: Keyboard access to agenda views
  126. * Weekly/Daily Agenda:: The calendar page with current tasks
  127. * Global TODO list:: All unfinished action items
  128. * Matching headline tags:: Structured information with fine-tuned search
  129. * Timeline:: Time-sorted view for single file
  130. * Agenda commands:: Remote editing of org trees
  131. The weekly/daily agenda
  132. * Categories:: Not all tasks are equal
  133. * Time-of-day specifications:: How the agenda knows the time
  134. * Calendar/Diary integration:: Integrating Anniversaries and more
  135. * Sorting of agenda items:: The order of things
  136. Exporting
  137. * ASCII export:: Export as a structured ASCII file
  138. * HTML export:: Export as an HTML file
  139. * iCalendar export:: Create calendar entries.
  140. HTML export
  141. * HTML formatting:: Interpretation of the buffer content
  142. * Export options:: How to influence exports
  143. * Comment lines:: Lines which will not be exported
  144. Miscellaneous
  145. * Completion:: M-TAB knows what you need
  146. * Customization:: Adapting Org-mode to your taste
  147. * Clean view:: Getting rid of leading stars in the outline
  148. * TTY keys:: Using Org-mode on a tty
  149. * FAQ:: Frequently asked questions
  150. * Interaction:: Other Emacs packages
  151. * Bugs:: Things which do not work perfectly
  152. * Acknowledgments:: These people provided feedback and more
  153. @end detailmenu
  154. @end menu
  155. @node Introduction, Document Structure, Top, Top
  156. @chapter Introduction
  157. @cindex introduction
  158. @menu
  159. * Summary:: Brief summary of what Org-mode does
  160. * Installation and activation:: How to install Org-mode
  161. * Feedback:: Bug reports, ideas, patches etc.
  162. @end menu
  163. @node Summary, Installation and activation, Introduction, Introduction
  164. @section Summary
  165. @cindex summary
  166. Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
  167. project planning with a fast and effective plain-text system.
  168. Org-mode develops organizational tasks around NOTES files that contain
  169. information about projects as plain text. Org-mode is implemented on
  170. top of outline-mode, which makes it possible to keep the content of
  171. large files well structured. Visibility cycling and structure editing
  172. help to work with the tree. Tables are easily created with a built-in
  173. table editor. Org-mode supports ToDo items, deadlines, time stamps,
  174. and scheduling. It dynamically compiles entries into an agenda that
  175. utilizes and smoothly integrates much of the Emacs calendar and diary.
  176. Plain text URL-like links connect to websites, emails, Usenet
  177. messages, BBDB entries, and any files related to the projects. For
  178. printing and sharing of notes, an Org-mode file can be exported as a
  179. structured ASCII file, as HTML, or (todo and agenda items only) as an
  180. iCalendar file.
  181. Org-mode keeps simple things simple. When first fired up, it should
  182. feel like a simple but easy to use outliner. Complexity is not
  183. imposed, but a large amount of functionality is available when you
  184. need it. Org-mode can be used on different levels and in different
  185. ways, for example:
  186. @example
  187. @r{@bullet{} as an outline extension with visibility cycling and structure editing}
  188. @r{@bullet{} as an ASCII system and table editor for taking structured notes}
  189. @r{@bullet{} as an ASCII table editor with spreadsheet-like capabilities}
  190. @r{@bullet{} as a simple hypertext system, with HTML export}
  191. @r{@bullet{} as a TODO list editor}
  192. @r{@bullet{} as a full agenda and planner with deadlines and work scheduling}
  193. @end example
  194. The Org-mode table editor can be integrated into any major mode by
  195. activating the minor Orgtbl-mode.
  196. There is a website for Org-mode which provides links to the newest
  197. version of Org-mode, as well as additional information, screen shots
  198. and example files. This page is located at
  199. @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
  200. @page
  201. @node Installation and activation, Feedback, Summary, Introduction
  202. @section Installation and Activation
  203. @cindex installation
  204. @cindex autoload
  205. @cindex global keybindings
  206. @cindex keybindings, global
  207. If Org-mode is part of the Emacs distribution or an XEmacs package,
  208. you only need to copy the following lines to your @file{.emacs} file.
  209. The last two lines define @emph{global} keys for the commands
  210. @command{org-store-link} and @command{org-agenda} - please
  211. choose suitable keys yourself.
  212. @lisp
  213. ;; The following lines are always needed. Choose your own keys.
  214. (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
  215. (define-key global-map "\C-cl" 'org-store-link)
  216. (define-key global-map "\C-ca" 'org-agenda)
  217. @end lisp
  218. If you have downloaded Org-mode from the Web, you must byte-compile
  219. @file{org.el} and put it on your load path. In addition to the Emacs
  220. Lisp lines above, you also need to add the following lines to
  221. @file{.emacs}:
  222. @lisp
  223. ;; These lines only if org-mode is not part of the X/Emacs distribution.
  224. (autoload 'org-mode "org" "Org mode" t)
  225. (autoload 'org-diary "org" "Diary entries from Org mode")
  226. (autoload 'org-agenda "org" "Multi-file agenda from Org mode" t)
  227. (autoload 'org-store-link "org" "Store a link to the current location" t)
  228. (autoload 'orgtbl-mode "org" "Org tables as a minor mode" t)
  229. (autoload 'turn-on-orgtbl "org" "Org tables as a minor mode")
  230. @end lisp
  231. @cindex org-mode, turning on
  232. With this setup, all files with extension @samp{.org} will be put into
  233. Org-mode. As an alternative, make the first line of a file look like
  234. this:
  235. @example
  236. MY PROJECTS -*- mode: org; -*-
  237. @end example
  238. @noindent which will select Org-mode for this buffer no matter what
  239. the file's name is. See also the variable
  240. @code{org-insert-mode-line-in-empty-file}.
  241. @node Feedback, , Installation and activation, Introduction
  242. @section Feedback
  243. @cindex feedback
  244. @cindex bug reports
  245. @cindex maintainer
  246. @cindex author
  247. If you find problems with Org-mode, or if you have questions, remarks,
  248. or ideas about it, please contact the maintainer Carsten Dominik at
  249. @value{MAINTAINEREMAIL}.
  250. For bug reports, please provide as much information as possible,
  251. including the version information of Emacs (@kbd{C-h v emacs-version
  252. @key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
  253. the Org-mode related setup in @file{.emacs}. If an error occurs, a
  254. traceback can be very useful. Often a small example file helps, along
  255. with clear information about:
  256. @enumerate
  257. @item What exactly did you do?
  258. @item What did you expect to happen?
  259. @item What happened instead?
  260. @end enumerate
  261. @noindent Thank you for helping to improve this mode.
  262. @node Document Structure, Tables, Introduction, Top
  263. @chapter Document Structure
  264. @cindex document structure
  265. @cindex structure of document
  266. Org-mode is based on outline mode and provides flexible commands to
  267. edit the structure of the document.
  268. @menu
  269. * Outlines:: Org-mode is based on outline-mode
  270. * Headlines:: How to typeset org-tree headlines
  271. * Visibility cycling:: Show and hide, much simplified
  272. * Motion:: Jumping to other headlines
  273. * Structure editing:: Changing sequence and level of headlines
  274. * Archiving:: Move done task trees to a different place
  275. * Sparse trees:: Matches embedded in context
  276. * Tags:: Tagging headlines and matching sets of tags
  277. * Plain Lists:: Editing hand-formatted lists
  278. @end menu
  279. @node Outlines, Headlines, Document Structure, Document Structure
  280. @section Outlines
  281. @cindex outlines
  282. @cindex outline-mode
  283. Org-mode is implemented on top of outline-mode. Outlines allow to
  284. organize a document in a hierarchical structure, which (at least for
  285. me) is the best representation of notes and thoughts. Overview over
  286. this structure is achieved by folding (hiding) large parts of the
  287. document to show only the general document structure and the parts
  288. currently being worked on. Org-mode greatly simplifies the use of
  289. outlines by compressing the entire show/hide functionality into a
  290. single command @command{org-cycle}, which is bound to the @key{TAB}
  291. key.
  292. @node Headlines, Visibility cycling, Outlines, Document Structure
  293. @section Headlines
  294. @cindex headlines
  295. @cindex outline tree
  296. Headlines define the structure of an outline tree. The headlines in
  297. Org-mode start with one or more stars, on the left margin. For
  298. example:
  299. @example
  300. * Top level headline
  301. ** Second level
  302. *** 3rd level
  303. some text
  304. *** 3rd level
  305. more text
  306. * Another top level headline
  307. @end example
  308. @noindent Some people find the many stars too noisy and would prefer an
  309. outline that has whitespace followed by a single star as headline
  310. starters. @ref{Clean view} describes a setup to realize this.
  311. @node Visibility cycling, Motion, Headlines, Document Structure
  312. @section Visibility cycling
  313. @cindex cycling, visibility
  314. @cindex visibility cycling
  315. @cindex trees, visibility
  316. @cindex show hidden text
  317. @cindex hide text
  318. Outlines make it possible to hide parts of the text in the buffer.
  319. Org-mode uses a single command bound to the @key{TAB} key to change
  320. the visibility in the buffer.
  321. @cindex subtree visibility states
  322. @cindex folded, subtree visibility state
  323. @cindex children, subtree visibility state
  324. @cindex subtree, subtree visibility state
  325. @table @kbd
  326. @kindex @key{TAB}
  327. @item @key{TAB}
  328. Rotate current subtree between the states
  329. @example
  330. ,-> FOLDED -> CHILDREN -> SUBTREE --.
  331. '-----------------------------------'
  332. @end example
  333. At the beginning of the buffer (or when called with @kbd{C-u}), this does
  334. the same as the command @kbd{S-@key{TAB}} below.
  335. @cindex global visibility states
  336. @cindex overview, global visibility state
  337. @cindex contents, global visibility state
  338. @cindex show all, global visibility state
  339. @kindex S-@key{TAB}
  340. @item S-@key{TAB}
  341. Rotate the entire buffer between the states
  342. @example
  343. ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
  344. '--------------------------------------'
  345. @end example
  346. Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
  347. @cindex show all, command
  348. @kindex C-c C-a
  349. @item C-c C-a
  350. Show all.
  351. @end table
  352. When Emacs first visits an Org-mode file, the global state is set to
  353. OVERVIEW, i.e. only the top level headlines are visible. This can be
  354. configured through the variable @code{org-startup-folded}, or on a
  355. per-file basis by adding one of the following lines anywhere in the
  356. buffer:
  357. @example
  358. #+STARTUP: fold
  359. #+STARTUP: nofold
  360. #+STARTUP: content
  361. @end example
  362. @node Motion, Structure editing, Visibility cycling, Document Structure
  363. @section Motion
  364. @cindex motion, between headlines
  365. @cindex jumping, to headlines
  366. @cindex headline navigation
  367. The following commands jump to other headlines in the buffer.
  368. @table @kbd
  369. @kindex C-c C-n
  370. @item C-c C-n
  371. Next heading.
  372. @kindex C-c C-p
  373. @item C-c C-p
  374. Previous heading.
  375. @kindex C-c C-f
  376. @item C-c C-f
  377. Next heading same level.
  378. @kindex C-c C-b
  379. @item C-c C-b
  380. Previous heading same level.
  381. @kindex C-c C-u
  382. @item C-c C-u
  383. Backward to higher level heading.
  384. @kindex C-c C-j
  385. @item C-c C-j
  386. Jump to a different place without changing the current outline
  387. visibility. Shows the document structure in a temporary buffer, where
  388. you can use visibility cycling (@key{TAB}) to find your destination.
  389. After pressing @key{RET}, the cursor moves to the selected location in
  390. the original buffer, and the headings hierarchy above it is made
  391. visible.
  392. @end table
  393. @node Structure editing, Archiving, Motion, Document Structure
  394. @section Structure editing
  395. @cindex structure editing
  396. @cindex headline, promotion and demotion
  397. @cindex promotion, of subtrees
  398. @cindex demotion, of subtrees
  399. @cindex subtree, cut and paste
  400. @cindex pasting, of subtrees
  401. @cindex cutting, of subtrees
  402. @cindex copying, of subtrees
  403. @cindex subtrees, cut and paste
  404. @table @kbd
  405. @kindex M-@key{RET}
  406. @item M-@key{RET}
  407. Insert new heading with same level as current. If the cursor is in a
  408. plain list item, a new item is created. To force creation of a new
  409. headline, use a prefix arg, or first press @key{RET} to get to the
  410. beginning of the next line.
  411. @kindex M-S-@key{RET}
  412. @item M-S-@key{RET}
  413. Insert new TODO entry with same level as current heading.
  414. @kindex M-@key{left}
  415. @item M-@key{left}
  416. Promote current heading by one level.
  417. @kindex M-@key{right}
  418. @item M-@key{right}
  419. Demote current heading by one level.
  420. @kindex M-S-@key{left}
  421. @item M-S-@key{left}
  422. Promote the current subtree by one level.
  423. @kindex M-S-@key{right}
  424. @item M-S-@key{right}
  425. Demote the current subtree by one level.
  426. @kindex M-S-@key{up}
  427. @item M-S-@key{up}
  428. Move subtree up (swap with previous subtree of same
  429. level).
  430. @kindex M-S-@key{down}
  431. @item M-S-@key{down}
  432. Move subtree down (swap with next subtree of same level).
  433. @kindex C-c C-x C-w
  434. @kindex C-c C-x C-k
  435. @item C-c C-x C-w
  436. @itemx C-c C-x C-k
  437. Kill subtree, i.e. remove it from buffer but save in kill ring.
  438. @kindex C-c C-x M-w
  439. @item C-c C-x M-w
  440. Copy subtree to kill ring.
  441. @kindex C-c C-x C-y
  442. @item C-c C-x C-y
  443. Yank subtree from kill ring. This does modify the level of the subtree to
  444. make sure the tree fits in nicely at the yank position. The yank
  445. level can also be specified with a prefix arg, or by yanking after a
  446. headline marker like @samp{****}.
  447. @end table
  448. @cindex region, active
  449. @cindex active region
  450. @cindex transient-mark-mode
  451. When there is an active region (transient-mark-mode), promotion and
  452. demotion work on all headlines in the region. To select a region of
  453. headlines, it is best to place both point and mark at the beginning of a
  454. line, mark at the beginning of the first headline, and point at the line
  455. just after the last headline to change. Note that when the cursor is
  456. inside a table (@pxref{Tables}), the Meta-Cursor keys have different
  457. functionality.
  458. @node Archiving, Sparse trees, Structure editing, Document Structure
  459. @section Archiving
  460. @cindex archiving
  461. @cindex filing subtrees
  462. When a project represented by a (sub)tree is finished, you may want
  463. to move the tree to an archive place, either in the same file under a
  464. special top-level heading, or even to a different file.
  465. @table @kbd
  466. @kindex C-c $
  467. @item @kbd{C-c $}
  468. Archive the subtree starting at the cursor position to the location
  469. given by @code{org-archive-location}.
  470. @end table
  471. @cindex archive locations
  472. The default archive is a file in the same directory as the current
  473. file, with the name derived by appending @file{_archive} to the
  474. current file name. For information and examples on how to change
  475. this, see the documentation string of the variable
  476. @code{org-archive-location}. If you are also using the Org-mode
  477. agenda, archiving to a different file is a good way to keep archived
  478. trees from contributing agenda items.
  479. @node Sparse trees, Tags, Archiving, Document Structure
  480. @section Sparse trees
  481. @cindex sparse trees
  482. @cindex trees, sparse
  483. @cindex folding, sparse trees
  484. @cindex occur, command
  485. An important feature of Org-mode is the ability to construct
  486. @emph{sparse trees} for selected information in an outline tree. A
  487. sparse tree means that the entire document is folded as much as
  488. possible, but the selected information is made visible along with the
  489. headline structure above it@footnote{See also the variables
  490. @code{org-show-hierarchy-above} and
  491. @code{org-show-following-heading}.}. Just try it out and you will see
  492. immediately how it works.
  493. Org-mode contains several commands creating such trees. The most
  494. basic one is @command{org-occur}:
  495. @table @kbd
  496. @kindex C-c /
  497. @item C-c /
  498. Occur. Prompts for a regexp and shows a sparse tree with all matches.
  499. If the match is in a headline, the headline is made visible. If the
  500. match is in the body of an entry, headline and body are made visible.
  501. In order to provide minimal context, also the full hierarchy of
  502. headlines above the match is shown, as well as the headline following
  503. the match. Each match is also highlighted, the highlights disappear
  504. when the buffer is changed with an editing command.
  505. @end table
  506. @noindent
  507. For frequently used sparse trees of specific search strings, you can
  508. use the variable @code{org-agenda-custom-commands} to define fast
  509. keyboard access to specific sparse trees. These commands will then be
  510. accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
  511. For example:
  512. @lisp
  513. (setq org-agenda-custom-commands
  514. '(("f" occur-tree "FIXME")))
  515. @end lisp
  516. @noindent will define the key @kbd{C-c a f} as a shortcut for creating
  517. a sparse tree matching the string @samp{FIXME}.
  518. Other commands are using sparse trees as well. For example @kbd{C-c
  519. C-v} creates a sparse TODO tree (@pxref{TODO basics}).
  520. @kindex C-c C-x v
  521. @cindex printing sparse trees
  522. @cindex visible text, printing
  523. To print a sparse tree, you can use the Emacs command
  524. @code{ps-print-buffer-with-faces} which does not print invisible parts
  525. of the document @footnote{This does not work under XEmacs, because
  526. XEmacs uses selective display for outlining, not text properties}.
  527. Or you can use the command @kbd{C-c C-x v} to copy the visible part of
  528. the document to another file (extension @file{.txt}) which can then be
  529. printed in any desired way.
  530. @node Tags, Plain Lists, Sparse trees, Document Structure
  531. @section Tags
  532. @cindex tags
  533. @cindex headline tagging
  534. @cindex matching, tags
  535. @cindex sparse tree, tag based
  536. If you wish to implement a tag system to cross-correlate information,
  537. this can be done as well in Org-mode. Every headline can contain a
  538. list of tags, at the end of the headline. Tags are normal words
  539. containing letters, numbers, @samp{_}, and @samp{@@}. Tags must be
  540. preceded and followed by a single colon; like @samp{:WORK:}. Several
  541. tags can be specified like @samp{:WORK:URGENT:}.
  542. @cindex inheritance, of tags
  543. Tags make use of the hierarchical structure of outline trees. If a
  544. heading has a certain tag, all subheadings will inherit the tag as
  545. well. For example, in the list
  546. @example
  547. * Meeting with the French group :WORK:
  548. ** Summary by Frank :BOSS:NOTES:
  549. *** TODO Prepare slides for him :ACTION:
  550. @end example
  551. @noindent
  552. the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
  553. @samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and
  554. Org-mode finds that a certain headline matches the search criterion,
  555. it will not check any sublevel headline, assuming that these likely
  556. also match, and that the list of matches can become very long. You
  557. can influence inheritance and searching using the variables
  558. @code{org-use-tag-inheritance} and
  559. @code{org-tags-match-list-sublevels}.
  560. @kindex M-@key{TAB}
  561. Tags can simply be typed into the buffer. After a colon,
  562. @kbd{M-@key{TAB}} offers completion on all tags being used in the
  563. current buffer. There are also special commands for inserting tags,
  564. and for executing searches based on tags.
  565. @table @kbd
  566. @kindex C-c C-c
  567. @item C-c C-c
  568. @cindex completion, of tags
  569. Enter new tags for the current headline. The minibuffer will prompt
  570. for a list of tags and offer completion with respect to all other tags
  571. used in the current buffer. Several tags, separated by colons, may be
  572. specified at the prompt. After pressing @key{RET}, the tags will
  573. be inserted and aligned to @code{org-tags-column}. When called with a
  574. @kbd{C-u} prefix, align all tags in the current buffer to that column,
  575. just to make things look nice. TAGS are automatically realigned after
  576. promotion, demotion, and TODO state changes (@pxref{TODO basics}).
  577. @kindex C-c \
  578. @item C-c \
  579. Create a sparse tree with all headlines matching a tags search.
  580. @kindex C-c a m
  581. @item C-c a m
  582. Create a global list of tag matches from all agenda files.
  583. @xref{Matching headline tags}.
  584. @kindex C-c a M
  585. @item C-c a M
  586. Create a global list of tag matches from all agenda files, but check
  587. only TODO items and force checking subitems (see variable
  588. @code{org-tags-match-list-sublevels}).
  589. @end table
  590. A tags search string can use Boolean operators @samp{&} for AND and
  591. @samp{|} for OR. @samp{&} binds more strongly than
  592. @samp{|}. Parenthesis are currently not implemented. A tag may also be
  593. preceded by @samp{-}, to select against it, and @samp{+} is syntactic
  594. sugar for positive selection. The AND operator @samp{&} is optional
  595. when @samp{+} or @samp{-} is present. For example, @samp{+WORK-BOSS}
  596. would select all headlines that are tagged @samp{:WORK:}, but discard
  597. those also tagged @samp{:BOSS:}. The search string @samp{WORK|LAPTOP}
  598. selects all lines tagged @samp{:WORK:} or @samp{:LAPTOP:}. The string
  599. @samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are
  600. also tagged @samp{NIGHT}.
  601. @node Plain Lists, , Tags, Document Structure
  602. @section Plain Lists
  603. @cindex plain lists
  604. @cindex lists, plain
  605. @cindex lists, ordered
  606. @cindex ordered lists
  607. Headlines define both the structure of the Org-mode file, and also lists
  608. (for example, TODO items (@pxref{TODO items}) should be created using
  609. headline levels). However, when taking notes, the plain text is
  610. sometimes easier to read with hand-formatted lists. Org-mode supports
  611. editing such lists, and the HTML exporter (@pxref{Exporting}) does
  612. parse and format them.
  613. Org-mode knows ordered and unordered lists. Unordered list items start
  614. with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
  615. bullet, lines must be indented or they will be seen as top-level
  616. headlines. Also, when you are hiding leading stars to get a clean
  617. outline view, plain list items starting with a star are visually
  618. indistinguishable from true headlines. In short: even though @samp{*}
  619. is supported, it may be better to not use it for plain list items} as
  620. bullets. Ordered list items start with @samp{1.} or @samp{1)}. Items
  621. belonging to the same list must have the same indentation on the first
  622. line. In particular, if an ordered list reaches number @samp{10.}, then
  623. the 2--digit numbers must be written left-aligned with the other numbers
  624. in the list. Indentation also determines the end of a list item. It
  625. ends before the next line that is indented like the bullet/number, or
  626. less. For example:
  627. @example
  628. ** Lord of the Rings
  629. My favorite scenes are (in this order)
  630. 1. Eowyns fight with the witch king
  631. + this was already my favorite scene in the book
  632. + I really like Miranda Otto.
  633. 2. The attack of the Rohirrim
  634. 3. Peter Jackson being shot by Legolas
  635. - on DVD only
  636. He makes a really funny face when it happens.
  637. @end example
  638. Org-mode supports these lists by tuning filling and wrapping commands
  639. to correctly deal with them. Furthermore, the following commands act
  640. on items when the cursor is in the first line of an item (the line
  641. with the bullet or number).
  642. @table @kbd
  643. @kindex @key{TAB}
  644. @item @key{TAB}
  645. Items can be folded just like headline levels if you set the variable
  646. @code{org-cycle-include-plain-lists}. The level of an item is then
  647. given by the indentation of the bullet/number. However, items are
  648. always subordinate to real headlines, the hierarchies remain
  649. completely separated.
  650. @kindex M-@key{RET}
  651. @item M-@key{RET}
  652. Insert new item at current level. With prefix arg, for a new heading.
  653. @kindex M-S-@key{up}
  654. @kindex M-S-@key{down}
  655. @item M-S-@key{up}
  656. @itemx M-S-@key{down}
  657. Move the item including subitems up/down (swap with previous/next item
  658. of same indentation). If the list is ordered, renumbering is
  659. automatic.
  660. @kindex M-S-@key{left}
  661. @kindex M-S-@key{right}
  662. @item M-S-@key{left}
  663. @itemx M-S-@key{right}
  664. Decrease/increase the indentation of the item, including subitems.
  665. Initially, the item tree is selected based on current indentation.
  666. When these commands are executed several times in direct succession,
  667. the initially selected region is used, even if the new indentation
  668. would imply a different hierarchy. To use the new hierarchy, break
  669. the command chain with a cursor motion or so.
  670. @kindex C-c C-c
  671. @item C-c C-c
  672. Renumber the ordered list at the cursor.
  673. @end table
  674. @node Tables, Hyperlinks, Document Structure, Top
  675. @chapter Tables
  676. @cindex tables
  677. @cindex editing tables
  678. Org-mode has a very fast and intuitive table editor built-in.
  679. Spreadsheet-like calculations are supported in connection with the
  680. Emacs @file{calc} package.
  681. @menu
  682. * Built-in table editor:: Simple tables
  683. * Table calculations:: Compute a field from other fields
  684. * orgtbl-mode:: The table editor as minor mode
  685. * table.el:: Complex tables
  686. @end menu
  687. @node Built-in table editor, Table calculations, Tables, Tables
  688. @section The built-in table editor
  689. @cindex table editor, builtin
  690. Org-mode makes it easy to format tables in plain ASCII. Any line with
  691. @samp{|} as the first non-white character is considered part of a
  692. table. @samp{|} is also the column separator. A table might look
  693. like this:
  694. @example
  695. | Name | Phone | Age |
  696. |-------+-------+-----|
  697. | Peter | 1234 | 17 |
  698. | Anna | 4321 | 25 |
  699. @end example
  700. A table is re-aligned automatically each time you press @key{TAB} or
  701. @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
  702. the next field (@key{RET} to the next row) and creates new table rows
  703. at the end of the table or before horizontal lines. The indentation
  704. of the table is set by the first line. Any line starting with
  705. @samp{|-} is considered as a horizontal separator line and will be
  706. expanded on the next re-align to span the whole table width. So, to
  707. create the above table, you would only type
  708. @example
  709. |Name|Phone|Age
  710. |-
  711. @end example
  712. @noindent and then press @key{TAB} to align the table and start filling in
  713. fields.
  714. When typing text into a field, Org-mode treats @key{DEL},
  715. @key{Backspace}, and all character keys in a special way, so that
  716. inserting and deleting avoids shifting other fields. Also, when
  717. typing @emph{immediately after the cursor was moved into a new field
  718. with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
  719. field is automatically made blank. If this behavior is too
  720. unpredictable for you, configure the variables
  721. @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
  722. @table @kbd
  723. @tsubheading{Creation and conversion}
  724. @item M-x org-table-create
  725. Creates an empty Org-mode table. However, it is much easier to just
  726. start typing, like @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}
  727. @kindex C-c C-c
  728. @item C-c C-c
  729. Convert region to table. Works when the cursor is not in an existing
  730. table, and when there is a region defined. If every line contains at
  731. least one TAB character, the function assumes that the material is tab
  732. separated. If not, lines are split at whitespace into fields. You
  733. can use a prefix argument to indicate the minimum number of consequtive
  734. spaces required to indentify a field separator (default: just one).
  735. @tsubheading{Re-aligning and field motion}
  736. @kindex C-c C-c
  737. @item C-c C-c
  738. Re-align the table without moving the cursor.
  739. @kindex @key{TAB}
  740. @item @key{TAB}
  741. Re-align the table, move to the next field. Creates a new row if
  742. necessary.
  743. @kindex S-@key{TAB}
  744. @item S-@key{TAB}
  745. Re-align, move to previous field.
  746. @kindex @key{RET}
  747. @item @key{RET}
  748. Re-align the table and move down to next row. Creates a new row if
  749. necessary. At the beginning or end of a line, @key{RET} still does
  750. NEWLINE, so it can be used to split a table.
  751. @tsubheading{Column and row editing}
  752. @kindex M-@key{left}
  753. @kindex M-@key{right}
  754. @item M-@key{left}
  755. @itemx M-@key{right}
  756. Move the current column left/right.
  757. @kindex M-S-@key{left}
  758. @item M-S-@key{left}
  759. Kill the current column.
  760. @kindex M-S-@key{right}
  761. @item M-S-@key{right}
  762. Insert a new column to the left of the cursor position.
  763. @kindex M-@key{up}
  764. @kindex M-@key{down}
  765. @item M-@key{up}
  766. @itemx M-@key{down}
  767. Move the current row up/down.
  768. @kindex M-S-@key{up}
  769. @item M-S-@key{up}
  770. Kill the current row or horizontal line.
  771. @kindex M-S-@key{down}
  772. @item M-S-@key{down}
  773. Insert a new row above (with arg: below) the current row.
  774. @kindex C-c -
  775. @item C-c -
  776. Insert a horizontal line below current row. With prefix arg, the line
  777. is created above the current line.
  778. @kindex C-c ^
  779. @item C-c ^
  780. Sort the table lines in the region. Point and mark must be in the first
  781. and last line to be included, and must be in the column that should be
  782. used for sorting. The command prompts for numerical versus
  783. alphanumerical sorting.
  784. @tsubheading{Regions}
  785. @kindex C-c C-x M-w
  786. @item C-c C-x M-w
  787. Copy a rectangular region from a table to a special clipboard. Point
  788. and mark determine edge fields of the rectangle. The process ignores
  789. horizontal separator lines.
  790. @kindex C-c C-x C-w
  791. @item C-c C-x C-w
  792. Copy a rectangular region from a table to a special clipboard, and
  793. blank all fields in the rectangle. So this is the ``cut'' operation.
  794. @kindex C-c C-x C-y
  795. @item C-c C-x C-y
  796. Paste a rectangular region into a table.
  797. The upper right corner ends up in the current field. All involved fields
  798. will be overwritten. If the rectangle does not fit into the present table,
  799. the table is enlarged as needed. The process ignores horizontal separator
  800. lines.
  801. @kindex C-c C-q
  802. @item C-c C-q
  803. Wrap several fields in a column like a paragraph. If there is an active
  804. region, and both point and mark are in the same column, the text in the
  805. column is wrapped to minimum width for the given number of lines. A
  806. prefix ARG may be used to change the number of desired lines. If there
  807. is no region, the current field is split at the cursor position and the
  808. text fragment to the right of the cursor is prepended to the field one
  809. line down. If there is no region, but you specify a prefix ARG, the
  810. current field is made blank, and the content is appended to the field
  811. above.
  812. @tsubheading{Calculations}
  813. @cindex formula, in tables
  814. @cindex calculations, in tables
  815. @kindex C-c =
  816. @item C-c =
  817. Install a new formula for the current column and replace current field
  818. with the result of the formula.
  819. @kindex C-u C-c =
  820. @item C-u C-c =
  821. Install a new formula for the current field, which must be a named
  822. field. Evaluate the formula and replace the field content with the
  823. result.
  824. @kindex C-c '
  825. @item C-c '
  826. Edit all formulas associated with the current table in a separate
  827. buffer.
  828. @kindex C-c *
  829. @item C-c *
  830. Recalculate the current row by applying the stored formulas from left
  831. to right. When called with a @kbd{C-u} prefix, recalculate the
  832. entire table, starting with the first non-header line (i.e. below the
  833. first horizontal separator line). For details, see @ref{Table calculations}.
  834. @kindex C-#
  835. @item C-#
  836. Rotate the calculation mark in first column through the states
  837. @samp{}, @samp{#}, @samp{*}, @samp{!}, @samp{$}. For the meaning of
  838. these marks see @ref{Advanced features}. When there is an active
  839. region, change all marks in the region.
  840. @kindex C-c ?
  841. @item C-c ?
  842. Which table column is the cursor in? Displays number >0 in echo
  843. area.
  844. @cindex region, active
  845. @cindex active region
  846. @cindex transient-mark-mode
  847. @kindex C-c +
  848. @item C-c +
  849. Sum the numbers in the current column, or in the rectangle defined by
  850. the active region. The result is shown in the echo area and can
  851. be inserted with @kbd{C-y}.
  852. @kindex S-@key{RET}
  853. @item S-@key{RET}
  854. When current field is empty, copy from first non-empty field above.
  855. When not empty, copy current field down to next row and move cursor
  856. along with it. Depending on the variable
  857. @code{org-table-copy-increment}, integer field values will be
  858. incremented during copy. This key is also used by CUA-mode
  859. (@pxref{Interaction}).
  860. @tsubheading{Miscellaneous}
  861. @kindex C-c |
  862. @item C-c |
  863. Toggle the visibility of vertical lines in tables. The lines are
  864. still there, only made invisible with a text property. Any @samp{|}
  865. added by hand will become invisible on the next align.
  866. @item M-x org-table-import
  867. Import a file as a table. The table should be TAB- or whitespace
  868. separated. Useful, for example, to import an Excel table or data from a
  869. database, because these programs generally can write TAB-separated text
  870. files. This command works by inserting the file into the buffer and
  871. then converting the region to a table. Any prefix argument is passed on
  872. to the converter, which uses it to determine the separator.
  873. @item M-x org-table-export
  874. Export the table as a TAB-separated file. Useful for data exchange with,
  875. for example, Excel or database programs.
  876. @end table
  877. If you don't like the automatic table editor because it gets in your
  878. way on lines which you would like to start with @samp{|}, you can turn
  879. it off with
  880. @lisp
  881. (setq org-enable-table-editor nil)
  882. @end lisp
  883. @noindent The only table command which then still works is
  884. @kbd{C-c C-c} to do a manual re-align.
  885. @node Table calculations, orgtbl-mode, Built-in table editor, Tables
  886. @section Calculations in tables
  887. @cindex calculations, in tables
  888. @cindex spreadsheet capabilities
  889. @cindex @file{calc} package
  890. The table editor makes use of the Emacs @file{calc} package to
  891. implement spreadsheet-like capabilities. Org-mode has two levels of
  892. complexity for table calculations. On the basic level, tables do only
  893. horizontal computations, so a field can be computed from other fields
  894. @emph{in the same row}, and Org-mode assumes that there is only one
  895. formula for each column. This is very efficient to work with and
  896. enough for many tasks. On the complex level, columns and individual
  897. fields can be named for easier referencing in formulas, individual
  898. named fields can have their own formula associated with them, and
  899. recalculation can be automated.
  900. @menu
  901. * Formula syntax:: How to write a formula
  902. * Column formulas:: Formulas valid for all fields in a column
  903. * Advanced features:: Field names, parameters and automatic recalc
  904. * Named-field formulas:: Formulas valid in single fields
  905. * Editing/debugging formulas:: Changing a stored formula
  906. * Appetizer:: Taste the power of calc
  907. @end menu
  908. @node Formula syntax, Column formulas, Table calculations, Table calculations
  909. @subsection Formula syntax
  910. @cindex formula syntax
  911. @cindex syntax, of formulas
  912. A formula can be any algebraic expression understood by the Emacs
  913. @file{calc} package. Note that @file{calc} has the slightly
  914. non-standard convention that @samp{/} has lower precedence than
  915. @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}. Before
  916. evaluation by @code{calc-eval} (@pxref{Calling Calc from Your Lisp
  917. Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs
  918. Calc Manual}), variable substitution takes place:
  919. @example
  920. $ @r{refers to the current field}
  921. $3 @r{refers to the field in column 3 of the current row}
  922. $3..$7 @r{a vector of the fields in columns 3-7 of current row}
  923. $P1..$P3 @r{vector of column range, using column names}
  924. &2 @r{second data field above the current, in same column}
  925. &5-2 @r{vector from fifth to second field above current}
  926. &III-II @r{vector of fields between 2nd and 3rd hline above}
  927. &III @r{vector of fields between third hline above and current field}
  928. $name @r{a named field, parameter or constant}
  929. @end example
  930. @cindex vectors, in table calculations
  931. The range vectors can be directly fed into the calc vector functions
  932. like @samp{vmean} and @samp{vsum}.
  933. @cindex name, of column or field
  934. @cindex constants, in calculations
  935. @samp{$name} is interpreted as the name of a column, parameter or
  936. constant. Constants are defined globally through the variable
  937. @code{org-table-formula-constants}. If you have the
  938. @file{constants.el} package, it will also be used to resolve
  939. constants, including natural constants like @samp{$h} for Planck's
  940. constant, and units like @samp{$km} for kilometers. Column names and
  941. parameters can be specified in special table lines. These are
  942. described below, see @ref{Advanced features}.
  943. @cindex format specifier
  944. @cindex mode, for @file{calc}
  945. A formula can contain an optional mode string after a semicolon. This
  946. string consists of flags to influence calc's modes@footnote{By
  947. default, Org-mode uses the standard calc modes (precision 12, angular
  948. units degrees, fraction and symbolic modes off). However, the display
  949. format has been changed to @code{(float 5)} to keep tables compact.
  950. The default settings can be configured using the variable
  951. @code{org-calc-default-modes}.} during execution, e.g. @samp{p20} to
  952. switch the internal precision to 20 digits, @samp{n3}, @samp{s3},
  953. @samp{e2} or @samp{f4} to switch to normal, scientific, engineering,
  954. or fixed display format, respectively, and @samp{D}, @samp{R}, @samp{F},
  955. and @samp{S} to turn on degrees, radians, fraction and symbolic modes,
  956. respectively. In addition, you may provide a @code{printf} format
  957. specifier to reformat the final result. A few examples:
  958. @example
  959. $1+$2 @r{Sum of first and second field}
  960. $1+$2;%.2f @r{Same, format result to two decimals}
  961. exp($2)+exp($1) @r{Math functions can be used}
  962. $;%.1f @r{Reformat current cell to 1 decimal}
  963. ($3-32)*5/9 @r{Degrees F -> C conversion}
  964. $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
  965. tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
  966. sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
  967. vmean($2..$7) @r{Compute column range mean, using vector function}
  968. vsum(&III) @r{Sum numbers from 3rd hline above, up to here}
  969. taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
  970. @end example
  971. @node Column formulas, Advanced features, Formula syntax, Table calculations
  972. @subsection Column formulas
  973. @cindex column formula
  974. @cindex formula, for table column
  975. To apply a formula to a field, type it directly into the field,
  976. preceded by an equal sign, like @samp{=$1+$2}. When you press
  977. @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
  978. field, the formula will be stored as the formula for the current
  979. column, evaluated and the current field replaced with the result. If
  980. the field contains only @samp{=}, the previously stored formula for
  981. this column is used.
  982. For each column, Org-mode will remember the most recently used
  983. formula. The information is stored in a special line starting with
  984. @samp{#+TBLFM} directly below the table. When adding/deleting/moving
  985. columns with the appropriate commands, the stored equations will be
  986. modified accordingly. When a column used in a calculation is removed,
  987. references to this column become invalid and will cause an error upon
  988. applying the equation.
  989. Instead of typing an equation into the field, you may also use the
  990. command @kbd{C-c =}. It prompts for a formula (with default taken
  991. from the @samp{#+TBLFM:} line) and applies it to the current field. A
  992. numerical prefix (e.g. @kbd{C-5 C-c =}) will apply it to that many
  993. subsequent fields in the current column.
  994. @cindex recomputing table fields
  995. To recompute all the fields in a line, use the command @kbd{C-c *}.
  996. It re-applies all stored equations to the current row, from left to
  997. right. With a @kbd{C-u} prefix, this will be done to every line in
  998. the table, so use this command it you want to make sure the entire
  999. table is up-to-date. @kbd{C-u C-c C-c} is another way to update the
  1000. entire table. Global updating does not touch the line(s) above the
  1001. first horizontal separator line, assuming that this is the table
  1002. header.
  1003. @node Advanced features, Named-field formulas, Column formulas, Table calculations
  1004. @subsection Advanced features
  1005. If you want the recalculation of fields to happen automatically,
  1006. or if you want to be able to assign a formula to an individual field
  1007. (instead of an entire column) you need to reserve the first column of
  1008. the table for special marking characters. Here is an example of a
  1009. table that collects exam results of students and makes use of these
  1010. features:
  1011. @example
  1012. @group
  1013. |---+---------+--------+--------+--------+-------+------|
  1014. | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
  1015. |---+---------+--------+--------+--------+-------+------|
  1016. | ! | | P1 | P2 | P3 | Tot | |
  1017. | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
  1018. | ^ | | m1 | m2 | m3 | mt | |
  1019. |---+---------+--------+--------+--------+-------+------|
  1020. | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
  1021. | # | Sara | 6 | 14 | 19 | 39 | 7.8 |
  1022. | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
  1023. |---+---------+--------+--------+--------+-------+------|
  1024. | | Average | | | | 29.7 | |
  1025. | ^ | | | | | at | |
  1026. | $ | max=50 | | | | | |
  1027. |---+---------+--------+--------+--------+-------+------|
  1028. #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(&II);%.1f
  1029. @end group
  1030. @end example
  1031. @noindent @b{Important}: Please note that for these special tables,
  1032. recalculating the table with @kbd{C-u C-c *} will only affect rows
  1033. which are marked @samp{#} or @samp{*}, and named fields. The column
  1034. formulas are not applied in rows with empty first field.
  1035. @cindex marking characters, tables
  1036. The marking characters have the following meaning:
  1037. @table @samp
  1038. @item !
  1039. The fields in this line define names for the columns, so that you may
  1040. refer to a column as @samp{$Tot} instead of @samp{$6}.
  1041. @item ^
  1042. This row defines names for the fields @emph{above} the row. With such
  1043. a definition, any formula in the table may use @samp{$m1} to refer to
  1044. the value @samp{10}. Also, named fields can have their own formula
  1045. associated with them.
  1046. @item _
  1047. Similar to @samp{^}, but defines names for the fields in the row
  1048. @emph{below}.
  1049. @item $
  1050. Fields in this row can define @emph{parameters} for formulas. For
  1051. example, if a field in a @samp{$} row contains @samp{max=50}, then
  1052. formulas in this table can refer to the value 50 using @samp{$max}.
  1053. Parameters work exactly like constants, only that they can be defined on
  1054. a per-table basis. Changing a parameter and then recalculating the
  1055. table can be useful.
  1056. @item #
  1057. Fields in this row are automatically recalculated when pressing
  1058. @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
  1059. is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
  1060. lines will be left alone by this command.
  1061. @item *
  1062. Selects this line for global recalculation with @kbd{C-u C-c *}, but
  1063. not for automatic recalculation. Use this when automatic
  1064. recalculation slows down editing too much.
  1065. @item
  1066. Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
  1067. All lines that should be recalculated should be marked with @samp{#}
  1068. or @samp{*}.
  1069. @end table
  1070. @node Named-field formulas, Editing/debugging formulas, Advanced features, Table calculations
  1071. @subsection Named-field formulas
  1072. @cindex named field formula
  1073. @cindex formula, for named table field
  1074. A named field can have its own formula associated with it. In the
  1075. example above, this is used for the @samp{at} field that contains
  1076. the average result of the students. To enter a formula for a named
  1077. field, just type it into the buffer, preceded by @samp{:=}. Or use
  1078. @kbd{C-u C-c =}. This equation will be stored below the table like
  1079. @samp{$name=...}. Any recalculation in the table (even if only
  1080. requested for the current line) will also update all named field
  1081. formulas.
  1082. @node Editing/debugging formulas, Appetizer, Named-field formulas, Table calculations
  1083. @subsection Editing and debugging formulas
  1084. @cindex formula editing
  1085. @cindex editing, of table formulas
  1086. To edit a column or field formula, use the commands @kbd{C-c
  1087. =} and @kbd{C-u C-c =}, respectively. The currently active expression
  1088. is then presented as default in the minibuffer, where it may be edited.
  1089. Note that making a table field blank does not remove the formula
  1090. associated with the field - during the next recalculation the field
  1091. will be filled again. To remove a formula from a field, you have to
  1092. give an empty reply when prompted for the formula, or to edit the
  1093. @samp{#+TBLFM} line.
  1094. @kindex C-c C-c
  1095. You may edit the @samp{#+TBLFM} directly and re-apply
  1096. the changed equations with @kbd{C-c C-c} in that line, or with the
  1097. normal recalculation commands in the table.
  1098. @kindex C-c '
  1099. @kindex C-c C-c
  1100. @kindex C-c C-q
  1101. @kindex C-c ?
  1102. In particular for large tables with many formulas, it is convenient to
  1103. use the command @kbd{C-c '} to edit the formulas of the current table
  1104. in a separate buffer. That buffer will show the formulas one per
  1105. line, and you are free to edit, add and remove formulas. Press
  1106. @kbd{C-c ?} on a @samp{$...} expression to get information about its
  1107. interpretation. Exiting the buffer with @kbd{C-c C-c} only stores the
  1108. modified formulas below the table. Exiting with @kbd{C-u C-c C-c}
  1109. also applies them to the entire table. @kbd{C-c C-q} exits without
  1110. installing the changes.
  1111. When the evaluation of a formula leads to an error, the field content
  1112. becomes the string @samp{#ERROR}. If you would like see what is going
  1113. on during variable substitution and calculation in order to find a
  1114. bug, turn on formula debugging in the menu and repeat the calculation,
  1115. for example by pressing @kbd{C-c = @key{RET}} in a field.
  1116. Detailed information will be displayed.
  1117. @node Appetizer, , Editing/debugging formulas, Table calculations
  1118. @subsection Appetizer
  1119. Finally, just to wet your appetite on what can be done with the fantastic
  1120. @file{calc} package, here is a table that computes the Taylor series
  1121. for a couple of functions (homework: try that with Excel :-)
  1122. @example
  1123. @group
  1124. |---+-------------+---+-----+--------------------------------------|
  1125. | | Func | n | x | Result |
  1126. |---+-------------+---+-----+--------------------------------------|
  1127. | # | exp(x) | 1 | x | 1 + x |
  1128. | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
  1129. | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
  1130. | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
  1131. | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
  1132. | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
  1133. |---+-------------+---+-----+--------------------------------------|
  1134. #+TBLFM: $5=taylor($2,$4,$3);n3
  1135. @end group
  1136. @end example
  1137. @node orgtbl-mode, table.el, Table calculations, Tables
  1138. @section The Orgtbl minor mode
  1139. @cindex orgtbl-mode
  1140. @cindex minor mode for tables
  1141. If you like the intuitive way the Org-mode table editor works, you
  1142. might want to use it also in other modes like text-mode or mail-mode.
  1143. The minor mode Orgtbl-mode makes this possible. You can always toggle
  1144. the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
  1145. example in mail mode, use
  1146. @lisp
  1147. (add-hook 'mail-mode-hook 'turn-on-orgtbl)
  1148. @end lisp
  1149. @node table.el, , orgtbl-mode, Tables
  1150. @section The @file{table.el} package
  1151. @kindex C-c C-c
  1152. @cindex table editor, @file{table.el}
  1153. @cindex @file{table.el}
  1154. Complex ASCII tables with automatic line wrapping, column- and
  1155. row-spanning, and alignment can be created using the Emacs table
  1156. package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
  1157. and also part of Emacs 22).
  1158. When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
  1159. will call @command{table-recognize-table} and move the cursor into the
  1160. table. Inside a table, the keymap of Org-mode is inactive. In order
  1161. to execute Org-mode-related commands, leave the table.
  1162. @table @kbd
  1163. @kindex C-c C-c
  1164. @item C-c C-c
  1165. Recognize @file{table.el} table. Works when the cursor is in a
  1166. table.el table.
  1167. @kindex C-c ~
  1168. @item C-c ~
  1169. Insert a table.el table. If there is already a table at point, this
  1170. command converts it between the table.el format and the Org-mode
  1171. format. See the documentation string of the command
  1172. @code{org-convert-table} for the restrictions under which this is
  1173. possible.
  1174. @end table
  1175. @node Hyperlinks, TODO items, Tables, Top
  1176. @chapter Hyperlinks
  1177. @cindex hyperlinks
  1178. Just like HMTL, Org-mode provides links inside a file, and external
  1179. links to other files, Usenet articles, emails and much more.
  1180. @menu
  1181. * Internal links:: Links to other places in the current file
  1182. * External links:: URL-like links to the world
  1183. * Managing links:: Creating, inserting and following
  1184. * Search Options:: Linking to a specific location
  1185. * Remember:: Org-trees store quick notes
  1186. @end menu
  1187. @node Internal links, External links, Hyperlinks, Hyperlinks
  1188. @section Internal links
  1189. @cindex internal links
  1190. @cindex links, internal
  1191. @cindex CamelCase links
  1192. Strings inside double brackets like @samp{[[My Target]]} are links
  1193. that lead to a text search in the current file. The link can be
  1194. followed with @kbd{C-c C-o} or with a mouse click (@pxref{Managing
  1195. links}). The preferred match for such a link is a dedicated target:
  1196. The same string in double angular brackets. Targets may be located
  1197. anywhere, often it is convenient to put them into a comment line, for
  1198. example
  1199. @example
  1200. # <<My Target>>
  1201. @end example
  1202. If no dedicated target exists, Org-mode will search for the words in
  1203. the link, in the above example for @samp{my target}. Links starting
  1204. with a star like @samp{*My Target} restrict the search to headlines.
  1205. When searching, Org-mode will first try an exact match, but then move
  1206. on to more and more lenient searches. For example, the link
  1207. @samp{[[*My Targets]]} will find any of the following:
  1208. @example
  1209. ** My targets
  1210. ** TODO my targets are bright
  1211. ** my 20 targets are
  1212. @end example
  1213. It is therefore often not necessary to set a dedicated target. To
  1214. insert a link targeting a headline, in-buffer completion can be used.
  1215. Just type a star followed by a few optional letters into the buffer
  1216. and press @kbd{M-@key{TAB}}. All headlines in the current buffer will
  1217. be offered as completions. @xref{Managing links}, for more commands
  1218. creating links.
  1219. Following a link pushes a mark onto Org-mode's own mark ring. You can
  1220. return to the previous position with @kbd{C-c &}. Using this command
  1221. several times in direct succession goes back to positions recorded
  1222. earlier.
  1223. @menu
  1224. * Radio targets:: Make targets trigger links in plain text.
  1225. * CamelCase links:: Activating CamelCase words as links
  1226. @end menu
  1227. @node Radio targets, CamelCase links, Internal links, Internal links
  1228. @subsection Radio targets
  1229. You can configure Org-mode to link any occurrences of certain target
  1230. names in normal text. So without explicitly creating a link, the text
  1231. connects to the target radioing its position. Radio targets are
  1232. enclosed by triple angular brackets. For example, a target
  1233. @samp{<<<My Target>>>} causes each occurrence of @samp{my target} in
  1234. normal text to become activated as a link. The Org-mode file is
  1235. scanned automatically for radio targets only when the file is first
  1236. loaded into Emacs. To update the target list during editing, press
  1237. @kbd{C-c C-c} with the cursor on or at a target.
  1238. @node CamelCase links, , Radio targets, Internal links
  1239. @subsection CamelCase words as links
  1240. @cindex completion, of CamelCase links
  1241. @cindex CamelCase links, completion of
  1242. As an alternative to @samp{[[...]]} links, Org-mode also supports
  1243. CamelCase words as links. This feature is not turned on by default
  1244. because of the occasional inconsistencies this system suffers from.
  1245. To activate CamelCase words as links, and to make headline completion
  1246. offer CamelCase version of headlines, the following customization is
  1247. needed:
  1248. @lisp
  1249. (setq org-activate-camels t
  1250. org-file-link-context-use-camel-case t)
  1251. @end lisp
  1252. @node External links, Managing links, Internal links, Hyperlinks
  1253. @section External links
  1254. @cindex links, external
  1255. @cindex external links
  1256. @cindex links, external
  1257. @cindex GNUS links
  1258. @cindex BBDB links
  1259. @cindex URL links
  1260. @cindex file links
  1261. @cindex VM links
  1262. @cindex RMAIL links
  1263. @cindex WANDERLUST links
  1264. @cindex MH-E links
  1265. @cindex USENET links
  1266. @cindex SHELL links
  1267. Org-mode supports links to files, websites, Usenet and email messages;
  1268. and BBDB database entries. Links are just plain-text URL-like
  1269. locators, optionally enclosed by angular brackets. The following list
  1270. shows examples for each link type.
  1271. @example
  1272. <http://www.astro.uva.nl/~dominik> @r{on the web}
  1273. <file:/home/dominik/images/jupiter.jpg> @r{file, absolute path}
  1274. <file:papers/last.pdf> @r{file, relative path}
  1275. <news:comp.emacs> @r{Usenet link}
  1276. <mailto:adent@@galaxy.net> @r{Mail link}
  1277. <vm:folder> @r{VM folder link}
  1278. <vm:folder#id> @r{VM message link}
  1279. <vm://myself@@some.where.org/folder#id> @r{VM on remote machine}
  1280. <wl:folder> @r{WANDERLUST folder link}
  1281. <wl:folder#id> @r{WANDERLUST message link}
  1282. <mhe:folder> @r{MH-E folder link}
  1283. <mhe:folder#id> @r{MH-E message link}
  1284. <rmail:folder> @r{RMAIL folder link}
  1285. <rmail:folder#id> @r{RMAIL message link}
  1286. <gnus:group> @r{GNUS group link}
  1287. <gnus:group#id> @r{GNUS article link}
  1288. <bbdb:Richard Stallman> @r{BBDB link}
  1289. <shell:ls *.org>@footnote{Note that @samp{<} and @samp{>} cannot be part of a link, and therefore of a shell command. If you need redirection, use @@@{ and @@@} instead.} @r{A shell command}
  1290. @end example
  1291. A link may contain space characters and is terminated by @samp{>} or by
  1292. the end of a line. In tables, the end of a table field also terminates
  1293. a link. Angle brackets around a link are not required, but are
  1294. recommended to avoid problems with punctuation and other text following
  1295. the link. See also the variable @code{org-allow-space-in-links}.
  1296. @node Managing links, Search Options, External links, Hyperlinks
  1297. @section Managing links
  1298. Org-mode provides methods to create a link in the correct syntax, to
  1299. insert it into an org-mode file, and to follow the link.
  1300. @table @kbd
  1301. @kindex C-c l
  1302. @cindex storing links
  1303. @item C-c l
  1304. Store a link to the current location. This is a @emph{global} command
  1305. which can be used in any buffer to create a link. The link will be
  1306. stored for later insertion into an Org-mode buffer (see below). For
  1307. VM, RMAIL, WANDERLUST, GNUS and BBDB buffers, the link will point to
  1308. the current article/entry. For W3 and W3M buffers, the link goes to
  1309. the current URL. For Org-mode files, the current headline is
  1310. targeted. For any other files, the link will point to the file, with
  1311. a search string (@pxref{Search Options}) pointing to the
  1312. contents of the current line. If there is an active region, the
  1313. selected words will form the basis of the search string. The key
  1314. binding @kbd{C-c l} is only a suggestion - see @ref{Installation and
  1315. activation}.
  1316. @kindex C-c C-l
  1317. @cindex link completion
  1318. @cindex file name completion
  1319. @cindex completion, of links
  1320. @cindex completion, of file names
  1321. @cindex inserting links
  1322. @item C-c C-l
  1323. Insert a link. This prompts for a link to be inserted into the
  1324. buffer. You can just type a link, using one of the link type prefixes
  1325. mentioned in the examples above. Through completion, all links stored
  1326. during the current session can be accessed. When called with prefix
  1327. arg, you can use file name completion to enter a file link. The link
  1328. will be formatted as given in the variable @code{org-link-format} and
  1329. inserted into the buffer. Note that you don't have to use this
  1330. command to insert a link. Links in Org-mode are plain text, and you
  1331. can type or paste them straight into the buffer.
  1332. @cindex following links
  1333. @kindex C-c C-o
  1334. @item C-c C-o
  1335. Open link at point. This will launch a web browser for URLs (using
  1336. @command{browse-url-at-point}), run vm/gnus/bbdb for the corresponding
  1337. links, and execute the command in a shell link. When the cursor is on
  1338. a CamelCase link, this commands runs the corresponding search. When
  1339. the cursor is on a TAGS list in a headline, it creates the
  1340. corresponding TAGS view. Furthermore, it will visit text files in
  1341. @samp{file:} links with Emacs and select a suitable application for
  1342. non-text files. Classification of files is based on file extension
  1343. only. See option @code{org-file-apps}. If there is no link at point,
  1344. the current subtree will be searched for one. If you want to override
  1345. the default application and visit the file with Emacs, use a @kbd{C-u}
  1346. prefix. If the cursor is on a time stamp, it compiles the agenda for
  1347. that date.
  1348. @strong{IMPORTANT}: Be careful not to use any dangerous commands in a
  1349. shell link.
  1350. @kindex mouse-2
  1351. @kindex mouse-1
  1352. @item mouse-2
  1353. @itemx mouse-1
  1354. On links, @kbd{mouse-2} will open the link just like @kbd{C-c C-o}
  1355. would. Under Emacs 22, also @kbd{mouse-1} will follow a link.
  1356. @kindex mouse-3
  1357. @item mouse-3
  1358. Like @kbd{mouse-2}, but force file links to be opened with Emacs.
  1359. @cindex mark ring
  1360. @kindex C-c %
  1361. @item C-c %
  1362. Push the current position onto the mark ring, to be able to return
  1363. easily. Commands following an internal link do this automatically.
  1364. @cindex links, returning to
  1365. @kindex C-c &
  1366. @item C-c &
  1367. Jump back to a recorded position. A position is recorded by the
  1368. commands following internal links, and by @kbd{C-c %}. Using this
  1369. command several times in direct succession moves through a ring of
  1370. previously recorded positions.
  1371. @end table
  1372. @node Search Options, Remember, Managing links, Hyperlinks
  1373. @section Search options in file links
  1374. @cindex search option in file links
  1375. @cindex file links, searching
  1376. File links can contain additional information to make Emacs jump to a
  1377. particular location in the file when following a link. This can be a
  1378. line number or a search option after a double@footnote{For backward
  1379. compatibility, line numbers can also follow a single colon.} colon.
  1380. For example:
  1381. @example
  1382. <file:~/code/main.c::255>
  1383. <file:~/xx.org::My Target>
  1384. <file:~/xx.org::*My Target>
  1385. <file:~/xx.org::/regexp/>
  1386. @end example
  1387. @noindent Here is what these options do.
  1388. @table @code
  1389. @item 255
  1390. Jump to line 255.
  1391. @item My Target
  1392. Search for a link target @samp{<<My Target>>}, or do a text search for
  1393. @samp{my target}, similar to the search in internal links, see
  1394. @ref{Internal links}.
  1395. @item *My Target
  1396. In an Org-mode file, restrict search to headlines.
  1397. @item /regexp/
  1398. Do a regular expression search for @code{regexp}. This uses the Emacs
  1399. command @code{occur} to list all matches in a separate window. If the
  1400. target file is in Org-mode, @code{org-occur} is used to create a
  1401. sparse tree with the matches.
  1402. @c If the target file is a directory,
  1403. @c @code{grep} will be used to search all files in the directory.
  1404. @end table
  1405. As a degenerate case, a file link with an empty file name can be used
  1406. to search the current file. For example, @code{<file:::find me>} does
  1407. a search for @samp{find me} in the current file, just like
  1408. @samp{[[find me]]} would.
  1409. @node Remember, , Search Options, Hyperlinks
  1410. @section Remember
  1411. @cindex @file{remember.el}
  1412. Another way to create org entries with links to other files is through
  1413. the @emph{Remember} package by John Wiegley. @emph{Remember} lets you
  1414. store quick notes with little interruption of your work flow. See
  1415. @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
  1416. information. The notes produced by @emph{Remember} can be stored in
  1417. different ways, and Org-mode files are a good target. Org-mode allows
  1418. to file away notes either to a default file, or directly to the
  1419. correct location in your Org-mode outline tree. The following
  1420. customization@footnote{The three autoload forms are only necessary if
  1421. @file{org.el} is not part of the Emacs distribution or an XEmacs
  1422. package.} will tell @emph{Remember} to use org files as target, and to
  1423. create annotations compatible with Org-mode links.
  1424. @example
  1425. (autoload 'org-remember-annotation "org")
  1426. (autoload 'org-remember-apply-template "org")
  1427. (autoload 'org-remember-handler "org")
  1428. (setq org-directory "~/path/to/my/orgfiles/")
  1429. (setq org-default-notes-file "~/.notes")
  1430. (setq remember-annotation-functions '(org-remember-annotation))
  1431. (setq remember-handler-functions '(org-remember-handler))
  1432. (add-hook 'remember-mode-hook 'org-remember-apply-template)
  1433. @end example
  1434. @cindex templates, for remember
  1435. In combination with Org-mode, you can use templates to generate
  1436. different types of remember notes. For example, if you would like to
  1437. use one template to create general TODO entries, and another one for
  1438. journal entries, you could use:
  1439. @example
  1440. (setq org-remember-templates
  1441. '((?t "* TODO %?\n %i\n %a" "~/org/TODO.org")
  1442. (?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")))
  1443. @end example
  1444. @noindent In these entries, the character specifies how to select the
  1445. template, the first string specifies the template, and the second string
  1446. specifies a default file (overruling @code{org-default-notes-file}) as a
  1447. target for this note.
  1448. When you call @kbd{M-x remember} to remember something, org will prompt
  1449. for a key to select the template and then prepare the buffer like
  1450. @example
  1451. * TODO
  1452. <file:link to where you called remember>
  1453. @end example
  1454. @noindent or
  1455. @example
  1456. * [2006-03-21 Tue 15:37]
  1457. <file:link to where you called remember>
  1458. @end example
  1459. @noindent See the variable @code{org-remember-templates} for more details.
  1460. When you are finished composing a note with remember, you have to press
  1461. @kbd{C-c C-c} to exit remember-mode and to file the note away. The
  1462. handler first prompts for a target file - if you press @key{RET}, the
  1463. value of @code{org-default-notes-file} is used. Then the command offers
  1464. the headings tree of the selected file. You can either immediately
  1465. press @key{RET} to get the note appended to the file. Or you can use
  1466. vertical cursor motion (@key{up} and @key{down}) and visibility cycling
  1467. (@key{TAB}) to find a better place. Pressing @key{RET} or @key{left} or
  1468. @key{right} leads to the following result.
  1469. @multitable @columnfractions 0.2 0.1 0.7
  1470. @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
  1471. @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file
  1472. @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor
  1473. @item @tab @key{left} @tab as same level, before current heading
  1474. @item @tab @key{right} @tab as same level, after current heading
  1475. @item not on headline @tab @key{RET}
  1476. @tab at cursor position, level taken from context.
  1477. Or use prefix arg to specify level manually.
  1478. @end multitable
  1479. So a fast way to store the note is to press @kbd{C-c C-c @key{RET}
  1480. @key{RET}} to append it to the default file. Even shorter would be
  1481. @kbd{C-u C-c C-c}, which does the same without even showing the tree.
  1482. But with little extra effort, you can push it directly to the correct
  1483. location.
  1484. Before inserting the text into a tree, the function ensures that the
  1485. text has a headline, i.e. a first line that starts with a @samp{*}.
  1486. If not, a headline is constructed from the current date and some
  1487. additional data. If the variable @code{org-adapt-indentation} is
  1488. non-nil, the entire text is also indented so that it starts in the
  1489. same column as the headline (after the asterisks).
  1490. @node TODO items, Timestamps, Hyperlinks, Top
  1491. @chapter TODO items
  1492. @cindex TODO items
  1493. Org-mode does not maintain TODO lists as a separate document. TODO
  1494. items are an integral part of the notes file, because TODO items
  1495. usually come up while taking notes! With Org-mode, you simply mark
  1496. any entry in a tree as being a TODO item. In this way, the
  1497. information is not duplicated, and the entire context from which the
  1498. item emerged is always present when you check.
  1499. Of course, this technique causes TODO items to be scattered throughout
  1500. your file. Org-mode provides methods to give you an overview over all
  1501. things you have to do.
  1502. @menu
  1503. * TODO basics:: Marking and displaying TODO entries
  1504. * Progress logging:: Document your productivity
  1505. * TODO extensions:: Workflow and assignments
  1506. * Priorities:: Some things are more important than others
  1507. @end menu
  1508. @node TODO basics, Progress logging, TODO items, TODO items
  1509. @section Basic TODO functionality
  1510. Any headline can become a TODO item by starting it with the word TODO,
  1511. for example:
  1512. @example
  1513. *** TODO Write letter to Sam Fortune
  1514. @end example
  1515. @noindent
  1516. The most important commands to work with TODO entries are:
  1517. @table @kbd
  1518. @kindex C-c C-t
  1519. @cindex cycling, of TODO states
  1520. @item C-c C-t
  1521. Rotate the TODO state of the current item between
  1522. @example
  1523. ,-> (unmarked) -> TODO -> DONE --.
  1524. '--------------------------------'
  1525. @end example
  1526. The same rotation can also be done ``remotely'' from the timeline and
  1527. agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
  1528. @kindex C-c C-v
  1529. @cindex sparse tree, for TODO
  1530. @item C-c C-v
  1531. View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
  1532. the entire buffer, but shows all TODO items and the headings hierarchy
  1533. above them. With prefix arg, show also the DONE entries. With
  1534. numerical prefix N, show the tree for the Nth keyword in the variable
  1535. @code{org-todo-keywords}.
  1536. @kindex C-c a t
  1537. @item C-c a t
  1538. Show the global TODO list. This collects the TODO items from all
  1539. agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
  1540. @code{agenda-mode}, so there are commands to examine and manipulate
  1541. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  1542. @xref{Global TODO list}, for more information.
  1543. @item @code{org-agenda-include-all-todo}
  1544. If you would like to have all your TODO items listed as part of your
  1545. agenda, customize the variable @code{org-agenda-include-all-todo}.
  1546. @end table
  1547. @node Progress logging, TODO extensions, TODO basics, TODO items
  1548. @section Progress Logging
  1549. @cindex progress logging
  1550. @cindex logging, of progress
  1551. If you want to keep track of @emph{when} a certain TODO item was
  1552. finished, turn on logging with
  1553. @lisp
  1554. (setq org-log-done t)
  1555. @end lisp
  1556. @noindent
  1557. Then each time you turn a TODO entry into DONE using either @kbd{C-c
  1558. C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
  1559. @samp{CLOSED: [timestamp]} will be inserted just after the headline.
  1560. If you turn the entry back into a TODO item again through further
  1561. state cycling, that line will be removed again. In the timeline
  1562. (@pxref{Timeline}) and in the agenda (@pxref{Weekly/Daily Agenda}),
  1563. you can then use the @kbd{L} key to display the TODO items closed on
  1564. each day, giving you an overview of what has been done on a day.
  1565. @node TODO extensions, Priorities, Progress logging, TODO items
  1566. @section Extended use of TODO keywords
  1567. @cindex extended TODO keywords
  1568. The default implementation of TODO entries is just two states: TODO
  1569. and DONE. You can, however, use the TODO feature for more
  1570. complicated things by configuring the variables
  1571. @code{org-todo-keywords} and @code{org-todo-interpretation}. Using
  1572. special setup, you can even use TODO keywords in different ways in
  1573. different org files.
  1574. @menu
  1575. * Workflow states:: From TODO to DONE in steps
  1576. * TODO types:: I do this, Fred the rest
  1577. * Per file keywords:: Different files, different requirements
  1578. @end menu
  1579. @node Workflow states, TODO types, TODO extensions, TODO extensions
  1580. @subsection TODO keywords as workflow states
  1581. @cindex TODO workflow
  1582. @cindex workflow states as TODO keywords
  1583. You can use TODO keywords to indicate different states in the process
  1584. of working on an item, for example:
  1585. @lisp
  1586. (setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
  1587. org-todo-interpretation 'sequence)
  1588. @end lisp
  1589. @cindex completion, of TODO keywords
  1590. Changing these variables becomes only effective in a new Emacs session.
  1591. With this setup, the command @kbd{C-c C-t} will cycle an entry from
  1592. TODO to FEEDBACK, then to VERIFY, and finally to DONE. You may also
  1593. use a prefix argument to quickly select a specific state. For example
  1594. @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
  1595. If you define many keywords, you can use in-buffer completion (see
  1596. @ref{Completion}) to insert these words into the buffer.
  1597. @node TODO types, Per file keywords, Workflow states, TODO extensions
  1598. @subsection TODO keywords as types
  1599. @cindex TODO types
  1600. @cindex names as TODO keywords
  1601. @cindex types as TODO keywords
  1602. The second possibility is to use TODO keywords to indicate different
  1603. types of action items. For example, you might want to indicate that
  1604. items are for ``work'' or ``home''. If you are into David Allen's
  1605. @emph{Getting Things DONE}, you might want to use todo types
  1606. @samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}. Or, when you work
  1607. with several people on a single project, you might want to assign
  1608. action items directly to persons, by using their names as TODO
  1609. keywords. This would be set up like this:
  1610. @lisp
  1611. (setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
  1612. org-todo-interpretation 'type)
  1613. @end lisp
  1614. In this case, different keywords do not indicate a sequence, but
  1615. rather different types. So it is normally not useful to change from
  1616. one type to another. Therefore, in this case the behavior of the
  1617. command @kbd{C-c C-t} is changed slightly@footnote{This is also true
  1618. for the @kbd{t} command in the timeline and agenda buffers.}. When
  1619. used several times in succession, it will still cycle through all
  1620. names. But when you return to the item after some time and execute
  1621. @kbd{C-c C-t} again, it will switch from each name directly to DONE.
  1622. Use prefix arguments or completion to quickly select a specific name.
  1623. You can also review the items of a specific TODO type in a sparse tree
  1624. by using a numeric prefix to @kbd{C-c C-v}. For example, to see all
  1625. things Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect
  1626. Lucy's items from all agenda files into a single buffer, you
  1627. would use the prefix arg as well when creating the global todo list:
  1628. @kbd{C-3 C-c t}.
  1629. @node Per file keywords, , TODO types, TODO extensions
  1630. @subsection Setting up TODO keywords for individual files
  1631. @cindex keyword options
  1632. @cindex per file keywords
  1633. It can be very useful to use different aspects of the TODO mechanism
  1634. in different files, which is not possible with the global settings
  1635. described above. For file-local settings, you need to add special
  1636. lines to the file which set the keywords and interpretation for that
  1637. file only. For example, to set one of the two examples discussed
  1638. above, you need one of the following lines, starting in column zero
  1639. anywhere in the file:
  1640. @example
  1641. #+SEQ_TODO: TODO FEEDBACK VERIFY DONE
  1642. #+TYP_TODO: Fred Sara Lucy Mike DONE
  1643. @end example
  1644. @cindex Completion, of option keywords
  1645. @kindex M-@key{TAB}
  1646. @noindent To make sure you are using the correct keyword, type
  1647. @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
  1648. @cindex DONE, final TODO keyword
  1649. Remember that the last keyword must always mean that the item is DONE
  1650. (you may use a different word, though). Also note that in each file,
  1651. only one of the two aspects of TODO keywords can be used. After
  1652. changing one of these lines, use @kbd{C-c C-c} with the cursor still
  1653. in the line to make the changes known to Org-mode@footnote{Org-mode
  1654. parses these lines only when Org-mode is activated after visiting a
  1655. file. @kbd{C-c C-c} with the cursor in a line starting with @samp{#+}
  1656. is simply restarting Org-mode, making sure that these changes will be
  1657. respected.}.
  1658. If you want to use very many keywords, for example when working with a
  1659. large group of people, you may split the names over several lines:
  1660. @example
  1661. #+TYP_TODO: Fred Sara Lucy Mike
  1662. #+TYP_TODO: Luis George Jules Jessica
  1663. #+TYP_TODO: Kim Arnold Peter
  1664. #+TYP_TODO: DONE
  1665. @end example
  1666. @node Priorities, , TODO extensions, TODO items
  1667. @section Priorities
  1668. @cindex priorities
  1669. If you use Org-mode extensively to organize your work, you may end up
  1670. with a number of TODO entries so large that you'd like to prioritize
  1671. them. This can be done by placing a @emph{priority cookie} into the
  1672. headline, like this
  1673. @example
  1674. *** TODO [#A] Write letter to Sam Fortune
  1675. @end example
  1676. @noindent
  1677. With its standard setup, Org-mode supports priorities @samp{A},
  1678. @samp{B}, and @samp{C}. @samp{A} is the highest priority. An entry
  1679. without a cookie is treated as priority @samp{B}. Priorities make a
  1680. difference only in the agenda (@pxref{Weekly/Daily Agenda}).
  1681. @table @kbd
  1682. @kindex @kbd{C-c ,}
  1683. @item @kbd{C-c ,}
  1684. Set the priority of the current item. The command prompts for a
  1685. priority character @samp{A}, @samp{B} or @samp{C}. When you press
  1686. @key{SPC} instead, the priority cookie is removed from the headline.
  1687. The priorities can also be changed ``remotely'' from the timeline and
  1688. agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
  1689. @kindex S-@key{up}
  1690. @kindex S-@key{down}
  1691. @item S-@key{up}
  1692. @itemx S-@key{down}
  1693. Increase/decrease priority of current item. Note that these keys are
  1694. also used to modify time stamps (@pxref{Creating timestamps}).
  1695. Furthermore, these keys are also used by CUA-mode
  1696. (@pxref{Interaction}).
  1697. @end table
  1698. @node Timestamps, Agenda Views, TODO items, Top
  1699. @chapter Timestamps
  1700. Items can be labeled with timestamps to make them useful for project
  1701. planning.
  1702. @menu
  1703. * Time stamps:: Assigning a time to a tree entry
  1704. * Creating timestamps:: Commands which insert timestamps
  1705. @end menu
  1706. @node Time stamps, Creating timestamps, Timestamps, Timestamps
  1707. @section Time stamps, deadlines and scheduling
  1708. @cindex time stamps
  1709. @cindex ranges, time
  1710. @cindex date stamps
  1711. @cindex deadlines
  1712. @cindex scheduling
  1713. A time stamp is a specification of a date (possibly with time) in a
  1714. special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16
  1715. Tue 09:39>}. A time stamp can appear anywhere in the headline or body
  1716. of an org-tree entry. Its presence allows entries to be shown on specific
  1717. dates in the agenda (@pxref{Weekly/Daily Agenda}). We distinguish:
  1718. @table @var
  1719. @cindex timestamp
  1720. @item TIMESTAMP
  1721. A simple time stamp just assigns a date/time to an item. In the
  1722. timeline and agenda displays, the headline of the entry will be shown
  1723. exactly on that date.
  1724. @item TIMERANGE
  1725. @cindex timerange
  1726. Two time stamps connected by @samp{--} denote a time range. The
  1727. headline will be shown on the first and last day of the range, and on
  1728. any dates that are displayed and fall in the range. Here is an
  1729. example:
  1730. @example
  1731. ** Meeting in Amsterdam
  1732. <2004-08-23 Mon>--<2004-08-26 Thu>
  1733. @end example
  1734. @item DEADLINE
  1735. @cindex DEADLINE keyword
  1736. If a time stamp is preceded by the word @samp{DEADLINE:}, the task
  1737. (most likely a TODO item) is supposed to be finished on that date, and
  1738. it will be listed then. In addition, the compilation for @emph{today}
  1739. will carry a warning about the approaching or missed deadline,
  1740. starting @code{org-deadline-warning-days} before the due date, and
  1741. continuing until the entry is marked DONE. An example:
  1742. @example
  1743. *** TODO write article about the Earth for the Guide
  1744. The editor in charge is <bbdb:Ford Prefect>
  1745. DEADLINE: <2004-02-29 Sun>
  1746. @end example
  1747. @item SCHEDULED
  1748. @cindex SCHEDULED keyword
  1749. If a time stamp is preceded by the word @samp{SCHEDULED:}, it means
  1750. you are planning to start working on that task on the given date. The
  1751. headline will be listed under the given date. In addition, a reminder
  1752. that the scheduled date has passed will be present in the compilation
  1753. for @emph{today}, until the entry is marked DONE. I.e., the
  1754. task will automatically be forwarded.
  1755. @end table
  1756. @node Creating timestamps, , Time stamps, Timestamps
  1757. @section Creating timestamps
  1758. @cindex creating timestamps
  1759. @cindex timestamps, creating
  1760. For Org-mode to recognize time stamps, they need to be in the specific
  1761. format. All commands listed below produce time stamps in the correct
  1762. format.
  1763. @table @kbd
  1764. @kindex C-c .
  1765. @item C-c .
  1766. Prompt for a date and insert a corresponding time stamp. When the
  1767. cursor is at a previously used time stamp, it is updated to NOW. When
  1768. this command is used twice in succession, a time range is inserted.
  1769. @kindex C-u C-c .
  1770. @item C-u C-c .
  1771. Like @kbd{C-c .}, but use the alternative format which contains date
  1772. and time. The default time can be rounded to multiples of 5 minutes,
  1773. see the option @code{org-time-stamp-rounding-minutes}.
  1774. @kindex C-c !
  1775. @item C-c !
  1776. Like @kbd{C-c .}, but insert an inactive time stamp not triggering the
  1777. agenda.
  1778. @kindex C-c <
  1779. @item C-c <
  1780. Insert a time stamp corresponding to the cursor date in the Calendar.
  1781. @kindex C-c >
  1782. @item C-c >
  1783. Access the Emacs calendar for the current date. If there is a
  1784. timestamp in the current line, goto the corresponding date
  1785. instead.
  1786. @kindex C-c C-o
  1787. @item C-c C-o
  1788. Access the agenda for the date given by the time stamp at point
  1789. (@pxref{Weekly/Daily Agenda}).
  1790. @kindex C-c C-d
  1791. @item C-c C-d
  1792. Insert @samp{DEADLINE} keyword along with a stamp.
  1793. @kindex C-c C-w
  1794. @cindex sparse tree, for deadlines
  1795. @item C-c C-w
  1796. Create a sparse tree with all deadlines that are either past-due, or
  1797. which will become due within @code{org-deadline-warning-days}.
  1798. With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
  1799. prefix, check that many days. For example, @kbd{C-1 C-c C-w} shows
  1800. all deadlines due tomorrow.
  1801. @kindex C-c C-s
  1802. @item C-c C-s
  1803. Insert @samp{SCHEDULED} keyword along with a stamp.
  1804. @kindex S-@key{left}
  1805. @kindex S-@key{right}
  1806. @item S-@key{left}
  1807. @itemx S-@key{right}
  1808. Change date at cursor by one day. These key bindings conflict with
  1809. CUA-mode (@pxref{Interaction}).
  1810. @kindex S-@key{up}
  1811. @kindex S-@key{down}
  1812. @item S-@key{up}
  1813. @itemx S-@key{down}
  1814. Change the item under the cursor in a timestamp. The cursor can be on
  1815. a year, month, day, hour or minute. Note that if the cursor is not at
  1816. a time stamp, these same keys modify the priority of an item.
  1817. (@pxref{Priorities}). The key bindings also conflict with CUA-mode
  1818. (@pxref{Interaction}).
  1819. @kindex C-c C-y
  1820. @cindex evaluate time range
  1821. @item C-c C-y
  1822. Evaluate a time range by computing the difference between start and
  1823. end. With prefix arg, insert result after the time range (in a table:
  1824. into the following column).
  1825. @end table
  1826. @cindex date, reading in minibuffer
  1827. @cindex time, reading in minibuffer
  1828. @cindex calendar, for selecting date
  1829. When Org-mode prompts for a date/time, the function reading your input
  1830. will replace anything you choose not to specify with the current date
  1831. and time. For details, see the documentation string of
  1832. @command{org-read-date}. Also, a calender will pop up to allow
  1833. selecting a date. The calendar can be fully controlled from the
  1834. minibuffer, and a date can be selected with the following commands:
  1835. @table @kbd
  1836. @kindex <
  1837. @item <
  1838. Scroll calendar backwards by one month.
  1839. @kindex >
  1840. @item >
  1841. Scroll calendar forwards by one month.
  1842. @kindex mouse-1
  1843. @item mouse-1
  1844. Select date by clicking on it.
  1845. @kindex S-@key{right}
  1846. @item S-@key{right}
  1847. One day forward.
  1848. @kindex S-@key{left}
  1849. @item S-@key{left}
  1850. One day back.
  1851. @kindex S-@key{down}
  1852. @item S-@key{down}
  1853. One week forward.
  1854. @kindex S-@key{up}
  1855. @item S-@key{up}
  1856. One week back.
  1857. @kindex M-S-@key{right}
  1858. @item M-S-@key{right}
  1859. One month forward.
  1860. @kindex M-S-@key{left}
  1861. @item M-S-@key{left}
  1862. One month back.
  1863. @kindex @key{RET}
  1864. @item @key{RET}
  1865. Choose date in calendar (only if nothing typed into minibuffer).
  1866. @end table
  1867. @node Agenda Views, Exporting, Timestamps, Top
  1868. @chapter Agenda Views
  1869. @cindex agenda views
  1870. Due to the way Org-mode works, TODO items and time-stamped items can
  1871. be scattered throughout a file or even a number of files. To get an
  1872. overview over open action items, or over events that are important for
  1873. a particular date, this information must be collected, sorted and
  1874. displayed in an organized way.
  1875. Org-mode can select items based on various criteria, and display them
  1876. in a separate buffer. Three different views are provided:
  1877. @itemize @bullet
  1878. @item
  1879. an @emph{agenda} that is like a calendar and shows information
  1880. for specific dates
  1881. @item
  1882. a @emph{TODO list} that covers all unfinished
  1883. action items, and
  1884. @item
  1885. a @emph{tags view} that shows information based on
  1886. the tags associated with headlines in the outline tree.
  1887. @end itemize
  1888. @noindent
  1889. The extracted information is displayed in a special @emph{agenda
  1890. buffer}. This buffer is read-only, but provides commands to visit the
  1891. corresponding locations in the original Org-mode files, and even to
  1892. edit these files remotely.
  1893. @menu
  1894. * Agenda files:: Files being searched for agenda information
  1895. * Agenda dispatcher:: Keyboard access to agenda views
  1896. * Weekly/Daily Agenda:: The calendar page with current tasks
  1897. * Global TODO list:: All unfinished action items
  1898. * Matching headline tags:: Structured information with fine-tuned search
  1899. * Timeline:: Time-sorted view for single file
  1900. * Agenda commands:: Remote editing of org trees
  1901. @end menu
  1902. @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
  1903. @section Agenda files
  1904. The information to be shown is collected from all @emph{agenda files},
  1905. the files listed in the variable @code{org-agenda-files}@footnote{If the
  1906. value of that variable is not a list, but a single file name, then the
  1907. list of agenda files will be maintained in that external file.}. Thus even
  1908. if you only work with a single Org-mode file, this file should be put
  1909. into that list@footnote{When using the dispatcher pressing @kbd{1}
  1910. before selecting a command will actually limit the command to the
  1911. current file, and ignore @code{org-agenda-files} until the next
  1912. dispatcher command.}. You can customize @code{org-agenda-files}, but
  1913. the easiest way to maintain it is through the following commands
  1914. @cindex files, adding to agenda list
  1915. @table @kbd
  1916. @kindex C-c [
  1917. @item C-c [
  1918. Add current file to the list of agenda files. The file is added to
  1919. the front of the list. If it was already in the list, it is moved to
  1920. the front. With prefix arg, file is added/moved to the end.
  1921. @kindex C-c ]
  1922. @item C-c ]
  1923. Remove current file from the list of agenda files.
  1924. @kindex C-,
  1925. @item C-,
  1926. Cycle through agenda file list, visiting one file after the other.
  1927. @end table
  1928. @noindent
  1929. The Org menu contains the current list of files and can be used
  1930. to visit any of them.
  1931. @node Agenda dispatcher, Weekly/Daily Agenda, Agenda files, Agenda Views
  1932. @section The agenda dispatcher
  1933. @cindex agenda dispatcher
  1934. @cindex dispatching agenda commands
  1935. @cindex custom agenda commands
  1936. @cindex agenda commands, custom
  1937. The views are created through a dispatcher that should be bound to a
  1938. global key, for example @kbd{C-c a} (@pxref{Installation and
  1939. activation}). In the following we will assume that @kbd{C-c a} is
  1940. indeed how the dispatcher is accessed and lists keyboard access to
  1941. commands accordingly. After pressing @kbd{C-c a}, an additional
  1942. letter is required to execute a command. The dispatcher offers the
  1943. following default commands:
  1944. @table @kbd
  1945. @item a
  1946. Create the calendar-like agenda (@pxref{Weekly/Daily Agenda}).
  1947. @item t / T
  1948. Create a list of all TODO items (@pxref{Global TODO list}).
  1949. @item m / M
  1950. Create a list of headlines matching a TAGS expression (@pxref{Matching
  1951. headline tags}).
  1952. @end table
  1953. You can also define custom commands that will be accessible through
  1954. the dispatcher, just like the default commands. Custom commands are
  1955. global searches for tags and specific TODO keywords, or a variety of
  1956. sparse tree creating commands (@pxref{Sparse trees}). As sparse trees
  1957. are only defined for a single org-mode file, these latter commands act
  1958. on the current buffer instead of the list of agenda files.
  1959. @kindex C-c a C
  1960. Custom commands are configured in the variable
  1961. @code{org-agenda-custom-commands}. You can customize this variable,
  1962. for example by pressing @kbd{C-c a C}. You can also directly set it
  1963. with Emacs Lisp in @file{.emacs}. For example:
  1964. @lisp
  1965. (setq org-agenda-custom-commands
  1966. '(("w" todo "WAITING")
  1967. ("u" tags "+BOSS-URGENT")
  1968. ("U" tags-tree "+BOSS-URGENT")
  1969. ("f" occur-tree "\\<FIXME\\>")))
  1970. @end lisp
  1971. @noindent will define @kbd{C-c a w} as a global search for
  1972. TODO entries with @samp{WAITING} as the TODO keyword, @kbd{C-c a u} as a
  1973. global tags search for headlines marked @samp{:BOSS:} but not
  1974. @samp{:URGENT:}, @kbd{C-c a U} to do the same search but only in the
  1975. current buffer and display the result as a sparse tree, and @kbd{C-c a
  1976. f} to create a sparse tree with all entries containing the word
  1977. @samp{FIXME}. For more information, look at the documentation string
  1978. of the variable @code{org-agenda-custom-commands}.
  1979. @node Weekly/Daily Agenda, Global TODO list, Agenda dispatcher, Agenda Views
  1980. @section The weekly/daily agenda
  1981. @cindex agenda
  1982. The purpose of the weekly/daily @emph{agenda} is to act like a page of
  1983. a paper agenda, showing all the tasks for the current week or day.
  1984. @table @kbd
  1985. @cindex org-agenda, command
  1986. @kindex C-c a a
  1987. @item C-c a a
  1988. Compile an agenda for the current week from a list of org files. The
  1989. agenda shows the entries for each day. With a @kbd{C-u} prefix (or
  1990. when the variable @code{org-agenda-include-all-todo} is @code{t}), all
  1991. unfinished TODO items (including those without a date) are also listed at
  1992. the beginning of the buffer, before the first date.@*
  1993. @end table
  1994. Remote editing from the agenda buffer means, for example, that you can
  1995. change the dates of deadlines and appointments from the agenda buffer.
  1996. The commands available in the Agenda buffer are listed in @ref{Agenda
  1997. commands}.
  1998. @menu
  1999. * Categories:: Not all tasks are equal
  2000. * Time-of-day specifications:: How the agenda knows the time
  2001. * Calendar/Diary integration:: Integrating Anniversaries and more
  2002. * Sorting of agenda items:: The order of things
  2003. @end menu
  2004. @node Categories, Time-of-day specifications, Weekly/Daily Agenda, Weekly/Daily Agenda
  2005. @subsection Categories
  2006. @cindex category
  2007. In the agenda buffer, each entry is preceded by a @emph{category},
  2008. which is derived from the file name. The category can also be set
  2009. with a special line anywhere in the buffer, looking like this:
  2010. @example
  2011. #+CATEGORY: Thesis
  2012. @end example
  2013. If there are several such lines in a file, each specifies the category
  2014. for the text below it (but the first category also applies to any text
  2015. before the first CATEGORY line). The display in the agenda buffer looks
  2016. best if the category is not longer than 10 characters.
  2017. @node Time-of-day specifications, Calendar/Diary integration, Categories, Weekly/Daily Agenda
  2018. @subsection Time-of-Day Specifications
  2019. Org-mode checks each agenda item for a time-of-day specification. The
  2020. time can be part of the time stamp that triggered inclusion into the
  2021. agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
  2022. ranges can be specified with two time stamps, like
  2023. @c
  2024. @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
  2025. In the headline of the entry itself, a time(range) may also appear as
  2026. plain text (like @samp{12:45} or a @samp{8:30-1pm}. If the agenda
  2027. integrates the Emacs diary (@pxref{Calendar/Diary integration}), time
  2028. specifications in diary entries are recognized as well.
  2029. For agenda display, Org-mode extracts the time and displays it in a
  2030. standard 24 hour format as part of the prefix. The example times in
  2031. the previous paragraphs would end up in the agenda like this:
  2032. @example
  2033. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  2034. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  2035. 19:00...... The Vogon reads his poem
  2036. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  2037. @end example
  2038. If the agenda is in single-day mode, or for the display of today, the
  2039. timed entries are embedded in a time grid, like
  2040. @example
  2041. 8:00...... ------------------
  2042. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  2043. 10:00...... ------------------
  2044. 12:00...... ------------------
  2045. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  2046. 14:00...... ------------------
  2047. 16:00...... ------------------
  2048. 18:00...... ------------------
  2049. 19:00...... The Vogon reads his poem
  2050. 20:00...... ------------------
  2051. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  2052. @end example
  2053. The time grid can be turned on and off with the variable
  2054. @code{org-agenda-use-time-grid}, and can be configured with
  2055. @code{org-agenda-time-grid}.
  2056. @node Calendar/Diary integration, Sorting of agenda items, Time-of-day specifications, Weekly/Daily Agenda
  2057. @subsection Calendar/Diary integration
  2058. @cindex calendar integration
  2059. @cindex diary integration
  2060. Emacs contains the calendar and diary by Edward M. Reingold. The
  2061. calendar displays a three-month calendar with holidays from different
  2062. countries and cultures. The diary allows you to keep track of
  2063. anniversaries, lunar phases, sunrise/set, recurrent appointments
  2064. (weekly, monthly) and more. In this way, it is quite complementary to
  2065. Org-mode. It can be very useful to combine output from Org-mode with
  2066. the diary.
  2067. In order to include entries from the Emacs diary into Org-mode's
  2068. agenda, you only need to customize the variable
  2069. @lisp
  2070. (setq org-agenda-include-diary t)
  2071. @end lisp
  2072. @noindent
  2073. @noindent After that, everything will happen automatically. All diary
  2074. entries including holidays, anniversaries etc will be included in the
  2075. agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and
  2076. @key{RET} can be used from the agenda buffer to jump to the diary
  2077. file in order to edit existing diary entries. The @kbd{i} command to
  2078. insert new entries for the current date works in the agenda buffer, as
  2079. well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
  2080. Sunrise/Sunset times, show lunar phases and to convert to other
  2081. calendars, respectively. @kbd{c} can be used to switch back and forth
  2082. between calendar and agenda.
  2083. @node Sorting of agenda items, , Calendar/Diary integration, Weekly/Daily Agenda
  2084. @subsection Sorting of agenda items
  2085. @cindex sorting, of agenda items
  2086. @cindex priorities, of agenda items
  2087. The entries for each day are sorted. The default order is to first
  2088. collect all items containing an explicit time-of-day specification.
  2089. These entries will be shown at the beginning of the list, as a
  2090. @emph{schedule} for the day. After that, items remain grouped in
  2091. categories, in the sequence given by @code{org-agenda-files}. Within
  2092. each category, items are sorted by priority (@pxref{Priorities}).
  2093. The priority is a numerical quantity composed of the base priority
  2094. (2000 for priority @samp{A}, 1000 for @samp{B}, and 0 for @samp{C}),
  2095. plus additional increments for overdue scheduled or deadline items.
  2096. Sorting can be customized using the variable
  2097. @code{org-agenda-sorting-strategy}.
  2098. @node Global TODO list, Matching headline tags, Weekly/Daily Agenda, Agenda Views
  2099. @section The global TODO list
  2100. @cindex global TODO list
  2101. @cindex TODO list, global
  2102. The global TODO list contains all unfinished TODO items, formatted and
  2103. collected into a single place.
  2104. @table @kbd
  2105. @kindex C-c a t
  2106. @item C-c a t
  2107. Show the global TODO list. This collects the TODO items from all
  2108. agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
  2109. @code{agenda-mode}, so there are commands to examine and manipulate
  2110. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  2111. @xref{Global TODO list}, for more information.
  2112. @kindex C-c a T
  2113. @item C-c a T
  2114. Like the above, but allows selection of a specific TODO keyword. You can
  2115. also do this by specifying a prefix argument to @kbd{C-c a t}. With a
  2116. @kbd{C-u} prefix you are prompted for a keyword. With a numeric
  2117. prefix, the Nth keyword in @code{org-todo-keywords} is selected.
  2118. @kindex r
  2119. The @kbd{r} key in the agenda buffer regenerates it, and you can give
  2120. a prefix argument to this command to change the selected TODO keyword,
  2121. for example @kbd{3 r}. If you often need a search for a specific
  2122. keyword, define a custom command for it (@pxref{Agenda dispatcher}).
  2123. @end table
  2124. Remote editing of TODO items means that you can change the state of a
  2125. TODO entry with a single key press. The commands available in the
  2126. TODO list are described in @ref{Agenda commands}.
  2127. @node Matching headline tags, Timeline, Global TODO list, Agenda Views
  2128. @section Matching headline tags
  2129. @cindex matching, of tags
  2130. @cindex tags view
  2131. If headlines in the agenda files are marked with @emph{tags}
  2132. (@pxref{Tags}), you can select headlines based on the tags that apply
  2133. to them and collect them into an agenda buffer.
  2134. @table @kbd
  2135. @kindex C-c a m
  2136. @item C-c a m
  2137. Produce a list of all headlines that match a given set of tags. The
  2138. command prompts for a selection criterion, which is a boolean logic
  2139. expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
  2140. @samp{WORK|HOME} (@pxref{Tags}). If you often need a specific search,
  2141. define a custom command for it (@pxref{Agenda dispatcher}).
  2142. @kindex C-c a M
  2143. @item C-c a M
  2144. Like @kbd{C-c a m}, but only select headlines that are also TODO items
  2145. and force checking subitems (see variable
  2146. @code{org-tags-match-list-sublevels}.
  2147. @end table
  2148. The commands available in the tags list are described in @ref{Agenda
  2149. commands}.
  2150. @node Timeline, Agenda commands, Matching headline tags, Agenda Views
  2151. @section Timeline for a single file
  2152. @cindex single file summary
  2153. @cindex agenda, for single file
  2154. @cindex timeline, single file
  2155. @cindex time-sorted view
  2156. The timeline is not really an agenda view, because it only summarizes
  2157. items from a single Org-mode file. But it also uses the agenda buffer
  2158. and provides similar commands, so we discuss it here. The timeline
  2159. shows all time-stamped items in a single Org-mode file (or the
  2160. selected part of it), in a @emph{time-sorted view}. The main purpose of
  2161. this command is to give an overview over events in a project.
  2162. @table @kbd
  2163. @kindex C-c C-r
  2164. @item C-c C-r
  2165. Show a time-sorted view of the org file, with all time-stamped items.
  2166. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  2167. (scheduled or not) are also listed under the current date.
  2168. @end table
  2169. @noindent
  2170. The commands available in the timeline buffer are listed in
  2171. @ref{Agenda commands}.
  2172. @node Agenda commands, , Timeline, Agenda Views
  2173. @section Commands in the agenda buffer
  2174. @cindex commands, in agenda buffer
  2175. Entries in the agenda buffer are linked back to the org file or diary
  2176. file where they originate. You are not allowed to edit the agenda
  2177. buffer itself, but commands are provided to show and jump to the
  2178. original entry location, and to edit the org-files ``remotely'' from
  2179. the agenda buffer. In this way, all information is stored only once,
  2180. removing the risk that your agenda and note files may diverge.
  2181. Some commands can be executed with mouse clicks on agenda lines. For
  2182. the other commands, the cursor needs to be in the desired line.
  2183. @table @kbd
  2184. @tsubheading{Motion}
  2185. @kindex n
  2186. @item n
  2187. Next line (same as @key{up}).
  2188. @kindex p
  2189. @item p
  2190. Previous line (same as @key{down}).
  2191. @tsubheading{View/GoTo org file}
  2192. @kindex mouse-3
  2193. @kindex @key{SPC}
  2194. @item mouse-3
  2195. @itemx @key{SPC}
  2196. Display the original location of the item in another window.
  2197. @kindex L
  2198. @item L
  2199. Display original location and recenter that window.
  2200. @kindex mouse-2
  2201. @kindex mouse-1
  2202. @kindex @key{TAB}
  2203. @item mouse-2
  2204. @itemx mouse-1
  2205. @itemx @key{TAB}
  2206. Go to the original location of the item in another window. Under Emacs
  2207. 22, @kbd{mouse-1} will also works for this.
  2208. @kindex @key{RET}
  2209. @itemx @key{RET}
  2210. Go to the original location of the item and delete other windows.
  2211. @kindex f
  2212. @item f
  2213. Toggle Follow mode. In Follow mode, as you move the cursor through
  2214. the agenda buffer, the other window always shows the corresponding
  2215. location in the org file.
  2216. @kindex l
  2217. @item l
  2218. Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
  2219. logging was on (variable @code{org-log-done}) are shown in the agenda.
  2220. @tsubheading{Change display}
  2221. @kindex o
  2222. @item o
  2223. Delete other windows.
  2224. @kindex w
  2225. @item w
  2226. Switch to weekly view (7 days displayed together).
  2227. @kindex d
  2228. @item d
  2229. Switch to daily view (just one day displayed).
  2230. @kindex D
  2231. @item D
  2232. Toggle the inclusion of diary entries. See @ref{Calendar/Diary integration}.
  2233. @kindex g
  2234. @item g
  2235. Toggle the time grid on and off. See also the variables
  2236. @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
  2237. @kindex r
  2238. @item r
  2239. Recreate the agenda buffer, for example to reflect the changes
  2240. after modification of the time stamps of items with S-@key{left} and
  2241. S-@key{right}. When the buffer is the global todo list, a prefix
  2242. argument is interpreted to create a selective list for a specific TODO
  2243. keyword.
  2244. @kindex @key{right}
  2245. @item @key{right}
  2246. Display the following @code{org-agenda-ndays} days. For example, if
  2247. the display covers a week, switch to the following week. With prefix
  2248. arg, go forward that many times @code{org-agenda-ndays} days.
  2249. @kindex @key{left}
  2250. @item @key{left}
  2251. Display the previous dates.
  2252. @kindex .
  2253. @item .
  2254. Goto today.
  2255. @tsubheading{Remote editing}
  2256. @item 0-9
  2257. Digit argument.
  2258. @kindex t
  2259. @item t
  2260. Change the TODO state of the item, both in the agenda and in the
  2261. original org file.
  2262. @kindex T
  2263. @item T
  2264. Show all tags assiciated with the current item. Because of
  2265. inheritance, this may be more than the tags listed in the line itself.
  2266. @kindex :
  2267. @item :
  2268. Set tags for the current headline.
  2269. @kindex ,
  2270. @item ,
  2271. Set the priority for the current item. Org-mode prompts for the
  2272. priority character. If you reply with @key{SPC}, the priority cookie
  2273. is removed from the entry.
  2274. @kindex P
  2275. @item p
  2276. Display weighted priority of current item.
  2277. @kindex +
  2278. @kindex S-@key{up}
  2279. @item +
  2280. @itemx S-@key{up}
  2281. Increase the priority of the current item. The priority is changed in
  2282. the original buffer, but the agenda is not resorted. Use the @kbd{r}
  2283. key for this.
  2284. @kindex -
  2285. @kindex S-@key{down}
  2286. @item -
  2287. @itemx S-@key{down}
  2288. Decrease the priority of the current item.
  2289. @kindex S-@key{right}
  2290. @item S-@key{right}
  2291. Change the time stamp associated with the current line by one day into
  2292. the future. With prefix argument, change it by that many days. For
  2293. example, @kbd{3 6 5 S-@key{right}} will change it by a year. The
  2294. stamp is changed in the original org file, but the change is not
  2295. directly reflected in the agenda buffer. Use the
  2296. @kbd{r} key to update the buffer.
  2297. @kindex S-@key{left}
  2298. @item S-@key{left}
  2299. Change the time stamp associated with the current line by one day
  2300. into the past.
  2301. @kindex >
  2302. @item >
  2303. Change the time stamp associated with the current line to today.
  2304. The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
  2305. on my keyboard.
  2306. @cindex diary entries, creating from agenda
  2307. @kindex i
  2308. @item i
  2309. Insert a new entry into the diary. Prompts for the type of entry
  2310. (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
  2311. entry in the diary, just like @kbd{i d} etc. would do in the calendar.
  2312. The date is taken from the cursor position.
  2313. @tsubheading{Calendar commands}
  2314. @kindex c
  2315. @item c
  2316. Open the Emacs calendar and move to the date at the agenda cursor.
  2317. @item c
  2318. When in the calendar, compute and show the Org-mode agenda for the
  2319. date at the cursor.
  2320. @kindex M
  2321. @item M
  2322. Show the phases of the moon for the three month around current date.
  2323. @kindex S
  2324. @item S
  2325. Show sunrise and sunset times. The geographical location must be set
  2326. with calendar variables, see documentation of the Emacs calendar.
  2327. @kindex C
  2328. @item C
  2329. Convert the date at cursor into many other cultural and historic
  2330. calendars.
  2331. @kindex H
  2332. @item H
  2333. Show holidays for three month around the cursor date.
  2334. @kindex C-c C-x C-c
  2335. @item C-c C-x C-c
  2336. Export a single iCalendar file containing entries from all agenda files.
  2337. @tsubheading{Quit and Exit}
  2338. @kindex q
  2339. @item q
  2340. Quit agenda, remove the agenda buffer.
  2341. @kindex x
  2342. @cindex agenda files, removing buffers
  2343. @item x
  2344. Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
  2345. for the compilation of the agenda. Buffers created by the user to
  2346. visit org files will not be removed.
  2347. @end table
  2348. @node Exporting, Miscellaneous, Agenda Views, Top
  2349. @chapter Exporting
  2350. @cindex exporting
  2351. For printing and sharing of notes, Org-mode documents can be exported
  2352. as ASCII or HTML files. To incorporate entries with associated times
  2353. like deadlines or appointments into a desktop calendar program like
  2354. iCal, Org-mode can also produce extracts in the iCalendar format.
  2355. @menu
  2356. * ASCII export:: Export as a structured ASCII file
  2357. * HTML export:: Export as an HTML file
  2358. * iCalendar export:: Create calendar entries.
  2359. @end menu
  2360. @node ASCII export, HTML export, Exporting, Exporting
  2361. @section ASCII export
  2362. @cindex ASCII export
  2363. @cindex region, active
  2364. @cindex active region
  2365. @cindex transient-mark-mode
  2366. @table @kbd
  2367. @kindex C-c C-x a
  2368. @item C-c C-x a
  2369. Export as ASCII file. If there is an active region, only the region
  2370. will be exported. For an org file @file{myfile.org}, the ASCII file
  2371. will be @file{myfile.txt}. The file will be overwritten without
  2372. warning.
  2373. @end table
  2374. @cindex headline levels, for exporting
  2375. In the exported version, the first 3 outline levels will become
  2376. headlines, defining a general document structure. Additional levels
  2377. will be exported as itemized lists. If you want that transition to occur
  2378. at a different level, specify it with a prefix argument. For example,
  2379. @example
  2380. @kbd{C-1 C-c C-x a org-export-as-ascii}
  2381. @end example
  2382. @noindent
  2383. creates only top level headlines and does the rest as items. Lines
  2384. starting with @samp{#} and subtrees starting with the word @samp{COMMENT}
  2385. will not be exported.
  2386. @node HTML export, iCalendar export, ASCII export, Exporting
  2387. @section HTML export
  2388. @cindex HTML export
  2389. Org-mode contains an HTML exporter with extensive HTML formatting, in
  2390. ways similar to John Grubers @emph{markdown} language, but with
  2391. additional support for tables.
  2392. @cindex region, active
  2393. @cindex active region
  2394. @cindex transient-mark-mode
  2395. @table @kbd
  2396. @kindex C-c C-x h
  2397. @item C-c C-x h
  2398. Export as HTML file @file{myfile.html}.
  2399. @kindex C-c C-x b
  2400. @item C-c C-x b
  2401. Export as HTML file and open it with a browser.
  2402. @kindex C-c C-x t
  2403. @item C-c C-x t
  2404. Insert template with export options, see below.
  2405. @kindex C-c :
  2406. @item C-c :
  2407. Toggle fixed-width for entry (QUOTE) or region, see below.
  2408. @end table
  2409. @cindex headline levels, for exporting
  2410. In the exported version, the first 3 outline levels will become
  2411. headlines, defining a general document structure. Additional levels
  2412. will be exported as itemized lists. If you want that transition to occur
  2413. at a different level, specify it with a prefix argument. For example,
  2414. @example
  2415. @kbd{C-2 C-c C-x b}
  2416. @end example
  2417. @noindent
  2418. creates two levels of headings and does the rest as items.
  2419. @menu
  2420. * HTML formatting:: Interpretation of the buffer content
  2421. * Export options:: How to influence exports
  2422. * Comment lines:: Lines which will not be exported
  2423. @end menu
  2424. @node HTML formatting, Export options, HTML export, HTML export
  2425. @subsection HTML formatting
  2426. Not all text is transferred literally to the exported HTML file. The
  2427. exporter implements the following interpretation:
  2428. @itemize @bullet
  2429. @cindex hand-formatted lists
  2430. @cindex lists, hand-formatted
  2431. @item
  2432. Hand-formatted lists with @samp{-}, @samp{*} or @samp{+} as
  2433. bullet, or with @samp{1.} or @samp{2)} as enumerator will be recognized and
  2434. transformed into HTML lists. See @xref{Plain Lists}.
  2435. @cindex underlined text
  2436. @cindex bold text
  2437. @cindex italic text
  2438. @item
  2439. You can make words @b{*bold*}, @i{/italic/}, and _underlined_
  2440. @cindex @TeX{} interpretation
  2441. @item
  2442. Simple @TeX{}-like math constructs are interpreted:
  2443. @cindex completion, of @TeX{} symbols
  2444. @itemize @minus
  2445. @item
  2446. @samp{10^22} and @samp{J_n} are super- and subscripts. You can quote
  2447. @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}
  2448. @item
  2449. @samp{\alpha} indicates a Greek letter, @samp{\to} an arrow. You can
  2450. use completion for these macros, just type @samp{\} and maybe a few
  2451. letters, and press @kbd{M-@key{TAB}} to see possible completions.
  2452. @end itemize
  2453. @cindex tables, export to HTML
  2454. @item
  2455. Tables are transformed into HTML tables. Data fields before the first
  2456. horizontal separator line will be formatted as table header fields.
  2457. @cindex fixed width
  2458. @item
  2459. If a headline starts with the word @samp{QUOTE}, the text below the
  2460. headline will be typeset as fixed-width, to allow quoting of computer
  2461. codes etc. Lines starting with @samp{:} are also typeset in
  2462. fixed-width font.
  2463. @cindex HTML tags
  2464. @item
  2465. If you want to include HTML tags which should be interpreted as such,
  2466. mark them with a @samp{@@} like in @samp{@@<b>bold text@@</b>}.
  2467. Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
  2468. @samp{&gt;} in HTML export.
  2469. @end itemize
  2470. If these conversions conflict with your habits of typing ASCII text,
  2471. they can all be turned off with corresponding variables.
  2472. @node Export options, Comment lines, HTML formatting, HTML export
  2473. @subsection Export options
  2474. @cindex options, for export
  2475. @cindex completion, of option keywords
  2476. The exporter recognizes special lines in the buffer which provide
  2477. additional information. These lines may be put anywhere in the file.
  2478. The whole set of lines can be inserted into the buffer with @kbd{C-c
  2479. C-x t}. For individual lines, a good way to make sure the keyword is
  2480. correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
  2481. (@pxref{Completion}).
  2482. @example
  2483. #+TITLE: the title to be shown (default is the buffer name)
  2484. #+AUTHOR: the author (default taken from @code{user-full-name})
  2485. #+EMAIL: his/her email address (default from @code{user-mail-address})
  2486. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  2487. #+TEXT: Some descriptive text to be inserted at the beginning.
  2488. #+TEXT: Several lines may be given.
  2489. #+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:nil TeX:t
  2490. @end example
  2491. @noindent
  2492. The OPTIONS line is a compact form to specify export settings. Here
  2493. you can:
  2494. @cindex headline levels
  2495. @cindex section-numbers
  2496. @cindex table of contents
  2497. @cindex linebreak preservation
  2498. @cindex quoted html tags
  2499. @cindex fixed-width sections
  2500. @cindex tables
  2501. @cindex @TeX{}-like syntax for sub- and superscripts
  2502. @cindex emphasized text
  2503. @cindex @TeX{} macros
  2504. @example
  2505. H: @r{set the number of headline levels for export}
  2506. num: @r{turn on/off section-numbers}
  2507. toc: @r{turn on/off table of contents}
  2508. \n: @r{turn on/off linebreak-preservation}
  2509. @@: @r{turn on/off quoted html tags}
  2510. :: @r{turn on/off fixed-width sections}
  2511. |: @r{turn on/off tables}
  2512. ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts.}
  2513. *: @r{turn on/off emphasized text (bold, italic, underlined)}
  2514. TeX: @r{turn on/off @TeX{} macros}
  2515. @end example
  2516. You can also give style information for the exported file. The
  2517. default specification can be configured through the option
  2518. @code{org-export-html-style}. If you want to use a file-local style,
  2519. you may use file variables, best wrapped into a COMMENT section at the
  2520. end of the outline tree. For example:
  2521. @example
  2522. * COMMENT HTML style specifications
  2523. # Local Variables:
  2524. # org-export-html-style: " <style type=\"text/css\">
  2525. p @{font-weight: normal; color: gray; @}
  2526. h1 @{color: black; @}
  2527. </style>"
  2528. # End: ***
  2529. @end example
  2530. Remember to execute @kbd{M-x normal-mode} after changing this to make
  2531. the new style visible to Emacs.
  2532. @node Comment lines, , Export options, HTML export
  2533. @subsection Comment lines
  2534. @cindex comment lines
  2535. @cindex exporting, not
  2536. Lines starting with @samp{#} in column zero are treated as comments
  2537. and will never be exported. Also entire subtrees starting with the
  2538. word @samp{COMMENT} will never be exported. Finally, any text before
  2539. the first headline will not be exported either. This applies also for
  2540. ASCII export.
  2541. @table @kbd
  2542. @kindex C-c ;
  2543. @item C-c ;
  2544. Toggle the COMMENT keyword at the beginning of an entry.
  2545. @end table
  2546. @node iCalendar export, , HTML export, Exporting
  2547. @section iCalendar export
  2548. @cindex iCalendar export
  2549. Some people like to use Org-mode for keeping track of projects, but
  2550. still prefer a standard calendar application for anniversaries and
  2551. appointments. In this case it can be useful to have deadlines and
  2552. other time-stamped items in Org-mode files show up in the calendar
  2553. application. Org-mode can export calendar information in the standard
  2554. iCalendar format.
  2555. @table @kbd
  2556. @kindex C-c C-x i
  2557. @item C-c C-x i
  2558. Create iCalendar entries for the current file and store them in the same
  2559. directory, using a file extension @file{.ics}.
  2560. @kindex C-c C-x C-i
  2561. @item C-c C-x C-i
  2562. Like @kbd{C-c C-x i}, but do this for all files in
  2563. @code{org-agenda-files}. For each of these files, a separate iCalendar
  2564. file will be written.
  2565. @kindex C-c C-x c
  2566. @item C-c C-x c
  2567. Create a single large iCalendar file from all files in
  2568. @code{org-agenda-files} and write it to the file given by
  2569. @code{org-combined-agenda-icalendar-file}.
  2570. @end table
  2571. How this calendar is best read and updated, depends on the application
  2572. you are using. For example, when using iCal under Apple MacOS X, you
  2573. could create a new calendar @samp{OrgMode} (the default name for the
  2574. calendar created by @kbd{C-c C-x c}, see the variables
  2575. @code{org-icalendar-combined-name} and
  2576. @code{org-combined-agenda-icalendar-file}). Then set Org-mode to
  2577. overwrite the corresponding file
  2578. @file{~/Library/Calendars/OrgMode.ics}. You may even use AppleScript
  2579. to make iCal re-read the calendar files each time a new version of
  2580. @file{OrgMode.ics} is produced. Here is the setup needed for this:
  2581. @cindex applescript, for calendar update
  2582. @lisp
  2583. (setq org-combined-agenda-icalendar-file
  2584. "~/Library/Calendars/OrgMode.ics")
  2585. (add-hook 'org-after-save-iCalendar-file-hook
  2586. (lambda ()
  2587. (shell-command
  2588. "osascript -e 'tell application \"iCal\" to reload calendars'")))
  2589. @end lisp
  2590. @node Miscellaneous, Index, Exporting, Top
  2591. @chapter Miscellaneous
  2592. @menu
  2593. * Completion:: M-TAB knows what you need
  2594. * Customization:: Adapting Org-mode to your taste
  2595. * Clean view:: Getting rid of leading stars in the outline
  2596. * TTY keys:: Using Org-mode on a tty
  2597. * FAQ:: Frequently asked questions
  2598. * Interaction:: Other Emacs packages
  2599. * Bugs:: Things which do not work perfectly
  2600. * Acknowledgments:: These people provided feedback and more
  2601. @end menu
  2602. @node Completion, Customization, Miscellaneous, Miscellaneous
  2603. @section Completion
  2604. @cindex completion, of @TeX{} symbols
  2605. @cindex completion, of TODO keywords
  2606. @cindex completion, of dictionary words
  2607. @cindex completion, of option keywords
  2608. @cindex completion, of CamelCase links
  2609. @cindex completion, of tags
  2610. @cindex @TeX{} symbol completion
  2611. @cindex TODO keywords completion
  2612. @cindex dictionary word completion
  2613. @cindex option keyword completion
  2614. @cindex CamelCase link completion
  2615. @cindex tag completion
  2616. Org-mode supports in-buffer completion. This type of completion does
  2617. not make use of the minibuffer. You simply type a few letters into
  2618. the buffer and use the key to complete text right there.
  2619. @table @kbd
  2620. @kindex M-@key{TAB}
  2621. @item M-@key{TAB}
  2622. Complete word at point
  2623. @itemize @bullet
  2624. @item
  2625. At the beginning of a headline, complete TODO keywords.
  2626. @item
  2627. After @samp{\}, complete @TeX{} symbols supported by the exporter.
  2628. @item
  2629. After @samp{*}, complete CamelCase versions of all headlines in the
  2630. buffer.
  2631. @item
  2632. After @samp{:}, complete tags used elsewhere in the buffer.
  2633. @item
  2634. After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
  2635. @samp{OPTIONS} which set file-specific options for Org-mode. When the
  2636. option keyword is already complete, pressing @kbd{M-@key{TAB}} again
  2637. will insert example settings for this keyword.
  2638. @item
  2639. Elsewhere, complete dictionary words using ispell.
  2640. @end itemize
  2641. @end table
  2642. @node Customization, Clean view, Completion, Miscellaneous
  2643. @section Customization
  2644. @cindex customization
  2645. @cindex options, for customization
  2646. @cindex variables, for customization
  2647. There are more than 100 variables that can be used to customize
  2648. Org-mode. For the sake of compactness of the manual, we are not
  2649. describing the variables here. A structured overview of customization
  2650. variables is available with @kbd{M-x org-customize}. Or select
  2651. @code{Browse Org Group} from the @code{Org->Customization} menu.
  2652. @node Clean view, TTY keys, Customization, Miscellaneous
  2653. @section A cleaner outline view
  2654. @cindex hiding leading stars
  2655. @cindex clean outline view
  2656. Some people find it noisy and distracting that the Org-mode headlines
  2657. are starting with a potentially large number of stars. For example in
  2658. the example tree from @ref{Headlines}:
  2659. @example
  2660. * Top level headline
  2661. ** Second level
  2662. *** 3rd level
  2663. some text
  2664. *** 3rd level
  2665. more text
  2666. * Another top level headline
  2667. @end example
  2668. @noindent
  2669. Unfortunately this is deeply ingrained into the code of Org-mode and
  2670. cannot be easily changed. You can, however, modify the display in such
  2671. a way that all leading stars become invisible and the outline more easy
  2672. to read. To do this, customize the variable
  2673. @code{org-hide-leading-stars} like this:
  2674. @lisp
  2675. (setq org-hide-leading-stars t)
  2676. @end lisp
  2677. @noindent
  2678. or change this on a per-file basis with one of the lines (anywhere in
  2679. the buffer)
  2680. @example
  2681. #+STARTUP: showstars
  2682. #+STARTUP: hidestars
  2683. @end example
  2684. @noindent
  2685. Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
  2686. the modifications.
  2687. With stars hidden, the tree becomes:
  2688. @example
  2689. * Top level headline
  2690. * Second level
  2691. * 3rd level
  2692. some text
  2693. * 3rd level
  2694. more text
  2695. * Another top level headline
  2696. @end example
  2697. @noindent
  2698. Note that the leading stars are not truly replaced by whitespace, they
  2699. are only fontified with the face @code{org-hide} that uses the
  2700. background color as font color. If are are not using either white or
  2701. black background, you may have to customize this face to get the wanted
  2702. effect. Another possibility is to set this font such that the extra
  2703. stars are @i{almost} invisible, for example using the color
  2704. @code{grey90} on a white background.
  2705. Things become cleaner still if you skip all the even levels and use only
  2706. odd levels 1, 3, 5..., effectively adding two stars to go from one
  2707. outline level to the next:
  2708. @example
  2709. * Top level headline
  2710. * Second level
  2711. * 3rd level
  2712. some text
  2713. * 3rd level
  2714. more text
  2715. * Another top level headline
  2716. @end example
  2717. @noindent
  2718. In order to make the structure editing and export commands handle this
  2719. convention correctly, use
  2720. @lisp
  2721. (setq org-odd-levels-only t)
  2722. @end lisp
  2723. @noindent
  2724. or set this on a per-file basis with one of the following lines (don't
  2725. forget to press @kbd{C-c C-c} with the cursor in the startup line to
  2726. activate changes immediately).
  2727. @example
  2728. #+STARTUP: odd
  2729. #+STARTUP: oddeven
  2730. @end example
  2731. You can convert an Org-mode file from single-star-per-level to
  2732. the double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
  2733. RET} in that file. There is no command for the back conversion because
  2734. such a command might merge levels and in this way destroy the
  2735. structure of the tree.
  2736. @c FIXME: Maybe we should have such a command...
  2737. @node TTY keys, FAQ, Clean view, Miscellaneous
  2738. @section Using org-mode on a tty
  2739. @cindex tty keybindings
  2740. Org-mode uses a number of keys that are not accessible on a tty. This
  2741. applies to most special keys like cursor keys, @key{TAB} and
  2742. @key{RET}, when these are combined with modifier keys like @key{Meta}
  2743. and/or @key{Shift}. Org-mode uses these bindings because it needs to
  2744. provide keys for a large number of commands, and because these keys
  2745. appeared particularly easy to remember. In order to still be able to
  2746. access the core functionality of Org-mode on a tty, alternative
  2747. bindings are provided. Here is a complete list of these bindings,
  2748. which are obviously more cumbersome to use. Note that sometimes a
  2749. work-around can be better. For example changing a time stamp is
  2750. really only fun with @kbd{S-@key{cursor}} keys. On a tty you would
  2751. rather use @kbd{C-c .} to re-insert the timestamp.
  2752. @multitable @columnfractions 0.15 0.2 0.2
  2753. @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
  2754. @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
  2755. @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
  2756. @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
  2757. @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}}
  2758. @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
  2759. @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
  2760. @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
  2761. @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
  2762. @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
  2763. @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
  2764. @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
  2765. @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
  2766. @item @kbd{S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
  2767. @item @kbd{S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
  2768. @item @kbd{S-@key{up}} @tab @kbd{C-c C-x @key{up}} @tab
  2769. @item @kbd{S-@key{down}} @tab @kbd{C-c C-x @key{down}} @tab
  2770. @end multitable
  2771. @node FAQ, Interaction, TTY keys, Miscellaneous
  2772. @section Frequently asked questions
  2773. @cindex FAQ
  2774. @enumerate
  2775. @item @b{Org-mode seems to be a useful default mode for the various
  2776. @file{README} files I have scattered through my directories. How do I
  2777. turn it on for all @file{README} files?}
  2778. @example
  2779. (add-to-list 'auto-mode-alist '("README$" . org-mode))
  2780. @end example
  2781. @item @b{All these stars are driving me mad, I just find the Emacs
  2782. outlines unreadable. Can't you just put white space and a single star as a
  2783. starter for headlines?}@*
  2784. See @ref{Clean view}.
  2785. @item @b{I would like to have two windows on the same Org-mode
  2786. file, but with different outline visibility. Is that possible?}@*
  2787. @cindex @code{make-indirect-buffer}
  2788. @cindex indirect buffers
  2789. In GNU Emacs, you may use @emph{indirect buffers} which do exactly
  2790. this. See the documentation on the command
  2791. @code{make-indirect-buffer}. In XEmacs, this is currently not
  2792. possible because of the different outline implementation.
  2793. @item @b{Is there an easy way to insert links to web locations?}@*
  2794. @cindex URL, paste into buffer
  2795. Sure, just type or paste them into the buffer. A plain-text URL-like
  2796. string is directly interpreted as a link.
  2797. @item @b{When I export my TODO list, every TODO item becomes a
  2798. separate section. How do I enforce these items to be exported as an
  2799. itemized list?}@*
  2800. If you plan to use ASCII or HTML export, make sure things you want to
  2801. be exported as item lists are level 4 at least, even if that does mean
  2802. there is a level jump. For example:
  2803. @example
  2804. * Todays top priorities
  2805. **** TODO write a letter to xyz
  2806. **** TODO Finish the paper
  2807. **** Pick up kids at the school
  2808. @end example
  2809. Alternatively, if you need a specific value for the heading/item
  2810. transition in a particular file, use the @samp{+OPTIONS} line to
  2811. configure the @samp{H} switch.
  2812. @example
  2813. +OPTIONS: H:2; ...
  2814. @end example
  2815. @item @b{I would like to export only a subtree of my file to HTML. How?}@*
  2816. @cindex exporting a subtree
  2817. If you want to export a subtree, mark the subtree as region and then
  2818. export. Marking can be done with @kbd{C-c @@ C-x C-x}, for example.
  2819. @item @b{Org-mode takes over the S-cursor keys. I also want to use
  2820. CUA-mode, is there a way to fix this conflict?}@*
  2821. Yes, see @ref{Interaction}.
  2822. @item @b{Is there an easy way to insert an empty table template with a
  2823. default number of rows and columns?}@*
  2824. @cindex table, empty template
  2825. To insert an empty table template, just type @samp{|-} and use
  2826. @key{TAB}. The default size can be changed with the variable
  2827. @code{org-table-default-size}. However, just starting to type the
  2828. first line is usually much easier.
  2829. @item @b{One of my table columns has started to fill up with
  2830. @samp{#ERROR}. What is going on?}@*
  2831. Org-mode tried to compute the column from other fields using a
  2832. formula stored in the @samp{#+TBLFMT:} line just below the table, and
  2833. the evaluation of the formula fails. Fix the fields used in the
  2834. formula, or fix the formula, or remove it!
  2835. @item @b{When I am in the last column of a table and just above a
  2836. horizontal line in the table, pressing TAB creates a new table line
  2837. @i{before} the horizontal line. How can I quickly move to the line
  2838. @i{below} the horizontal line instead?}@*
  2839. Press @key{down} (to get on the separator line) and then @key{TAB}.
  2840. Or configure the variable @code{org-table-tab-jumps-over-hlines}.
  2841. @item @b{How can I change the indentation of an entire table without
  2842. fixing every line by hand?}@*
  2843. @cindex indentation, of tables
  2844. The indentation of a table is set by the first line. So just fix the
  2845. indentation of the first line and realign with @key{TAB}.
  2846. @item @b{Is it possible to include entries from org-mode files into my
  2847. emacs diary?}@*
  2848. Since the org-mode agenda is much more powerful and can contain the
  2849. diary (@pxref{Calendar/Diary integration}), you should think twice
  2850. before deciding to do this. Integrating Org-mode information into the
  2851. diary is, however, possible. The following steps are necessary:
  2852. Autoload the function @command{org-diary} as shown above under
  2853. @ref{Installation and activation}. You also need to use @emph{fancy
  2854. diary display} by setting in @file{.emacs}:
  2855. @lisp
  2856. (add-hook 'diary-display-hook 'fancy-diary-display)
  2857. @end lisp
  2858. Then include the following line into your @file{~/diary} file, in
  2859. order to get the entries from all files listed in the variable
  2860. @code{org-agenda-files}:
  2861. @example
  2862. &%%(org-diary)
  2863. @end example
  2864. @noindent
  2865. You may also select specific files with
  2866. @example
  2867. &%%(org-diary) ~/path/to/some/org-file.org
  2868. &%%(org-diary) ~/path/to/another/org-file.org
  2869. @end example
  2870. If you now launch the calendar and press @kbd{d} to display a diary,
  2871. the headlines of entries containing a timestamp, date range, schedule,
  2872. or deadline referring to the selected date will be listed. Just like
  2873. in Org-mode's agenda view, the diary for @emph{today} contains
  2874. additional entries for overdue deadlines and scheduled items. See
  2875. also the documentation of the @command{org-diary} function.
  2876. @end enumerate
  2877. @node Interaction, Bugs, FAQ, Miscellaneous
  2878. @section Interaction with other packages
  2879. @cindex packages, interaction with other
  2880. Org-mode can cooperate with the following packages:
  2881. @table @asis
  2882. @cindex @file{org-mouse.el}
  2883. @item @file{org-mouse.el} by Piotr Zielinski
  2884. This package implements extended mouse functionality for Org-mode. It
  2885. allows you to cycle visibility and to edit the document structure with
  2886. the mouse. It also provides a context-sensitive menu that changes
  2887. depending on the context of a mouse-click. Use a search engine to find
  2888. this package on the web.
  2889. @cindex @file{table.el}
  2890. @item @file{table.el} by Takaaki Ota
  2891. Org mode cooperates with table.el, see @ref{table.el}. @file{table.el}
  2892. is part of Emacs 22.
  2893. @cindex @file{calc.el}
  2894. @item @file{calc.el} by Dave Gillespie
  2895. Org-mode uses the calc package for implementing spreadsheet
  2896. functionality in its tables (@pxref{Table calculations}). Org-modes
  2897. checks for the availability of calc by looking for the function
  2898. @code{calc-eval} which should be autoloaded in your setup if calc has
  2899. been installed properly. As of Emacs 22, calc is part of the Emacs
  2900. distribution. Another possibility for interaction between the two
  2901. packages is using calc for embedded calculations. @xref{Embedded Mode,
  2902. , Embedded Mode, calc, GNU Emacs Calc Manual}.
  2903. @cindex @file{constants.el}
  2904. @item @file{constants.el} by Carsten Dominik
  2905. In a table formula (@pxref{Table calculations}), it is possible to use
  2906. names for natural constants or units. Instead of defining you own
  2907. constants in the variable @code{org-table-formula-constants}, install
  2908. the @file{constants} package which defines a large number of constants
  2909. and units, and lets you use unit prefixes like @samp{M} for
  2910. @samp{Mega} etc. You will need version 2.0 of this package, available
  2911. at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
  2912. the function @code{constants-get}, which has to be autoloaded in your
  2913. setup. See the installation instructions in the file
  2914. @file{constants.el}.
  2915. @cindex @file{remember.el}
  2916. @cindex @file{CUA.el}
  2917. @item @file{CUA.el} by Kim. F. Storm
  2918. Keybindings in Org-mode conflict with the @kbd{S-<cursor>} keys
  2919. used by CUA-mode (as well as pc-select-mode and s-region-mode) to
  2920. select and extend the region. If you want to use one of these
  2921. packages along with Org-mode, configure the variable
  2922. @code{org-CUA-compatible}. When set, Org-mode will move the following
  2923. keybindings in org-mode files, and in the agenda buffer (but not
  2924. during date selection).
  2925. @example
  2926. S-UP -> M-p S-DOWN -> M-n
  2927. S-LEFT -> M-- S-RIGHT -> M-+
  2928. S-RET -> C-S-RET
  2929. @end example
  2930. Yes, these are unfortunately more difficult to remember. If you want
  2931. to have other replacement keys, look at the variable
  2932. @code{org-disputed-keys}.
  2933. @item @file{remember.el} by John Wiegley
  2934. Org mode cooperates with remember, see @ref{Remember}.
  2935. @file{Remember.el} is not part of Emacs, find it on the web.
  2936. @cindex @file{planner.el}
  2937. @item @file{planner.el} by John Wiegley
  2938. Planner is another tool to plan work and keep track of tasks. Planner
  2939. uses a multi-file approach with project pages and day pages. Is it
  2940. based on Emacs-Wiki. If Planner is your primary tool, it can be useful
  2941. to display the agenda entries resulting from org files in day-pages of
  2942. the planner. This can be done through the diary of the calendar:
  2943. integrate org files into the diary as described above, and then turn on
  2944. the diary support of planner. Planner is not part of Emacs, find it on
  2945. the web.
  2946. @end table
  2947. @node Bugs, Acknowledgments, Interaction, Miscellaneous
  2948. @section Bugs
  2949. @cindex bugs
  2950. Here is a list of things which should work differently, but which I
  2951. have found too hard to fix.
  2952. @itemize @bullet
  2953. @item
  2954. Text in an entry protected with the @samp{QUOTE} keyword should not
  2955. autowrap.
  2956. @item
  2957. When the application called by @kbd{C-c C-o} to open a file link fails
  2958. (for example because the application does not exits or refuses to open
  2959. the file), it does so silently. No error message is displayed.
  2960. @item
  2961. Plain list items should be able to hold a TODO item. Unfortunately this
  2962. has so many technical problems that I will only consider this change for
  2963. the next major release (5.0).
  2964. @item
  2965. The remote-editing commands in the agenda buffer cannot be undone with
  2966. @code{undo} called from within the agenda buffer. But you can go to
  2967. the corresponding buffer (using @key{TAB} or @key{RET} and execute
  2968. @code{undo} there.
  2969. @item
  2970. Recalculating a table line applies the formulas from left to right.
  2971. If a formula uses @emph{calculated} fields further down the row,
  2972. multiple recalculation may be needed to get all fields consistent.
  2973. @item
  2974. Under XEmacs, if Org-mode entries are included into the diary, it is
  2975. not possible to jump back from the diary to the org file. Apparently,
  2976. the text properties are lost when the fancy-diary-display is used.
  2977. However, from Org-mode's timeline and agenda buffers (created with
  2978. @kbd{C-c C-r} and @kbd{C-c a}), things do work correctly.
  2979. @item
  2980. You can only make a single word boldface or italic. To emphasize
  2981. several words in a row, each must have the emphasize markers, like in
  2982. @samp{*three* *bold* *words*}.
  2983. @item
  2984. The exporters work well, but could be made more efficient.
  2985. @end itemize
  2986. @page
  2987. @node Acknowledgments, , Bugs, Miscellaneous
  2988. @section Acknowledgments
  2989. @cindex acknowledgments
  2990. @cindex thanks
  2991. Org-mode was written by Carsten Dominik, who still maintains it at the
  2992. Org-mode homepage @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
  2993. The following people (in alphabetic order) have helped the development
  2994. along with ideas, suggestions and patches. Many thanks to all of you,
  2995. Org-mode would not be what it is without your input.
  2996. @itemize @bullet
  2997. @item
  2998. Thomas Baumann contributed the code for links to the MH-E email system.
  2999. @item
  3000. Alex Bochannek provided a patch for rounding time stamps.
  3001. @item
  3002. Charles Caves' suggestion sparked the implementation of templates for
  3003. Remember.
  3004. @item
  3005. Pavel Chalmoviansky influenced the agenda treatment of items with
  3006. specified time.
  3007. @item
  3008. Sacha Chua suggested to copy linking code from Planner (we did take
  3009. some).
  3010. @item
  3011. Christian Egli converted the documentation into TeXInfo format, patched
  3012. CSS formatting into the HTML exporter, and inspired the agenda.
  3013. @item
  3014. Kai Grossjohann pointed out key-binding conflicts caused by Org-mode.
  3015. @item
  3016. Stefan Monnier provided a patch to keep the Emacs-Lisp compiler happy.
  3017. @item
  3018. Tim O'Callaghan suggested in-file links, search options for
  3019. general file links, and TAGS.
  3020. @item
  3021. Oliver Oppitz suggested multi-state TODO items.
  3022. @item
  3023. Pete Phillips helped the development of the TAGS feature.
  3024. @item
  3025. Matthias Rempe (Oelde) provided ideas, Windows support, and quality
  3026. control.
  3027. @item
  3028. Kevin Rogers contributed code to access VM files on remote hosts.
  3029. @item
  3030. Philip Rooke created the Org-mode reference card and provided lots of feedback.
  3031. @item
  3032. Christian Schlauer proposed angular brackets around links, among other
  3033. things.
  3034. @item
  3035. Linking to VM/BBDB/GNUS was inspired by Tom Shannon's
  3036. @file{organizer-mode.el}.
  3037. @item
  3038. J@"urgen Vollmer contributed code generating the table of contents
  3039. in HTML output.
  3040. @item
  3041. Chris Wallace provided a patch implementing the @samp{QUOTE} keyword.
  3042. @item
  3043. David Wainberg suggested archiving, and improvements to the linking
  3044. system.
  3045. @item
  3046. Scheduling TODO items was inspired by John Wiegley's @file{planner.el}.
  3047. @item
  3048. Carsten Wimmer suggested some changes and helped fix a bug in linking
  3049. to GNUS.
  3050. @item
  3051. Roland Winkler requested additional keybindings to make Org-mode
  3052. work on a tty.
  3053. @item
  3054. Piotr Zielinski wrote @file{org-mouse.el} and showed how to follow links
  3055. with mouse-1.
  3056. @end itemize
  3057. @node Index, Key Index, Miscellaneous, Top
  3058. @chapter Index
  3059. @printindex cp
  3060. @node Key Index, , Index, Top
  3061. @chapter Key Index
  3062. @printindex ky
  3063. @bye
  3064. @ignore
  3065. arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
  3066. @end ignore