org.texi 383 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675
  1. \input texinfo
  2. @c %**start of header
  3. @setfilename ../../info/org
  4. @settitle The Org Manual
  5. @set VERSION 6.06b
  6. @set DATE July 2008
  7. @dircategory Emacs
  8. @direntry
  9. * Org Mode: (org). Outline-based notes management and organizer
  10. @end direntry
  11. @c Version and Contact Info
  12. @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
  13. @set AUTHOR Carsten Dominik
  14. @set MAINTAINER Carsten Dominik
  15. @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
  16. @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
  17. @c %**end of header
  18. @finalout
  19. @c Macro definitions
  20. @c Subheadings inside a table.
  21. @macro tsubheading{text}
  22. @ifinfo
  23. @subsubheading \text\
  24. @end ifinfo
  25. @ifnotinfo
  26. @item @b{\text\}
  27. @end ifnotinfo
  28. @end macro
  29. @copying
  30. This manual is for Org (version @value{VERSION}).
  31. Copyright @copyright{} 2004, 2005, 2006, 2007, 2008 Free Software Foundation
  32. @quotation
  33. Permission is granted to copy, distribute and/or modify this document
  34. under the terms of the GNU Free Documentation License, Version 1.2 or
  35. any later version published by the Free Software Foundation; with no
  36. Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
  37. and with the Back-Cover Texts as in (a) below. A copy of the license
  38. is included in the section entitled ``GNU Free Documentation License.''
  39. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  40. modify this GNU manual. Buying copies from the FSF supports it in
  41. developing GNU and promoting software freedom.''
  42. This document is part of a collection distributed under the GNU Free
  43. Documentation License. If you want to distribute this document
  44. separately from the collection, you can do so by adding a copy of the
  45. license to the document, as described in section 6 of the license.
  46. @end quotation
  47. @end copying
  48. @titlepage
  49. @title The Org Manual
  50. @subtitle Release @value{VERSION}
  51. @author by Carsten Dominik
  52. @c The following two commands start the copyright page.
  53. @page
  54. @vskip 0pt plus 1filll
  55. @insertcopying
  56. @end titlepage
  57. @c Output the table of contents at the beginning.
  58. @contents
  59. @ifnottex
  60. @node Top, Introduction, (dir), (dir)
  61. @top Org Mode Manual
  62. @insertcopying
  63. @end ifnottex
  64. @menu
  65. * Introduction:: Getting started
  66. * Document Structure:: A tree works like your brain
  67. * Tables:: Pure magic for quick formatting
  68. * Hyperlinks:: Notes in context
  69. * TODO Items:: Every tree branch can be a TODO item
  70. * Tags:: Tagging headlines and matching sets of tags
  71. * Properties and Columns:: Storing information about an entry
  72. * Dates and Times:: Making items useful for planning
  73. * Remember:: Quickly adding nodes to the outline tree
  74. * Agenda Views:: Collecting information into views
  75. * Embedded LaTeX:: LaTeX fragments and formulas
  76. * Exporting:: Sharing and publishing of notes
  77. * Publishing:: Create a web site of linked Org files
  78. * Miscellaneous:: All the rest which did not fit elsewhere
  79. * Extensions:: Add-ons for Org mode
  80. * Hacking:: How hack your way around
  81. * History and Acknowledgments:: How Org came into being
  82. * Main Index:: An index of Org's concepts and features
  83. * Key Index:: Key bindings and where they are described
  84. @detailmenu
  85. --- The Detailed Node Listing ---
  86. Introduction
  87. * Summary:: Brief summary of what Org does
  88. * Installation:: How to install a downloaded version of Org
  89. * Activation:: How to activate Org for certain buffers
  90. * Feedback:: Bug reports, ideas, patches etc.
  91. * Conventions:: Type-setting conventions in the manual
  92. Document Structure
  93. * Outlines:: Org is based on Outline mode
  94. * Headlines:: How to typeset Org tree headlines
  95. * Visibility cycling:: Show and hide, much simplified
  96. * Motion:: Jumping to other headlines
  97. * Structure editing:: Changing sequence and level of headlines
  98. * Archiving:: Move done task trees to a different place
  99. * Sparse trees:: Matches embedded in context
  100. * Plain lists:: Additional structure within an entry
  101. * Drawers:: Tucking stuff away
  102. * Orgstruct mode:: Structure editing outside Org
  103. Archiving
  104. * ARCHIVE tag:: Marking a tree as inactive
  105. * Moving subtrees:: Moving a tree to an archive file
  106. Tables
  107. * Built-in table editor:: Simple tables
  108. * Narrow columns:: Stop wasting space in tables
  109. * Column groups:: Grouping to trigger vertical lines
  110. * Orgtbl mode:: The table editor as minor mode
  111. * The spreadsheet:: The table editor has spreadsheet capabilities
  112. The spreadsheet
  113. * References:: How to refer to another field or range
  114. * Formula syntax for Calc:: Using Calc to compute stuff
  115. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  116. * Field formulas:: Formulas valid for a single field
  117. * Column formulas:: Formulas valid for an entire column
  118. * Editing and debugging formulas:: Fixing formulas
  119. * Updating the table:: Recomputing all dependent fields
  120. * Advanced features:: Field names, parameters and automatic recalc
  121. Hyperlinks
  122. * Link format:: How links in Org are formatted
  123. * Internal links:: Links to other places in the current file
  124. * External links:: URL-like links to the world
  125. * Handling links:: Creating, inserting and following
  126. * Using links outside Org:: Linking from my C source code?
  127. * Link abbreviations:: Shortcuts for writing complex links
  128. * Search options:: Linking to a specific location
  129. * Custom searches:: When the default search is not enough
  130. Internal links
  131. * Radio targets:: Make targets trigger links in plain text
  132. TODO Items
  133. * TODO basics:: Marking and displaying TODO entries
  134. * TODO extensions:: Workflow and assignments
  135. * Progress logging:: Dates and notes for progress
  136. * Priorities:: Some things are more important than others
  137. * Breaking down tasks:: Splitting a task into manageable pieces
  138. * Checkboxes:: Tick-off lists
  139. Extended use of TODO keywords
  140. * Workflow states:: From TODO to DONE in steps
  141. * TODO types:: I do this, Fred does the rest
  142. * Multiple sets in one file:: Mixing it all, and still finding your way
  143. * Fast access to TODO states:: Single letter selection of a state
  144. * Per-file keywords:: Different files, different requirements
  145. * Faces for TODO keywords:: Highlighting states
  146. Progress logging
  147. * Closing items:: When was this entry marked DONE?
  148. * Tracking TODO state changes:: When did the status change?
  149. Tags
  150. * Tag inheritance:: Tags use the tree structure of the outline
  151. * Setting tags:: How to assign tags to a headline
  152. * Tag searches:: Searching for combinations of tags
  153. Properties and Columns
  154. * Property syntax:: How properties are spelled out
  155. * Special properties:: Access to other Org mode features
  156. * Property searches:: Matching property values
  157. * Property inheritance:: Passing values down the tree
  158. * Column view:: Tabular viewing and editing
  159. * Property API:: Properties for Lisp programmers
  160. Column view
  161. * Defining columns:: The COLUMNS format property
  162. * Using column view:: How to create and use column view
  163. * Capturing column view:: A dynamic block for column view
  164. Defining columns
  165. * Scope of column definitions:: Where defined, where valid?
  166. * Column attributes:: Appearance and content of a column
  167. Dates and Times
  168. * Timestamps:: Assigning a time to a tree entry
  169. * Creating timestamps:: Commands which insert timestamps
  170. * Deadlines and scheduling:: Planning your work
  171. * Clocking work time:: Tracking how long you spend on a task
  172. * Effort estimates:: Planning work effort in advance
  173. Creating timestamps
  174. * The date/time prompt:: How Org mode helps you entering date and time
  175. * Custom time format:: Making dates look different
  176. Deadlines and scheduling
  177. * Inserting deadline/schedule:: Planning items
  178. * Repeated tasks:: Items that show up again and again
  179. Remember
  180. * Setting up Remember:: Some code for .emacs to get things going
  181. * Remember templates:: Define the outline of different note types
  182. * Storing notes:: Directly get the note to where it belongs
  183. * Refiling notes:: Moving a note or task to a project
  184. Agenda Views
  185. * Agenda files:: Files being searched for agenda information
  186. * Agenda dispatcher:: Keyboard access to agenda views
  187. * Built-in agenda views:: What is available out of the box?
  188. * Presentation and sorting:: How agenda items are prepared for display
  189. * Agenda commands:: Remote editing of Org trees
  190. * Custom agenda views:: Defining special searches and views
  191. * Agenda column view:: Using column view for collected entries
  192. The built-in agenda views
  193. * Weekly/daily agenda:: The calendar page with current tasks
  194. * Global TODO list:: All unfinished action items
  195. * Matching tags and properties:: Structured information with fine-tuned search
  196. * Timeline:: Time-sorted view for single file
  197. * Keyword search:: Finding entries by keyword
  198. * Stuck projects:: Find projects you need to review
  199. Presentation and sorting
  200. * Categories:: Not all tasks are equal
  201. * Time-of-day specifications:: How the agenda knows the time
  202. * Sorting of agenda items:: The order of things
  203. Custom agenda views
  204. * Storing searches:: Type once, use often
  205. * Block agenda:: All the stuff you need in a single buffer
  206. * Setting Options:: Changing the rules
  207. * Exporting Agenda Views:: Writing agendas to files
  208. * Using the agenda elsewhere:: Using agenda information in other programs
  209. Embedded LaTeX
  210. * Math symbols:: TeX macros for symbols and Greek letters
  211. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  212. * LaTeX fragments:: Complex formulas made easy
  213. * Processing LaTeX fragments:: Previewing LaTeX processing
  214. * CDLaTeX mode:: Speed up entering of formulas
  215. Exporting
  216. * Markup rules:: Which structures are recognized?
  217. * Export options:: Per-file export settings
  218. * The export dispatcher:: How to access exporter commands
  219. * ASCII export:: Exporting to plain ASCII
  220. * HTML export:: Exporting to HTML
  221. * LaTeX export:: Exporting to LaTeX
  222. * XOXO export:: Exporting to XOXO
  223. * iCalendar export:: Exporting in iCalendar format
  224. Markup rules
  225. * Document title:: How the document title is determined
  226. * Headings and sections:: The main structure of the exported document
  227. * Table of contents:: If, where, how to create a table of contents
  228. * Initial text:: Text before the first headline
  229. * Lists:: Plain lists are exported
  230. * Paragraphs:: What determines beginning and ending
  231. * Literal examples:: Source code and other examples
  232. * Include files:: Include the contents of a file during export
  233. * Tables exported:: Tables are exported richly
  234. * Footnotes:: Numbers like [1]
  235. * Emphasis and monospace:: To bold or not to bold
  236. * TeX macros and LaTeX fragments:: Create special, rich export.
  237. * Horizontal rules:: A line across the page
  238. * Comment lines:: Some lines will not be exported
  239. HTML export
  240. * HTML Export commands:: How to invoke HTML export
  241. * Quoting HTML tags:: Using direct HTML in Org mode
  242. * Links:: Transformation of links for HTML
  243. * Images:: How to include images
  244. * CSS support:: Changing the appearance of the output
  245. * Javascript support:: Info and Folding in a web browser
  246. LaTeX export
  247. * LaTeX export commands:: How to invoke LaTeX export
  248. * Quoting LaTeX code:: Incorporating literal LaTeX code
  249. * Sectioning structure:: Changing sectioning in LaTeX output
  250. Publishing
  251. * Configuration:: Defining projects
  252. * Sample configuration:: Example projects
  253. * Triggering publication:: Publication commands
  254. Configuration
  255. * Project alist:: The central configuration variable
  256. * Sources and destinations:: From here to there
  257. * Selecting files:: What files are part of the project?
  258. * Publishing action:: Setting the function doing the publishing
  259. * Publishing options:: Tweaking HTML export
  260. * Publishing links:: Which links keep working after publishing?
  261. * Project page index:: Publishing a list of project files
  262. Sample configuration
  263. * Simple example:: One-component publishing
  264. * Complex example:: A multi-component publishing example
  265. Miscellaneous
  266. * Completion:: M-TAB knows what you need
  267. * Customization:: Adapting Org to your taste
  268. * In-buffer settings:: Overview of the #+KEYWORDS
  269. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  270. * Clean view:: Getting rid of leading stars in the outline
  271. * TTY keys:: Using Org on a tty
  272. * Interaction:: Other Emacs packages
  273. * Bugs:: Things which do not work perfectly
  274. Interaction with other packages
  275. * Cooperation:: Packages Org cooperates with
  276. * Conflicts:: Packages that lead to conflicts
  277. Extensions
  278. * Extensions in the contrib directory:: These come with the Org distro
  279. * Other extensions:: These you have to find on the web.
  280. Hacking
  281. * Adding hyperlink types:: New custom link types
  282. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  283. * Dynamic blocks:: Automatically filled blocks
  284. * Special agenda views:: Customized views
  285. * Using the property API:: Writing programs that use entry properties
  286. * Using the mapping API:: Mapping over all or selected entries
  287. Tables and lists in arbitrary syntax
  288. * Radio tables:: Sending and receiving
  289. * A LaTeX example:: Step by step, almost a tutorial
  290. * Translator functions:: Copy and modify
  291. * Radio lists:: Doing the same for lists
  292. @end detailmenu
  293. @end menu
  294. @node Introduction, Document Structure, Top, Top
  295. @chapter Introduction
  296. @cindex introduction
  297. @menu
  298. * Summary:: Brief summary of what Org does
  299. * Installation:: How to install a downloaded version of Org
  300. * Activation:: How to activate Org for certain buffers
  301. * Feedback:: Bug reports, ideas, patches etc.
  302. * Conventions:: Type-setting conventions in the manual
  303. @end menu
  304. @node Summary, Installation, Introduction, Introduction
  305. @section Summary
  306. @cindex summary
  307. Org is a mode for keeping notes, maintaining TODO lists, and doing
  308. project planning with a fast and effective plain-text system.
  309. Org develops organizational tasks around NOTES files that contain
  310. lists or information about projects as plain text. Org is
  311. implemented on top of Outline mode, which makes it possible to keep the
  312. content of large files well structured. Visibility cycling and
  313. structure editing help to work with the tree. Tables are easily created
  314. with a built-in table editor. Org supports TODO items, deadlines,
  315. time stamps, and scheduling. It dynamically compiles entries into an
  316. agenda that utilizes and smoothly integrates much of the Emacs calendar
  317. and diary. Plain text URL-like links connect to websites, emails,
  318. Usenet messages, BBDB entries, and any files related to the projects.
  319. For printing and sharing of notes, an Org file can be exported as a
  320. structured ASCII file, as HTML, or (TODO and agenda items only) as an
  321. iCalendar file. It can also serve as a publishing tool for a set of
  322. linked web pages.
  323. An important design aspect that distinguishes Org from for example
  324. Planner/Muse is that it encourages to store every piece of information
  325. only once. In Planner, you have project pages, day pages and possibly
  326. other files, duplicating some information such as tasks. In Org,
  327. you only have notes files. In your notes you mark entries as tasks,
  328. label them with tags and timestamps. All necessary lists like a
  329. schedule for the day, the agenda for a meeting, tasks lists selected by
  330. tags etc are created dynamically when you need them.
  331. Org keeps simple things simple. When first fired up, it should
  332. feel like a straightforward, easy to use outliner. Complexity is not
  333. imposed, but a large amount of functionality is available when you need
  334. it. Org is a toolbox and can be used in different ways, for
  335. example as:
  336. @example
  337. @r{@bullet{} outline extension with visibility cycling and structure editing}
  338. @r{@bullet{} ASCII system and table editor for taking structured notes}
  339. @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
  340. @r{@bullet{} TODO list editor}
  341. @r{@bullet{} full agenda and planner with deadlines and work scheduling}
  342. @r{@bullet{} environment to implement David Allen's GTD system}
  343. @r{@bullet{} a basic database application}
  344. @r{@bullet{} simple hypertext system, with HTML and LaTeX export}
  345. @r{@bullet{} publishing tool to create a set of interlinked webpages}
  346. @end example
  347. Org's automatic, context sensitive table editor with spreadsheet
  348. capabilities can be integrated into any major mode by activating the
  349. minor Orgtbl mode. Using a translation step, it can be used to maintain
  350. tables in arbitrary file types, for example in La@TeX{}. The structure
  351. editing and list creation capabilities can be used outside Org with
  352. the minor Orgstruct mode.
  353. @cindex FAQ
  354. There is a website for Org which provides links to the newest
  355. version of Org, as well as additional information, frequently asked
  356. questions (FAQ), links to tutorials etc. This page is located at
  357. @uref{http://orgmode.org}.
  358. @page
  359. @node Installation, Activation, Summary, Introduction
  360. @section Installation
  361. @cindex installation
  362. @cindex XEmacs
  363. @b{Important:} @i{If Org is part of the Emacs distribution or an
  364. XEmacs package, please skip this section and go directly to
  365. @ref{Activation}.}
  366. If you have downloaded Org from the Web, either as a distribution @file{.zip}
  367. or @file{.tar} file, or as a GIT archive, you must take the following steps
  368. to install it: Go into the unpacked Org distribution directory and edit the
  369. top section of the file @file{Makefile}. You must set the name of the Emacs
  370. binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
  371. directories where local Lisp and Info files are kept. If you don't have
  372. access to the system-wide directories, you can simply run Org directly from
  373. the distribution directory by adding the @file{lisp} subdirectory to the
  374. Emacs load path. To do this, add the following line to @file{.emacs}:
  375. @example
  376. (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
  377. @end example
  378. @noindent
  379. If you plan to use code from the @file{contrib} subdirectory, do a similar
  380. step for this directory:
  381. @example
  382. (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
  383. @end example
  384. @b{XEmacs users now need to install the file @file{noutline.el} from
  385. the @file{xemacs} sub-directory of the Org distribution. Use the
  386. command:}
  387. @example
  388. @b{make install-noutline}
  389. @end example
  390. @noindent Now byte-compile the Lisp files with the shell command:
  391. @example
  392. make
  393. @end example
  394. @noindent If you are running Org from the distribution directory, this is
  395. all. If you want to install into the system directories, use
  396. @example
  397. make install
  398. make install-info
  399. @end example
  400. @noindent Then add to @file{.emacs}:
  401. @lisp
  402. ;; This line only if Org is not part of the X/Emacs distribution.
  403. (require 'org-install)
  404. @end lisp
  405. @node Activation, Feedback, Installation, Introduction
  406. @section Activation
  407. @cindex activation
  408. @cindex autoload
  409. @cindex global key bindings
  410. @cindex key bindings, global
  411. @iftex
  412. @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
  413. PDF documentation as viewed by some PDF viewers to your .emacs file, the
  414. single quote character comes out incorrectly and the code will not work.
  415. You need to fix the single quotes by hand, or copy from Info
  416. documentation.}
  417. @end iftex
  418. Add the following lines to your @file{.emacs} file. The last two lines
  419. define @emph{global} keys for the commands @command{org-store-link},
  420. @command{org-agenda}, and @command{org-iswitchb} - please choose suitable
  421. keys yourself.
  422. @lisp
  423. ;; The following lines are always needed. Choose your own keys.
  424. (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  425. (global-set-key "\C-cl" 'org-store-link)
  426. (global-set-key "\C-ca" 'org-agenda)
  427. (global-set-key "\C-cb" 'org-iswitchb)
  428. @end lisp
  429. Furthermore, you must activate @code{font-lock-mode} in Org
  430. buffers, because significant functionality depends on font-locking being
  431. active. You can do this with either one of the following two lines
  432. (XEmacs user must use the second option):
  433. @lisp
  434. (global-font-lock-mode 1) ; for all buffers
  435. (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
  436. @end lisp
  437. @cindex Org mode, turning on
  438. With this setup, all files with extension @samp{.org} will be put
  439. into Org mode. As an alternative, make the first line of a file look
  440. like this:
  441. @example
  442. MY PROJECTS -*- mode: org; -*-
  443. @end example
  444. @noindent which will select Org mode for this buffer no matter what
  445. the file's name is. See also the variable
  446. @code{org-insert-mode-line-in-empty-file}.
  447. @node Feedback, Conventions, Activation, Introduction
  448. @section Feedback
  449. @cindex feedback
  450. @cindex bug reports
  451. @cindex maintainer
  452. @cindex author
  453. If you find problems with Org, or if you have questions, remarks, or ideas
  454. about it, please mail to the Org mailing list @code{emacs-orgmode@@gnu.org}.
  455. If you are not a member of the mailing list, your mail will be reviewed by a
  456. moderator and then passed through to the list.
  457. For bug reports, please provide as much information as possible,
  458. including the version information of Emacs (@kbd{C-h v emacs-version
  459. @key{RET}}) and Org (@kbd{C-h v org-version @key{RET}}), as well as
  460. the Org related setup in @file{.emacs}. If an error occurs, a
  461. backtrace can be very useful (see below on how to create one). Often a
  462. small example file helps, along with clear information about:
  463. @enumerate
  464. @item What exactly did you do?
  465. @item What did you expect to happen?
  466. @item What happened instead?
  467. @end enumerate
  468. @noindent Thank you for helping to improve this mode.
  469. @subsubheading How to create a useful backtrace
  470. @cindex backtrace of an error
  471. If working with Org produces an error with a message you don't
  472. understand, you may have hit a bug. The best way to report this is by
  473. providing, in addition to what was mentioned above, a @emph{Backtrace}.
  474. This is information from the built-in debugger about where and how the
  475. error occurred. Here is how to produce a useful backtrace:
  476. @enumerate
  477. @item
  478. Start a fresh Emacs or XEmacs, and make sure that it will load the
  479. original Lisp code in @file{org.el} instead of the compiled version in
  480. @file{org.elc}. The backtrace contains much more information if it is
  481. produced with uncompiled code. To do this, either rename @file{org.elc}
  482. to something else before starting Emacs, or ask Emacs explicitly to load
  483. @file{org.el} by using the command line
  484. @example
  485. emacs -l /path/to/org.el
  486. @end example
  487. @item
  488. Go to the @code{Options} menu and select @code{Enter Debugger on Error}
  489. (XEmacs has this option in the @code{Troubleshooting} sub-menu).
  490. @item
  491. Do whatever you have to do to hit the error. Don't forget to
  492. document the steps you take.
  493. @item
  494. When you hit the error, a @file{*Backtrace*} buffer will appear on the
  495. screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
  496. attach it to your bug report.
  497. @end enumerate
  498. @node Conventions, , Feedback, Introduction
  499. @section Typesetting conventions used in this manual
  500. Org uses three types of keywords: TODO keywords, tags, and property
  501. names. In this manual we use the following conventions:
  502. @table @code
  503. @item TODO
  504. @itemx WAITING
  505. TODO keywords are written with all capitals, even if they are
  506. user-defined.
  507. @item boss
  508. @itemx ARCHIVE
  509. User-defined tags are written in lowercase; built-in tags with special
  510. meaning are written with all capitals.
  511. @item Release
  512. @itemx PRIORITY
  513. User-defined properties are capitalized; built-in properties with
  514. special meaning are written with all capitals.
  515. @end table
  516. @node Document Structure, Tables, Introduction, Top
  517. @chapter Document Structure
  518. @cindex document structure
  519. @cindex structure of document
  520. Org is based on outline mode and provides flexible commands to
  521. edit the structure of the document.
  522. @menu
  523. * Outlines:: Org is based on Outline mode
  524. * Headlines:: How to typeset Org tree headlines
  525. * Visibility cycling:: Show and hide, much simplified
  526. * Motion:: Jumping to other headlines
  527. * Structure editing:: Changing sequence and level of headlines
  528. * Archiving:: Move done task trees to a different place
  529. * Sparse trees:: Matches embedded in context
  530. * Plain lists:: Additional structure within an entry
  531. * Drawers:: Tucking stuff away
  532. * Orgstruct mode:: Structure editing outside Org
  533. @end menu
  534. @node Outlines, Headlines, Document Structure, Document Structure
  535. @section Outlines
  536. @cindex outlines
  537. @cindex Outline mode
  538. Org is implemented on top of Outline mode. Outlines allow a
  539. document to be organized in a hierarchical structure, which (at least
  540. for me) is the best representation of notes and thoughts. An overview
  541. of this structure is achieved by folding (hiding) large parts of the
  542. document to show only the general document structure and the parts
  543. currently being worked on. Org greatly simplifies the use of
  544. outlines by compressing the entire show/hide functionality into a single
  545. command @command{org-cycle}, which is bound to the @key{TAB} key.
  546. @node Headlines, Visibility cycling, Outlines, Document Structure
  547. @section Headlines
  548. @cindex headlines
  549. @cindex outline tree
  550. Headlines define the structure of an outline tree. The headlines in
  551. Org start with one or more stars, on the left margin@footnote{See
  552. the variable @code{org-special-ctrl-a/e} to configure special behavior
  553. of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
  554. @example
  555. * Top level headline
  556. ** Second level
  557. *** 3rd level
  558. some text
  559. *** 3rd level
  560. more text
  561. * Another top level headline
  562. @end example
  563. @noindent Some people find the many stars too noisy and would prefer an
  564. outline that has whitespace followed by a single star as headline
  565. starters. @ref{Clean view} describes a setup to realize this.
  566. An empty line after the end of a subtree is considered part of it and
  567. will be hidden when the subtree is folded. However, if you leave at
  568. least two empty lines, one empty line will remain visible after folding
  569. the subtree, in order to structure the collapsed view. See the
  570. variable @code{org-cycle-separator-lines} to modify this behavior.
  571. @node Visibility cycling, Motion, Headlines, Document Structure
  572. @section Visibility cycling
  573. @cindex cycling, visibility
  574. @cindex visibility cycling
  575. @cindex trees, visibility
  576. @cindex show hidden text
  577. @cindex hide text
  578. Outlines make it possible to hide parts of the text in the buffer.
  579. Org uses just two commands, bound to @key{TAB} and
  580. @kbd{S-@key{TAB}} to change the visibility in the buffer.
  581. @cindex subtree visibility states
  582. @cindex subtree cycling
  583. @cindex folded, subtree visibility state
  584. @cindex children, subtree visibility state
  585. @cindex subtree, subtree visibility state
  586. @table @kbd
  587. @kindex @key{TAB}
  588. @item @key{TAB}
  589. @emph{Subtree cycling}: Rotate current subtree among the states
  590. @example
  591. ,-> FOLDED -> CHILDREN -> SUBTREE --.
  592. '-----------------------------------'
  593. @end example
  594. The cursor must be on a headline for this to work@footnote{see, however,
  595. the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
  596. beginning of the buffer and the first line is not a headline, then
  597. @key{TAB} actually runs global cycling (see below)@footnote{see the
  598. option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
  599. argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
  600. @cindex global visibility states
  601. @cindex global cycling
  602. @cindex overview, global visibility state
  603. @cindex contents, global visibility state
  604. @cindex show all, global visibility state
  605. @kindex S-@key{TAB}
  606. @item S-@key{TAB}
  607. @itemx C-u @key{TAB}
  608. @emph{Global cycling}: Rotate the entire buffer among the states
  609. @example
  610. ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
  611. '--------------------------------------'
  612. @end example
  613. When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
  614. CONTENTS view up to headlines of level N will be shown. Note that inside
  615. tables, @kbd{S-@key{TAB}} jumps to the previous field.
  616. @cindex show all, command
  617. @kindex C-c C-a
  618. @item C-c C-a
  619. Show all.
  620. @kindex C-c C-r
  621. @item C-c C-r
  622. Reveal context around point, showing the current entry, the following heading
  623. and the hierarchy above. Useful for working near a location that has been
  624. exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
  625. (@pxref{Agenda commands}). With a prefix argument show, on each
  626. level, all sibling headings.
  627. @kindex C-c C-x b
  628. @item C-c C-x b
  629. Show the current subtree in an indirect buffer@footnote{The indirect
  630. buffer
  631. @ifinfo
  632. (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
  633. @end ifinfo
  634. @ifnotinfo
  635. (see the Emacs manual for more information about indirect buffers)
  636. @end ifnotinfo
  637. will contain the entire buffer, but will be narrowed to the current
  638. tree. Editing the indirect buffer will also change the original buffer,
  639. but without affecting visibility in that buffer.}. With a numeric
  640. prefix argument N, go up to level N and then take that tree. If N is
  641. negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
  642. the previously used indirect buffer.
  643. @end table
  644. When Emacs first visits an Org file, the global state is set to
  645. OVERVIEW, i.e. only the top level headlines are visible. This can be
  646. configured through the variable @code{org-startup-folded}, or on a
  647. per-file basis by adding one of the following lines anywhere in the
  648. buffer:
  649. @example
  650. #+STARTUP: overview
  651. #+STARTUP: content
  652. #+STARTUP: showall
  653. @end example
  654. @noindent
  655. Forthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties
  656. and Columns}) will get their visibility adapted accordingly. Allowed values
  657. for this property are @code{folded}, @code{children}, @code{content}, and
  658. @code{all}.
  659. @table @kbd
  660. @kindex C-u C-u @key{TAB}
  661. @item C-u C-u @key{TAB}
  662. Switch back to the startup visibility of the buffer, i.e. whatever is
  663. requested by startup options and @samp{VISIBILITY} properties in individual
  664. entries.
  665. @end table
  666. @node Motion, Structure editing, Visibility cycling, Document Structure
  667. @section Motion
  668. @cindex motion, between headlines
  669. @cindex jumping, to headlines
  670. @cindex headline navigation
  671. The following commands jump to other headlines in the buffer.
  672. @table @kbd
  673. @kindex C-c C-n
  674. @item C-c C-n
  675. Next heading.
  676. @kindex C-c C-p
  677. @item C-c C-p
  678. Previous heading.
  679. @kindex C-c C-f
  680. @item C-c C-f
  681. Next heading same level.
  682. @kindex C-c C-b
  683. @item C-c C-b
  684. Previous heading same level.
  685. @kindex C-c C-u
  686. @item C-c C-u
  687. Backward to higher level heading.
  688. @kindex C-c C-j
  689. @item C-c C-j
  690. Jump to a different place without changing the current outline
  691. visibility. Shows the document structure in a temporary buffer, where
  692. you can use the following keys to find your destination:
  693. @example
  694. @key{TAB} @r{Cycle visibility.}
  695. @key{down} / @key{up} @r{Next/previous visible headline.}
  696. n / p @r{Next/previous visible headline.}
  697. f / b @r{Next/previous headline same level.}
  698. u @r{One level up.}
  699. 0-9 @r{Digit argument.}
  700. @key{RET} @r{Select this location.}
  701. @end example
  702. @end table
  703. @node Structure editing, Archiving, Motion, Document Structure
  704. @section Structure editing
  705. @cindex structure editing
  706. @cindex headline, promotion and demotion
  707. @cindex promotion, of subtrees
  708. @cindex demotion, of subtrees
  709. @cindex subtree, cut and paste
  710. @cindex pasting, of subtrees
  711. @cindex cutting, of subtrees
  712. @cindex copying, of subtrees
  713. @cindex subtrees, cut and paste
  714. @table @kbd
  715. @kindex M-@key{RET}
  716. @item M-@key{RET}
  717. Insert new heading with same level as current. If the cursor is in a
  718. plain list item, a new item is created (@pxref{Plain lists}). To force
  719. creation of a new headline, use a prefix argument, or first press @key{RET}
  720. to get to the beginning of the next line. When this command is used in
  721. the middle of a line, the line is split and the rest of the line becomes
  722. the new headline@footnote{If you do not want the line to be split,
  723. customize the variable @code{org-M-RET-may-split-line}.}. If the
  724. command is used at the beginning of a headline, the new headline is
  725. created before the current line. If at the beginning of any other line,
  726. the content of that line is made the new heading. If the command is
  727. used at the end of a folded subtree (i.e. behind the ellipses at the end
  728. of a headline), then a headline like the current one will be inserted
  729. after the end of the subtree.
  730. @kindex C-@key{RET}
  731. @item C-@key{RET}
  732. Insert a new heading after the current subtree, same level as the
  733. current headline. This command works from anywhere in the entry.
  734. @kindex M-S-@key{RET}
  735. @item M-S-@key{RET}
  736. Insert new TODO entry with same level as current heading.
  737. @kindex M-@key{left}
  738. @item M-@key{left}
  739. Promote current heading by one level.
  740. @kindex M-@key{right}
  741. @item M-@key{right}
  742. Demote current heading by one level.
  743. @kindex M-S-@key{left}
  744. @item M-S-@key{left}
  745. Promote the current subtree by one level.
  746. @kindex M-S-@key{right}
  747. @item M-S-@key{right}
  748. Demote the current subtree by one level.
  749. @kindex M-S-@key{up}
  750. @item M-S-@key{up}
  751. Move subtree up (swap with previous subtree of same
  752. level).
  753. @kindex M-S-@key{down}
  754. @item M-S-@key{down}
  755. Move subtree down (swap with next subtree of same level).
  756. @kindex C-c C-x C-w
  757. @kindex C-c C-x C-k
  758. @item C-c C-x C-w
  759. @itemx C-c C-x C-k
  760. Kill subtree, i.e. remove it from buffer but save in kill ring.
  761. With a numeric prefix argument N, kill N sequential subtrees.
  762. @kindex C-c C-x M-w
  763. @item C-c C-x M-w
  764. Copy subtree to kill ring. With a numeric prefix argument N, copy the N
  765. sequential subtrees.
  766. @kindex C-c C-x C-y
  767. @item C-c C-x C-y
  768. Yank subtree from kill ring. This does modify the level of the subtree to
  769. make sure the tree fits in nicely at the yank position. The yank level can
  770. also be specified with a numeric prefix argument, or by yanking after a
  771. headline marker like @samp{****}.
  772. @kindex C-c C-w
  773. @item C-c C-w
  774. Refile entry to a different location. @xref{Refiling notes}.
  775. @kindex C-c ^
  776. @item C-c ^
  777. Sort same-level entries. When there is an active region, all entries in the
  778. region will be sorted. Otherwise the children of the current headline are
  779. sorted. The command prompts for the sorting method, which can be
  780. alphabetically, numerically, by time (using the first time stamp in each
  781. entry), by priority, or by TODO keyword (in the sequence the keywords have
  782. been defined in the setup). Reverse sorting is possible as well. You can
  783. also supply your own function to extract the sorting key. With a @kbd{C-u}
  784. prefix, sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes,
  785. duplicate entries will also be removed.
  786. @kindex C-x n s
  787. @item C-x n s
  788. Narrow buffer to current subtree.
  789. @kindex C-x n w
  790. @item C-x n w
  791. Widen buffer to remove a narrowing.
  792. @kindex C-c *
  793. @item C-c *
  794. Turn a normal line or plain list item into a headline (so that it
  795. becomes a subheading at its location). Also turn a headline into a
  796. normal line by removing the stars. If there is an active region, turn
  797. all lines in the region into headlines. Or, if the first line is a
  798. headline, remove the stars from all headlines in the region.
  799. @end table
  800. @cindex region, active
  801. @cindex active region
  802. @cindex Transient mark mode
  803. When there is an active region (Transient mark mode), promotion and
  804. demotion work on all headlines in the region. To select a region of
  805. headlines, it is best to place both point and mark at the beginning of a
  806. line, mark at the beginning of the first headline, and point at the line
  807. just after the last headline to change. Note that when the cursor is
  808. inside a table (@pxref{Tables}), the Meta-Cursor keys have different
  809. functionality.
  810. @node Archiving, Sparse trees, Structure editing, Document Structure
  811. @section Archiving
  812. @cindex archiving
  813. When a project represented by a (sub)tree is finished, you may want
  814. to move the tree out of the way and to stop it from contributing to the
  815. agenda. Org mode knows two ways of archiving. You can mark a tree with
  816. the ARCHIVE tag, or you can move an entire (sub)tree to a different
  817. location.
  818. @menu
  819. * ARCHIVE tag:: Marking a tree as inactive
  820. * Moving subtrees:: Moving a tree to an archive file
  821. @end menu
  822. @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
  823. @subsection The ARCHIVE tag
  824. @cindex internal archiving
  825. A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
  826. its location in the outline tree, but behaves in the following way:
  827. @itemize @minus
  828. @item
  829. It does not open when you attempt to do so with a visibility cycling
  830. command (@pxref{Visibility cycling}). You can force cycling archived
  831. subtrees with @kbd{C-@key{TAB}}, or by setting the option
  832. @code{org-cycle-open-archived-trees}. Also normal outline commands like
  833. @code{show-all} will open archived subtrees.
  834. @item
  835. During sparse tree construction (@pxref{Sparse trees}), matches in
  836. archived subtrees are not exposed, unless you configure the option
  837. @code{org-sparse-tree-open-archived-trees}.
  838. @item
  839. During agenda view construction (@pxref{Agenda Views}), the content of
  840. archived trees is ignored unless you configure the option
  841. @code{org-agenda-skip-archived-trees}, in which case these trees will always
  842. be included. In the agenda you can press the @kbd{v} key to get archives
  843. temporarily included.
  844. @item
  845. Archived trees are not exported (@pxref{Exporting}), only the headline
  846. is. Configure the details using the variable
  847. @code{org-export-with-archived-trees}.
  848. @end itemize
  849. The following commands help managing the ARCHIVE tag:
  850. @table @kbd
  851. @kindex C-c C-x a
  852. @item C-c C-x a
  853. Toggle the ARCHIVE tag for the current headline. When the tag is set,
  854. the headline changes to a shadowed face, and the subtree below it is
  855. hidden.
  856. @kindex C-u C-c C-x a
  857. @item C-u C-c C-x a
  858. Check if any direct children of the current headline should be archived.
  859. To do this, each subtree is checked for open TODO entries. If none are
  860. found, the command offers to set the ARCHIVE tag for the child. If the
  861. cursor is @emph{not} on a headline when this command is invoked, the
  862. level 1 trees will be checked.
  863. @kindex C-@kbd{TAB}
  864. @item C-@kbd{TAB}
  865. Cycle a tree even if it is tagged with ARCHIVE.
  866. @end table
  867. @node Moving subtrees, , ARCHIVE tag, Archiving
  868. @subsection Moving subtrees
  869. @cindex external archiving
  870. Once an entire project is finished, you may want to move it to a different
  871. location. Org can move it to an @emph{Archive Sibling} in the same tree, to a
  872. different tree in the current file, or to a different file, the archive file.
  873. @table @kbd
  874. @kindex C-c C-x A
  875. @item C-c C-x A
  876. Move the current entry to the @emph{Archive Sibling}. This is a sibling of
  877. the entry with the heading @samp{Archive} and the tag @samp{ARCHIVE}
  878. (@pxref{ARCHIVE tag}). The entry becomes a child of that sibling and in this
  879. way retains a lot of its original context, including inherited tags and
  880. approximate position in the outline.
  881. @kindex C-c C-x C-s
  882. @item C-c C-x C-s
  883. Archive the subtree starting at the cursor position to the location
  884. given by @code{org-archive-location}. Context information that could be
  885. lost like the file name, the category, inherited tags, and the TODO
  886. state will be store as properties in the entry.
  887. @kindex C-u C-c C-x C-s
  888. @item C-u C-c C-x C-s
  889. Check if any direct children of the current headline could be moved to
  890. the archive. To do this, each subtree is checked for open TODO entries.
  891. If none are found, the command offers to move it to the archive
  892. location. If the cursor is @emph{not} on a headline when this command
  893. is invoked, the level 1 trees will be checked.
  894. @end table
  895. @cindex archive locations
  896. The default archive location is a file in the same directory as the
  897. current file, with the name derived by appending @file{_archive} to the
  898. current file name. For information and examples on how to change this,
  899. see the documentation string of the variable
  900. @code{org-archive-location}. There is also an in-buffer option for
  901. setting this variable, for example@footnote{For backward compatibility,
  902. the following also works: If there are several such lines in a file,
  903. each specifies the archive location for the text below it. The first
  904. such line also applies to any text before its definition. However,
  905. using this method is @emph{strongly} deprecated as it is incompatible
  906. with the outline structure of the document. The correct method for
  907. setting multiple archive locations in a buffer is using a property.}:
  908. @example
  909. #+ARCHIVE: %s_done::
  910. @end example
  911. @noindent
  912. If you would like to have a special ARCHIVE location for a single entry
  913. or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
  914. location as the value (@pxref{Properties and Columns}).
  915. When a subtree is moved, it receives a number of special properties that
  916. record context information like the file from where the entry came, it's
  917. outline path the archiving time etc. Configure the variable
  918. @code{org-archive-save-context-info} to adjust the amount of information
  919. added.
  920. @node Sparse trees, Plain lists, Archiving, Document Structure
  921. @section Sparse trees
  922. @cindex sparse trees
  923. @cindex trees, sparse
  924. @cindex folding, sparse trees
  925. @cindex occur, command
  926. An important feature of Org mode is the ability to construct @emph{sparse
  927. trees} for selected information in an outline tree, so that the entire
  928. document is folded as much as possible, but the selected information is made
  929. visible along with the headline structure above it@footnote{See also the
  930. variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
  931. @code{org-show-siblings}, and @code{org-show-entry-below} for detailed
  932. control on how much context is shown around each match.}. Just try it out
  933. and you will see immediately how it works.
  934. Org mode contains several commands creating such trees, all these
  935. commands can be accessed through a dispatcher:
  936. @table @kbd
  937. @kindex C-c /
  938. @item C-c /
  939. This prompts for an extra key to select a sparse-tree creating command.
  940. @kindex C-c / r
  941. @item C-c / r
  942. Occur. Prompts for a regexp and shows a sparse tree with all matches. If
  943. the match is in a headline, the headline is made visible. If the match is in
  944. the body of an entry, headline and body are made visible. In order to
  945. provide minimal context, also the full hierarchy of headlines above the match
  946. is shown, as well as the headline following the match. Each match is also
  947. highlighted; the highlights disappear when the buffer is changed by an
  948. editing command@footnote{depending on the option
  949. @code{org-remove-highlights-with-change}}, or by pressing @kbd{C-c C-c}.
  950. When called with a @kbd{C-u} prefix argument, previous highlights are kept,
  951. so several calls to this command can be stacked.
  952. @end table
  953. @noindent
  954. For frequently used sparse trees of specific search strings, you can
  955. use the variable @code{org-agenda-custom-commands} to define fast
  956. keyboard access to specific sparse trees. These commands will then be
  957. accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
  958. For example:
  959. @lisp
  960. (setq org-agenda-custom-commands
  961. '(("f" occur-tree "FIXME")))
  962. @end lisp
  963. @noindent will define the key @kbd{C-c a f} as a shortcut for creating
  964. a sparse tree matching the string @samp{FIXME}.
  965. The other sparse tree commands select headings based on TODO keywords,
  966. tags, or properties and will be discussed later in this manual.
  967. @kindex C-c C-e v
  968. @cindex printing sparse trees
  969. @cindex visible text, printing
  970. To print a sparse tree, you can use the Emacs command
  971. @code{ps-print-buffer-with-faces} which does not print invisible parts
  972. of the document @footnote{This does not work under XEmacs, because
  973. XEmacs uses selective display for outlining, not text properties.}.
  974. Or you can use the command @kbd{C-c C-e v} to export only the visible
  975. part of the document and print the resulting file.
  976. @node Plain lists, Drawers, Sparse trees, Document Structure
  977. @section Plain lists
  978. @cindex plain lists
  979. @cindex lists, plain
  980. @cindex lists, ordered
  981. @cindex ordered lists
  982. Within an entry of the outline tree, hand-formatted lists can provide
  983. additional structure. They also provide a way to create lists of
  984. checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
  985. and the HTML exporter (@pxref{Exporting}) parses and formats them.
  986. Org knows ordered lists, unordered lists, and description lists.
  987. @itemize @bullet
  988. @item
  989. @emph{Unordered} list items start with @samp{-}, @samp{+}, or
  990. @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
  991. they will be seen as top-level headlines. Also, when you are hiding leading
  992. stars to get a clean outline view, plain list items starting with a star are
  993. visually indistinguishable from true headlines. In short: even though
  994. @samp{*} is supported, it may be better to not use it for plain list items.}
  995. as bullets.
  996. @item
  997. @emph{Ordered} list items start with a numeral followed by either a period or
  998. a right parenthesis, such as @samp{1.} or @samp{1)}.
  999. @item
  1000. @emph{Description} list items are like unordered list items, but contain the
  1001. separator @samp{ :: } to separate the description @emph{term} from the
  1002. desciption.
  1003. @end itemize
  1004. Items belonging to the same list must have the same indentation on the first
  1005. line. In particular, if an ordered list reaches number @samp{10.}, then the
  1006. 2--digit numbers must be written left-aligned with the other numbers in the
  1007. list. Indentation also determines the end of a list item. It ends before
  1008. the next line that is indented like the bullet/number, or less. Empty lines
  1009. are part of the previous item, so you can have several paragraphs in one
  1010. item. If you would like an empty line to terminate all currently open plain
  1011. lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
  1012. Here is an example:
  1013. @example
  1014. @group
  1015. ** Lord of the Rings
  1016. My favorite scenes are (in this order)
  1017. 1. The attack of the Rohirrim
  1018. 2. Eowyns fight with the witch king
  1019. + this was already my favorite scene in the book
  1020. + I really like Miranda Otto.
  1021. 3. Peter Jackson being shot by Legolas
  1022. - on DVD only
  1023. He makes a really funny face when it happens.
  1024. But in the end, not individual scenes matter but the film as a whole.
  1025. Important actors in this film are:
  1026. - @b{Elijah Wood} :: He plays the Frodo
  1027. - @b{Sean Austin} :: He plays the Sam, Frodos friend. I still remember
  1028. him very well from his role as Mikey Walsh a in the Goonies.
  1029. @end group
  1030. @end example
  1031. Org supports these lists by tuning filling and wrapping commands to
  1032. deal with them correctly@footnote{Org only changes the filling
  1033. settings for Emacs. For XEmacs, you should use Kyle E. Jones'
  1034. @file{filladapt.el}. To turn this on, put into @file{.emacs}:
  1035. @code{(require 'filladapt)}}, and by exporting them properly
  1036. (@pxref{Exporting}).
  1037. The following commands act on items when the cursor is in the first line
  1038. of an item (the line with the bullet or number).
  1039. @table @kbd
  1040. @kindex @key{TAB}
  1041. @item @key{TAB}
  1042. Items can be folded just like headline levels if you set the variable
  1043. @code{org-cycle-include-plain-lists}. The level of an item is then
  1044. given by the indentation of the bullet/number. Items are always
  1045. subordinate to real headlines, however; the hierarchies remain
  1046. completely separated.
  1047. If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
  1048. fixes the indentation of the current line in a heuristic way.
  1049. @kindex M-@key{RET}
  1050. @item M-@key{RET}
  1051. Insert new item at current level. With a prefix argument, force a new
  1052. heading (@pxref{Structure editing}). If this command is used in the middle
  1053. of a line, the line is @emph{split} and the rest of the line becomes the new
  1054. item@footnote{If you do not want the line to be split, customize the variable
  1055. @code{org-M-RET-may-split-line}.}. If this command is executed in the
  1056. @emph{whitespace before a bullet or number}, the new item is created
  1057. @emph{before} the current item. If the command is executed in the white
  1058. space before the text that is part of an item but does not contain the
  1059. bullet, a bullet is added to the current line.
  1060. @kindex M-S-@key{RET}
  1061. @item M-S-@key{RET}
  1062. Insert a new item with a checkbox (@pxref{Checkboxes}).
  1063. @kindex S-@key{up}
  1064. @kindex S-@key{down}
  1065. @item S-@key{up}
  1066. @itemx S-@key{down}
  1067. Jump to the previous/next item in the current list.
  1068. @kindex M-S-@key{up}
  1069. @kindex M-S-@key{down}
  1070. @item M-S-@key{up}
  1071. @itemx M-S-@key{down}
  1072. Move the item including subitems up/down (swap with previous/next item
  1073. of same indentation). If the list is ordered, renumbering is
  1074. automatic.
  1075. @kindex M-S-@key{left}
  1076. @kindex M-S-@key{right}
  1077. @item M-S-@key{left}
  1078. @itemx M-S-@key{right}
  1079. Decrease/increase the indentation of the item, including subitems.
  1080. Initially, the item tree is selected based on current indentation.
  1081. When these commands are executed several times in direct succession,
  1082. the initially selected region is used, even if the new indentation
  1083. would imply a different hierarchy. To use the new hierarchy, break
  1084. the command chain with a cursor motion or so.
  1085. @kindex C-c C-c
  1086. @item C-c C-c
  1087. If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
  1088. state of the checkbox. If not, this command makes sure that all the
  1089. items on this list level use the same bullet. Furthermore, if this is
  1090. an ordered list, make sure the numbering is OK.
  1091. @kindex C-c -
  1092. @item C-c -
  1093. Cycle the entire list level through the different itemize/enumerate bullets
  1094. (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}). With a numeric prefix
  1095. argument N, select the Nth bullet from this list. If there is an active
  1096. region when calling this, all lines will be converted to list items. If the
  1097. first line already was a list item, any item markers will be removed from the
  1098. list. Finally, even without an active region, a normal line will be
  1099. converted into a list item.
  1100. @end table
  1101. @node Drawers, Orgstruct mode, Plain lists, Document Structure
  1102. @section Drawers
  1103. @cindex drawers
  1104. @cindex visibility cycling, drawers
  1105. Sometimes you want to keep information associated with an entry, but you
  1106. normally don't want to see it. For this, Org mode has @emph{drawers}.
  1107. Drawers need to be configured with the variable
  1108. @code{org-drawers}@footnote{You can define drawers on a per-file basis
  1109. with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
  1110. look like this:
  1111. @example
  1112. ** This is a headline
  1113. Still outside the drawer
  1114. :DRAWERNAME:
  1115. This is inside the drawer.
  1116. :END:
  1117. After the drawer.
  1118. @end example
  1119. Visibility cycling (@pxref{Visibility cycling}) on the headline will
  1120. hide and show the entry, but keep the drawer collapsed to a single line.
  1121. In order to look inside the drawer, you need to move the cursor to the
  1122. drawer line and press @key{TAB} there. Org mode uses a drawer for
  1123. storing properties (@pxref{Properties and Columns}), and another one for
  1124. storing clock times (@pxref{Clocking work time}).
  1125. @node Orgstruct mode, , Drawers, Document Structure
  1126. @section The Orgstruct minor mode
  1127. @cindex Orgstruct mode
  1128. @cindex minor mode for structure editing
  1129. If you like the intuitive way the Org mode structure editing and list
  1130. formatting works, you might want to use these commands in other modes
  1131. like Text mode or Mail mode as well. The minor mode Orgstruct mode
  1132. makes this possible. You can always toggle the mode with @kbd{M-x
  1133. orgstruct-mode}. To turn it on by default, for example in Mail mode,
  1134. use
  1135. @lisp
  1136. (add-hook 'mail-mode-hook 'turn-on-orgstruct)
  1137. @end lisp
  1138. When this mode is active and the cursor is on a line that looks to
  1139. Org like a headline of the first line of a list item, most
  1140. structure editing commands will work, even if the same keys normally
  1141. have different functionality in the major mode you are using. If the
  1142. cursor is not in one of those special lines, Orgstruct mode lurks
  1143. silently in the shadow.
  1144. @node Tables, Hyperlinks, Document Structure, Top
  1145. @chapter Tables
  1146. @cindex tables
  1147. @cindex editing tables
  1148. Org comes with a fast and intuitive table editor. Spreadsheet-like
  1149. calculations are supported in connection with the Emacs @file{calc}
  1150. package
  1151. @ifinfo
  1152. (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
  1153. @end ifinfo
  1154. @ifnotinfo
  1155. (see the Emacs Calculator manual for more information about the Emacs
  1156. calculator).
  1157. @end ifnotinfo
  1158. @menu
  1159. * Built-in table editor:: Simple tables
  1160. * Narrow columns:: Stop wasting space in tables
  1161. * Column groups:: Grouping to trigger vertical lines
  1162. * Orgtbl mode:: The table editor as minor mode
  1163. * The spreadsheet:: The table editor has spreadsheet capabilities
  1164. @end menu
  1165. @node Built-in table editor, Narrow columns, Tables, Tables
  1166. @section The built-in table editor
  1167. @cindex table editor, built-in
  1168. Org makes it easy to format tables in plain ASCII. Any line with
  1169. @samp{|} as the first non-whitespace character is considered part of a
  1170. table. @samp{|} is also the column separator. A table might look like
  1171. this:
  1172. @example
  1173. | Name | Phone | Age |
  1174. |-------+-------+-----|
  1175. | Peter | 1234 | 17 |
  1176. | Anna | 4321 | 25 |
  1177. @end example
  1178. A table is re-aligned automatically each time you press @key{TAB} or
  1179. @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
  1180. the next field (@key{RET} to the next row) and creates new table rows
  1181. at the end of the table or before horizontal lines. The indentation
  1182. of the table is set by the first line. Any line starting with
  1183. @samp{|-} is considered as a horizontal separator line and will be
  1184. expanded on the next re-align to span the whole table width. So, to
  1185. create the above table, you would only type
  1186. @example
  1187. |Name|Phone|Age|
  1188. |-
  1189. @end example
  1190. @noindent and then press @key{TAB} to align the table and start filling in
  1191. fields.
  1192. When typing text into a field, Org treats @key{DEL},
  1193. @key{Backspace}, and all character keys in a special way, so that
  1194. inserting and deleting avoids shifting other fields. Also, when
  1195. typing @emph{immediately after the cursor was moved into a new field
  1196. with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
  1197. field is automatically made blank. If this behavior is too
  1198. unpredictable for you, configure the variables
  1199. @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
  1200. @table @kbd
  1201. @tsubheading{Creation and conversion}
  1202. @kindex C-c |
  1203. @item C-c |
  1204. Convert the active region to table. If every line contains at least one
  1205. TAB character, the function assumes that the material is tab separated.
  1206. If every line contains a comma, comma-separated values (CSV) are assumed.
  1207. If not, lines are split at whitespace into fields. You can use a prefix
  1208. argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
  1209. C-u} forces TAB, and a numeric argument N indicates that at least N
  1210. consecutive spaces, or alternatively a TAB will be the separator.
  1211. @*
  1212. If there is no active region, this command creates an empty Org
  1213. table. But it's easier just to start typing, like
  1214. @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
  1215. @tsubheading{Re-aligning and field motion}
  1216. @kindex C-c C-c
  1217. @item C-c C-c
  1218. Re-align the table without moving the cursor.
  1219. @c
  1220. @kindex @key{TAB}
  1221. @item @key{TAB}
  1222. Re-align the table, move to the next field. Creates a new row if
  1223. necessary.
  1224. @c
  1225. @kindex S-@key{TAB}
  1226. @item S-@key{TAB}
  1227. Re-align, move to previous field.
  1228. @c
  1229. @kindex @key{RET}
  1230. @item @key{RET}
  1231. Re-align the table and move down to next row. Creates a new row if
  1232. necessary. At the beginning or end of a line, @key{RET} still does
  1233. NEWLINE, so it can be used to split a table.
  1234. @tsubheading{Column and row editing}
  1235. @kindex M-@key{left}
  1236. @kindex M-@key{right}
  1237. @item M-@key{left}
  1238. @itemx M-@key{right}
  1239. Move the current column left/right.
  1240. @c
  1241. @kindex M-S-@key{left}
  1242. @item M-S-@key{left}
  1243. Kill the current column.
  1244. @c
  1245. @kindex M-S-@key{right}
  1246. @item M-S-@key{right}
  1247. Insert a new column to the left of the cursor position.
  1248. @c
  1249. @kindex M-@key{up}
  1250. @kindex M-@key{down}
  1251. @item M-@key{up}
  1252. @itemx M-@key{down}
  1253. Move the current row up/down.
  1254. @c
  1255. @kindex M-S-@key{up}
  1256. @item M-S-@key{up}
  1257. Kill the current row or horizontal line.
  1258. @c
  1259. @kindex M-S-@key{down}
  1260. @item M-S-@key{down}
  1261. Insert a new row above the current row. With a prefix argument, the line is
  1262. created below the current one.
  1263. @c
  1264. @kindex C-c -
  1265. @item C-c -
  1266. Insert a horizontal line below current row. With a prefix argument, the line
  1267. is created above the current line.
  1268. @c
  1269. @kindex C-c ^
  1270. @item C-c ^
  1271. Sort the table lines in the region. The position of point indicates the
  1272. column to be used for sorting, and the range of lines is the range
  1273. between the nearest horizontal separator lines, or the entire table. If
  1274. point is before the first column, you will be prompted for the sorting
  1275. column. If there is an active region, the mark specifies the first line
  1276. and the sorting column, while point should be in the last line to be
  1277. included into the sorting. The command prompts for the sorting type
  1278. (alphabetically, numerically, or by time). When called with a prefix
  1279. argument, alphabetic sorting will be case-sensitive.
  1280. @tsubheading{Regions}
  1281. @kindex C-c C-x M-w
  1282. @item C-c C-x M-w
  1283. Copy a rectangular region from a table to a special clipboard. Point
  1284. and mark determine edge fields of the rectangle. The process ignores
  1285. horizontal separator lines.
  1286. @c
  1287. @kindex C-c C-x C-w
  1288. @item C-c C-x C-w
  1289. Copy a rectangular region from a table to a special clipboard, and
  1290. blank all fields in the rectangle. So this is the ``cut'' operation.
  1291. @c
  1292. @kindex C-c C-x C-y
  1293. @item C-c C-x C-y
  1294. Paste a rectangular region into a table.
  1295. The upper right corner ends up in the current field. All involved fields
  1296. will be overwritten. If the rectangle does not fit into the present table,
  1297. the table is enlarged as needed. The process ignores horizontal separator
  1298. lines.
  1299. @c
  1300. @kindex C-c C-q
  1301. @kindex M-@key{RET}
  1302. @item C-c C-q
  1303. @itemx M-@kbd{RET}
  1304. Wrap several fields in a column like a paragraph. If there is an active
  1305. region, and both point and mark are in the same column, the text in the
  1306. column is wrapped to minimum width for the given number of lines. A numeric
  1307. prefix argument may be used to change the number of desired lines. If there
  1308. is no region, the current field is split at the cursor position and the text
  1309. fragment to the right of the cursor is prepended to the field one line
  1310. down. If there is no region, but you specify a prefix argument, the current
  1311. field is made blank, and the content is appended to the field above.
  1312. @tsubheading{Calculations}
  1313. @cindex formula, in tables
  1314. @cindex calculations, in tables
  1315. @cindex region, active
  1316. @cindex active region
  1317. @cindex Transient mark mode
  1318. @kindex C-c +
  1319. @item C-c +
  1320. Sum the numbers in the current column, or in the rectangle defined by
  1321. the active region. The result is shown in the echo area and can
  1322. be inserted with @kbd{C-y}.
  1323. @c
  1324. @kindex S-@key{RET}
  1325. @item S-@key{RET}
  1326. When current field is empty, copy from first non-empty field above. When not
  1327. empty, copy current field down to next row and move cursor along with it.
  1328. Depending on the variable @code{org-table-copy-increment}, integer field
  1329. values will be incremented during copy. Integers that are too large will not
  1330. be incremented. Also, a @code{0} prefix argument temporarily dispables the
  1331. increment. This key is also used by CUA mode (@pxref{Cooperation}).
  1332. @tsubheading{Miscellaneous}
  1333. @kindex C-c `
  1334. @item C-c `
  1335. Edit the current field in a separate window. This is useful for fields
  1336. that are not fully visible (@pxref{Narrow columns}). When called with a
  1337. @kbd{C-u} prefix, just make the full field visible, so that it can be
  1338. edited in place.
  1339. @c
  1340. @item M-x org-table-import
  1341. Import a file as a table. The table should be TAB- or whitespace
  1342. separated. Useful, for example, to import a spreadsheet table or data
  1343. from a database, because these programs generally can write
  1344. TAB-separated text files. This command works by inserting the file into
  1345. the buffer and then converting the region to a table. Any prefix
  1346. argument is passed on to the converter, which uses it to determine the
  1347. separator.
  1348. @item C-c |
  1349. Tables can also be imported by pasting tabular text into the Org
  1350. buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
  1351. @kbd{C-c |} command (see above under @i{Creation and conversion}).
  1352. @c
  1353. @item M-x org-table-export
  1354. Export the table, by default as a TAB-separated file. Useful for data
  1355. exchange with, for example, spreadsheet or database programs. The format
  1356. used to export the file can be configured in the variable
  1357. @code{org-table-export-default-format}. You may also use properties
  1358. @code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
  1359. name and the format for table export in a subtree. Org supports quite
  1360. general formats for exported tables. The exporter format is the same as the
  1361. format used by Orgtbl radio tables, see @ref{Translator functions} for a
  1362. detailed description.
  1363. @end table
  1364. If you don't like the automatic table editor because it gets in your
  1365. way on lines which you would like to start with @samp{|}, you can turn
  1366. it off with
  1367. @lisp
  1368. (setq org-enable-table-editor nil)
  1369. @end lisp
  1370. @noindent Then the only table command that still works is
  1371. @kbd{C-c C-c} to do a manual re-align.
  1372. @node Narrow columns, Column groups, Built-in table editor, Tables
  1373. @section Narrow columns
  1374. @cindex narrow columns in tables
  1375. The width of columns is automatically determined by the table editor.
  1376. Sometimes a single field or a few fields need to carry more text,
  1377. leading to inconveniently wide columns. To limit@footnote{This feature
  1378. does not work on XEmacs.} the width of a column, one field anywhere in
  1379. the column may contain just the string @samp{<N>} where @samp{N} is an
  1380. integer specifying the width of the column in characters. The next
  1381. re-align will then set the width of this column to no more than this
  1382. value.
  1383. @example
  1384. @group
  1385. |---+------------------------------| |---+--------|
  1386. | | | | | <6> |
  1387. | 1 | one | | 1 | one |
  1388. | 2 | two | ----\ | 2 | two |
  1389. | 3 | This is a long chunk of text | ----/ | 3 | This=> |
  1390. | 4 | four | | 4 | four |
  1391. |---+------------------------------| |---+--------|
  1392. @end group
  1393. @end example
  1394. @noindent
  1395. Fields that are wider become clipped and end in the string @samp{=>}.
  1396. Note that the full text is still in the buffer, it is only invisible.
  1397. To see the full text, hold the mouse over the field - a tool-tip window
  1398. will show the full content. To edit such a field, use the command
  1399. @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
  1400. open a new window with the full field. Edit it and finish with @kbd{C-c
  1401. C-c}.
  1402. When visiting a file containing a table with narrowed columns, the
  1403. necessary character hiding has not yet happened, and the table needs to
  1404. be aligned before it looks nice. Setting the option
  1405. @code{org-startup-align-all-tables} will realign all tables in a file
  1406. upon visiting, but also slow down startup. You can also set this option
  1407. on a per-file basis with:
  1408. @example
  1409. #+STARTUP: align
  1410. #+STARTUP: noalign
  1411. @end example
  1412. @node Column groups, Orgtbl mode, Narrow columns, Tables
  1413. @section Column groups
  1414. @cindex grouping columns in tables
  1415. When Org exports tables, it does so by default without vertical
  1416. lines because that is visually more satisfying in general. Occasionally
  1417. however, vertical lines can be useful to structure a table into groups
  1418. of columns, much like horizontal lines can do for groups of rows. In
  1419. order to specify column groups, you can use a special row where the
  1420. first field contains only @samp{/}. The further fields can either
  1421. contain @samp{<} to indicate that this column should start a group,
  1422. @samp{>} to indicate the end of a column, or @samp{<>} to make a column
  1423. a group of its own. Boundaries between column groups will upon export be
  1424. marked with vertical lines. Here is an example:
  1425. @example
  1426. | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1427. |---+----+-----+-----+-----+---------+------------|
  1428. | / | <> | < | | > | < | > |
  1429. | # | 1 | 1 | 1 | 1 | 1 | 1 |
  1430. | # | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
  1431. | # | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
  1432. |---+----+-----+-----+-----+---------+------------|
  1433. #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2)))
  1434. @end example
  1435. It is also sufficient to just insert the column group starters after
  1436. every vertical line you'd like to have:
  1437. @example
  1438. | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1439. |----+-----+-----+-----+---------+------------|
  1440. | / | < | | | < | |
  1441. @end example
  1442. @node Orgtbl mode, The spreadsheet, Column groups, Tables
  1443. @section The Orgtbl minor mode
  1444. @cindex Orgtbl mode
  1445. @cindex minor mode for tables
  1446. If you like the intuitive way the Org table editor works, you
  1447. might also want to use it in other modes like Text mode or Mail mode.
  1448. The minor mode Orgtbl mode makes this possible. You can always toggle
  1449. the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
  1450. example in mail mode, use
  1451. @lisp
  1452. (add-hook 'mail-mode-hook 'turn-on-orgtbl)
  1453. @end lisp
  1454. Furthermore, with some special setup, it is possible to maintain tables
  1455. in arbitrary syntax with Orgtbl mode. For example, it is possible to
  1456. construct La@TeX{} tables with the underlying ease and power of
  1457. Orgtbl mode, including spreadsheet capabilities. For details, see
  1458. @ref{Tables in arbitrary syntax}.
  1459. @node The spreadsheet, , Orgtbl mode, Tables
  1460. @section The spreadsheet
  1461. @cindex calculations, in tables
  1462. @cindex spreadsheet capabilities
  1463. @cindex @file{calc} package
  1464. The table editor makes use of the Emacs @file{calc} package to implement
  1465. spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
  1466. derive fields from other fields. While fully featured, Org's
  1467. implementation is not identical to other spreadsheets. For example,
  1468. Org knows the concept of a @emph{column formula} that will be
  1469. applied to all non-header fields in a column without having to copy the
  1470. formula to each relevant field.
  1471. @menu
  1472. * References:: How to refer to another field or range
  1473. * Formula syntax for Calc:: Using Calc to compute stuff
  1474. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  1475. * Field formulas:: Formulas valid for a single field
  1476. * Column formulas:: Formulas valid for an entire column
  1477. * Editing and debugging formulas:: Fixing formulas
  1478. * Updating the table:: Recomputing all dependent fields
  1479. * Advanced features:: Field names, parameters and automatic recalc
  1480. @end menu
  1481. @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
  1482. @subsection References
  1483. @cindex references
  1484. To compute fields in the table from other fields, formulas must
  1485. reference other fields or ranges. In Org, fields can be referenced
  1486. by name, by absolute coordinates, and by relative coordinates. To find
  1487. out what the coordinates of a field are, press @kbd{C-c ?} in that
  1488. field, or press @kbd{C-c @}} to toggle the display of a grid.
  1489. @subsubheading Field references
  1490. @cindex field references
  1491. @cindex references, to fields
  1492. Formulas can reference the value of another field in two ways. Like in
  1493. any other spreadsheet, you may reference fields with a letter/number
  1494. combination like @code{B3}, meaning the 2nd field in the 3rd row.
  1495. @c Such references are always fixed to that field, they don't change
  1496. @c when you copy and paste a formula to a different field. So
  1497. @c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
  1498. @noindent
  1499. Org also uses another, more general operator that looks like this:
  1500. @example
  1501. @@row$column
  1502. @end example
  1503. @noindent
  1504. Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
  1505. or relative to the current column like @samp{+1} or @samp{-2}.
  1506. The row specification only counts data lines and ignores horizontal
  1507. separator lines (hlines). You can use absolute row numbers
  1508. @samp{1}...@samp{N}, and row numbers relative to the current row like
  1509. @samp{+3} or @samp{-1}. Or specify the row relative to one of the
  1510. hlines: @samp{I} refers to the first hline@footnote{Note that only
  1511. hlines are counted that @emph{separate} table lines. If the table
  1512. starts with a hline above the header, it does not count.}, @samp{II} to
  1513. the second etc. @samp{-I} refers to the first such line above the
  1514. current line, @samp{+I} to the first such line below the current line.
  1515. You can also write @samp{III+2} which is the second data line after the
  1516. third hline in the table. Relative row numbers like @samp{-3} will not
  1517. cross hlines if the current line is too close to the hline. Instead,
  1518. the value directly at the hline is used.
  1519. @samp{0} refers to the current row and column. Also, if you omit
  1520. either the column or the row part of the reference, the current
  1521. row/column is implied.
  1522. Org's references with @emph{unsigned} numbers are fixed references
  1523. in the sense that if you use the same reference in the formula for two
  1524. different fields, the same field will be referenced each time.
  1525. Org's references with @emph{signed} numbers are floating
  1526. references because the same reference operator can reference different
  1527. fields depending on the field being calculated by the formula.
  1528. Here are a few examples:
  1529. @example
  1530. @@2$3 @r{2nd row, 3rd column}
  1531. C2 @r{same as previous}
  1532. $5 @r{column 5 in the current row}
  1533. E& @r{same as previous}
  1534. @@2 @r{current column, row 2}
  1535. @@-1$-3 @r{the field one row up, three columns to the left}
  1536. @@-I$2 @r{field just under hline above current row, column 2}
  1537. @end example
  1538. @subsubheading Range references
  1539. @cindex range references
  1540. @cindex references, to ranges
  1541. You may reference a rectangular range of fields by specifying two field
  1542. references connected by two dots @samp{..}. If both fields are in the
  1543. current row, you may simply use @samp{$2..$7}, but if at least one field
  1544. is in a different row, you need to use the general @code{@@row$column}
  1545. format at least for the first field (i.e the reference must start with
  1546. @samp{@@} in order to be interpreted correctly). Examples:
  1547. @example
  1548. $1..$3 @r{First three fields in the current row.}
  1549. $P..$Q @r{Range, using column names (see under Advanced)}
  1550. @@2$1..@@4$3 @r{6 fields between these two fields.}
  1551. A2..C4 @r{Same as above.}
  1552. @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
  1553. @end example
  1554. @noindent Range references return a vector of values that can be fed
  1555. into Calc vector functions. Empty fields in ranges are normally
  1556. suppressed, so that the vector contains only the non-empty fields (but
  1557. see the @samp{E} mode switch below). If there are no non-empty fields,
  1558. @samp{[0]} is returned to avoid syntax errors in formulas.
  1559. @subsubheading Named references
  1560. @cindex named references
  1561. @cindex references, named
  1562. @cindex name, of column or field
  1563. @cindex constants, in calculations
  1564. @samp{$name} is interpreted as the name of a column, parameter or
  1565. constant. Constants are defined globally through the variable
  1566. @code{org-table-formula-constants}, and locally (for the file) through a
  1567. line like
  1568. @example
  1569. #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
  1570. @end example
  1571. @noindent
  1572. Also properties (@pxref{Properties and Columns}) can be used as
  1573. constants in table formulas: For a property @samp{:Xyz:} use the name
  1574. @samp{$PROP_Xyz}, and the property will be searched in the current
  1575. outline entry and in the hierarchy above it. If you have the
  1576. @file{constants.el} package, it will also be used to resolve constants,
  1577. including natural constants like @samp{$h} for Planck's constant, and
  1578. units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
  1579. supply the values of constants in two different unit systems, @code{SI}
  1580. and @code{cgs}. Which one is used depends on the value of the variable
  1581. @code{constants-unit-system}. You can use the @code{#+STARTUP} options
  1582. @code{constSI} and @code{constcgs} to set this value for the current
  1583. buffer.}. Column names and parameters can be specified in special table
  1584. lines. These are described below, see @ref{Advanced features}. All
  1585. names must start with a letter, and further consist of letters and
  1586. numbers.
  1587. @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
  1588. @subsection Formula syntax for Calc
  1589. @cindex formula syntax, Calc
  1590. @cindex syntax, of formulas
  1591. A formula can be any algebraic expression understood by the Emacs
  1592. @file{Calc} package. @b{Note that @file{calc} has the
  1593. non-standard convention that @samp{/} has lower precedence than
  1594. @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
  1595. evaluation by @code{calc-eval} (@pxref{Calling Calc from
  1596. Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
  1597. Emacs Calc Manual}),
  1598. @c FIXME: The link to the Calc manual in HTML does not work.
  1599. variable substitution takes place according to the rules described above.
  1600. @cindex vectors, in table calculations
  1601. The range vectors can be directly fed into the Calc vector functions
  1602. like @samp{vmean} and @samp{vsum}.
  1603. @cindex format specifier
  1604. @cindex mode, for @file{calc}
  1605. A formula can contain an optional mode string after a semicolon. This
  1606. string consists of flags to influence Calc and other modes during
  1607. execution. By default, Org uses the standard Calc modes (precision
  1608. 12, angular units degrees, fraction and symbolic modes off). The display
  1609. format, however, has been changed to @code{(float 5)} to keep tables
  1610. compact. The default settings can be configured using the variable
  1611. @code{org-calc-default-modes}.
  1612. @example
  1613. p20 @r{switch the internal precision to 20 digits}
  1614. n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
  1615. D R @r{angle modes: degrees, radians}
  1616. F S @r{fraction and symbolic modes}
  1617. N @r{interpret all fields as numbers, use 0 for non-numbers}
  1618. T @r{force text interpretation}
  1619. E @r{keep empty fields in ranges}
  1620. @end example
  1621. @noindent
  1622. In addition, you may provide a @code{printf} format specifier to
  1623. reformat the final result. A few examples:
  1624. @example
  1625. $1+$2 @r{Sum of first and second field}
  1626. $1+$2;%.2f @r{Same, format result to two decimals}
  1627. exp($2)+exp($1) @r{Math functions can be used}
  1628. $0;%.1f @r{Reformat current cell to 1 decimal}
  1629. ($3-32)*5/9 @r{Degrees F -> C conversion}
  1630. $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
  1631. tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
  1632. sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
  1633. vmean($2..$7) @r{Compute column range mean, using vector function}
  1634. vmean($2..$7);EN @r{Same, but treat empty fields as 0}
  1635. taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
  1636. @end example
  1637. Calc also contains a complete set of logical operations. For example
  1638. @example
  1639. if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
  1640. @end example
  1641. @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
  1642. @subsection Emacs Lisp forms as formulas
  1643. @cindex Lisp forms, as table formulas
  1644. It is also possible to write a formula in Emacs Lisp; this can be useful
  1645. for string manipulation and control structures, if the Calc's
  1646. functionality is not enough. If a formula starts with a single quote
  1647. followed by an opening parenthesis, then it is evaluated as a lisp form.
  1648. The evaluation should return either a string or a number. Just as with
  1649. @file{calc} formulas, you can specify modes and a printf format after a
  1650. semicolon. With Emacs Lisp forms, you need to be conscious about the way
  1651. field references are interpolated into the form. By default, a
  1652. reference will be interpolated as a Lisp string (in double quotes)
  1653. containing the field. If you provide the @samp{N} mode switch, all
  1654. referenced elements will be numbers (non-number fields will be zero) and
  1655. interpolated as Lisp numbers, without quotes. If you provide the
  1656. @samp{L} flag, all fields will be interpolated literally, without quotes.
  1657. I.e., if you want a reference to be interpreted as a string by the Lisp
  1658. form, enclose the reference operator itself in double quotes, like
  1659. @code{"$3"}. Ranges are inserted as space-separated fields, so you can
  1660. embed them in list or vector syntax. A few examples, note how the
  1661. @samp{N} mode is used when we do computations in lisp.
  1662. @example
  1663. @r{Swap the first two characters of the content of column 1}
  1664. '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
  1665. @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
  1666. '(+ $1 $2);N
  1667. @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
  1668. '(apply '+ '($1..$4));N
  1669. @end example
  1670. @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
  1671. @subsection Field formulas
  1672. @cindex field formula
  1673. @cindex formula, for individual table field
  1674. To assign a formula to a particular field, type it directly into the
  1675. field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
  1676. press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
  1677. the field, the formula will be stored as the formula for this field,
  1678. evaluated, and the current field replaced with the result.
  1679. Formulas are stored in a special line starting with @samp{#+TBLFM:}
  1680. directly below the table. If you typed the equation in the 4th field of
  1681. the 3rd data line in the table, the formula will look like
  1682. @samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
  1683. with the appropriate commands, @i{absolute references} (but not relative
  1684. ones) in stored formulas are modified in order to still reference the
  1685. same field. Of cause this is not true if you edit the table structure
  1686. with normal editing commands - then you must fix the equations yourself.
  1687. Instead of typing an equation into the field, you may also use the
  1688. following command
  1689. @table @kbd
  1690. @kindex C-u C-c =
  1691. @item C-u C-c =
  1692. Install a new formula for the current field. The command prompts for a
  1693. formula, with default taken from the @samp{#+TBLFM:} line, applies
  1694. it to the current field and stores it.
  1695. @end table
  1696. @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
  1697. @subsection Column formulas
  1698. @cindex column formula
  1699. @cindex formula, for table column
  1700. Often in a table, the same formula should be used for all fields in a
  1701. particular column. Instead of having to copy the formula to all fields
  1702. in that column, Org allows to assign a single formula to an entire
  1703. column. If the table contains horizontal separator hlines, everything
  1704. before the first such line is considered part of the table @emph{header}
  1705. and will not be modified by column formulas.
  1706. To assign a formula to a column, type it directly into any field in the
  1707. column, preceded by an equal sign, like @samp{=$1+$2}. When you press
  1708. @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
  1709. field, the formula will be stored as the formula for the current column,
  1710. evaluated and the current field replaced with the result. If the field
  1711. contains only @samp{=}, the previously stored formula for this column is
  1712. used. For each column, Org will only remember the most recently
  1713. used formula. In the @samp{TBLFM:} line, column formulas will look like
  1714. @samp{$4=$1+$2}.
  1715. Instead of typing an equation into the field, you may also use the
  1716. following command:
  1717. @table @kbd
  1718. @kindex C-c =
  1719. @item C-c =
  1720. Install a new formula for the current column and replace current field with
  1721. the result of the formula. The command prompts for a formula, with default
  1722. taken from the @samp{#+TBLFM} line, applies it to the current field and
  1723. stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
  1724. will apply it to that many consecutive fields in the current column.
  1725. @end table
  1726. @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
  1727. @subsection Editing and debugging formulas
  1728. @cindex formula editing
  1729. @cindex editing, of table formulas
  1730. You can edit individual formulas in the minibuffer or directly in the
  1731. field. Org can also prepare a special buffer with all active
  1732. formulas of a table. When offering a formula for editing, Org
  1733. converts references to the standard format (like @code{B3} or @code{D&})
  1734. if possible. If you prefer to only work with the internal format (like
  1735. @code{@@3$2} or @code{$4}), configure the variable
  1736. @code{org-table-use-standard-references}.
  1737. @table @kbd
  1738. @kindex C-c =
  1739. @kindex C-u C-c =
  1740. @item C-c =
  1741. @itemx C-u C-c =
  1742. Edit the formula associated with the current column/field in the
  1743. minibuffer. See @ref{Column formulas} and @ref{Field formulas}.
  1744. @kindex C-u C-u C-c =
  1745. @item C-u C-u C-c =
  1746. Re-insert the active formula (either a
  1747. field formula, or a column formula) into the current field, so that you
  1748. can edit it directly in the field. The advantage over editing in the
  1749. minibuffer is that you can use the command @kbd{C-c ?}.
  1750. @kindex C-c ?
  1751. @item C-c ?
  1752. While editing a formula in a table field, highlight the field(s)
  1753. referenced by the reference at the cursor position in the formula.
  1754. @kindex C-c @}
  1755. @item C-c @}
  1756. Toggle the display of row and column numbers for a table, using
  1757. overlays. These are updated each time the table is aligned, you can
  1758. force it with @kbd{C-c C-c}.
  1759. @kindex C-c @{
  1760. @item C-c @{
  1761. Toggle the formula debugger on and off. See below.
  1762. @kindex C-c '
  1763. @item C-c '
  1764. Edit all formulas for the current table in a special buffer, where the
  1765. formulas will be displayed one per line. If the current field has an
  1766. active formula, the cursor in the formula editor will mark it.
  1767. While inside the special buffer, Org will automatically highlight
  1768. any field or range reference at the cursor position. You may edit,
  1769. remove and add formulas, and use the following commands:
  1770. @table @kbd
  1771. @kindex C-c C-c
  1772. @kindex C-x C-s
  1773. @item C-c C-c
  1774. @itemx C-x C-s
  1775. Exit the formula editor and store the modified formulas. With @kbd{C-u}
  1776. prefix, also apply the new formulas to the entire table.
  1777. @kindex C-c C-q
  1778. @item C-c C-q
  1779. Exit the formula editor without installing changes.
  1780. @kindex C-c C-r
  1781. @item C-c C-r
  1782. Toggle all references in the formula editor between standard (like
  1783. @code{B3}) and internal (like @code{@@3$2}).
  1784. @kindex @key{TAB}
  1785. @item @key{TAB}
  1786. Pretty-print or indent lisp formula at point. When in a line containing
  1787. a lisp formula, format the formula according to Emacs Lisp rules.
  1788. Another @key{TAB} collapses the formula back again. In the open
  1789. formula, @key{TAB} re-indents just like in Emacs lisp mode.
  1790. @kindex M-@key{TAB}
  1791. @item M-@key{TAB}
  1792. Complete Lisp symbols, just like in Emacs lisp mode.
  1793. @kindex S-@key{up}
  1794. @kindex S-@key{down}
  1795. @kindex S-@key{left}
  1796. @kindex S-@key{right}
  1797. @item S-@key{up}/@key{down}/@key{left}/@key{right}
  1798. Shift the reference at point. For example, if the reference is
  1799. @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
  1800. This also works for relative references, and for hline references.
  1801. @kindex M-S-@key{up}
  1802. @kindex M-S-@key{down}
  1803. @item M-S-@key{up}/@key{down}
  1804. Move the test line for column formulas in the Org buffer up and
  1805. down.
  1806. @kindex M-@key{up}
  1807. @kindex M-@key{down}
  1808. @item M-@key{up}/@key{down}
  1809. Scroll the window displaying the table.
  1810. @kindex C-c @}
  1811. @item C-c @}
  1812. Turn the coordinate grid in the table on and off.
  1813. @end table
  1814. @end table
  1815. Making a table field blank does not remove the formula associated with
  1816. the field, because that is stored in a different line (the @samp{TBLFM}
  1817. line) - during the next recalculation the field will be filled again.
  1818. To remove a formula from a field, you have to give an empty reply when
  1819. prompted for the formula, or to edit the @samp{#+TBLFM} line.
  1820. @kindex C-c C-c
  1821. You may edit the @samp{#+TBLFM} directly and re-apply the changed
  1822. equations with @kbd{C-c C-c} in that line, or with the normal
  1823. recalculation commands in the table.
  1824. @subsubheading Debugging formulas
  1825. @cindex formula debugging
  1826. @cindex debugging, of table formulas
  1827. When the evaluation of a formula leads to an error, the field content
  1828. becomes the string @samp{#ERROR}. If you would like see what is going
  1829. on during variable substitution and calculation in order to find a bug,
  1830. turn on formula debugging in the @code{Tbl} menu and repeat the
  1831. calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
  1832. field. Detailed information will be displayed.
  1833. @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
  1834. @subsection Updating the table
  1835. @cindex recomputing table fields
  1836. @cindex updating, table
  1837. Recalculation of a table is normally not automatic, but needs to be
  1838. triggered by a command. See @ref{Advanced features} for a way to make
  1839. recalculation at least semi-automatically.
  1840. In order to recalculate a line of a table or the entire table, use the
  1841. following commands:
  1842. @table @kbd
  1843. @kindex C-c *
  1844. @item C-c *
  1845. Recalculate the current row by first applying the stored column formulas
  1846. from left to right, and all field formulas in the current row.
  1847. @c
  1848. @kindex C-u C-c *
  1849. @item C-u C-c *
  1850. @kindex C-u C-c C-c
  1851. @itemx C-u C-c C-c
  1852. Recompute the entire table, line by line. Any lines before the first
  1853. hline are left alone, assuming that these are part of the table header.
  1854. @c
  1855. @kindex C-u C-u C-c *
  1856. @kindex C-u C-u C-c C-c
  1857. @item C-u C-u C-c *
  1858. @itemx C-u C-u C-c C-c
  1859. Iterate the table by recomputing it until no further changes occur.
  1860. This may be necessary if some computed fields use the value of other
  1861. fields that are computed @i{later} in the calculation sequence.
  1862. @end table
  1863. @node Advanced features, , Updating the table, The spreadsheet
  1864. @subsection Advanced features
  1865. If you want the recalculation of fields to happen automatically, or if
  1866. you want to be able to assign @i{names} to fields and columns, you need
  1867. to reserve the first column of the table for special marking characters.
  1868. @table @kbd
  1869. @kindex C-#
  1870. @item C-#
  1871. Rotate the calculation mark in first column through the states @samp{},
  1872. @samp{#}, @samp{*}, @samp{!}, @samp{$}. The meaning of these characters
  1873. is discussed below. When there is an active region, change all marks in
  1874. the region.
  1875. @end table
  1876. Here is an example of a table that collects exam results of students and
  1877. makes use of these features:
  1878. @example
  1879. @group
  1880. |---+---------+--------+--------+--------+-------+------|
  1881. | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
  1882. |---+---------+--------+--------+--------+-------+------|
  1883. | ! | | P1 | P2 | P3 | Tot | |
  1884. | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
  1885. | ^ | | m1 | m2 | m3 | mt | |
  1886. |---+---------+--------+--------+--------+-------+------|
  1887. | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
  1888. | # | Sara | 6 | 14 | 19 | 39 | 7.8 |
  1889. | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
  1890. |---+---------+--------+--------+--------+-------+------|
  1891. | | Average | | | | 29.7 | |
  1892. | ^ | | | | | at | |
  1893. | $ | max=50 | | | | | |
  1894. |---+---------+--------+--------+--------+-------+------|
  1895. #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
  1896. @end group
  1897. @end example
  1898. @noindent @b{Important}: Please note that for these special tables,
  1899. recalculating the table with @kbd{C-u C-c *} will only affect rows that
  1900. are marked @samp{#} or @samp{*}, and fields that have a formula assigned
  1901. to the field itself. The column formulas are not applied in rows with
  1902. empty first field.
  1903. @cindex marking characters, tables
  1904. The marking characters have the following meaning:
  1905. @table @samp
  1906. @item !
  1907. The fields in this line define names for the columns, so that you may
  1908. refer to a column as @samp{$Tot} instead of @samp{$6}.
  1909. @item ^
  1910. This row defines names for the fields @emph{above} the row. With such
  1911. a definition, any formula in the table may use @samp{$m1} to refer to
  1912. the value @samp{10}. Also, if you assign a formula to a names field, it
  1913. will be stored as @samp{$name=...}.
  1914. @item _
  1915. Similar to @samp{^}, but defines names for the fields in the row
  1916. @emph{below}.
  1917. @item $
  1918. Fields in this row can define @emph{parameters} for formulas. For
  1919. example, if a field in a @samp{$} row contains @samp{max=50}, then
  1920. formulas in this table can refer to the value 50 using @samp{$max}.
  1921. Parameters work exactly like constants, only that they can be defined on
  1922. a per-table basis.
  1923. @item #
  1924. Fields in this row are automatically recalculated when pressing
  1925. @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
  1926. is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
  1927. lines will be left alone by this command.
  1928. @item *
  1929. Selects this line for global recalculation with @kbd{C-u C-c *}, but
  1930. not for automatic recalculation. Use this when automatic
  1931. recalculation slows down editing too much.
  1932. @item
  1933. Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
  1934. All lines that should be recalculated should be marked with @samp{#}
  1935. or @samp{*}.
  1936. @item /
  1937. Do not export this line. Useful for lines that contain the narrowing
  1938. @samp{<N>} markers.
  1939. @end table
  1940. Finally, just to whet your appetite on what can be done with the
  1941. fantastic @file{calc} package, here is a table that computes the Taylor
  1942. series of degree @code{n} at location @code{x} for a couple of
  1943. functions.
  1944. @example
  1945. @group
  1946. |---+-------------+---+-----+--------------------------------------|
  1947. | | Func | n | x | Result |
  1948. |---+-------------+---+-----+--------------------------------------|
  1949. | # | exp(x) | 1 | x | 1 + x |
  1950. | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
  1951. | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
  1952. | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
  1953. | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
  1954. | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
  1955. |---+-------------+---+-----+--------------------------------------|
  1956. #+TBLFM: $5=taylor($2,$4,$3);n3
  1957. @end group
  1958. @end example
  1959. @node Hyperlinks, TODO Items, Tables, Top
  1960. @chapter Hyperlinks
  1961. @cindex hyperlinks
  1962. Like HTML, Org provides links inside a file, external links to
  1963. other files, Usenet articles, emails, and much more.
  1964. @menu
  1965. * Link format:: How links in Org are formatted
  1966. * Internal links:: Links to other places in the current file
  1967. * External links:: URL-like links to the world
  1968. * Handling links:: Creating, inserting and following
  1969. * Using links outside Org:: Linking from my C source code?
  1970. * Link abbreviations:: Shortcuts for writing complex links
  1971. * Search options:: Linking to a specific location
  1972. * Custom searches:: When the default search is not enough
  1973. @end menu
  1974. @node Link format, Internal links, Hyperlinks, Hyperlinks
  1975. @section Link format
  1976. @cindex link format
  1977. @cindex format, of links
  1978. Org will recognize plain URL-like links and activate them as
  1979. clickable links. The general link format, however, looks like this:
  1980. @example
  1981. [[link][description]] @r{or alternatively} [[link]]
  1982. @end example
  1983. Once a link in the buffer is complete (all brackets present), Org
  1984. will change the display so that @samp{description} is displayed instead
  1985. of @samp{[[link][description]]} and @samp{link} is displayed instead of
  1986. @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
  1987. which by default is an underlined face. You can directly edit the
  1988. visible part of a link. Note that this can be either the @samp{link}
  1989. part (if there is no description) or the @samp{description} part. To
  1990. edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
  1991. cursor on the link.
  1992. If you place the cursor at the beginning or just behind the end of the
  1993. displayed text and press @key{BACKSPACE}, you will remove the
  1994. (invisible) bracket at that location. This makes the link incomplete
  1995. and the internals are again displayed as plain text. Inserting the
  1996. missing bracket hides the link internals again. To show the
  1997. internal structure of all links, use the menu entry
  1998. @code{Org->Hyperlinks->Literal links}.
  1999. @node Internal links, External links, Link format, Hyperlinks
  2000. @section Internal links
  2001. @cindex internal links
  2002. @cindex links, internal
  2003. @cindex targets, for links
  2004. If the link does not look like a URL, it is considered to be internal in
  2005. the current file. Links such as @samp{[[My Target]]} or @samp{[[My
  2006. Target][Find my target]]} lead to a text search in the current file.
  2007. The link can be followed with @kbd{C-c C-o} when the cursor is on the
  2008. link, or with a mouse click (@pxref{Handling links}). The preferred
  2009. match for such a link is a dedicated target: the same string in double
  2010. angular brackets. Targets may be located anywhere; sometimes it is
  2011. convenient to put them into a comment line. For example
  2012. @example
  2013. # <<My Target>>
  2014. @end example
  2015. @noindent In HTML export (@pxref{HTML export}), such targets will become
  2016. named anchors for direct access through @samp{http} links@footnote{Note
  2017. that text before the first headline is usually not exported, so the
  2018. first such target should be after the first headline.}.
  2019. If no dedicated target exists, Org will search for the words in the
  2020. link. In the above example the search would be for @samp{my target}.
  2021. Links starting with a star like @samp{*My Target} restrict the search to
  2022. headlines. When searching, Org mode will first try an exact match, but
  2023. then move on to more and more lenient searches. For example, the link
  2024. @samp{[[*My Targets]]} will find any of the following:
  2025. @example
  2026. ** My targets
  2027. ** TODO my targets are bright
  2028. ** my 20 targets are
  2029. @end example
  2030. To insert a link targeting a headline, in-buffer completion can be used.
  2031. Just type a star followed by a few optional letters into the buffer and
  2032. press @kbd{M-@key{TAB}}. All headlines in the current buffer will be
  2033. offered as completions. @xref{Handling links}, for more commands
  2034. creating links.
  2035. Following a link pushes a mark onto Org's own mark ring. You can
  2036. return to the previous position with @kbd{C-c &}. Using this command
  2037. several times in direct succession goes back to positions recorded
  2038. earlier.
  2039. @menu
  2040. * Radio targets:: Make targets trigger links in plain text
  2041. @end menu
  2042. @node Radio targets, , Internal links, Internal links
  2043. @subsection Radio targets
  2044. @cindex radio targets
  2045. @cindex targets, radio
  2046. @cindex links, radio targets
  2047. Org can automatically turn any occurrences of certain target names
  2048. in normal text into a link. So without explicitly creating a link, the
  2049. text connects to the target radioing its position. Radio targets are
  2050. enclosed by triple angular brackets. For example, a target @samp{<<<My
  2051. Target>>>} causes each occurrence of @samp{my target} in normal text to
  2052. become activated as a link. The Org file is scanned automatically
  2053. for radio targets only when the file is first loaded into Emacs. To
  2054. update the target list during editing, press @kbd{C-c C-c} with the
  2055. cursor on or at a target.
  2056. @node External links, Handling links, Internal links, Hyperlinks
  2057. @section External links
  2058. @cindex links, external
  2059. @cindex external links
  2060. @cindex links, external
  2061. @cindex Gnus links
  2062. @cindex BBDB links
  2063. @cindex IRC links
  2064. @cindex URL links
  2065. @cindex file links
  2066. @cindex VM links
  2067. @cindex RMAIL links
  2068. @cindex WANDERLUST links
  2069. @cindex MH-E links
  2070. @cindex USENET links
  2071. @cindex SHELL links
  2072. @cindex Info links
  2073. @cindex elisp links
  2074. Org supports links to files, websites, Usenet and email messages,
  2075. BBDB database entries and links to both IRC conversations and their
  2076. logs. External links are URL-like locators. They start with a short
  2077. identifying string followed by a colon. There can be no space after
  2078. the colon. The following list shows examples for each link type.
  2079. @example
  2080. http://www.astro.uva.nl/~dominik @r{on the web}
  2081. file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
  2082. /home/dominik/images/jupiter.jpg @r{same as above}
  2083. file:papers/last.pdf @r{file, relative path}
  2084. ./papers/last.pdf @r{same as above}
  2085. news:comp.emacs @r{Usenet link}
  2086. mailto:adent@@galaxy.net @r{Mail link}
  2087. vm:folder @r{VM folder link}
  2088. vm:folder#id @r{VM message link}
  2089. vm://myself@@some.where.org/folder#id @r{VM on remote machine}
  2090. wl:folder @r{WANDERLUST folder link}
  2091. wl:folder#id @r{WANDERLUST message link}
  2092. mhe:folder @r{MH-E folder link}
  2093. mhe:folder#id @r{MH-E message link}
  2094. rmail:folder @r{RMAIL folder link}
  2095. rmail:folder#id @r{RMAIL message link}
  2096. gnus:group @r{Gnus group link}
  2097. gnus:group#id @r{Gnus article link}
  2098. bbdb:Richard Stallman @r{BBDB link}
  2099. irc:/irc.com/#emacs/bob @r{IRC link}
  2100. shell:ls *.org @r{A shell command}
  2101. elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
  2102. @end example
  2103. A link should be enclosed in double brackets and may contain a
  2104. descriptive text to be displayed instead of the URL (@pxref{Link
  2105. format}), for example:
  2106. @example
  2107. [[http://www.gnu.org/software/emacs/][GNU Emacs]]
  2108. @end example
  2109. @noindent
  2110. If the description is a file name or URL that points to an image, HTML
  2111. export (@pxref{HTML export}) will inline the image as a clickable
  2112. button. If there is no description at all and the link points to an
  2113. image,
  2114. that image will be inlined into the exported HTML file.
  2115. @cindex angular brackets, around links
  2116. @cindex plain text external links
  2117. Org also finds external links in the normal text and activates them
  2118. as links. If spaces must be part of the link (for example in
  2119. @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
  2120. about the end of the link, enclose them in angular brackets.
  2121. @node Handling links, Using links outside Org, External links, Hyperlinks
  2122. @section Handling links
  2123. @cindex links, handling
  2124. Org provides methods to create a link in the correct syntax, to
  2125. insert it into an Org file, and to follow the link.
  2126. @table @kbd
  2127. @kindex C-c l
  2128. @cindex storing links
  2129. @item C-c l
  2130. Store a link to the current location. This is a @emph{global} command
  2131. which can be used in any buffer to create a link. The link will be
  2132. stored for later insertion into an Org buffer (see below). For
  2133. Org files, if there is a @samp{<<target>>} at the cursor, the
  2134. link points to the target. Otherwise it points to the current
  2135. headline. For VM, Rmail, Wanderlust, MH-E, Gnus and BBDB buffers, the
  2136. link will indicate the current article/entry. For W3 and W3M buffers,
  2137. the link goes to the current URL. For IRC links, if you set the
  2138. variable @code{org-irc-link-to-logs} to non-nil then @kbd{C-c l} will
  2139. store a @samp{file:/} style link to the relevant point in the logs for
  2140. the current conversation. Otherwise an @samp{irc:/} style link to the
  2141. user/channel/server under the point will be stored. For any other
  2142. files, the link will point to the file, with a search string
  2143. (@pxref{Search options}) pointing to the contents of the current line.
  2144. If there is an active region, the selected words will form the basis
  2145. of the search string. If the automatically created link is not
  2146. working correctly or accurately enough, you can write custom functions
  2147. to select the search string and to do the search for particular file
  2148. types - see @ref{Custom searches}. The key binding @kbd{C-c l} is
  2149. only a suggestion - see @ref{Installation}.
  2150. @c
  2151. @kindex C-c C-l
  2152. @cindex link completion
  2153. @cindex completion, of links
  2154. @cindex inserting links
  2155. @item C-c C-l
  2156. Insert a link. This prompts for a link to be inserted into the buffer. You
  2157. can just type a link, using text for an internal link, or one of the link
  2158. type prefixes mentioned in the examples above. All links stored during the
  2159. current session are part of the history for this prompt, so you can access
  2160. them with @key{up} and @key{down} (or @kbd{M-p/n}). Completion, on the other
  2161. hand, will help you to insert valid link prefixes like @samp{http:} or
  2162. @samp{ftp:}, including the prefixes defined through link abbreviations
  2163. (@pxref{Link abbreviations}). The link will be inserted into the
  2164. buffer@footnote{After insertion of a stored link, the link will be removed
  2165. from the list of stored links. To keep it in the list later use, use a
  2166. triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
  2167. @code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
  2168. If some text was selected when this command is called, the selected text
  2169. becomes the default description.@* Note that you don't have to use this
  2170. command to insert a link. Links in Org are plain text, and you can type
  2171. or paste them straight into the buffer. By using this command, the links are
  2172. automatically enclosed in double brackets, and you will be asked for the
  2173. optional descriptive text.
  2174. @c
  2175. @c If the link is a @samp{file:} link and
  2176. @c the linked file is located in the same directory as the current file or
  2177. @c a subdirectory of it, the path of the file will be inserted relative to
  2178. @c the current directory.
  2179. @c
  2180. @kindex C-u C-c C-l
  2181. @cindex file name completion
  2182. @cindex completion, of file names
  2183. @item C-u C-c C-l
  2184. When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
  2185. a file will be inserted and you may use file name completion to select
  2186. the name of the file. The path to the file is inserted relative to the
  2187. directory of the current org file, if the linked file is in the current
  2188. directory or in a sub-directory of it, or if the path is written relative
  2189. to the current directory using @samp{../}. Otherwise an absolute path
  2190. is used, if possible with @samp{~/} for your home directory. You can
  2191. force an absolute path with two @kbd{C-u} prefixes.
  2192. @c
  2193. @item C-c C-l @r{(with cursor on existing link)}
  2194. When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
  2195. link and description parts of the link.
  2196. @c
  2197. @cindex following links
  2198. @kindex C-c C-o
  2199. @item C-c C-o
  2200. Open link at point. This will launch a web browser for URLs (using
  2201. @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB
  2202. for the corresponding links, and execute the command in a shell link.
  2203. When the cursor is on an internal link, this commands runs the
  2204. corresponding search. When the cursor is on a TAG list in a headline,
  2205. it creates the corresponding TAGS view. If the cursor is on a time
  2206. stamp, it compiles the agenda for that date. Furthermore, it will visit
  2207. text and remote files in @samp{file:} links with Emacs and select a
  2208. suitable application for local non-text files. Classification of files
  2209. is based on file extension only. See option @code{org-file-apps}. If
  2210. you want to override the default application and visit the file with
  2211. Emacs, use a @kbd{C-u} prefix.
  2212. @c
  2213. @kindex mouse-2
  2214. @kindex mouse-1
  2215. @item mouse-2
  2216. @itemx mouse-1
  2217. On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
  2218. would. Under Emacs 22, also @kbd{mouse-1} will follow a link.
  2219. @c
  2220. @kindex mouse-3
  2221. @item mouse-3
  2222. Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
  2223. internal links to be displayed in another window@footnote{See the
  2224. variable @code{org-display-internal-link-with-indirect-buffer}}.
  2225. @c
  2226. @cindex mark ring
  2227. @kindex C-c %
  2228. @item C-c %
  2229. Push the current position onto the mark ring, to be able to return
  2230. easily. Commands following an internal link do this automatically.
  2231. @c
  2232. @cindex links, returning to
  2233. @kindex C-c &
  2234. @item C-c &
  2235. Jump back to a recorded position. A position is recorded by the
  2236. commands following internal links, and by @kbd{C-c %}. Using this
  2237. command several times in direct succession moves through a ring of
  2238. previously recorded positions.
  2239. @c
  2240. @kindex C-c C-x C-n
  2241. @kindex C-c C-x C-p
  2242. @cindex links, finding next/previous
  2243. @item C-c C-x C-n
  2244. @itemx C-c C-x C-p
  2245. Move forward/backward to the next link in the buffer. At the limit of
  2246. the buffer, the search fails once, and then wraps around. The key
  2247. bindings for this are really too long, you might want to bind this also
  2248. to @kbd{C-n} and @kbd{C-p}
  2249. @lisp
  2250. (add-hook 'org-load-hook
  2251. (lambda ()
  2252. (define-key 'org-mode-map "\C-n" 'org-next-link)
  2253. (define-key 'org-mode-map "\C-p" 'org-previous-link)))
  2254. @end lisp
  2255. @end table
  2256. @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
  2257. @section Using links outside Org
  2258. You can insert and follow links that have Org syntax not only in
  2259. Org, but in any Emacs buffer. For this, you should create two
  2260. global commands, like this (please select suitable global keys
  2261. yourself):
  2262. @lisp
  2263. (global-set-key "\C-c L" 'org-insert-link-global)
  2264. (global-set-key "\C-c o" 'org-open-at-point-global)
  2265. @end lisp
  2266. @node Link abbreviations, Search options, Using links outside Org, Hyperlinks
  2267. @section Link abbreviations
  2268. @cindex link abbreviations
  2269. @cindex abbreviation, links
  2270. Long URLs can be cumbersome to type, and often many similar links are
  2271. needed in a document. For this you can use link abbreviations. An
  2272. abbreviated link looks like this
  2273. @example
  2274. [[linkword:tag][description]]
  2275. @end example
  2276. @noindent
  2277. where the tag is optional. Such abbreviations are resolved according to
  2278. the information in the variable @code{org-link-abbrev-alist} that
  2279. relates the linkwords to replacement text. Here is an example:
  2280. @lisp
  2281. @group
  2282. (setq org-link-abbrev-alist
  2283. '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
  2284. ("google" . "http://www.google.com/search?q=")
  2285. ("ads" . "http://adsabs.harvard.edu/cgi-bin/
  2286. nph-abs_connect?author=%s&db_key=AST")))
  2287. @end group
  2288. @end lisp
  2289. If the replacement text contains the string @samp{%s}, it will be
  2290. replaced with the tag. Otherwise the tag will be appended to the string
  2291. in order to create the link. You may also specify a function that will
  2292. be called with the tag as the only argument to create the link.
  2293. With the above setting, you could link to a specific bug with
  2294. @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
  2295. @code{[[google:OrgMode]]} and find out what the Org author is
  2296. doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
  2297. If you need special abbreviations just for a single Org buffer, you
  2298. can define them in the file with
  2299. @example
  2300. #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
  2301. #+LINK: google http://www.google.com/search?q=%s
  2302. @end example
  2303. @noindent
  2304. In-buffer completion @pxref{Completion} can be used after @samp{[} to
  2305. complete link abbreviations.
  2306. @node Search options, Custom searches, Link abbreviations, Hyperlinks
  2307. @section Search options in file links
  2308. @cindex search option in file links
  2309. @cindex file links, searching
  2310. File links can contain additional information to make Emacs jump to a
  2311. particular location in the file when following a link. This can be a
  2312. line number or a search option after a double@footnote{For backward
  2313. compatibility, line numbers can also follow a single colon.} colon. For
  2314. example, when the command @kbd{C-c l} creates a link (@pxref{Handling
  2315. links}) to a file, it encodes the words in the current line as a search
  2316. string that can be used to find this line back later when following the
  2317. link with @kbd{C-c C-o}.
  2318. Here is the syntax of the different ways to attach a search to a file
  2319. link, together with an explanation:
  2320. @example
  2321. [[file:~/code/main.c::255]]
  2322. [[file:~/xx.org::My Target]]
  2323. [[file:~/xx.org::*My Target]]
  2324. [[file:~/xx.org::/regexp/]]
  2325. @end example
  2326. @table @code
  2327. @item 255
  2328. Jump to line 255.
  2329. @item My Target
  2330. Search for a link target @samp{<<My Target>>}, or do a text search for
  2331. @samp{my target}, similar to the search in internal links, see
  2332. @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
  2333. link will become an HTML reference to the corresponding named anchor in
  2334. the linked file.
  2335. @item *My Target
  2336. In an Org file, restrict search to headlines.
  2337. @item /regexp/
  2338. Do a regular expression search for @code{regexp}. This uses the Emacs
  2339. command @code{occur} to list all matches in a separate window. If the
  2340. target file is in Org mode, @code{org-occur} is used to create a
  2341. sparse tree with the matches.
  2342. @c If the target file is a directory,
  2343. @c @code{grep} will be used to search all files in the directory.
  2344. @end table
  2345. As a degenerate case, a file link with an empty file name can be used
  2346. to search the current file. For example, @code{[[file:::find me]]} does
  2347. a search for @samp{find me} in the current file, just as
  2348. @samp{[[find me]]} would.
  2349. @node Custom searches, , Search options, Hyperlinks
  2350. @section Custom Searches
  2351. @cindex custom search strings
  2352. @cindex search strings, custom
  2353. The default mechanism for creating search strings and for doing the
  2354. actual search related to a file link may not work correctly in all
  2355. cases. For example, BibTeX database files have many entries like
  2356. @samp{year="1993"} which would not result in good search strings,
  2357. because the only unique identification for a BibTeX entry is the
  2358. citation key.
  2359. If you come across such a problem, you can write custom functions to set
  2360. the right search string for a particular file type, and to do the search
  2361. for the string in the file. Using @code{add-hook}, these functions need
  2362. to be added to the hook variables
  2363. @code{org-create-file-search-functions} and
  2364. @code{org-execute-file-search-functions}. See the docstring for these
  2365. variables for more information. Org actually uses this mechanism
  2366. for Bib@TeX{} database files, and you can use the corresponding code as
  2367. an implementation example. See the file @file{org-bibtex.el}.
  2368. @node TODO Items, Tags, Hyperlinks, Top
  2369. @chapter TODO Items
  2370. @cindex TODO items
  2371. Org mode does not maintain TODO lists as separate documents@footnote{Of
  2372. course, you can make a document that contains inly long lists of TODO items,
  2373. but this is not required.}. Instead, TODO items are an integral part of the
  2374. notes file, because TODO items usually come up while taking notes! With Org
  2375. mode, simply mark any entry in a tree as being a TODO item. In this way,
  2376. information is not duplicated, and the entire context from which the TODO
  2377. item emerged is always present.
  2378. Of course, this technique for managing TODO items scatters them
  2379. throughout your notes file. Org mode compensates for this by providing
  2380. methods to give you an overview of all the things that you have to do.
  2381. @menu
  2382. * TODO basics:: Marking and displaying TODO entries
  2383. * TODO extensions:: Workflow and assignments
  2384. * Progress logging:: Dates and notes for progress
  2385. * Priorities:: Some things are more important than others
  2386. * Breaking down tasks:: Splitting a task into manageable pieces
  2387. * Checkboxes:: Tick-off lists
  2388. @end menu
  2389. @node TODO basics, TODO extensions, TODO Items, TODO Items
  2390. @section Basic TODO functionality
  2391. Any headline becomes a TODO item when it starts with the word
  2392. @samp{TODO}, for example:
  2393. @example
  2394. *** TODO Write letter to Sam Fortune
  2395. @end example
  2396. @noindent
  2397. The most important commands to work with TODO entries are:
  2398. @table @kbd
  2399. @kindex C-c C-t
  2400. @cindex cycling, of TODO states
  2401. @item C-c C-t
  2402. Rotate the TODO state of the current item among
  2403. @example
  2404. ,-> (unmarked) -> TODO -> DONE --.
  2405. '--------------------------------'
  2406. @end example
  2407. The same rotation can also be done ``remotely'' from the timeline and
  2408. agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
  2409. @kindex C-u C-c C-t
  2410. @item C-u C-c C-t
  2411. Select a specific keyword using completion or (if it has been set up)
  2412. the fast selection interface. For the latter, you need to assign keys
  2413. to TODO states, see @ref{Per-file keywords} and @ref{Setting tags} for
  2414. more information.
  2415. @kindex S-@key{right}
  2416. @kindex S-@key{left}
  2417. @item S-@key{right}
  2418. @itemx S-@key{left}
  2419. Select the following/preceding TODO state, similar to cycling. Useful
  2420. mostly if more than two TODO states are possible (@pxref{TODO
  2421. extensions}).
  2422. @kindex C-c C-v
  2423. @kindex C-c / t
  2424. @cindex sparse tree, for TODO
  2425. @item C-c C-v
  2426. @itemx C-c / t
  2427. View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
  2428. the entire buffer, but shows all TODO items and the headings hierarchy
  2429. above them. With a prefix argument, search for a specific TODO. You will be
  2430. prompted for the keyword, and you can also give a list of keywords like
  2431. @code{KWD1|KWD2|...}. With numeric prefix argument N, show the tree for the
  2432. Nth keyword in the variable @code{org-todo-keywords}. With two prefix
  2433. arguments, find all TODO and DONE entries.
  2434. @kindex C-c a t
  2435. @item C-c a t
  2436. Show the global TODO list. Collects the TODO items from all agenda
  2437. files (@pxref{Agenda Views}) into a single buffer. The new buffer will
  2438. be in @code{agenda-mode}, which provides commands to examine and
  2439. manipulate the TODO entries from the new buffer (@pxref{Agenda
  2440. commands}). @xref{Global TODO list}, for more information.
  2441. @kindex S-M-@key{RET}
  2442. @item S-M-@key{RET}
  2443. Insert a new TODO entry below the current one.
  2444. @end table
  2445. @node TODO extensions, Progress logging, TODO basics, TODO Items
  2446. @section Extended use of TODO keywords
  2447. @cindex extended TODO keywords
  2448. By default, marked TODO entries have one of only two states: TODO and
  2449. DONE. Org mode allows you to classify TODO items in more complex ways
  2450. with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
  2451. special setup, the TODO keyword system can work differently in different
  2452. files.
  2453. Note that @i{tags} are another way to classify headlines in general and
  2454. TODO items in particular (@pxref{Tags}).
  2455. @menu
  2456. * Workflow states:: From TODO to DONE in steps
  2457. * TODO types:: I do this, Fred does the rest
  2458. * Multiple sets in one file:: Mixing it all, and still finding your way
  2459. * Fast access to TODO states:: Single letter selection of a state
  2460. * Per-file keywords:: Different files, different requirements
  2461. * Faces for TODO keywords:: Highlighting states
  2462. @end menu
  2463. @node Workflow states, TODO types, TODO extensions, TODO extensions
  2464. @subsection TODO keywords as workflow states
  2465. @cindex TODO workflow
  2466. @cindex workflow states as TODO keywords
  2467. You can use TODO keywords to indicate different @emph{sequential} states
  2468. in the process of working on an item, for example@footnote{Changing
  2469. this variable only becomes effective after restarting Org mode in a
  2470. buffer.}:
  2471. @lisp
  2472. (setq org-todo-keywords
  2473. '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
  2474. @end lisp
  2475. The vertical bar separates the TODO keywords (states that @emph{need
  2476. action}) from the DONE states (which need @emph{no further action}). If
  2477. you don't provide the separator bar, the last state is used as the DONE
  2478. state.
  2479. @cindex completion, of TODO keywords
  2480. With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
  2481. to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
  2482. also use a numeric prefix argument to quickly select a specific state. For
  2483. example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
  2484. Or you can use @kbd{S-left} to go backward through the sequence. If you
  2485. define many keywords, you can use in-buffer completion
  2486. (@pxref{Completion}) or even a special one-key selection scheme
  2487. (@pxref{Fast access to TODO states}) to insert these words into the
  2488. buffer. Changing a TODO state can be logged with a timestamp, see
  2489. @ref{Tracking TODO state changes} for more information.
  2490. @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
  2491. @subsection TODO keywords as types
  2492. @cindex TODO types
  2493. @cindex names as TODO keywords
  2494. @cindex types as TODO keywords
  2495. The second possibility is to use TODO keywords to indicate different
  2496. @emph{types} of action items. For example, you might want to indicate
  2497. that items are for ``work'' or ``home''. Or, when you work with several
  2498. people on a single project, you might want to assign action items
  2499. directly to persons, by using their names as TODO keywords. This would
  2500. be set up like this:
  2501. @lisp
  2502. (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
  2503. @end lisp
  2504. In this case, different keywords do not indicate a sequence, but rather
  2505. different types. So the normal work flow would be to assign a task to a
  2506. person, and later to mark it DONE. Org mode supports this style by adapting
  2507. the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
  2508. @kbd{t} command in the timeline and agenda buffers.}. When used several
  2509. times in succession, it will still cycle through all names, in order to first
  2510. select the right type for a task. But when you return to the item after some
  2511. time and execute @kbd{C-c C-t} again, it will switch from any name directly
  2512. to DONE. Use prefix arguments or completion to quickly select a specific
  2513. name. You can also review the items of a specific TODO type in a sparse tree
  2514. by using a numeric prefix to @kbd{C-c C-v}. For example, to see all things
  2515. Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect Lucy's items
  2516. from all agenda files into a single buffer, you would use the numeric prefix
  2517. argument as well when creating the global TODO list: @kbd{C-3 C-c t}.
  2518. @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
  2519. @subsection Multiple keyword sets in one file
  2520. @cindex TODO keyword sets
  2521. Sometimes you may want to use different sets of TODO keywords in
  2522. parallel. For example, you may want to have the basic
  2523. @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
  2524. separate state indicating that an item has been canceled (so it is not
  2525. DONE, but also does not require action). Your setup would then look
  2526. like this:
  2527. @lisp
  2528. (setq org-todo-keywords
  2529. '((sequence "TODO" "|" "DONE")
  2530. (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
  2531. (sequence "|" "CANCELED")))
  2532. @end lisp
  2533. The keywords should all be different, this helps Org mode to keep track
  2534. of which subsequence should be used for a given entry. In this setup,
  2535. @kbd{C-c C-t} only operates within a subsequence, so it switches from
  2536. @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
  2537. (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
  2538. select the correct sequence. Besides the obvious ways like typing a
  2539. keyword or using completion, you may also apply the following commands:
  2540. @table @kbd
  2541. @kindex C-S-@key{right}
  2542. @kindex C-S-@key{left}
  2543. @item C-S-@key{right}
  2544. @itemx C-S-@key{left}
  2545. These keys jump from one TODO subset to the next. In the above example,
  2546. @kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
  2547. @code{REPORT}, and any of the words in the second row to @code{CANCELED}.
  2548. @kindex S-@key{right}
  2549. @kindex S-@key{left}
  2550. @item S-@key{right}
  2551. @itemx S-@key{left}
  2552. @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
  2553. @emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
  2554. would switch from @code{DONE} to @code{REPORT} in the example above.
  2555. @end table
  2556. @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
  2557. @subsection Fast access to TODO states
  2558. If you would like to quickly change an entry to an arbitrary TODO state
  2559. instead of cycling through the states, you can set up keys for
  2560. single-letter access to the states. This is done by adding the section
  2561. key after each keyword, in parenthesis. For example:
  2562. @lisp
  2563. (setq org-todo-keywords
  2564. '((sequence "TODO(t)" "|" "DONE(d)")
  2565. (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
  2566. (sequence "|" "CANCELED(c)")))
  2567. @end lisp
  2568. If you then press @code{C-u C-c C-t} followed by the selection key, the
  2569. entry will be switched to this state. @key{SPC} can be used to remove
  2570. any TODO keyword from an entry. Should you like this way of selecting
  2571. TODO states a lot, you might want to set the variable
  2572. @code{org-use-fast-todo-selection} to @code{t} and make this behavior
  2573. the default. Check also the variable
  2574. @code{org-fast-tag-selection-include-todo}, it allows to change the TODO
  2575. state through the tags interface (@pxref{Setting tags}), in case you
  2576. like to mingle the two concepts.
  2577. @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
  2578. @subsection Setting up keywords for individual files
  2579. @cindex keyword options
  2580. @cindex per-file keywords
  2581. It can be very useful to use different aspects of the TODO mechanism in
  2582. different files. For file-local settings, you need to add special lines
  2583. to the file which set the keywords and interpretation for that file
  2584. only. For example, to set one of the two examples discussed above, you
  2585. need one of the following lines, starting in column zero anywhere in the
  2586. file:
  2587. @example
  2588. #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
  2589. @end example
  2590. or
  2591. @example
  2592. #+TYP_TODO: Fred Sara Lucy Mike | DONE
  2593. @end example
  2594. A setup for using several sets in parallel would be:
  2595. @example
  2596. #+SEQ_TODO: TODO | DONE
  2597. #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
  2598. #+SEQ_TODO: | CANCELED
  2599. @end example
  2600. @cindex completion, of option keywords
  2601. @kindex M-@key{TAB}
  2602. @noindent To make sure you are using the correct keyword, type
  2603. @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
  2604. @cindex DONE, final TODO keyword
  2605. Remember that the keywords after the vertical bar (or the last keyword
  2606. if no bar is there) must always mean that the item is DONE (although you
  2607. may use a different word). After changing one of these lines, use
  2608. @kbd{C-c C-c} with the cursor still in the line to make the changes
  2609. known to Org mode@footnote{Org mode parses these lines only when
  2610. Org mode is activated after visiting a file. @kbd{C-c C-c} with the
  2611. cursor in a line starting with @samp{#+} is simply restarting Org mode
  2612. for the current buffer.}.
  2613. @node Faces for TODO keywords, , Per-file keywords, TODO extensions
  2614. @subsection Faces for TODO keywords
  2615. @cindex faces, for TODO keywords
  2616. Org mode highlights TODO keywords with special faces: @code{org-todo}
  2617. for keywords indicating that an item still has to be acted upon, and
  2618. @code{org-done} for keywords indicating that an item is finished. If
  2619. you are using more than 2 different states, you might want to use
  2620. special faces for some of them. This can be done using the variable
  2621. @code{org-todo-keyword-faces}. For example:
  2622. @lisp
  2623. (setq org-todo-keyword-faces
  2624. '(("TODO" . org-warning)
  2625. ("DEFERRED" . shadow)
  2626. ("CANCELED" . (:foreground "blue" :weight bold))))
  2627. @end lisp
  2628. While using a list with face properties as shown for CANCELED
  2629. @emph{should} work, this does not aways seem to be the case. If
  2630. necessary, define a special face and use that.
  2631. @page
  2632. @node Progress logging, Priorities, TODO extensions, TODO Items
  2633. @section Progress logging
  2634. @cindex progress logging
  2635. @cindex logging, of progress
  2636. Org mode can automatically record a time stamp and possibly a note when
  2637. you mark a TODO item as DONE, or even each time you change the state of
  2638. a TODO item. This system is highly configurable, settings can be on a
  2639. per-keyword basis and can be localized to a file or even a subtree. For
  2640. information on how to clock working time for a task, see @ref{Clocking
  2641. work time}.
  2642. @menu
  2643. * Closing items:: When was this entry marked DONE?
  2644. * Tracking TODO state changes:: When did the status change?
  2645. @end menu
  2646. @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
  2647. @subsection Closing items
  2648. The most basic logging is to keep track of @emph{when} a certain TODO
  2649. item was finished. This is achieved with@footnote{The corresponding
  2650. in-buffer setting is: @code{#+STARTUP: logdone}}.
  2651. @lisp
  2652. (setq org-log-done 'time)
  2653. @end lisp
  2654. @noindent
  2655. Then each time you turn an entry from a TODO (not-done) state into any
  2656. of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
  2657. just after the headline. If you turn the entry back into a TODO item
  2658. through further state cycling, that line will be removed again. If you
  2659. want to record a note along with the timestamp, use@footnote{The
  2660. corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
  2661. @lisp
  2662. (setq org-log-done 'note)
  2663. @end lisp
  2664. @noindent
  2665. You will then be prompted for a note, and that note will be stored below
  2666. the entry with a @samp{Closing Note} heading.
  2667. In the timeline (@pxref{Timeline}) and in the agenda
  2668. (@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
  2669. display the TODO items with a @samp{CLOSED} timestamp on each day,
  2670. giving you an overview of what has been done.
  2671. @node Tracking TODO state changes, , Closing items, Progress logging
  2672. @subsection Tracking TODO state changes
  2673. When TODO keywords are used as workflow states (@pxref{Workflow
  2674. states}), you might want to keep track of when a state change occurred
  2675. and maybe take a note about this change. Since it is normally too much
  2676. to record a note for every state, Org mode expects configuration on a
  2677. per-keyword basis for this. This is achieved by adding special markers
  2678. @samp{!} (for a time stamp) and @samp{@@} (for a note) in parenthesis
  2679. after each keyword. For example, with the setting
  2680. @lisp
  2681. (setq org-todo-keywords
  2682. '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
  2683. @end lisp
  2684. @noindent
  2685. you not only define global TODO keywords and fast access keys, but also
  2686. request that a time is recorded when the entry is turned into
  2687. DONE@footnote{It is possible that Org mode will record two time stamps
  2688. when you are using both @code{org-log-done} and state change logging.
  2689. However, it will never prompt for two notes - if you have configured
  2690. both, the state change recording note will take precedence and cancel
  2691. the @samp{Closing Note}.}, and that a note is recorded when switching to
  2692. WAIT or CANCELED. The setting for WAIT is even more special: The
  2693. @samp{!} after the slash means that in addition to the note taken when
  2694. entering the state, a time stamp should be recorded when @i{leaving} the
  2695. WAIT state, if and only if the @i{target} state does not configure
  2696. logging for entering it. So it has no effect when switching from WAIT
  2697. to DONE, because DONE is configured to record a timestamp only. But
  2698. when switching from WAIT back to TODO, the @samp{/!} in the WAIT
  2699. setting now triggers a timestamp even though TODO has no logging
  2700. configured.
  2701. You can use the exact same syntax for setting logging preferences local
  2702. to a buffer:
  2703. @example
  2704. #+SEQ_TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
  2705. @end example
  2706. In order to define logging settings that are local to a subtree or a
  2707. single item, define a LOGGING property in this entry. Any non-empty
  2708. LOGGING property resets all logging settings to nil. You may then turn
  2709. on logging for this specific tree using STARTUP keywords like
  2710. @code{lognotedone} or @code{logrepeat}, as well as adding state specific
  2711. settings like @code{TODO(!)}. For example
  2712. @example
  2713. * TODO Log each state with only a time
  2714. :PROPERTIES:
  2715. :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
  2716. :END:
  2717. * TODO Only log when switching to WAIT, and when repeating
  2718. :PROPERTIES:
  2719. :LOGGING: WAIT(@@) logrepeat
  2720. :END:
  2721. * TODO No logging at all
  2722. :PROPERTIES:
  2723. :LOGGING: nil
  2724. :END:
  2725. @end example
  2726. @node Priorities, Breaking down tasks, Progress logging, TODO Items
  2727. @section Priorities
  2728. @cindex priorities
  2729. If you use Org mode extensively, you may end up enough TODO items that
  2730. it starts to make sense to prioritize them. Prioritizing can be done by
  2731. placing a @emph{priority cookie} into the headline of a TODO item, like
  2732. this
  2733. @example
  2734. *** TODO [#A] Write letter to Sam Fortune
  2735. @end example
  2736. @noindent
  2737. By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
  2738. @samp{C}. @samp{A} is the highest priority. An entry without a cookie
  2739. is treated as priority @samp{B}. Priorities make a difference only in
  2740. the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have
  2741. no inherent meaning to Org mode.
  2742. Priorities can be attached to any outline tree entries; they do not need
  2743. to be TODO items.
  2744. @table @kbd
  2745. @kindex @kbd{C-c ,}
  2746. @item @kbd{C-c ,}
  2747. Set the priority of the current headline. The command prompts for a
  2748. priority character @samp{A}, @samp{B} or @samp{C}. When you press
  2749. @key{SPC} instead, the priority cookie is removed from the headline.
  2750. The priorities can also be changed ``remotely'' from the timeline and
  2751. agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
  2752. @c
  2753. @kindex S-@key{up}
  2754. @kindex S-@key{down}
  2755. @item S-@key{up}
  2756. @itemx S-@key{down}
  2757. Increase/decrease priority of current headline@footnote{See also the
  2758. option @code{org-priority-start-cycle-with-default'}.}. Note that these
  2759. keys are also used to modify time stamps (@pxref{Creating timestamps}).
  2760. Furthermore, these keys are also used by CUA mode (@pxref{Conflicts}).
  2761. @end table
  2762. You can change the range of allowed priorities by setting the variables
  2763. @code{org-highest-priority}, @code{org-lowest-priority}, and
  2764. @code{org-default-priority}. For an individual buffer, you may set
  2765. these values (highest, lowest, default) like this (please make sure that
  2766. the highest priority is earlier in the alphabet than the lowest
  2767. priority):
  2768. @example
  2769. #+PRIORITIES: A C B
  2770. @end example
  2771. @node Breaking down tasks, Checkboxes, Priorities, TODO Items
  2772. @section Breaking tasks down into subtasks
  2773. @cindex tasks, breaking down
  2774. It is often advisable to break down large tasks into smaller, manageable
  2775. subtasks. You can do this by creating an outline tree below a TODO item,
  2776. with detailed subtasks on the tree@footnote{To keep subtasks out of the
  2777. global TODO list, see the @code{org-agenda-todo-list-sublevels}.}. To keep
  2778. the overview over the fraction of subtasks that are already completed, insert
  2779. either @samp{[/]} or @samp{[%]} anywhere in the headline. These cookies will
  2780. be updates each time the todo status of a child changes. For example:
  2781. @example
  2782. * Organize Party [33%]
  2783. ** TODO Call people [1/2]
  2784. *** TODO Peter
  2785. *** DONE Sarah
  2786. ** TODO Buy food
  2787. ** DONE Talk to neighbor
  2788. @end example
  2789. If you would like a TODO entry to automatically change to DONE when all
  2790. chilrden are done, you can use the following setup:
  2791. @example
  2792. (defun org-summary-todo (n-done n-not-done)
  2793. "Switch entry to DONE when all subentries are done, to TODO otherwise."
  2794. (let (org-log-done org-log-states) ; turn off logging
  2795. (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
  2796. (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
  2797. @end example
  2798. Another possibility is the use of checkboxes to identify (a hierarchy of) a
  2799. large number of subtasks (@pxref{Checkboxes}).
  2800. @node Checkboxes, , Breaking down tasks, TODO Items
  2801. @section Checkboxes
  2802. @cindex checkboxes
  2803. Every item in a plain list (@pxref{Plain lists}) can be made into a
  2804. checkbox by starting it with the string @samp{[ ]}. This feature is
  2805. similar to TODO items (@pxref{TODO Items}), but is more lightweight.
  2806. Checkboxes are not included into the global TODO list, so they are often
  2807. great to split a task into a number of simple steps. Or you can use
  2808. them in a shopping list. To toggle a checkbox, use @kbd{C-c C-c}, or
  2809. use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}).
  2810. Here is an example of a checkbox list.
  2811. @example
  2812. * TODO Organize party [2/4]
  2813. - [-] call people [1/3]
  2814. - [ ] Peter
  2815. - [X] Sarah
  2816. - [ ] Sam
  2817. - [X] order food
  2818. - [ ] think about what music to play
  2819. - [X] talk to the neighbors
  2820. @end example
  2821. Checkboxes work hierarchically, so if a checkbox item has children that
  2822. are checkboxes, toggling one of the children checkboxes will make the
  2823. parent checkbox reflect if none, some, or all of the children are
  2824. checked.
  2825. @cindex statistics, for checkboxes
  2826. @cindex checkbox statistics
  2827. The @samp{[2/4]} and @samp{[1/3]} in the first and second line are
  2828. cookies indicating how many checkboxes present in this entry have been
  2829. checked off, and the total number of checkboxes are present. This can
  2830. give you an idea on how many checkboxes remain, even without opening a
  2831. folded entry. The cookies can be placed into a headline or into (the
  2832. first line of) a plain list item. Each cookie covers all checkboxes
  2833. structurally below the headline/item on which the cookie appear. You
  2834. have to insert the cookie yourself by typing either @samp{[/]} or
  2835. @samp{[%]}. With @samp{[/]} you get an @samp{n out of m} result, as in
  2836. the examples above. With @samp{[%]} you get information about the
  2837. percentage of checkboxes checked (in the above example, this would be
  2838. @samp{[50%]} and @samp{[33%]}, respectively).
  2839. @noindent The following commands work with checkboxes:
  2840. @table @kbd
  2841. @kindex C-c C-c
  2842. @item C-c C-c
  2843. Toggle checkbox at point. With a prefix argument, set it to @samp{[-]},
  2844. which is considered to be an intermediate state.
  2845. @kindex C-c C-x C-b
  2846. @item C-c C-x C-b
  2847. Toggle checkbox at point.
  2848. @itemize @minus
  2849. @item
  2850. If there is an active region, toggle the first checkbox in the region
  2851. and set all remaining boxes to the same status as the first. If you
  2852. want to toggle all boxes in the region independently, use a prefix
  2853. argument.
  2854. @item
  2855. If the cursor is in a headline, toggle checkboxes in the region between
  2856. this headline and the next (so @emph{not} the entire subtree).
  2857. @item
  2858. If there is no active region, just toggle the checkbox at point.
  2859. @end itemize
  2860. @kindex M-S-@key{RET}
  2861. @item M-S-@key{RET}
  2862. Insert a new item with a checkbox.
  2863. This works only if the cursor is already in a plain list item
  2864. (@pxref{Plain lists}).
  2865. @kindex C-c #
  2866. @item C-c #
  2867. Update the checkbox statistics in the current outline entry. When
  2868. called with a @kbd{C-u} prefix, update the entire file. Checkbox
  2869. statistic cookies are updated automatically if you toggle checkboxes
  2870. with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}. If you
  2871. delete boxes or add/change them by hand, use this command to get things
  2872. back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
  2873. @end table
  2874. @node Tags, Properties and Columns, TODO Items, Top
  2875. @chapter Tags
  2876. @cindex tags
  2877. @cindex headline tagging
  2878. @cindex matching, tags
  2879. @cindex sparse tree, tag based
  2880. An excellent way to implement labels and contexts for cross-correlating
  2881. information is to assign @i{tags} to headlines. Org mode has extensive
  2882. support for tags.
  2883. Every headline can contain a list of tags; they occur at the end of the
  2884. headline. Tags are normal words containing letters, numbers, @samp{_},
  2885. and @samp{@@}. Tags must be preceded and followed by a single colon,
  2886. e.g., @samp{:work:}. Several tags can be specified, as in
  2887. @samp{:work:urgent:}.
  2888. @menu
  2889. * Tag inheritance:: Tags use the tree structure of the outline
  2890. * Setting tags:: How to assign tags to a headline
  2891. * Tag searches:: Searching for combinations of tags
  2892. @end menu
  2893. @node Tag inheritance, Setting tags, Tags, Tags
  2894. @section Tag inheritance
  2895. @cindex tag inheritance
  2896. @cindex inheritance, of tags
  2897. @cindex sublevels, inclusion into tags match
  2898. @i{Tags} make use of the hierarchical structure of outline trees. If a
  2899. heading has a certain tag, all subheadings will inherit the tag as
  2900. well. For example, in the list
  2901. @example
  2902. * Meeting with the French group :work:
  2903. ** Summary by Frank :boss:notes:
  2904. *** TODO Prepare slides for him :action:
  2905. @end example
  2906. @noindent
  2907. the final heading will have the tags @samp{:work:}, @samp{:boss:},
  2908. @samp{:notes:}, and @samp{:action:} even though the final heading is not
  2909. explicitly marked with those tags. You can also set tags that all entries in
  2910. a file should inherit as if these tags would be defined in a hypothetical
  2911. level zero that surounds the entire file.
  2912. @example
  2913. #+FILETAGS: :Peter:Boss:Secret:
  2914. @end example
  2915. @noindent
  2916. To limit tag inheritance to specific tags, or to turn it off entirely, use
  2917. the variable @code{org-use-tag-inheritance}.
  2918. When a headline matches during a tags search while tag inheritance is turned
  2919. on, all the sublevels in the same tree will match as well@footnote{This is
  2920. only true if the the search does not involve more complex tests including
  2921. properties (@pxref{Property searches}).}. The list of matches may then
  2922. become very long. If you only want to see the first tags match in a subtree,
  2923. configure the variable @code{org-tags-match-list-sublevels}.
  2924. @node Setting tags, Tag searches, Tag inheritance, Tags
  2925. @section Setting tags
  2926. @cindex setting tags
  2927. @cindex tags, setting
  2928. @kindex M-@key{TAB}
  2929. Tags can simply be typed into the buffer at the end of a headline.
  2930. After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
  2931. also a special command for inserting tags:
  2932. @table @kbd
  2933. @kindex C-c C-c
  2934. @item C-c C-c
  2935. @cindex completion, of tags
  2936. Enter new tags for the current headline. Org mode will either offer
  2937. completion or a special single-key interface for setting tags, see
  2938. below. After pressing @key{RET}, the tags will be inserted and aligned
  2939. to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
  2940. tags in the current buffer will be aligned to that column, just to make
  2941. things look nice. TAGS are automatically realigned after promotion,
  2942. demotion, and TODO state changes (@pxref{TODO basics}).
  2943. @end table
  2944. Org will support tag insertion based on a @emph{list of tags}. By
  2945. default this list is constructed dynamically, containing all tags
  2946. currently used in the buffer. You may also globally specify a hard list
  2947. of tags with the variable @code{org-tag-alist}. Finally you can set
  2948. the default tags for a given file with lines like
  2949. @example
  2950. #+TAGS: @@work @@home @@tennisclub
  2951. #+TAGS: laptop car pc sailboat
  2952. @end example
  2953. If you have globally defined your preferred set of tags using the
  2954. variable @code{org-tag-alist}, but would like to use a dynamic tag list
  2955. in a specific file, add an empty TAGS option line to that file:
  2956. @example
  2957. #+TAGS:
  2958. @end example
  2959. By default Org mode uses the standard minibuffer completion facilities for
  2960. entering tags. However, it also implements another, quicker, tag selection
  2961. method called @emph{fast tag selection}. This allows you to select and
  2962. deselect tags with just a single key press. For this to work well you should
  2963. assign unique letters to most of your commonly used tags. You can do this
  2964. globally by configuring the variable @code{org-tag-alist} in your
  2965. @file{.emacs} file. For example, you may find the need to tag many items in
  2966. different files with @samp{:@@home:}. In this case you can set something
  2967. like:
  2968. @lisp
  2969. (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
  2970. @end lisp
  2971. @noindent If the tag is only relevant to the file you are working on then you
  2972. can, instead, set the TAGS option line as:
  2973. @example
  2974. #+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
  2975. @end example
  2976. @noindent
  2977. You can also group together tags that are mutually exclusive. By using
  2978. braces, as in:
  2979. @example
  2980. #+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
  2981. @end example
  2982. @noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
  2983. and @samp{@@tennisclub} should be selected. Multiple such groups are allowed.
  2984. @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
  2985. these lines to activate any changes.
  2986. @noindent
  2987. To set these mutually exclusive groups in the variable @code{org-mode-alist}
  2988. you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
  2989. of the braces. The previous example would be set globally by the following
  2990. configuration:
  2991. @lisp
  2992. (setq org-tag-alist '((:startgroup . nil)
  2993. ("@@work" . ?w) ("@@home" . ?h)
  2994. ("@@tennisclub" . ?t)
  2995. (:endgroup . nil)
  2996. ("laptop" . ?l) ("pc" . ?p)))
  2997. @end lisp
  2998. If at least one tag has a selection key then pressing @kbd{C-c C-c} will
  2999. automatically present you with a special interface, listing inherited tags,
  3000. the tags of the current headline, and a list of all valid tags with
  3001. corresponding keys@footnote{Keys will automatically be assigned to tags which
  3002. have no configured keys.}. In this interface, you can use the following
  3003. keys:
  3004. @table @kbd
  3005. @item a-z...
  3006. Pressing keys assigned to tags will add or remove them from the list of
  3007. tags in the current line. Selecting a tag in a group of mutually
  3008. exclusive tags will turn off any other tags from that group.
  3009. @kindex @key{TAB}
  3010. @item @key{TAB}
  3011. Enter a tag in the minibuffer, even if the tag is not in the predefined
  3012. list. You will be able to complete on all tags present in the buffer.
  3013. @kindex @key{SPC}
  3014. @item @key{SPC}
  3015. Clear all tags for this line.
  3016. @kindex @key{RET}
  3017. @item @key{RET}
  3018. Accept the modified set.
  3019. @item C-g
  3020. Abort without installing changes.
  3021. @item q
  3022. If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
  3023. @item !
  3024. Turn off groups of mutually exclusive tags. Use this to (as an
  3025. exception) assign several tags from such a group.
  3026. @item C-c
  3027. Toggle auto-exit after the next change (see below).
  3028. If you are using expert mode, the first @kbd{C-c} will display the
  3029. selection window.
  3030. @end table
  3031. @noindent
  3032. This method lets you assign tags to a headline with very few keys. With
  3033. the above setup, you could clear the current tags and set @samp{@@home},
  3034. @samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
  3035. C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to
  3036. @samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
  3037. alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
  3038. @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
  3039. @key{RET} @key{RET}}.
  3040. If you find that most of the time, you need only a single key press to
  3041. modify your list of tags, set the variable
  3042. @code{org-fast-tag-selection-single-key}. Then you no longer have to
  3043. press @key{RET} to exit fast tag selection - it will immediately exit
  3044. after the first change. If you then occasionally need more keys, press
  3045. @kbd{C-c} to turn off auto-exit for the current tag selection process
  3046. (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
  3047. C-c}). If you set the variable to the value @code{expert}, the special
  3048. window is not even shown for single-key tag selection, it comes up only
  3049. when you press an extra @kbd{C-c}.
  3050. @node Tag searches, , Setting tags, Tags
  3051. @section Tag searches
  3052. @cindex tag searches
  3053. @cindex searching for tags
  3054. Once a system of tags has been set up, it can be used to collect related
  3055. information into special lists.
  3056. @table @kbd
  3057. @kindex C-c \
  3058. @kindex C-c / T
  3059. @item C-c \
  3060. @itemx C-c / T
  3061. Create a sparse tree with all headlines matching a tags search. With a
  3062. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  3063. @kindex C-c a m
  3064. @item C-c a m
  3065. Create a global list of tag matches from all agenda files.
  3066. @xref{Matching tags and properties}.
  3067. @kindex C-c a M
  3068. @item C-c a M
  3069. Create a global list of tag matches from all agenda files, but check
  3070. only TODO items and force checking subitems (see variable
  3071. @code{org-tags-match-list-sublevels}).
  3072. @end table
  3073. @cindex Boolean logic, for tag searches
  3074. A @i{tags} search string can use Boolean operators @samp{&} for AND and
  3075. @samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
  3076. Parenthesis are currently not implemented. A tag may also be preceded
  3077. by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
  3078. positive selection. The AND operator @samp{&} is optional when @samp{+}
  3079. or @samp{-} is present. Examples:
  3080. @table @samp
  3081. @item +work-boss
  3082. Select headlines tagged @samp{:work:}, but discard those also tagged
  3083. @samp{:boss:}.
  3084. @item work|laptop
  3085. Selects lines tagged @samp{:work:} or @samp{:laptop:}.
  3086. @item work|laptop&night
  3087. Like before, but require the @samp{:laptop:} lines to be tagged also
  3088. @samp{:night:}.
  3089. @end table
  3090. @cindex TODO keyword matching, with tags search
  3091. If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
  3092. can be useful to also match on the TODO keyword. This can be done by
  3093. adding a condition after a slash to a tags match. The syntax is similar
  3094. to the tag matches, but should be applied with consideration: For
  3095. example, a positive selection on several TODO keywords can not
  3096. meaningfully be combined with boolean AND. However, @emph{negative
  3097. selection} combined with AND can be meaningful. To make sure that only
  3098. lines are checked that actually have any TODO keyword, use @kbd{C-c a
  3099. M}, or equivalently start the TODO part after the slash with @samp{!}.
  3100. Examples:
  3101. @table @samp
  3102. @item work/WAITING
  3103. Select @samp{:work:}-tagged TODO lines with the specific TODO
  3104. keyword @samp{WAITING}.
  3105. @item work/!-WAITING-NEXT
  3106. Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
  3107. nor @samp{NEXT}
  3108. @item work/+WAITING|+NEXT
  3109. Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
  3110. @samp{NEXT}.
  3111. @end table
  3112. @cindex regular expressions, with tags search
  3113. Any element of the tag/todo match can be a regular expression - in this
  3114. case it must be enclosed in curly braces. For example,
  3115. @samp{work+@{^boss.*@}} matches headlines that contain the tag
  3116. @samp{:work:} and any tag @i{starting} with @samp{boss}.
  3117. @cindex level, require for tags/property match
  3118. @cindex category, require for tags/property match
  3119. You can also require a headline to be of a certain level or category, by
  3120. writing instead of any TAG an expression like @samp{LEVEL=3} or
  3121. @samp{CATEGORY="work"}, respectively. For example, a search
  3122. @samp{+LEVEL=3+boss/-DONE} lists all level three headlines that have the
  3123. tag @samp{boss} and are @emph{not} marked with the TODO keyword DONE.
  3124. @node Properties and Columns, Dates and Times, Tags, Top
  3125. @chapter Properties and Columns
  3126. @cindex properties
  3127. Properties are a set of key-value pairs associated with an entry. There
  3128. are two main applications for properties in Org mode. First, properties
  3129. are like tags, but with a value. Second, you can use properties to
  3130. implement (very basic) database capabilities in an Org buffer. For
  3131. an example of the first application, imagine maintaining a file where
  3132. you document bugs and plan releases of a piece of software. Instead of
  3133. using tags like @code{:release_1:}, @code{:release_2:}, one can use a
  3134. property, say @code{:Release:}, that in different subtrees has different
  3135. values, such as @code{1.0} or @code{2.0}. For an example of the second
  3136. application of properties, imagine keeping track of your music CD's,
  3137. where properties could be things such as the album artist, date of
  3138. release, number of tracks, and so on.
  3139. Properties can be conveniently edited and viewed in column view
  3140. (@pxref{Column view}).
  3141. Properties are like tags, but with a value. For example, in a file
  3142. where you document bugs and plan releases of a piece of software,
  3143. instead of using tags like @code{:release_1:}, @code{:release_2:}, it
  3144. can be more efficient to use a property @code{:Release:} with a value
  3145. @code{1.0} or @code{2.0}. Second, you can use properties to implement
  3146. (very basic) database capabilities in an Org buffer, for example to
  3147. create a list of Music CD's you own. You can edit and view properties
  3148. conveniently in column view (@pxref{Column view}).
  3149. @menu
  3150. * Property syntax:: How properties are spelled out
  3151. * Special properties:: Access to other Org mode features
  3152. * Property searches:: Matching property values
  3153. * Property inheritance:: Passing values down the tree
  3154. * Column view:: Tabular viewing and editing
  3155. * Property API:: Properties for Lisp programmers
  3156. @end menu
  3157. @node Property syntax, Special properties, Properties and Columns, Properties and Columns
  3158. @section Property syntax
  3159. @cindex property syntax
  3160. @cindex drawer, for properties
  3161. Properties are key-value pairs. They need to be inserted into a special
  3162. drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
  3163. is specified on a single line, with the key (surrounded by colons)
  3164. first, and the value after it. Here is an example:
  3165. @example
  3166. * CD collection
  3167. ** Classic
  3168. *** Goldberg Variations
  3169. :PROPERTIES:
  3170. :Title: Goldberg Variations
  3171. :Composer: J.S. Bach
  3172. :Artist: Glen Gould
  3173. :Publisher: Deutsche Grammphon
  3174. :NDisks: 1
  3175. :END:
  3176. @end example
  3177. You may define the allowed values for a particular property @samp{:Xyz:}
  3178. by setting a property @samp{:Xyz_ALL:}. This special property is
  3179. @emph{inherited}, so if you set it in a level 1 entry, it will apply to
  3180. the entire tree. When allowed values are defined, setting the
  3181. corresponding property becomes easier and is less prone to typing
  3182. errors. For the example with the CD collection, we can predefine
  3183. publishers and the number of disks in a box like this:
  3184. @example
  3185. * CD collection
  3186. :PROPERTIES:
  3187. :NDisks_ALL: 1 2 3 4
  3188. :Publisher_ALL: "Deutsche Grammophon" Phillips EMI
  3189. :END:
  3190. @end example
  3191. If you want to set properties that can be inherited by any entry in a
  3192. file, use a line like
  3193. @example
  3194. #+PROPERTY: NDisks_ALL 1 2 3 4
  3195. @end example
  3196. Property values set with the global variable
  3197. @code{org-global-properties} can be inherited by all entries in all
  3198. Org files.
  3199. @noindent
  3200. The following commands help to work with properties:
  3201. @table @kbd
  3202. @kindex M-@key{TAB}
  3203. @item M-@key{TAB}
  3204. After an initial colon in a line, complete property keys. All keys used
  3205. in the current file will be offered as possible completions.
  3206. @kindex C-c C-x p
  3207. @item C-c C-x p
  3208. Set a property. This prompts for a property name and a value. If
  3209. necessary, the property drawer is created as well.
  3210. @item M-x org-insert-property-drawer
  3211. Insert a property drawer into the current entry. The drawer will be
  3212. inserted early in the entry, but after the lines with planning
  3213. information like deadlines.
  3214. @kindex C-c C-c
  3215. @item C-c C-c
  3216. With the cursor in a property drawer, this executes property commands.
  3217. @item C-c C-c s
  3218. Set a property in the current entry. Both the property and the value
  3219. can be inserted using completion.
  3220. @kindex S-@key{right}
  3221. @kindex S-@key{left}
  3222. @item S-@key{left}/@key{right}
  3223. Switch property at point to the next/previous allowed value.
  3224. @item C-c C-c d
  3225. Remove a property from the current entry.
  3226. @item C-c C-c D
  3227. Globally remove a property, from all entries in the current file.
  3228. @item C-c C-c c
  3229. Compute the property at point, using the operator and scope from the
  3230. nearest column format definition.
  3231. @end table
  3232. @node Special properties, Property searches, Property syntax, Properties and Columns
  3233. @section Special properties
  3234. @cindex properties, special
  3235. Special properties provide alternative access method to Org mode
  3236. features discussed in the previous chapters, like the TODO state or the
  3237. priority of an entry. This interface exists so that you can include
  3238. these states into columns view (@pxref{Column view}), or to use them in
  3239. queries. The following property names are special and should not be
  3240. used as keys in the properties drawer:
  3241. @example
  3242. TODO @r{The TODO keyword of the entry.}
  3243. TAGS @r{The tags defined directly in the headline.}
  3244. ALLTAGS @r{All tags, including inherited ones.}
  3245. PRIORITY @r{The priority of the entry, a string with a single letter.}
  3246. DEADLINE @r{The deadline time string, without the angular brackets.}
  3247. SCHEDULED @r{The scheduling time stamp, without the angular brackets.}
  3248. TIMESTAMP @r{The first keyword-less time stamp in the entry.}
  3249. TIMESTAMP_IA @r{The first inactive time stamp in the entry.}
  3250. CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
  3251. @r{must be run first to compute the values.}
  3252. @end example
  3253. @node Property searches, Property inheritance, Special properties, Properties and Columns
  3254. @section Property searches
  3255. @cindex properties, searching
  3256. @cindex searching, of properties
  3257. To create sparse trees and special lists with selection based on properties,
  3258. the same commands are used as for tag searches (@pxref{Tag searches}), and
  3259. the same logic applies. For example, here is a search string:
  3260. @example
  3261. +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \
  3262. +With=@{Sarah\|Denny@}+SCHEDULED>="<2008-10-11>"
  3263. @end example
  3264. @noindent
  3265. The type of comparison will depend on how the comparison value is written:
  3266. @itemize @minus
  3267. @item
  3268. If the comparison value is a plain number, a numerical comparison is done,
  3269. and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
  3270. @samp{>=}, and @samp{<>}.
  3271. @item
  3272. If the comparison value is enclosed in double
  3273. quotes, a string comparison is done, and the same operators are allowed.
  3274. @item
  3275. If the comparison value is enclosed in double quotes @emph{and} angular
  3276. brackets (like @samp{DEADLINE<="<2008-12-24 18:30>"}), both values are
  3277. assumed to be date/time specifications in the standard Org way@footnote{The
  3278. only special values that will be recognized are @samp{"<now>"} for now, and
  3279. @samp{"<today"} today at 0:00 hours, i.e. without a time specification.}, and
  3280. the comparison will be done accordingly.
  3281. @item
  3282. If the comparison value is enclosed
  3283. in curly braces, a regexp match is performed, with @samp{=} meaning that the
  3284. regexp matches the property value, and @samp{<>} meaning that it does not
  3285. match.
  3286. @end itemize
  3287. So the search string in the example finds entries tagged @samp{:work:} but
  3288. not @samp{:boss:}, which also have a priority value @samp{A}, a
  3289. @samp{:Coffee:} property with the value @samp{unlimited}, an @samp{Effort}
  3290. property that is numerically smaller than 2, a @samp{:With:} property that is
  3291. matched by the regular expression @samp{Sarah\|Denny}, and that are scheduled
  3292. on or after October 11, 2008.
  3293. You can configure Org mode to use property inheritance during a search, but
  3294. beware that this can slow down searches considerably. See @ref{Property
  3295. inheritance} for details.
  3296. There is also a special command for creating sparse trees based on a
  3297. single property:
  3298. @table @kbd
  3299. @kindex C-c / p
  3300. @item C-c / p
  3301. Create a sparse tree based on the value of a property. This first
  3302. prompts for the name of a property, and then for a value. A sparse tree
  3303. is created with all entries that define this property with the given
  3304. value. If you enclose the value into curly braces, it is interpreted as
  3305. a regular expression and matched against the property values.
  3306. @end table
  3307. @node Property inheritance, Column view, Property searches, Properties and Columns
  3308. @section Property Inheritance
  3309. @cindex properties, inheritance
  3310. @cindex inheritance, of properties
  3311. The outline structure of Org mode documents lends itself for an
  3312. inheritance model of properties: If the parent in a tree has a certain
  3313. property, the children can inherit this property. Org mode does not
  3314. turn this on by default, because it can slow down property searches
  3315. significantly and is often not needed. However, if you find inheritance
  3316. useful, you can turn it on by setting the variable
  3317. @code{org-use-property-inheritance}. It may be set to @code{t}, to make
  3318. all properties inherited from the parent, to a list of properties
  3319. that should be inherited, or to a regular expression that matches
  3320. inherited properties.
  3321. Org mode has a few properties for which inheritance is hard-coded, at
  3322. least for the special applications for which they are used:
  3323. @table @code
  3324. @item COLUMNS
  3325. The @code{:COLUMNS:} property defines the format of column view
  3326. (@pxref{Column view}). It is inherited in the sense that the level
  3327. where a @code{:COLUMNS:} property is defined is used as the starting
  3328. point for a column view table, independently of the location in the
  3329. subtree from where columns view is turned on.
  3330. @item CATEGORY
  3331. For agenda view, a category set through a @code{:CATEGORY:} property
  3332. applies to the entire subtree.
  3333. @item ARCHIVE
  3334. For archiving, the @code{:ARCHIVE:} property may define the archive
  3335. location for the entire subtree (@pxref{Moving subtrees}).
  3336. @item LOGGING
  3337. The LOGGING property may define logging settings for an entry or a
  3338. subtree (@pxref{Tracking TODO state changes}).
  3339. @end table
  3340. @node Column view, Property API, Property inheritance, Properties and Columns
  3341. @section Column view
  3342. A great way to view and edit properties in an outline tree is
  3343. @emph{column view}. In column view, each outline item is turned into a
  3344. table row. Columns in this table provide access to properties of the
  3345. entries. Org mode implements columns by overlaying a tabular structure
  3346. over the headline of each item. While the headlines have been turned
  3347. into a table row, you can still change the visibility of the outline
  3348. tree. For example, you get a compact table by switching to CONTENTS
  3349. view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
  3350. is active), but you can still open, read, and edit the entry below each
  3351. headline. Or, you can switch to column view after executing a sparse
  3352. tree command and in this way get a table only for the selected items.
  3353. Column view also works in agenda buffers (@pxref{Agenda Views}) where
  3354. queries have collected selected items, possibly from a number of files.
  3355. @menu
  3356. * Defining columns:: The COLUMNS format property
  3357. * Using column view:: How to create and use column view
  3358. * Capturing column view:: A dynamic block for column view
  3359. @end menu
  3360. @node Defining columns, Using column view, Column view, Column view
  3361. @subsection Defining columns
  3362. @cindex column view, for properties
  3363. @cindex properties, column view
  3364. Setting up a column view first requires defining the columns. This is
  3365. done by defining a column format line.
  3366. @menu
  3367. * Scope of column definitions:: Where defined, where valid?
  3368. * Column attributes:: Appearance and content of a column
  3369. @end menu
  3370. @node Scope of column definitions, Column attributes, Defining columns, Defining columns
  3371. @subsubsection Scope of column definitions
  3372. To define a column format for an entire file, use a line like
  3373. @example
  3374. #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3375. @end example
  3376. To specify a format that only applies to a specific tree, add a
  3377. @code{:COLUMNS:} property to the top node of that tree, for example:
  3378. @example
  3379. ** Top node for columns view
  3380. :PROPERTIES:
  3381. :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3382. :END:
  3383. @end example
  3384. If a @code{:COLUMNS:} property is present in an entry, it defines columns
  3385. for the entry itself, and for the entire subtree below it. Since the
  3386. column definition is part of the hierarchical structure of the document,
  3387. you can define columns on level 1 that are general enough for all
  3388. sublevels, and more specific columns further down, when you edit a
  3389. deeper part of the tree.
  3390. @node Column attributes, , Scope of column definitions, Defining columns
  3391. @subsubsection Column attributes
  3392. A column definition sets the attributes of a column. The general
  3393. definition looks like this:
  3394. @example
  3395. %[width]property[(title)][@{summary-type@}]
  3396. @end example
  3397. @noindent
  3398. Except for the percent sign and the property name, all items are
  3399. optional. The individual parts have the following meaning:
  3400. @example
  3401. width @r{An integer specifying the width of the column in characters.}
  3402. @r{If omitted, the width will be determined automatically.}
  3403. property @r{The property that should be edited in this column.}
  3404. (title) @r{The header text for the column. If omitted, the}
  3405. @r{property name is used.}
  3406. @{summary-type@} @r{The summary type. If specified, the column values for}
  3407. @r{parent nodes are computed from the children.}
  3408. @r{Supported summary types are:}
  3409. @{+@} @r{Sum numbers in this column.}
  3410. @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.}
  3411. @{$@} @r{Currency, short for @samp{+;%.2f}.}
  3412. @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
  3413. @{X@} @r{Checkbox status, [X] if all children are [X].}
  3414. @{X/@} @r{Checkbox status, [n/m].}
  3415. @{X%@} @r{Checkbox status, [n%].}
  3416. @end example
  3417. @noindent
  3418. Here is an example for a complete columns definition, along with allowed
  3419. values.
  3420. @example
  3421. :COLUMNS: %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status \@footnote{Please note that the COLUMNS definition must be on a single line - it is wrapped here only because of formatting constraints.}
  3422. %10Time_Estimate@{:@} %CLOCKSUM
  3423. :Owner_ALL: Tammy Mark Karl Lisa Don
  3424. :Status_ALL: "In progress" "Not started yet" "Finished" ""
  3425. :Approved_ALL: "[ ]" "[X]"
  3426. @end example
  3427. The first column, @samp{%25ITEM}, means the first 25 characters of the
  3428. item itself, i.e. of the headline. You probably always should start the
  3429. column definition with the @samp{ITEM} specifier. The other specifiers
  3430. create columns @samp{Owner} with a list of names as allowed values, for
  3431. @samp{Status} with four different possible values, and for a checkbox
  3432. field @samp{Approved}. When no width is given after the @samp{%}
  3433. character, the column will be exactly as wide as it needs to be in order
  3434. to fully display all values. The @samp{Approved} column does have a
  3435. modified title (@samp{Approved?}, with a question mark). Summaries will
  3436. be created for the @samp{Time_Estimate} column by adding time duration
  3437. expressions like HH:MM, and for the @samp{Approved} column, by providing
  3438. an @samp{[X]} status if all children have been checked. The
  3439. @samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
  3440. in the subtree.
  3441. @node Using column view, Capturing column view, Defining columns, Column view
  3442. @subsection Using column view
  3443. @table @kbd
  3444. @tsubheading{Turning column view on and off}
  3445. @kindex C-c C-x C-c
  3446. @item C-c C-x C-c
  3447. Create the column view for the local environment. This command searches
  3448. the hierarchy, up from point, for a @code{:COLUMNS:} property that defines
  3449. a format. When one is found, the column view table is established for
  3450. the entire tree, starting from the entry that contains the @code{:COLUMNS:}
  3451. property. If none is found, the format is taken from the @code{#+COLUMNS}
  3452. line or from the variable @code{org-columns-default-format}, and column
  3453. view is established for the current entry and its subtree.
  3454. @kindex r
  3455. @item r
  3456. Recreate the column view, to include recent changes made in the buffer.
  3457. @kindex g
  3458. @item g
  3459. Same as @kbd{r}.
  3460. @kindex q
  3461. @item q
  3462. Exit column view.
  3463. @tsubheading{Editing values}
  3464. @item @key{left} @key{right} @key{up} @key{down}
  3465. Move through the column view from field to field.
  3466. @kindex S-@key{left}
  3467. @kindex S-@key{right}
  3468. @item S-@key{left}/@key{right}
  3469. Switch to the next/previous allowed value of the field. For this, you
  3470. have to have specified allowed values for a property.
  3471. @item 1..9,0
  3472. Directly select the nth allowed value, @kbd{0} selects the 10th value.
  3473. @kindex n
  3474. @kindex p
  3475. @itemx n / p
  3476. Same as @kbd{S-@key{left}/@key{right}}
  3477. @kindex e
  3478. @item e
  3479. Edit the property at point. For the special properties, this will
  3480. invoke the same interface that you normally use to change that
  3481. property. For example, when editing a TAGS property, the tag completion
  3482. or fast selection interface will pop up.
  3483. @kindex C-c C-c
  3484. @item C-c C-c
  3485. When there is a checkbox at point, toggle it.
  3486. @kindex v
  3487. @item v
  3488. View the full value of this property. This is useful if the width of
  3489. the column is smaller than that of the value.
  3490. @kindex a
  3491. @item a
  3492. Edit the list of allowed values for this property. If the list is found
  3493. in the hierarchy, the modified values is stored there. If no list is
  3494. found, the new value is stored in the first entry that is part of the
  3495. current column view.
  3496. @tsubheading{Modifying the table structure}
  3497. @kindex <
  3498. @kindex >
  3499. @item < / >
  3500. Make the column narrower/wider by one character.
  3501. @kindex S-M-@key{right}
  3502. @item S-M-@key{right}
  3503. Insert a new column, to the right of the current column.
  3504. @kindex S-M-@key{left}
  3505. @item S-M-@key{left}
  3506. Delete the current column.
  3507. @end table
  3508. @node Capturing column view, , Using column view, Column view
  3509. @subsection Capturing column view
  3510. Since column view is just an overlay over a buffer, it cannot be
  3511. exported or printed directly. If you want to capture a column view, use
  3512. this @code{columnview} dynamic block (@pxref{Dynamic blocks}). The frame
  3513. of this block looks like this:
  3514. @cindex #+BEGIN: columnview
  3515. @example
  3516. * The column view
  3517. #+BEGIN: columnview :hlines 1 :id "label"
  3518. #+END:
  3519. @end example
  3520. @noindent This dynamic block has the following parameters:
  3521. @table @code
  3522. @item :id
  3523. This is most important parameter. Column view is a feature that is
  3524. often localized to a certain (sub)tree, and the capture block might be
  3525. in a different location in the file. To identify the tree whose view to
  3526. capture, you can use 3 values:
  3527. @example
  3528. local @r{use the tree in which the capture block is located}
  3529. global @r{make a global view, including all headings in the file}
  3530. "label" @r{call column view in the tree that has an @code{:ID:}}
  3531. @r{property with the value @i{label}. You can use}
  3532. @r{@kbd{M-x org-id-copy} to create a globally unique ID for}
  3533. @r{the current entry and copy it to the kill-ring.}
  3534. @end example
  3535. @item :hlines
  3536. When @code{t}, insert a hline after every line. When a number N, insert
  3537. a hline before each headline with level @code{<= N}.
  3538. @item :vlines
  3539. When set to @code{t}, enforce column groups to get vertical lines.
  3540. @item :maxlevel
  3541. When set to a number, don't capture entries below this level.
  3542. @item :skip-empty-rows
  3543. When set to @code{t}, skip row where the only non-empty specifier of the
  3544. column view is @code{ITEM}.
  3545. @end table
  3546. @noindent
  3547. The following commands insert or update the dynamic block:
  3548. @table @kbd
  3549. @kindex C-c C-x i
  3550. @item C-c C-x i
  3551. Insert a dynamic block capturing a column view. You will be prompted
  3552. for the scope or id of the view.
  3553. @kindex C-c C-c
  3554. @item C-c C-c
  3555. @kindex C-c C-x C-u
  3556. @itemx C-c C-x C-u
  3557. Update dynamical block at point. The cursor needs to be in the
  3558. @code{#+BEGIN} line of the dynamic block.
  3559. @kindex C-u C-c C-x C-u
  3560. @item C-u C-c C-x C-u
  3561. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  3562. you have several clock table blocks in a buffer.
  3563. @end table
  3564. You can add formulas to the column view table and you may add plotting
  3565. instructions in front of the table - these will survive an update of the
  3566. block. If there is a @code{#+TBLFM:} after the table, the table will actually
  3567. be recalculated automatically after an update.
  3568. @node Property API, , Column view, Properties and Columns
  3569. @section The Property API
  3570. @cindex properties, API
  3571. @cindex API, for properties
  3572. There is a full API for accessing and changing properties. This API can
  3573. be used by Emacs Lisp programs to work with properties and to implement
  3574. features based on them. For more information see @ref{Using the
  3575. property API}.
  3576. @node Dates and Times, Remember, Properties and Columns, Top
  3577. @chapter Dates and Times
  3578. @cindex dates
  3579. @cindex times
  3580. @cindex time stamps
  3581. @cindex date stamps
  3582. To assist project planning, TODO items can be labeled with a date and/or
  3583. a time. The specially formatted string carrying the date and time
  3584. information is called a @emph{timestamp} in Org mode. This may be a
  3585. little confusing because timestamp is often used as indicating when
  3586. something was created or last changed. However, in Org mode this term
  3587. is used in a much wider sense.
  3588. @menu
  3589. * Timestamps:: Assigning a time to a tree entry
  3590. * Creating timestamps:: Commands which insert timestamps
  3591. * Deadlines and scheduling:: Planning your work
  3592. * Clocking work time:: Tracking how long you spend on a task
  3593. * Effort estimates:: Planning work effort in advance
  3594. @end menu
  3595. @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
  3596. @section Timestamps, deadlines and scheduling
  3597. @cindex time stamps
  3598. @cindex ranges, time
  3599. @cindex date stamps
  3600. @cindex deadlines
  3601. @cindex scheduling
  3602. A time stamp is a specification of a date (possibly with time or a range
  3603. of times) in a special format, either @samp{<2003-09-16 Tue>} or
  3604. @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
  3605. 12:00-12:30>}@footnote{This is the standard ISO date/time format. To
  3606. use an alternative format, see @ref{Custom time format}.}. A time stamp
  3607. can appear anywhere in the headline or body of an Org tree entry. Its
  3608. presence causes entries to be shown on specific dates in the agenda
  3609. (@pxref{Weekly/daily agenda}). We distinguish:
  3610. @table @var
  3611. @item Plain time stamp; Event; Appointment
  3612. @cindex timestamp
  3613. A simple time stamp just assigns a date/time to an item. This is just
  3614. like writing down an appointment or event in a paper agenda. In the
  3615. timeline and agenda displays, the headline of an entry associated with a
  3616. plain time stamp will be shown exactly on that date.
  3617. @example
  3618. * Meet Peter at the movies <2006-11-01 Wed 19:15>
  3619. * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
  3620. @end example
  3621. @item Time stamp with repeater interval
  3622. @cindex timestamp, with repeater interval
  3623. A time stamp may contain a @emph{repeater interval}, indicating that it
  3624. applies not only on the given date, but again and again after a certain
  3625. interval of N days (d), weeks (w), months(m), or years(y). The
  3626. following will show up in the agenda every Wednesday:
  3627. @example
  3628. * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
  3629. @end example
  3630. @item Diary-style sexp entries
  3631. For more complex date specifications, Org mode supports using the
  3632. special sexp diary entries implemented in the Emacs calendar/diary
  3633. package. For example
  3634. @example
  3635. * The nerd meeting on every 2nd Thursday of the month
  3636. <%%(diary-float t 4 2)>
  3637. @end example
  3638. @item Time/Date range
  3639. @cindex timerange
  3640. @cindex date range
  3641. Two time stamps connected by @samp{--} denote a range. The headline
  3642. will be shown on the first and last day of the range, and on any dates
  3643. that are displayed and fall in the range. Here is an example:
  3644. @example
  3645. ** Meeting in Amsterdam
  3646. <2004-08-23 Mon>--<2004-08-26 Thu>
  3647. @end example
  3648. @item Inactive time stamp
  3649. @cindex timestamp, inactive
  3650. @cindex inactive timestamp
  3651. Just like a plain time stamp, but with square brackets instead of
  3652. angular ones. These time stamps are inactive in the sense that they do
  3653. @emph{not} trigger an entry to show up in the agenda.
  3654. @example
  3655. * Gillian comes late for the fifth time [2006-11-01 Wed]
  3656. @end example
  3657. @end table
  3658. @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
  3659. @section Creating timestamps
  3660. @cindex creating timestamps
  3661. @cindex timestamps, creating
  3662. For Org mode to recognize time stamps, they need to be in the specific
  3663. format. All commands listed below produce time stamps in the correct
  3664. format.
  3665. @table @kbd
  3666. @kindex C-c .
  3667. @item C-c .
  3668. Prompt for a date and insert a corresponding time stamp. When the cursor is
  3669. at an existing time stamp in the buffer, the command is used to modify this
  3670. timestamp instead of inserting a new one. When this command is used twice in
  3671. succession, a time range is inserted.
  3672. @c
  3673. @kindex C-u C-c .
  3674. @item C-u C-c .
  3675. Like @kbd{C-c .}, but use the alternative format which contains date
  3676. and time. The default time can be rounded to multiples of 5 minutes,
  3677. see the option @code{org-time-stamp-rounding-minutes}.
  3678. @c
  3679. @kindex C-c !
  3680. @item C-c !
  3681. Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
  3682. an agenda entry.
  3683. @c
  3684. @kindex C-c <
  3685. @item C-c <
  3686. Insert a time stamp corresponding to the cursor date in the Calendar.
  3687. @c
  3688. @kindex C-c >
  3689. @item C-c >
  3690. Access the Emacs calendar for the current date. If there is a
  3691. timestamp in the current line, go to the corresponding date
  3692. instead.
  3693. @c
  3694. @kindex C-c C-o
  3695. @item C-c C-o
  3696. Access the agenda for the date given by the time stamp or -range at
  3697. point (@pxref{Weekly/daily agenda}).
  3698. @c
  3699. @kindex S-@key{left}
  3700. @kindex S-@key{right}
  3701. @item S-@key{left}
  3702. @itemx S-@key{right}
  3703. Change date at cursor by one day. These key bindings conflict with
  3704. CUA mode (@pxref{Conflicts}).
  3705. @c
  3706. @kindex S-@key{up}
  3707. @kindex S-@key{down}
  3708. @item S-@key{up}
  3709. @itemx S-@key{down}
  3710. Change the item under the cursor in a timestamp. The cursor can be on a
  3711. year, month, day, hour or minute. Note that if the cursor is in a
  3712. headline and not at a time stamp, these same keys modify the priority of
  3713. an item. (@pxref{Priorities}). The key bindings also conflict with
  3714. CUA mode (@pxref{Conflicts}).
  3715. @c
  3716. @kindex C-c C-y
  3717. @cindex evaluate time range
  3718. @item C-c C-y
  3719. Evaluate a time range by computing the difference between start and end.
  3720. With a prefix argument, insert result after the time range (in a table: into
  3721. the following column).
  3722. @end table
  3723. @menu
  3724. * The date/time prompt:: How Org mode helps you entering date and time
  3725. * Custom time format:: Making dates look different
  3726. @end menu
  3727. @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
  3728. @subsection The date/time prompt
  3729. @cindex date, reading in minibuffer
  3730. @cindex time, reading in minibuffer
  3731. When Org mode prompts for a date/time, the default is shown as an ISO
  3732. date, and the prompt therefore seems to ask for an ISO date. But it
  3733. will in fact accept any string containing some date and/or time
  3734. information, and it is really smart about interpreting your input. You
  3735. can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
  3736. copied from an email message. Org mode will find whatever information
  3737. is in there and derive anything you have not specified from the
  3738. @emph{default date and time}. The default is usually the current date
  3739. and time, but when modifying an existing time stamp, or when entering
  3740. the second stamp of a range, it is taken from the stamp in the buffer.
  3741. When filling in information, Org mode assumes that most of the time you
  3742. will want to enter a date in the future: If you omit the month/year and
  3743. the given day/month is @i{before} today, it will assume that you mean a
  3744. future date@footnote{See the variable
  3745. @code{org-read-date-prefer-future}.}.
  3746. For example, lets assume that today is @b{June 13, 2006}. Here is how
  3747. various inputs will be interpreted, the items filled in by Org mode are
  3748. in @b{bold}.
  3749. @example
  3750. 3-2-5 --> 2003-02-05
  3751. 14 --> @b{2006}-@b{06}-14
  3752. 12 --> @b{2006}-@b{07}-12
  3753. Fri --> nearest Friday (defaultdate or later)
  3754. sep 15 --> @b{2006}-11-15
  3755. feb 15 --> @b{2007}-02-15
  3756. sep 12 9 --> 2009-09-12
  3757. 12:45 --> @b{2006}-@b{06}-@b{13} 12:45
  3758. 22 sept 0:34 --> @b{2006}-09-22 0:34
  3759. w4 --> ISO week for of the current year @b{2006}
  3760. 2012 w4 fri --> Friday of ISO week 4 in 2012
  3761. 2012-w04-5 --> Same as above
  3762. @end example
  3763. Furthermore you can specify a relative date by giving, as the
  3764. @emph{first} thing in the input: a plus/minus sign, a number and a
  3765. letter [dwmy] to indicate change in days weeks, months, years. With a
  3766. single plus or minus, the date is always relative to today. With a
  3767. double plus or minus, it is relative to the default date. If instead of
  3768. a single letter, you use the abbreviation of day name, the date will be
  3769. the nth such day. E.g.
  3770. @example
  3771. +0 --> today
  3772. . --> today
  3773. +4d --> four days from today
  3774. +4 --> same as above
  3775. +2w --> two weeks from today
  3776. ++5 --> five days from default date
  3777. +2tue --> second tuesday from now.
  3778. @end example
  3779. The function understands English month and weekday abbreviations. If
  3780. you want to use unabbreviated names and/or other languages, configure
  3781. the variables @code{parse-time-months} and @code{parse-time-weekdays}.
  3782. @cindex calendar, for selecting date
  3783. Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
  3784. you don't need/want the calendar, configure the variable
  3785. @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
  3786. prompt, either by clicking on a date in the calendar, or by pressing
  3787. @key{RET}, the date selected in the calendar will be combined with the
  3788. information entered at the prompt. You can control the calendar fully
  3789. from the minibuffer:
  3790. @kindex <
  3791. @kindex >
  3792. @kindex mouse-1
  3793. @kindex S-@key{right}
  3794. @kindex S-@key{left}
  3795. @kindex S-@key{down}
  3796. @kindex S-@key{up}
  3797. @kindex M-S-@key{right}
  3798. @kindex M-S-@key{left}
  3799. @kindex @key{RET}
  3800. @example
  3801. > / < @r{Scroll calendar forward/backward by one month.}
  3802. mouse-1 @r{Select date by clicking on it.}
  3803. S-@key{right}/@key{left} @r{One day forward/backward.}
  3804. S-@key{down}/@key{up} @r{One week forward/backward.}
  3805. M-S-@key{right}/@key{left} @r{One month forward/backward.}
  3806. @key{RET} @r{Choose date in calendar.}
  3807. @end example
  3808. The actions of the date/time prompt may seem complex, but I assure you they
  3809. will grow on you, and you will start getting annoyed by pretty much any other
  3810. way of entering a date/time out there. To help you understand what is going
  3811. on, the current interpretation of your input will be displayed live in the
  3812. minibuffer@footnote{If you find this distracting, turn the display of with
  3813. @code{org-read-date-display-live}.}.
  3814. @node Custom time format, , The date/time prompt, Creating timestamps
  3815. @subsection Custom time format
  3816. @cindex custom date/time format
  3817. @cindex time format, custom
  3818. @cindex date format, custom
  3819. Org mode uses the standard ISO notation for dates and times as it is
  3820. defined in ISO 8601. If you cannot get used to this and require another
  3821. representation of date and time to keep you happy, you can get it by
  3822. customizing the variables @code{org-display-custom-times} and
  3823. @code{org-time-stamp-custom-formats}.
  3824. @table @kbd
  3825. @kindex C-c C-x C-t
  3826. @item C-c C-x C-t
  3827. Toggle the display of custom formats for dates and times.
  3828. @end table
  3829. @noindent
  3830. Org mode needs the default format for scanning, so the custom date/time
  3831. format does not @emph{replace} the default format - instead it is put
  3832. @emph{over} the default format using text properties. This has the
  3833. following consequences:
  3834. @itemize @bullet
  3835. @item
  3836. You cannot place the cursor onto a time stamp anymore, only before or
  3837. after.
  3838. @item
  3839. The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
  3840. each component of a time stamp. If the cursor is at the beginning of
  3841. the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
  3842. just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
  3843. time will be changed by one minute.
  3844. @item
  3845. If the time stamp contains a range of clock times or a repeater, these
  3846. will not be overlayed, but remain in the buffer as they were.
  3847. @item
  3848. When you delete a time stamp character-by-character, it will only
  3849. disappear from the buffer after @emph{all} (invisible) characters
  3850. belonging to the ISO timestamp have been removed.
  3851. @item
  3852. If the custom time stamp format is longer than the default and you are
  3853. using dates in tables, table alignment will be messed up. If the custom
  3854. format is shorter, things do work as expected.
  3855. @end itemize
  3856. @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
  3857. @section Deadlines and scheduling
  3858. A time stamp may be preceded by special keywords to facilitate planning:
  3859. @table @var
  3860. @item DEADLINE
  3861. @cindex DEADLINE keyword
  3862. Meaning: the task (most likely a TODO item, though not necessarily) is supposed
  3863. to be finished on that date.
  3864. On the deadline date, the task will be listed in the agenda. In
  3865. addition, the agenda for @emph{today} will carry a warning about the
  3866. approaching or missed deadline, starting
  3867. @code{org-deadline-warning-days} before the due date, and continuing
  3868. until the entry is marked DONE. An example:
  3869. @example
  3870. *** TODO write article about the Earth for the Guide
  3871. The editor in charge is [[bbdb:Ford Prefect]]
  3872. DEADLINE: <2004-02-29 Sun>
  3873. @end example
  3874. You can specify a different lead time for warnings for a specific
  3875. deadlines using the following syntax. Here is an example with a warning
  3876. period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
  3877. @item SCHEDULED
  3878. @cindex SCHEDULED keyword
  3879. Meaning: you are planning to start working on that task on the given
  3880. date.
  3881. The headline will be listed under the given date@footnote{It will still
  3882. be listed on that date after it has been marked DONE. If you don't like
  3883. this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
  3884. addition, a reminder that the scheduled date has passed will be present
  3885. in the compilation for @emph{today}, until the entry is marked DONE.
  3886. I.e., the task will automatically be forwarded until completed.
  3887. @example
  3888. *** TODO Call Trillian for a date on New Years Eve.
  3889. SCHEDULED: <2004-12-25 Sat>
  3890. @end example
  3891. @noindent
  3892. @b{Important:} Scheduling an item in Org mode should @i{not} be
  3893. understood in the same way that we understand @i{scheduling a meeting}.
  3894. Setting a date for a meeting is just a simple appointment, you should
  3895. mark this entry with a simple plain time stamp, to get this item shown
  3896. on the date where it applies. This is a frequent mis-understanding from
  3897. Org-users. In Org mode, @i{scheduling} means setting a date when you
  3898. want to start working on an action item.
  3899. @end table
  3900. You may use time stamps with repeaters in scheduling and deadline
  3901. entries. Org mode will issue early and late warnings based on the
  3902. assumption that the time stamp represents the @i{nearest instance} of
  3903. the repeater. However, the use of diary sexp entries like
  3904. @c
  3905. @code{<%%(diary-float t 42)>}
  3906. @c
  3907. in scheduling and deadline timestamps is limited. Org mode does not
  3908. know enough about the internals of each sexp function to issue early and
  3909. late warnings. However, it will show the item on each day where the
  3910. sexp entry matches.
  3911. @menu
  3912. * Inserting deadline/schedule:: Planning items
  3913. * Repeated tasks:: Items that show up again and again
  3914. @end menu
  3915. @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
  3916. @subsection Inserting deadlines or schedules
  3917. The following commands allow to quickly insert a deadline or to schedule
  3918. an item:
  3919. @table @kbd
  3920. @c
  3921. @kindex C-c C-d
  3922. @item C-c C-d
  3923. Insert @samp{DEADLINE} keyword along with a stamp. The insertion will
  3924. happen in the line directly following the headline. When called with a
  3925. prefix arg, an existing deadline will be removed from the entry.
  3926. @c FIXME Any CLOSED timestamp will be removed.????????
  3927. @c
  3928. @kindex C-c / d
  3929. @cindex sparse tree, for deadlines
  3930. @item C-c / d
  3931. Create a sparse tree with all deadlines that are either past-due, or
  3932. which will become due within @code{org-deadline-warning-days}.
  3933. With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
  3934. prefix, check that many days. For example, @kbd{C-1 C-c / d} shows
  3935. all deadlines due tomorrow.
  3936. @c
  3937. @kindex C-c C-s
  3938. @item C-c C-s
  3939. Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
  3940. happen in the line directly following the headline. Any CLOSED
  3941. timestamp will be removed. When called with a prefix argument, remove
  3942. the scheduling date from the entry.
  3943. @c
  3944. @kindex C-c C-x C-k
  3945. @kindex k a
  3946. @kindex k s
  3947. @item C-c C-x C-k
  3948. Mark the current entry for agenda action. After you have marked the entry
  3949. like this, you can open the agenda or the calendar to find an appropriate
  3950. date. With the cursor on the selected date, press @kbd{k s} or @kbd{k d} to
  3951. schedule the marked item.
  3952. @end table
  3953. @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
  3954. @subsection Repeated tasks
  3955. Some tasks need to be repeated again and again. Org mode helps to
  3956. organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
  3957. or plain time stamp. In the following example
  3958. @example
  3959. ** TODO Pay the rent
  3960. DEADLINE: <2005-10-01 Sat +1m>
  3961. @end example
  3962. the @code{+1m} is a repeater; the intended interpretation is that the
  3963. task has a deadline on <2005-10-01> and repeats itself every (one) month
  3964. starting from that time. If you need both a repeater and a special
  3965. warning period in a deadline entry, the repeater comes first and the
  3966. warning period last: @code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
  3967. Deadlines and scheduled items produce entries in the agenda when they
  3968. are over-due, so it is important to be able to mark such an entry as
  3969. completed once you have done so. When you mark a DEADLINE or a SCHEDULE
  3970. with the TODO keyword DONE, it will no longer produce entries in the
  3971. agenda. The problem with this is, however, that then also the
  3972. @emph{next} instance of the repeated entry will not be active. Org mode
  3973. deals with this in the following way: When you try to mark such an entry
  3974. DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
  3975. time stamp by the repeater interval, and immediately set the entry state
  3976. back to TODO. In the example above, setting the state to DONE would
  3977. actually switch the date like this:
  3978. @example
  3979. ** TODO Pay the rent
  3980. DEADLINE: <2005-11-01 Tue +1m>
  3981. @end example
  3982. A timestamp@footnote{You can change this using the option
  3983. @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
  3984. @code{lognoterepeat}, and @code{nologrepeat}. With @code{lognoterepeat}, you
  3985. will aslo be prompted for a note.} will be added under the deadline, to keep
  3986. a record that you actually acted on the previous instance of this deadline.
  3987. As a consequence of shifting the base date, this entry will no longer be
  3988. visible in the agenda when checking past dates, but all future instances
  3989. will be visible.
  3990. With the @samp{+1m} cookie, the date shift will always be exactly one
  3991. month. So if you have not payed the rent for three months, marking this
  3992. entry DONE will still keep it as an overdue deadline. Depending on the
  3993. task, this may not be the best way to handle it. For example, if you
  3994. forgot to call you father for 3 weeks, it does not make sense to call
  3995. him 3 times in a single day to make up for it. Finally, there are tasks
  3996. like changing batteries which should always repeat a certain time
  3997. @i{after} the last time you did it. For these tasks, Org mode has
  3998. special repeaters markers with @samp{++} and @samp{.+}. For example:
  3999. @example
  4000. ** TODO Call Father
  4001. DEADLINE: <2008-02-10 Sun ++1w>
  4002. Marking this DONE will shift the date by at least one week,
  4003. but also by as many weeks as it takes to get this date into
  4004. the future. However, it stays on a Sunday, even if you called
  4005. and marked it done on Saturday.
  4006. ** TODO Check the batteries in the smoke detectors
  4007. DEADLINE: <2005-11-01 Tue .+1m>
  4008. Marking this DONE will shift the date to one month after
  4009. today.
  4010. @end example
  4011. You may have both scheduling and deadline information for a specific
  4012. task - just make sure that the repeater intervals on both are the same.
  4013. @node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times
  4014. @section Clocking work time
  4015. Org mode allows you to clock the time you spent on specific tasks in a
  4016. project. When you start working on an item, you can start the clock.
  4017. When you stop working on that task, or when you mark the task done, the
  4018. clock is stopped and the corresponding time interval is recorded. It
  4019. also computes the total time spent on each subtree of a project.
  4020. @table @kbd
  4021. @kindex C-c C-x C-i
  4022. @item C-c C-x C-i
  4023. Start the clock on the current item (clock-in). This inserts the CLOCK
  4024. keyword together with a timestamp. If this is not the first clocking of
  4025. this item, the multiple CLOCK lines will be wrapped into a
  4026. @code{:CLOCK:} drawer (see also the variable
  4027. @code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument,
  4028. select the task from a list of recently clocked tasks. With two @kbd{C-u
  4029. C-u} prefixes, clock into the task at point and mark it as the default task.
  4030. The default task will always be available when selecting a clocking task,
  4031. with letter @kbd{d}.
  4032. @kindex C-c C-x C-o
  4033. @item C-c C-x C-o
  4034. Stop the clock (clock-out). The inserts another timestamp at the same
  4035. location where the clock was last started. It also directly computes
  4036. the resulting time in inserts it after the time range as @samp{=>
  4037. HH:MM}. See the variable @code{org-log-note-clock-out} for the
  4038. possibility to record an additional note together with the clock-out
  4039. time stamp@footnote{The corresponding in-buffer setting is:
  4040. @code{#+STARTUP: lognoteclock-out}}.
  4041. @kindex C-c C-y
  4042. @item C-c C-y
  4043. Recompute the time interval after changing one of the time stamps. This
  4044. is only necessary if you edit the time stamps directly. If you change
  4045. them with @kbd{S-@key{cursor}} keys, the update is automatic.
  4046. @kindex C-c C-t
  4047. @item C-c C-t
  4048. Changing the TODO state of an item to DONE automatically stops the clock
  4049. if it is running in this same item.
  4050. @kindex C-c C-x C-x
  4051. @item C-c C-x C-x
  4052. Cancel the current clock. This is useful if a clock was started by
  4053. mistake, or if you ended up working on something else.
  4054. @kindex C-c C-x C-j
  4055. @item C-c C-x C-j
  4056. Jump to the entry that contains the currently running clock. With a
  4057. @kbd{C-u} prefix arg, select the target task from a list of recently clocked
  4058. tasks.
  4059. @kindex C-c C-x C-d
  4060. @item C-c C-x C-d
  4061. Display time summaries for each subtree in the current buffer. This
  4062. puts overlays at the end of each headline, showing the total time
  4063. recorded under that heading, including the time of any subheadings. You
  4064. can use visibility cycling to study the tree, but the overlays disappear
  4065. when you change the buffer (see variable
  4066. @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
  4067. @kindex C-c C-x C-r
  4068. @item C-c C-x C-r
  4069. Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
  4070. report as an Org mode table into the current file. When the cursor is
  4071. at an existing clock table, just update it. When called with a prefix
  4072. argument, jump to the first clock report in the current document and
  4073. update it.
  4074. @cindex #+BEGIN: clocktable
  4075. @example
  4076. #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
  4077. #+END: clocktable
  4078. @end example
  4079. @noindent
  4080. If such a block already exists at point, its content is replaced by the
  4081. new table. The @samp{BEGIN} line can specify options:
  4082. @example
  4083. :maxlevel @r{Maximum level depth to which times are listed in the table.}
  4084. :emphasize @r{When @code{t}, emphasize level one and level two items}
  4085. :scope @r{The scope to consider. This can be any of the following:}
  4086. nil @r{the current buffer or narrowed region}
  4087. file @r{the full current buffer}
  4088. subtree @r{the subtree where the clocktable is located}
  4089. treeN @r{the surrounding level N tree, for example @code{tree3}}
  4090. tree @r{the surrounding level 1 tree}
  4091. agenda @r{all agenda files}
  4092. ("file"..) @r{scan these files}
  4093. file-with-archives @r{current file and its archives}
  4094. agenda-with-archives @r{all agenda files, including archives}
  4095. :block @r{The time block to consider. This block is specified either}
  4096. @r{absolute, or relative to the current time and may be any of}
  4097. @r{these formats:}
  4098. 2007-12-31 @r{New year eve 2007}
  4099. 2007-12 @r{December 2007}
  4100. 2007-W50 @r{ISO-week 50 in 2007}
  4101. 2007 @r{the year 2007}
  4102. today, yesterday, today-N @r{a relative day}
  4103. thisweek, lastweek, thisweek-N @r{a relative week}
  4104. thismonth, lastmonth, thismonth-N @r{a relative month}
  4105. thisyear, lastyear, thisyear-N @r{a relative year}
  4106. @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
  4107. :tstart @r{A time string specifying when to start considering times}
  4108. :tend @r{A time string specifying when to stop considering times}
  4109. :step @r{@code{week} or @code{day}, to split the table into chunks.}
  4110. @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
  4111. :link @r{Link the item headlines in the table to their origins}
  4112. @end example
  4113. So to get a clock summary of the current level 1 tree, for the current
  4114. day, you could write
  4115. @example
  4116. #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
  4117. #+END: clocktable
  4118. @end example
  4119. and to use a specific time range you could write@footnote{Note that all
  4120. parameters must be specified in a single line - the line is broken here
  4121. only to fit it onto the manual.}
  4122. @example
  4123. #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
  4124. :tend "<2006-08-10 Thu 12:00>"
  4125. #+END: clocktable
  4126. @end example
  4127. @kindex C-c C-c
  4128. @item C-c C-c
  4129. @kindex C-c C-x C-u
  4130. @itemx C-c C-x C-u
  4131. Update dynamical block at point. The cursor needs to be in the
  4132. @code{#+BEGIN} line of the dynamic block.
  4133. @kindex C-u C-c C-x C-u
  4134. @item C-u C-c C-x C-u
  4135. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  4136. you have several clock table blocks in a buffer.
  4137. @kindex S-@key{left}
  4138. @kindex S-@key{right}
  4139. @item S-@key{left}
  4140. @itemx S-@key{right}
  4141. Shift the current @code{:block} interval and update the table. The cursor
  4142. needs to be in the @code{#+BEGIN: clocktable} line for this command. If
  4143. @code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
  4144. @end table
  4145. The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
  4146. the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
  4147. worked on or closed during a day.
  4148. @node Effort estimates, , Clocking work time, Dates and Times
  4149. @section Effort estimates
  4150. @cindex Effort estimates
  4151. If you want to plan your work in a very detailed way, or if you need to
  4152. produce offers with quotations of the estimated work effort, you may want to
  4153. assign effort estimates to entries. If you are also clocking your work, you
  4154. may later want to compare the planned effort with the actual working time, a
  4155. great way to improve planning estimates. Effort estimates are stored in a
  4156. special property @samp{Effort}@footnote{You may change the property being
  4157. used with the variable @code{org-effort-property}.}. Clearly the best way to
  4158. work with effort estimates is through column view (@pxref{Column view}). You
  4159. should start by setting up discrete values for effort estimates, and a
  4160. @code{COLUMNS} format that displays these values together with clock sums (if
  4161. you want to clock your time). For a specific buffer you can use
  4162. @example
  4163. #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
  4164. #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
  4165. @end example
  4166. @noindent
  4167. or you can set up these values globally by customizing the variables
  4168. @code{org-global-properties} and @code{org-columns-default-format}. In
  4169. particular if you want to use this setup also in the agenda, a global setup
  4170. may be advised.
  4171. The way to assign estimates to individual items is then to switch to column
  4172. mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
  4173. value. The values you enter will immediately be summed up in the hierarchy.
  4174. In the column next to it, any clocked time will be displayed.
  4175. If you switch to column view in the daily/weekly agenda, the effort column
  4176. will summarize the estimated work effort for each day@footnote{Please note
  4177. the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
  4178. column view}).}, and you can use this to find space in your schedule. To get
  4179. an overview of the entire part of the day that is committed, you can set the
  4180. option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
  4181. appointments on a day that take place over a specified time interval will
  4182. then also be added to the load estimate of the day.
  4183. @node Remember, Agenda Views, Dates and Times, Top
  4184. @chapter Remember
  4185. @cindex @file{remember.el}
  4186. The @i{Remember} package by John Wiegley lets you store quick notes with
  4187. little interruption of your work flow. See
  4188. @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
  4189. information. It is an excellent way to add new notes and tasks to
  4190. Org files. Org significantly expands the possibilities of
  4191. @i{remember}: You may define templates for different note types, and
  4192. associate target files and headlines with specific templates. It also
  4193. allows you to select the location where a note should be stored
  4194. interactively, on the fly.
  4195. @menu
  4196. * Setting up Remember:: Some code for .emacs to get things going
  4197. * Remember templates:: Define the outline of different note types
  4198. * Storing notes:: Directly get the note to where it belongs
  4199. * Refiling notes:: Moving a note or task to a project
  4200. @end menu
  4201. @node Setting up Remember, Remember templates, Remember, Remember
  4202. @section Setting up Remember
  4203. The following customization will tell @i{remember} to use org files as
  4204. target, and to create annotations compatible with Org links.
  4205. @example
  4206. (org-remember-insinuate)
  4207. (setq org-directory "~/path/to/my/orgfiles/")
  4208. (setq org-default-notes-file (concat org-directory "/notes.org"))
  4209. (define-key global-map "\C-cr" 'org-remember)
  4210. @end example
  4211. The last line binds the command @code{org-remember} to a global
  4212. key@footnote{Please select your own key, @kbd{C-c r} is only a
  4213. suggestion.}. @code{org-remember} basically just calls @code{remember},
  4214. but it makes a few things easier: If there is an active region, it will
  4215. automatically copy the region into the remember buffer. It also allows
  4216. to jump to the buffer and location where remember notes are being
  4217. stored: Just call @code{org-remember} with a prefix argument. If you
  4218. use two prefix arguments, Org jumps to the location where the last
  4219. remember note was stored.
  4220. You can also call @code{org-remember} in a special way from the agenda,
  4221. using the @kbd{k r} key combination. With this access, any time stamps
  4222. inserted by the selected remember template (see below) will default to
  4223. the cursor date in the agenda, rather than to the current date.
  4224. @node Remember templates, Storing notes, Setting up Remember, Remember
  4225. @section Remember templates
  4226. @cindex templates, for remember
  4227. In combination with Org, you can use templates to generate
  4228. different types of @i{remember} notes. For example, if you would like
  4229. to use one template to create general TODO entries, another one for
  4230. journal entries, and a third one for collecting random ideas, you could
  4231. use:
  4232. @example
  4233. (setq org-remember-templates
  4234. '(("Todo" ?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
  4235. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
  4236. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  4237. @end example
  4238. @noindent In these entries, the first string is just a name, and the
  4239. character specifies how to select the template. It is useful if the
  4240. character is also the first letter of the name. The next string specifies
  4241. the template. Two more (optional) strings give the file in which, and the
  4242. headline under which the new note should be stored. The file (if not present
  4243. or @code{nil}) defaults to @code{org-default-notes-file}, the heading to
  4244. @code{org-remember-default-headline}. If the file name is not an absolute
  4245. path, it will be interpreted relative to @code{org-directory}. The heading
  4246. can also be the symbols @code{top} or @code{bottom} to send note as level 1
  4247. entries to the beginning or end of the file, respectively.
  4248. An optional sixth element specifies the contexts in which the user can select
  4249. the template. This element can be a list of major modes or a function.
  4250. @code{org-remember} will first check whether the function returns @code{t} or
  4251. if we are in any of the listed major mode, and exclude templates fo which
  4252. this condition is not fulfilled. Templates that do not specify this element
  4253. at all, or that use @code{nil} or @code{t} as a value will always be
  4254. selectable.
  4255. So for example:
  4256. @example
  4257. (setq org-remember-templates
  4258. '(("Bug" ?b "* BUG %?\n %i\n %a" "~/org/BUGS.org" "Bugs" (emacs-lisp-mode))
  4259. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org" "X" my-check)
  4260. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  4261. @end example
  4262. The first template will only be available when invoking @code{org-remember}
  4263. from an buffer in @code{emacs-lisp-mode}. The second template will only be
  4264. available when the function @code{my-check} returns @code{t}. The third
  4265. template will be proposed in any context.
  4266. When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
  4267. something, Org will prompt for a key to select the template (if you have
  4268. more than one template) and then prepare the buffer like
  4269. @example
  4270. * TODO
  4271. [[file:link to where you called remember]]
  4272. @end example
  4273. @noindent
  4274. During expansion of the template, special @kbd{%}-escapes allow dynamic
  4275. insertion of content:
  4276. @example
  4277. %^@{prompt@} @r{prompt the user for a string and replace this sequence with it.}
  4278. @r{You may specify a default value and a completion table with}
  4279. @r{%^@{prompt|default|completion2|completion3...@}}
  4280. @r{The arrow keys access a prompt-specific history.}
  4281. %a @r{annotation, normally the link created with @code{org-store-link}}
  4282. %A @r{like @code{%a}, but prompt for the description part}
  4283. %i @r{initial content, the region when remember is called with C-u.}
  4284. @r{The entire text will be indented like @code{%i} itself.}
  4285. %t @r{time stamp, date only}
  4286. %T @r{time stamp with date and time}
  4287. %u, %U @r{like the above, but inactive time stamps}
  4288. %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
  4289. @r{You may define a prompt like @code{%^@{Birthday@}t}}
  4290. %n @r{user name (taken from @code{user-full-name})}
  4291. %c @r{Current kill ring head.}
  4292. %x @r{Content of the X clipboard.}
  4293. %^C @r{Interactive selection of which kill or clip to use.}
  4294. %^L @r{Like @code{%^C}, but insert as link.}
  4295. %^g @r{prompt for tags, with completion on tags in target file.}
  4296. %^G @r{prompt for tags, with completion all tags in all agenda files.}
  4297. %:keyword @r{specific information for certain link types, see below}
  4298. %[pathname] @r{insert the contents of the file given by @code{pathname}}
  4299. %(sexp) @r{evaluate elisp @code{(sexp)} and replace with the result}
  4300. %! @r{immediately store note after completing the template}
  4301. @r{(skipping the @kbd{C-c C-c} that normally triggers storing)}
  4302. %& @r{jump to target location immediately after storing note}
  4303. @end example
  4304. @noindent
  4305. For specific link types, the following keywords will be
  4306. defined@footnote{If you define your own link types (@pxref{Adding
  4307. hyperlink types}), any property you store with
  4308. @code{org-store-link-props} can be accessed in remember templates in a
  4309. similar way.}:
  4310. @example
  4311. Link type | Available keywords
  4312. -------------------+----------------------------------------------
  4313. bbdb | %:name %:company
  4314. bbdb | %::server %:port %:nick
  4315. vm, wl, mh, rmail | %:type %:subject %:message-id
  4316. | %:from %:fromname %:fromaddress
  4317. | %:to %:toname %:toaddress
  4318. | %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user. See the variable @code{org-from-is-user-regexp}.}}
  4319. gnus | %:group, @r{for messages also all email fields}
  4320. w3, w3m | %:url
  4321. info | %:file %:node
  4322. calendar | %:date"
  4323. @end example
  4324. @noindent
  4325. To place the cursor after template expansion use:
  4326. @example
  4327. %? @r{After completing the template, position cursor here.}
  4328. @end example
  4329. @noindent
  4330. If you change your mind about which template to use, call
  4331. @code{org-remember} in the remember buffer. You may then select a new
  4332. template that will be filled with the previous context information.
  4333. @node Storing notes, Refiling notes, Remember templates, Remember
  4334. @section Storing notes
  4335. When you are finished preparing a note with @i{remember}, you have to press
  4336. @kbd{C-c C-c} to file the note away. If you have started the clock in the
  4337. remember buffer, you will first be asked if you want to clock out
  4338. now@footnote{To avoid this query, configure the variable
  4339. @code{org-remember-clock-out-on-exit}.}. If you answer @kbd{n}, the clock
  4340. will continue to run after the note was filed away.
  4341. The handler will then store the note in the file and under the headline
  4342. specified in the template, or it will use the default file and headlines.
  4343. The window configuration will be restored, sending you back to the working
  4344. context before the call to @code{remember}. To re-use the location found
  4345. during the last call to @code{remember}, exit the remember buffer with
  4346. @kbd{C-0 C-c C-c}, i.e. specify a zero prefix argument to @kbd{C-c C-c}.
  4347. If you want to store the note directly to a different place, use
  4348. @kbd{C-1 C-c C-c} instead to exit remember@footnote{Configure the
  4349. variable @code{org-remember-store-without-prompt} to make this behavior
  4350. the default.}. The handler will then first prompt for a target file -
  4351. if you press @key{RET}, the value specified for the template is used.
  4352. Then the command offers the headings tree of the selected file, with the
  4353. cursor position at the default headline (if you had specified one in the
  4354. template). You can either immediately press @key{RET} to get the note
  4355. placed there. Or you can use the following keys to find a different
  4356. location:
  4357. @example
  4358. @key{TAB} @r{Cycle visibility.}
  4359. @key{down} / @key{up} @r{Next/previous visible headline.}
  4360. n / p @r{Next/previous visible headline.}
  4361. f / b @r{Next/previous headline same level.}
  4362. u @r{One level up.}
  4363. @c 0-9 @r{Digit argument.}
  4364. @end example
  4365. @noindent
  4366. Pressing @key{RET} or @key{left} or @key{right}
  4367. then leads to the following result.
  4368. @multitable @columnfractions 0.2 0.15 0.65
  4369. @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
  4370. @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
  4371. @item @tab @tab depending on @code{org-reverse-note-order}.
  4372. @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
  4373. @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
  4374. @item @tab @tab depending on @code{org-reverse-note-order}.
  4375. @item not on headline @tab @key{RET}
  4376. @tab at cursor position, level taken from context.
  4377. @end multitable
  4378. Before inserting the text into a tree, the function ensures that the
  4379. text has a headline, i.e. a first line that starts with a @samp{*}. If
  4380. not, a headline is constructed from the current date and some additional
  4381. data. If you have indented the text of the note below the headline, the
  4382. indentation will be adapted if inserting the note into the tree requires
  4383. demotion from level 1.
  4384. @node Refiling notes, , Storing notes, Remember
  4385. @section Refiling notes
  4386. @cindex refiling notes
  4387. Remember is usually used to quickly capture notes and tasks into one or
  4388. a few capture lists. When reviewing the captured data, you may want to
  4389. refile some of the entries into a different list, for example into a
  4390. project. Cutting, finding the right location and then pasting the note
  4391. is cumbersome. To simplify this process, you can use the following
  4392. special command:
  4393. @table @kbd
  4394. @kindex C-c C-w
  4395. @item C-c C-w
  4396. Refile the entry at point. This command offers possible locations for
  4397. refiling the entry and lets you select one with completion. The item is
  4398. filed below the target heading as a subitem. Depending on
  4399. @code{org-reverse-note-order}, it will be either the first of last
  4400. subitem.@* By default, all level 1 headlines in the current buffer are
  4401. considered to be targets, but you can have more complex definitions
  4402. across a number of files. See the variable @code{org-refile-targets}
  4403. for details. If you would like to select a location via a file-pathlike
  4404. completion along the outline path, see the variable
  4405. @code{org-refile-use-outline-path}.
  4406. @kindex C-u C-c C-w
  4407. @item C-u C-c C-w
  4408. Use the refile interface to jump to a heading.
  4409. @kindex C-u C-u C-c C-w
  4410. @item C-u C-u C-c C-w
  4411. Jump to the location where @code{org-refile} last moved a tree to.
  4412. @end table
  4413. @node Agenda Views, Embedded LaTeX, Remember, Top
  4414. @chapter Agenda Views
  4415. @cindex agenda views
  4416. Due to the way Org works, TODO items, time-stamped items, and
  4417. tagged headlines can be scattered throughout a file or even a number of
  4418. files. To get an overview of open action items, or of events that are
  4419. important for a particular date, this information must be collected,
  4420. sorted and displayed in an organized way.
  4421. Org can select items based on various criteria, and display them
  4422. in a separate buffer. Seven different view types are provided:
  4423. @itemize @bullet
  4424. @item
  4425. an @emph{agenda} that is like a calendar and shows information
  4426. for specific dates,
  4427. @item
  4428. a @emph{TODO list} that covers all unfinished
  4429. action items,
  4430. @item
  4431. a @emph{tags view}, showings headlines based on
  4432. the tags associated with them,
  4433. @item
  4434. a @emph{timeline view} that shows all events in a single Org file,
  4435. in time-sorted view,
  4436. @item
  4437. a @emph{keyword search view} that shows all entries from multiple files
  4438. that contain specified keywords.
  4439. @item
  4440. a @emph{stuck projects view} showing projects that currently don't move
  4441. along, and
  4442. @item
  4443. @emph{custom views} that are special tag/keyword searches and
  4444. combinations of different views.
  4445. @end itemize
  4446. @noindent
  4447. The extracted information is displayed in a special @emph{agenda
  4448. buffer}. This buffer is read-only, but provides commands to visit the
  4449. corresponding locations in the original Org files, and even to
  4450. edit these files remotely.
  4451. Two variables control how the agenda buffer is displayed and whether the
  4452. window configuration is restored when the agenda exits:
  4453. @code{org-agenda-window-setup} and
  4454. @code{org-agenda-restore-windows-after-quit}.
  4455. @menu
  4456. * Agenda files:: Files being searched for agenda information
  4457. * Agenda dispatcher:: Keyboard access to agenda views
  4458. * Built-in agenda views:: What is available out of the box?
  4459. * Presentation and sorting:: How agenda items are prepared for display
  4460. * Agenda commands:: Remote editing of Org trees
  4461. * Custom agenda views:: Defining special searches and views
  4462. * Agenda column view:: Using column view for collected entries
  4463. @end menu
  4464. @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
  4465. @section Agenda files
  4466. @cindex agenda files
  4467. @cindex files for agenda
  4468. The information to be shown is normally collected from all @emph{agenda
  4469. files}, the files listed in the variable
  4470. @code{org-agenda-files}@footnote{If the value of that variable is not a
  4471. list, but a single file name, then the list of agenda files will be
  4472. maintained in that external file.}. If a directory is part of this list,
  4473. all files with the extension @file{.org} in this directory will be part
  4474. of the list.
  4475. Thus even if you only work with a single Org file, this file should
  4476. be put into that list@footnote{When using the dispatcher, pressing
  4477. @kbd{<} before selecting a command will actually limit the command to
  4478. the current file, and ignore @code{org-agenda-files} until the next
  4479. dispatcher command.}. You can customize @code{org-agenda-files}, but
  4480. the easiest way to maintain it is through the following commands
  4481. @cindex files, adding to agenda list
  4482. @table @kbd
  4483. @kindex C-c [
  4484. @item C-c [
  4485. Add current file to the list of agenda files. The file is added to
  4486. the front of the list. If it was already in the list, it is moved to
  4487. the front. With a prefix argument, file is added/moved to the end.
  4488. @kindex C-c ]
  4489. @item C-c ]
  4490. Remove current file from the list of agenda files.
  4491. @kindex C-,
  4492. @kindex C-'
  4493. @item C-,
  4494. @itemx C-'
  4495. Cycle through agenda file list, visiting one file after the other.
  4496. @kindex M-x org-iswitchb
  4497. @item M-x org-iswitchb
  4498. Command to use an @code{iswitchb}-like interface to switch to and between Org
  4499. buffers.
  4500. @end table
  4501. @noindent
  4502. The Org menu contains the current list of files and can be used
  4503. to visit any of them.
  4504. If you would like to focus the agenda temporarily onto a file not in
  4505. this list, or onto just one file in the list or even only a subtree in a
  4506. file, this can be done in different ways. For a single agenda command,
  4507. you may press @kbd{<} once or several times in the dispatcher
  4508. (@pxref{Agenda dispatcher}). To restrict the agenda scope for an
  4509. extended period, use the following commands:
  4510. @table @kbd
  4511. @kindex C-c C-x <
  4512. @item C-c C-x <
  4513. Permanently restrict the agenda to the current subtree. When with a
  4514. prefix argument, or with the cursor before the first headline in a file,
  4515. the agenda scope is set to the entire file. This restriction remains in
  4516. effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
  4517. or @kbd{>} in the agenda dispatcher. If there is a window displaying an
  4518. agenda view, the new restriction takes effect immediately.
  4519. @kindex C-c C-x <
  4520. @item C-c C-x <
  4521. Remove the permanent restriction created by @kbd{C-c C-x <}.
  4522. @end table
  4523. @noindent
  4524. When working with @file{Speedbar}, you can use the following commands in
  4525. the Speedbar frame:
  4526. @table @kbd
  4527. @kindex <
  4528. @item < @r{in the speedbar frame}
  4529. Permanently restrict the agenda to the item at the cursor in the
  4530. Speedbar frame, either an Org file or a subtree in such a file.
  4531. If there is a window displaying an agenda view, the new restriction takes
  4532. effect immediately.
  4533. @kindex <
  4534. @item > @r{in the speedbar frame}
  4535. Lift the restriction again.
  4536. @end table
  4537. @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
  4538. @section The agenda dispatcher
  4539. @cindex agenda dispatcher
  4540. @cindex dispatching agenda commands
  4541. The views are created through a dispatcher that should be bound to a
  4542. global key, for example @kbd{C-c a} (@pxref{Installation}). In the
  4543. following we will assume that @kbd{C-c a} is indeed how the dispatcher
  4544. is accessed and list keyboard access to commands accordingly. After
  4545. pressing @kbd{C-c a}, an additional letter is required to execute a
  4546. command. The dispatcher offers the following default commands:
  4547. @table @kbd
  4548. @item a
  4549. Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
  4550. @item t @r{/} T
  4551. Create a list of all TODO items (@pxref{Global TODO list}).
  4552. @item m @r{/} M
  4553. Create a list of headlines matching a TAGS expression (@pxref{Matching
  4554. tags and properties}).
  4555. @item L
  4556. Create the timeline view for the current buffer (@pxref{Timeline}).
  4557. @item s
  4558. Create a list of entries selected by a boolean expression of keywords
  4559. and/or regular expressions that must or must not occur in the entry.
  4560. @item /
  4561. Search for a regular expression in all agenda files and additionally in
  4562. the files listed in @code{org-agenda-multi-occur-extra-files}. This
  4563. uses the Emacs command @code{multi-occur}. A prefix argument can be
  4564. used to specify the number of context lines for each match, default is
  4565. 1.
  4566. @item # @r{/} !
  4567. Create a list of stuck projects (@pxref{Stuck projects}).
  4568. @item <
  4569. Restrict an agenda command to the current buffer@footnote{For backward
  4570. compatibility, you can also press @kbd{1} to restrict to the current
  4571. buffer.}. After pressing @kbd{<}, you still need to press the character
  4572. selecting the command.
  4573. @item < <
  4574. If there is an active region, restrict the following agenda command to
  4575. the region. Otherwise, restrict it to the current subtree@footnote{For
  4576. backward compatibility, you can also press @kbd{0} to restrict to the
  4577. current buffer.}. After pressing @kbd{< <}, you still need to press the
  4578. character selecting the command.
  4579. @end table
  4580. You can also define custom commands that will be accessible through the
  4581. dispatcher, just like the default commands. This includes the
  4582. possibility to create extended agenda buffers that contain several
  4583. blocks together, for example the weekly agenda, the global TODO list and
  4584. a number of special tags matches. @xref{Custom agenda views}.
  4585. @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
  4586. @section The built-in agenda views
  4587. In this section we describe the built-in views.
  4588. @menu
  4589. * Weekly/daily agenda:: The calendar page with current tasks
  4590. * Global TODO list:: All unfinished action items
  4591. * Matching tags and properties:: Structured information with fine-tuned search
  4592. * Timeline:: Time-sorted view for single file
  4593. * Keyword search:: Finding entries by keyword
  4594. * Stuck projects:: Find projects you need to review
  4595. @end menu
  4596. @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
  4597. @subsection The weekly/daily agenda
  4598. @cindex agenda
  4599. @cindex weekly agenda
  4600. @cindex daily agenda
  4601. The purpose of the weekly/daily @emph{agenda} is to act like a page of a
  4602. paper agenda, showing all the tasks for the current week or day.
  4603. @table @kbd
  4604. @cindex org-agenda, command
  4605. @kindex C-c a a
  4606. @item C-c a a
  4607. Compile an agenda for the current week from a list of org files. The
  4608. agenda shows the entries for each day. With a numeric
  4609. prefix@footnote{For backward compatibility, the universal prefix
  4610. @kbd{C-u} causes all TODO entries to be listed before the agenda. This
  4611. feature is deprecated, use the dedicated TODO list, or a block agenda
  4612. instead.} (like @kbd{C-u 2 1 C-c a a}) you may set the number of days
  4613. to be displayed (see also the variable @code{org-agenda-ndays})
  4614. @end table
  4615. Remote editing from the agenda buffer means, for example, that you can
  4616. change the dates of deadlines and appointments from the agenda buffer.
  4617. The commands available in the Agenda buffer are listed in @ref{Agenda
  4618. commands}.
  4619. @subsubheading Calendar/Diary integration
  4620. @cindex calendar integration
  4621. @cindex diary integration
  4622. Emacs contains the calendar and diary by Edward M. Reingold. The
  4623. calendar displays a three-month calendar with holidays from different
  4624. countries and cultures. The diary allows you to keep track of
  4625. anniversaries, lunar phases, sunrise/set, recurrent appointments
  4626. (weekly, monthly) and more. In this way, it is quite complementary to
  4627. Org. It can be very useful to combine output from Org with
  4628. the diary.
  4629. In order to include entries from the Emacs diary into Org mode's
  4630. agenda, you only need to customize the variable
  4631. @lisp
  4632. (setq org-agenda-include-diary t)
  4633. @end lisp
  4634. @noindent After that, everything will happen automatically. All diary
  4635. entries including holidays, anniversaries etc will be included in the
  4636. agenda buffer created by Org mode. @key{SPC}, @key{TAB}, and
  4637. @key{RET} can be used from the agenda buffer to jump to the diary
  4638. file in order to edit existing diary entries. The @kbd{i} command to
  4639. insert new entries for the current date works in the agenda buffer, as
  4640. well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
  4641. Sunrise/Sunset times, show lunar phases and to convert to other
  4642. calendars, respectively. @kbd{c} can be used to switch back and forth
  4643. between calendar and agenda.
  4644. If you are using the diary only for sexp entries and holidays, it is
  4645. faster to not use the above setting, but instead to copy or even move
  4646. the entries into an Org file. Org mode evaluates diary-style sexp
  4647. entries, and does it faster because there is no overhead for first
  4648. creating the diary display. Note that the sexp entries must start at
  4649. the left margin, no white space is allowed before them. For example,
  4650. the following segment of an Org file will be processed and entries
  4651. will be made in the agenda:
  4652. @example
  4653. * Birthdays and similar stuff
  4654. #+CATEGORY: Holiday
  4655. %%(org-calendar-holiday) ; special function for holiday names
  4656. #+CATEGORY: Ann
  4657. %%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
  4658. %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
  4659. @end example
  4660. @subsubheading Appointment reminders
  4661. @cindex @file{appt.el}
  4662. @cindex appointment reminders
  4663. Org can interact with Emacs appointments notification facility.
  4664. To add all the appointments of your agenda files, use the command
  4665. @code{org-agenda-to-appt}. This commands also lets you filter through
  4666. the list of your appointments and add only those belonging to a specific
  4667. category or matching a regular expression. See the docstring for
  4668. details.
  4669. @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
  4670. @subsection The global TODO list
  4671. @cindex global TODO list
  4672. @cindex TODO list, global
  4673. The global TODO list contains all unfinished TODO items, formatted and
  4674. collected into a single place.
  4675. @table @kbd
  4676. @kindex C-c a t
  4677. @item C-c a t
  4678. Show the global TODO list. This collects the TODO items from all
  4679. agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
  4680. @code{agenda-mode}, so there are commands to examine and manipulate
  4681. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  4682. @kindex C-c a T
  4683. @item C-c a T
  4684. @cindex TODO keyword matching
  4685. Like the above, but allows selection of a specific TODO keyword. You
  4686. can also do this by specifying a prefix argument to @kbd{C-c a t}. With
  4687. a @kbd{C-u} prefix you are prompted for a keyword, and you may also
  4688. specify several keywords by separating them with @samp{|} as boolean OR
  4689. operator. With a numeric prefix, the Nth keyword in
  4690. @code{org-todo-keywords} is selected.
  4691. @kindex r
  4692. The @kbd{r} key in the agenda buffer regenerates it, and you can give
  4693. a prefix argument to this command to change the selected TODO keyword,
  4694. for example @kbd{3 r}. If you often need a search for a specific
  4695. keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
  4696. Matching specific TODO keywords can also be done as part of a tags
  4697. search (@pxref{Tag searches}).
  4698. @end table
  4699. Remote editing of TODO items means that you can change the state of a
  4700. TODO entry with a single key press. The commands available in the
  4701. TODO list are described in @ref{Agenda commands}.
  4702. @cindex sublevels, inclusion into TODO list
  4703. Normally the global TODO list simply shows all headlines with TODO
  4704. keywords. This list can become very long. There are two ways to keep
  4705. it more compact:
  4706. @itemize @minus
  4707. @item
  4708. Some people view a TODO item that has been @emph{scheduled} for
  4709. execution (@pxref{Timestamps}) as no longer @emph{open}. Configure the
  4710. variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
  4711. items from the global TODO list.
  4712. @item
  4713. TODO items may have sublevels to break up the task into subtasks. In
  4714. such cases it may be enough to list only the highest level TODO headline
  4715. and omit the sublevels from the global list. Configure the variable
  4716. @code{org-agenda-todo-list-sublevels} to get this behavior.
  4717. @end itemize
  4718. @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
  4719. @subsection Matching tags and properties
  4720. @cindex matching, of tags
  4721. @cindex matching, of properties
  4722. @cindex tags view
  4723. If headlines in the agenda files are marked with @emph{tags}
  4724. (@pxref{Tags}), you can select headlines based on the tags that apply
  4725. to them and collect them into an agenda buffer.
  4726. @table @kbd
  4727. @kindex C-c a m
  4728. @item C-c a m
  4729. Produce a list of all headlines that match a given set of tags. The
  4730. command prompts for a selection criterion, which is a boolean logic
  4731. expression with tags, like @samp{+work+urgent-withboss} or
  4732. @samp{work|home} (@pxref{Tags}). If you often need a specific search,
  4733. define a custom command for it (@pxref{Agenda dispatcher}).
  4734. @kindex C-c a M
  4735. @item C-c a M
  4736. Like @kbd{C-c a m}, but only select headlines that are also TODO items
  4737. and force checking subitems (see variable
  4738. @code{org-tags-match-list-sublevels}). Matching specific TODO keywords
  4739. together with a tags match is also possible, see @ref{Tag searches}.
  4740. @end table
  4741. The commands available in the tags list are described in @ref{Agenda
  4742. commands}.
  4743. @node Timeline, Keyword search, Matching tags and properties, Built-in agenda views
  4744. @subsection Timeline for a single file
  4745. @cindex timeline, single file
  4746. @cindex time-sorted view
  4747. The timeline summarizes all time-stamped items from a single Org mode
  4748. file in a @emph{time-sorted view}. The main purpose of this command is
  4749. to give an overview over events in a project.
  4750. @table @kbd
  4751. @kindex C-c a L
  4752. @item C-c a L
  4753. Show a time-sorted view of the org file, with all time-stamped items.
  4754. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  4755. (scheduled or not) are also listed under the current date.
  4756. @end table
  4757. @noindent
  4758. The commands available in the timeline buffer are listed in
  4759. @ref{Agenda commands}.
  4760. @node Keyword search, Stuck projects, Timeline, Built-in agenda views
  4761. @subsection Keyword search
  4762. @cindex keyword search
  4763. @cindex searching, for keywords
  4764. This agenda view is a general text search facility for Org mode entries.
  4765. It is particularly useful to find notes.
  4766. @table @kbd
  4767. @kindex C-c a s
  4768. @item C-c a s
  4769. This is a special search that lets you select entries by keywords or
  4770. regular expression, using a boolean logic. For example, the search
  4771. string
  4772. @example
  4773. +computer +wifi -ethernet -@{8\.11[bg]@}
  4774. @end example
  4775. @noindent
  4776. will search for note entries that contain the keywords @code{computer}
  4777. and @code{wifi}, but not the keyword @code{ethernet}, and which are also
  4778. not matched by the regular expression @code{8\.11[bg]}, meaning to
  4779. exclude both 8.11b and 8.11g.
  4780. Note that in addition to the agenda files, this command will also search
  4781. the files listed in @code{org-agenda-text-search-extra-files}.
  4782. @end table
  4783. @node Stuck projects, , Keyword search, Built-in agenda views
  4784. @subsection Stuck projects
  4785. If you are following a system like David Allen's GTD to organize your
  4786. work, one of the ``duties'' you have is a regular review to make sure
  4787. that all projects move along. A @emph{stuck} project is a project that
  4788. has no defined next actions, so it will never show up in the TODO lists
  4789. Org mode produces. During the review, you need to identify such
  4790. projects and define next actions for them.
  4791. @table @kbd
  4792. @kindex C-c a #
  4793. @item C-c a #
  4794. List projects that are stuck.
  4795. @kindex C-c a !
  4796. @item C-c a !
  4797. Customize the variable @code{org-stuck-projects} to define what a stuck
  4798. project is and how to find it.
  4799. @end table
  4800. You almost certainly will have to configure this view before it will
  4801. work for you. The built-in default assumes that all your projects are
  4802. level-2 headlines, and that a project is not stuck if it has at least
  4803. one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
  4804. Lets assume that you, in your own way of using Org mode, identify
  4805. projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
  4806. indicate a project that should not be considered yet. Lets further
  4807. assume that the TODO keyword DONE marks finished projects, and that NEXT
  4808. and TODO indicate next actions. The tag @@SHOP indicates shopping and
  4809. is a next action even without the NEXT tag. Finally, if the project
  4810. contains the special word IGNORE anywhere, it should not be listed
  4811. either. In this case you would start by identifying eligible projects
  4812. with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
  4813. TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
  4814. are not stuck. The correct customization for this is
  4815. @lisp
  4816. (setq org-stuck-projects
  4817. '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
  4818. "\\<IGNORE\\>"))
  4819. @end lisp
  4820. @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
  4821. @section Presentation and sorting
  4822. @cindex presentation, of agenda items
  4823. Before displaying items in an agenda view, Org mode visually prepares
  4824. the items and sorts them. Each item occupies a single line. The line
  4825. starts with a @emph{prefix} that contains the @emph{category}
  4826. (@pxref{Categories}) of the item and other important information. You can
  4827. customize the prefix using the option @code{org-agenda-prefix-format}.
  4828. The prefix is followed by a cleaned-up version of the outline headline
  4829. associated with the item.
  4830. @menu
  4831. * Categories:: Not all tasks are equal
  4832. * Time-of-day specifications:: How the agenda knows the time
  4833. * Sorting of agenda items:: The order of things
  4834. @end menu
  4835. @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
  4836. @subsection Categories
  4837. @cindex category
  4838. The category is a broad label assigned to each agenda item. By default,
  4839. the category is simply derived from the file name, but you can also
  4840. specify it with a special line in the buffer, like this@footnote{For
  4841. backward compatibility, the following also works: If there are several
  4842. such lines in a file, each specifies the category for the text below it.
  4843. The first category also applies to any text before the first CATEGORY
  4844. line. However, using this method is @emph{strongly} deprecated as it is
  4845. incompatible with the outline structure of the document. The correct
  4846. method for setting multiple categories in a buffer is using a
  4847. property.}:
  4848. @example
  4849. #+CATEGORY: Thesis
  4850. @end example
  4851. @noindent
  4852. If you would like to have a special CATEGORY for a single entry or a
  4853. (sub)tree, give the entry a @code{:CATEGORY:} property with the location
  4854. as the value (@pxref{Properties and Columns}).
  4855. @noindent
  4856. The display in the agenda buffer looks best if the category is not
  4857. longer than 10 characters.
  4858. @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
  4859. @subsection Time-of-day specifications
  4860. @cindex time-of-day specification
  4861. Org mode checks each agenda item for a time-of-day specification. The
  4862. time can be part of the time stamp that triggered inclusion into the
  4863. agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
  4864. ranges can be specified with two time stamps, like
  4865. @c
  4866. @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
  4867. In the headline of the entry itself, a time(range) may also appear as
  4868. plain text (like @samp{12:45} or a @samp{8:30-1pm}). If the agenda
  4869. integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
  4870. specifications in diary entries are recognized as well.
  4871. For agenda display, Org mode extracts the time and displays it in a
  4872. standard 24 hour format as part of the prefix. The example times in
  4873. the previous paragraphs would end up in the agenda like this:
  4874. @example
  4875. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  4876. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  4877. 19:00...... The Vogon reads his poem
  4878. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  4879. @end example
  4880. @cindex time grid
  4881. If the agenda is in single-day mode, or for the display of today, the
  4882. timed entries are embedded in a time grid, like
  4883. @example
  4884. 8:00...... ------------------
  4885. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  4886. 10:00...... ------------------
  4887. 12:00...... ------------------
  4888. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  4889. 14:00...... ------------------
  4890. 16:00...... ------------------
  4891. 18:00...... ------------------
  4892. 19:00...... The Vogon reads his poem
  4893. 20:00...... ------------------
  4894. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  4895. @end example
  4896. The time grid can be turned on and off with the variable
  4897. @code{org-agenda-use-time-grid}, and can be configured with
  4898. @code{org-agenda-time-grid}.
  4899. @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
  4900. @subsection Sorting of agenda items
  4901. @cindex sorting, of agenda items
  4902. @cindex priorities, of agenda items
  4903. Before being inserted into a view, the items are sorted. How this is
  4904. done depends on the type of view.
  4905. @itemize @bullet
  4906. @item
  4907. For the daily/weekly agenda, the items for each day are sorted. The
  4908. default order is to first collect all items containing an explicit
  4909. time-of-day specification. These entries will be shown at the beginning
  4910. of the list, as a @emph{schedule} for the day. After that, items remain
  4911. grouped in categories, in the sequence given by @code{org-agenda-files}.
  4912. Within each category, items are sorted by priority (@pxref{Priorities}),
  4913. which is composed of the base priority (2000 for priority @samp{A}, 1000
  4914. for @samp{B}, and 0 for @samp{C}), plus additional increments for
  4915. overdue scheduled or deadline items.
  4916. @item
  4917. For the TODO list, items remain in the order of categories, but within
  4918. each category, sorting takes place according to priority
  4919. (@pxref{Priorities}).
  4920. @item
  4921. For tags matches, items are not sorted at all, but just appear in the
  4922. sequence in which they are found in the agenda files.
  4923. @end itemize
  4924. Sorting can be customized using the variable
  4925. @code{org-agenda-sorting-strategy}, and may also include criteria based on
  4926. the estimated effort of an entry.
  4927. @c FIXME: link!!!!!!!!
  4928. @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
  4929. @section Commands in the agenda buffer
  4930. @cindex commands, in agenda buffer
  4931. Entries in the agenda buffer are linked back to the org file or diary
  4932. file where they originate. You are not allowed to edit the agenda
  4933. buffer itself, but commands are provided to show and jump to the
  4934. original entry location, and to edit the org-files ``remotely'' from
  4935. the agenda buffer. In this way, all information is stored only once,
  4936. removing the risk that your agenda and note files may diverge.
  4937. Some commands can be executed with mouse clicks on agenda lines. For
  4938. the other commands, the cursor needs to be in the desired line.
  4939. @table @kbd
  4940. @tsubheading{Motion}
  4941. @cindex motion commands in agenda
  4942. @kindex n
  4943. @item n
  4944. Next line (same as @key{up} and @kbd{C-p}).
  4945. @kindex p
  4946. @item p
  4947. Previous line (same as @key{down} and @kbd{C-n}).
  4948. @tsubheading{View/Go to org file}
  4949. @kindex mouse-3
  4950. @kindex @key{SPC}
  4951. @item mouse-3
  4952. @itemx @key{SPC}
  4953. Display the original location of the item in another window.
  4954. @c
  4955. @kindex L
  4956. @item L
  4957. Display original location and recenter that window.
  4958. @c
  4959. @kindex mouse-2
  4960. @kindex mouse-1
  4961. @kindex @key{TAB}
  4962. @item mouse-2
  4963. @itemx mouse-1
  4964. @itemx @key{TAB}
  4965. Go to the original location of the item in another window. Under Emacs
  4966. 22, @kbd{mouse-1} will also works for this.
  4967. @c
  4968. @kindex @key{RET}
  4969. @itemx @key{RET}
  4970. Go to the original location of the item and delete other windows.
  4971. @c
  4972. @kindex f
  4973. @item f
  4974. Toggle Follow mode. In Follow mode, as you move the cursor through
  4975. the agenda buffer, the other window always shows the corresponding
  4976. location in the org file. The initial setting for this mode in new
  4977. agenda buffers can be set with the variable
  4978. @code{org-agenda-start-with-follow-mode}.
  4979. @c
  4980. @kindex b
  4981. @item b
  4982. Display the entire subtree of the current item in an indirect buffer. With a
  4983. numeric prefix argument N, go up to level N and then take that tree. If N is
  4984. negative, go up that many levels. With a @kbd{C-u} prefix, do not remove the
  4985. previously used indirect buffer.
  4986. @c
  4987. @kindex l
  4988. @item l
  4989. Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
  4990. logging was on (variable @code{org-log-done}) are shown in the agenda,
  4991. as are entries that have been clocked on that day.
  4992. @c
  4993. @kindex v
  4994. @item v
  4995. Toggle Archives mode. In archives mode, trees that are marked are also
  4996. scanned when producing the agenda. When you call this command with a
  4997. @kbd{C-u} prefix argument, even all archive files are included. To exit
  4998. archives mode, press @kbd{v} again.
  4999. @c
  5000. @kindex R
  5001. @item R
  5002. Toggle Clockreport mode. In clockreport mode, the daily/weekly agenda will
  5003. always show a table with the clocked times for the timespan and file scope
  5004. covered by the current agenda view. The initial setting for this mode in new
  5005. agenda buffers can be set with the variable
  5006. @code{org-agenda-start-with-clockreport-mode}.
  5007. @tsubheading{Change display}
  5008. @cindex display changing, in agenda
  5009. @kindex o
  5010. @item o
  5011. Delete other windows.
  5012. @c
  5013. @kindex d
  5014. @kindex w
  5015. @kindex m
  5016. @kindex y
  5017. @item d w m y
  5018. Switch to day/week/month/year view. When switching to day or week view,
  5019. this setting becomes the default for subsequent agenda commands. Since
  5020. month and year views are slow to create, they do not become the default.
  5021. A numeric prefix argument may be used to jump directly to a specific day
  5022. of the year, ISO week, month, or year, respectively. For example,
  5023. @kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When
  5024. setting day, week, or month view, a year may be encoded in the prefix
  5025. argument as well. For example, @kbd{200712 w} will jump to week 12 in
  5026. 2007. If such a year specification has only one or two digits, it will
  5027. be mapped to the interval 1938-2037.
  5028. @c
  5029. @kindex D
  5030. @item D
  5031. Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
  5032. @c
  5033. @kindex G
  5034. @item G
  5035. Toggle the time grid on and off. See also the variables
  5036. @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
  5037. @c
  5038. @kindex r
  5039. @item r
  5040. Recreate the agenda buffer, for example to reflect the changes
  5041. after modification of the time stamps of items with S-@key{left} and
  5042. S-@key{right}. When the buffer is the global TODO list, a prefix
  5043. argument is interpreted to create a selective list for a specific TODO
  5044. keyword.
  5045. @kindex g
  5046. @item g
  5047. Same as @kbd{r}.
  5048. @c
  5049. @kindex s
  5050. @kindex C-x C-s
  5051. @item s
  5052. @itemx C-x C-s
  5053. Save all Org buffers in the current Emacs session.
  5054. @c
  5055. @kindex @key{right}
  5056. @item @key{right}
  5057. Display the following @code{org-agenda-ndays} days. For example, if
  5058. the display covers a week, switch to the following week. With prefix
  5059. arg, go forward that many times @code{org-agenda-ndays} days.
  5060. @c
  5061. @kindex @key{left}
  5062. @item @key{left}
  5063. Display the previous dates.
  5064. @c
  5065. @kindex .
  5066. @item .
  5067. Go to today.
  5068. @c
  5069. @kindex C-c C-x C-c
  5070. @item C-c C-x C-c
  5071. Invoke column view (@pxref{Column view}) in the agenda buffer. The column
  5072. view format is taken from the entry at point, or (if there is no entry at
  5073. point), from the first entry in the agenda view. So whatever the format for
  5074. that entry would be in the original buffer (taken from a property, from a
  5075. @code{#+COLUMNS} line, or from the default variable
  5076. @code{org-columns-default-format}), will be used in the agenda.
  5077. @tsubheading{Secondary filtering and query editing}
  5078. @cindex query editing, in agenda
  5079. @kindex /
  5080. @item /
  5081. Filter the current agenda view with respect to a tag. You will be prompted
  5082. for a tag selection letter. Pressing @key{TAB} at that prompt will offer use
  5083. completion to select a tag (including any tags that do not have a selection
  5084. character). The command then hides all entries that do not contain or
  5085. inherit this tag. When called with prefix arg, remove the entries that
  5086. @emph{do} have the tag. A second @kbd{/} at the prompt will unhide any
  5087. hidden entries.
  5088. @kindex [
  5089. @kindex ]
  5090. @kindex @{
  5091. @kindex @}
  5092. @item [ ] @{ @}
  5093. In the @i{search view} (@pxref{Keyword search}), these keys add new search
  5094. words (@kbd{[} and @kbd{]}) or new regular expressions (@kbd{@{} and
  5095. @kbd{@}}) to the query string. The opening bracket/brace will add a positive
  5096. search term prefixed by @samp{+}, indicating that this search term @i{must}
  5097. occur/match in the entry. The closing bracket/brace will add a negative
  5098. search term which @i{must not} occur/match in the entry for it to be
  5099. selected.
  5100. @tsubheading{Remote editing}
  5101. @cindex remote editing, from agenda
  5102. @item 0-9
  5103. Digit argument.
  5104. @c
  5105. @cindex undoing remote-editing events
  5106. @cindex remote editing, undo
  5107. @kindex C-_
  5108. @item C-_
  5109. Undo a change due to a remote editing command. The change is undone
  5110. both in the agenda buffer and in the remote buffer.
  5111. @c
  5112. @kindex t
  5113. @item t
  5114. Change the TODO state of the item, both in the agenda and in the
  5115. original org file.
  5116. @c
  5117. @kindex C-k
  5118. @item C-k
  5119. Delete the current agenda item along with the entire subtree belonging
  5120. to it in the original Org file. If the text to be deleted remotely
  5121. is longer than one line, the kill needs to be confirmed by the user. See
  5122. variable @code{org-agenda-confirm-kill}.
  5123. @c
  5124. @kindex a
  5125. @item a
  5126. Toggle the ARCHIVE tag for the current headline.
  5127. @c
  5128. @kindex A
  5129. @item A
  5130. Move the subtree corresponding to the current entry to its @emph{Archive
  5131. Sibling}.
  5132. @c
  5133. @kindex $
  5134. @item $
  5135. Archive the subtree corresponding to the current headline. This means the
  5136. entry will be moved to the configured archive location, most likely a
  5137. different file.
  5138. @c
  5139. @kindex T
  5140. @item T
  5141. Show all tags associated with the current item. Because of
  5142. inheritance, this may be more than the tags listed in the line itself.
  5143. @c
  5144. @kindex :
  5145. @item :
  5146. Set tags for the current headline. If there is an active region in the
  5147. agenda, change a tag for all headings in the region.
  5148. @c
  5149. @kindex ,
  5150. @item ,
  5151. Set the priority for the current item. Org mode prompts for the
  5152. priority character. If you reply with @key{SPC}, the priority cookie
  5153. is removed from the entry.
  5154. @c
  5155. @kindex P
  5156. @item P
  5157. Display weighted priority of current item.
  5158. @c
  5159. @kindex +
  5160. @kindex S-@key{up}
  5161. @item +
  5162. @itemx S-@key{up}
  5163. Increase the priority of the current item. The priority is changed in
  5164. the original buffer, but the agenda is not resorted. Use the @kbd{r}
  5165. key for this.
  5166. @c
  5167. @kindex -
  5168. @kindex S-@key{down}
  5169. @item -
  5170. @itemx S-@key{down}
  5171. Decrease the priority of the current item.
  5172. @c
  5173. @kindex C-c C-s
  5174. @item C-c C-s
  5175. Schedule this item
  5176. @c
  5177. @kindex C-c C-d
  5178. @item C-c C-d
  5179. Set a deadline for this item.
  5180. @c
  5181. @kindex k
  5182. @item k
  5183. Agenda actions, to set dates for selected items to the cursor date.
  5184. This command also works in the calendar! The command prompts for an
  5185. additonal key:
  5186. @example
  5187. m @r{Mark the entry at point for action. You can also make entries}
  5188. @r{in Org files with @kbd{C-c C-x C-k}.}
  5189. d @r{Set the deadline of the marked entry to the date at point.}
  5190. s @r{Schedule the marked entry at the date at point.}
  5191. r @r{Call @code{org-remember} with the cursor date as default date.}
  5192. @end example
  5193. Press @kbd{r} afterwards to refresh the agenda and see the effect of the
  5194. command.
  5195. @c
  5196. @kindex S-@key{right}
  5197. @item S-@key{right}
  5198. Change the time stamp associated with the current line by one day into the
  5199. future. With a numeric prefix argument, change it by that many days. For
  5200. example, @kbd{3 6 5 S-@key{right}} will change it by a year. The stamp is
  5201. changed in the original org file, but the change is not directly reflected in
  5202. the agenda buffer. Use the @kbd{r} key to update the buffer.
  5203. @c
  5204. @kindex S-@key{left}
  5205. @item S-@key{left}
  5206. Change the time stamp associated with the current line by one day
  5207. into the past.
  5208. @c
  5209. @kindex >
  5210. @item >
  5211. Change the time stamp associated with the current line to today.
  5212. The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
  5213. on my keyboard.
  5214. @c
  5215. @kindex I
  5216. @item I
  5217. Start the clock on the current item. If a clock is running already, it
  5218. is stopped first.
  5219. @c
  5220. @kindex O
  5221. @item O
  5222. Stop the previously started clock.
  5223. @c
  5224. @kindex X
  5225. @item X
  5226. Cancel the currently running clock.
  5227. @kindex J
  5228. @item J
  5229. Jump to the running clock in another window.
  5230. @tsubheading{Calendar commands}
  5231. @cindex calendar commands, from agenda
  5232. @kindex c
  5233. @item c
  5234. Open the Emacs calendar and move to the date at the agenda cursor.
  5235. @c
  5236. @item c
  5237. When in the calendar, compute and show the Org mode agenda for the
  5238. date at the cursor.
  5239. @c
  5240. @cindex diary entries, creating from agenda
  5241. @kindex i
  5242. @item i
  5243. Insert a new entry into the diary. Prompts for the type of entry
  5244. (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
  5245. entry in the diary, just as @kbd{i d} etc. would do in the calendar.
  5246. The date is taken from the cursor position.
  5247. @c
  5248. @kindex M
  5249. @item M
  5250. Show the phases of the moon for the three months around current date.
  5251. @c
  5252. @kindex S
  5253. @item S
  5254. Show sunrise and sunset times. The geographical location must be set
  5255. with calendar variables, see documentation of the Emacs calendar.
  5256. @c
  5257. @kindex C
  5258. @item C
  5259. Convert the date at cursor into many other cultural and historic
  5260. calendars.
  5261. @c
  5262. @kindex H
  5263. @item H
  5264. Show holidays for three month around the cursor date.
  5265. @item M-x org-export-icalendar-combine-agenda-files
  5266. Export a single iCalendar file containing entries from all agenda files.
  5267. This is a globally available command, and also available in the agenda menu.
  5268. @tsubheading{Exporting to a file}
  5269. @kindex C-x C-w
  5270. @item C-x C-w
  5271. @cindex exporting agenda views
  5272. @cindex agenda views, exporting
  5273. Write the agenda view to a file. Depending on the extension of the
  5274. selected file name, the view will be exported as HTML (extension
  5275. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
  5276. plain text (any other extension). Use the variable
  5277. @code{org-agenda-exporter-settings} to set options for @file{ps-print}
  5278. and for @file{htmlize} to be used during export.
  5279. @tsubheading{Quit and Exit}
  5280. @kindex q
  5281. @item q
  5282. Quit agenda, remove the agenda buffer.
  5283. @c
  5284. @kindex x
  5285. @cindex agenda files, removing buffers
  5286. @item x
  5287. Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
  5288. for the compilation of the agenda. Buffers created by the user to
  5289. visit org files will not be removed.
  5290. @end table
  5291. @node Custom agenda views, Agenda column view, Agenda commands, Agenda Views
  5292. @section Custom agenda views
  5293. @cindex custom agenda views
  5294. @cindex agenda views, custom
  5295. Custom agenda commands serve two purposes: to store and quickly access
  5296. frequently used TODO and tags searches, and to create special composite
  5297. agenda buffers. Custom agenda commands will be accessible through the
  5298. dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
  5299. @menu
  5300. * Storing searches:: Type once, use often
  5301. * Block agenda:: All the stuff you need in a single buffer
  5302. * Setting Options:: Changing the rules
  5303. * Exporting Agenda Views:: Writing agendas to files
  5304. * Using the agenda elsewhere:: Using agenda information in other programs
  5305. @end menu
  5306. @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
  5307. @subsection Storing searches
  5308. The first application of custom searches is the definition of keyboard
  5309. shortcuts for frequently used searches, either creating an agenda
  5310. buffer, or a sparse tree (the latter covering of course only the current
  5311. buffer).
  5312. @kindex C-c a C
  5313. Custom commands are configured in the variable
  5314. @code{org-agenda-custom-commands}. You can customize this variable, for
  5315. example by pressing @kbd{C-c a C}. You can also directly set it with
  5316. Emacs Lisp in @file{.emacs}. The following example contains all valid
  5317. search types:
  5318. @lisp
  5319. @group
  5320. (setq org-agenda-custom-commands
  5321. '(("w" todo "WAITING")
  5322. ("W" todo-tree "WAITING")
  5323. ("u" tags "+boss-urgent")
  5324. ("v" tags-todo "+boss-urgent")
  5325. ("U" tags-tree "+boss-urgent")
  5326. ("f" occur-tree "\\<FIXME\\>")
  5327. ("h" . "HOME+Name tags searches") ; description for "h" prefix
  5328. ("hl" tags "+home+Lisa")
  5329. ("hp" tags "+home+Peter")
  5330. ("hk" tags "+home+Kim")))
  5331. @end group
  5332. @end lisp
  5333. @noindent
  5334. The initial string in each entry defines the keys you have to press
  5335. after the dispatcher command @kbd{C-c a} in order to access the command.
  5336. Usually this will be just a single character, but if you have many
  5337. similar commands, you can also define two-letter combinations where the
  5338. first character is the same in several combinations and serves as a
  5339. prefix key@footnote{You can provide a description for a prefix key by
  5340. inserting a cons cell with the prefix and the description.}. The second
  5341. parameter is the search type, followed by the string or regular
  5342. expression to be used for the matching. The example above will
  5343. therefore define:
  5344. @table @kbd
  5345. @item C-c a w
  5346. as a global search for TODO entries with @samp{WAITING} as the TODO
  5347. keyword
  5348. @item C-c a W
  5349. as the same search, but only in the current buffer and displaying the
  5350. results as a sparse tree
  5351. @item C-c a u
  5352. as a global tags search for headlines marked @samp{:boss:} but not
  5353. @samp{:urgent:}
  5354. @item C-c a v
  5355. as the same search as @kbd{C-c a u}, but limiting the search to
  5356. headlines that are also TODO items
  5357. @item C-c a U
  5358. as the same search as @kbd{C-c a u}, but only in the current buffer and
  5359. displaying the result as a sparse tree
  5360. @item C-c a f
  5361. to create a sparse tree (again: current buffer only) with all entries
  5362. containing the word @samp{FIXME}
  5363. @item C-c a h
  5364. as a prefix command for a HOME tags search where you have to press an
  5365. additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
  5366. Peter, or Kim) as additional tag to match.
  5367. @end table
  5368. @node Block agenda, Setting Options, Storing searches, Custom agenda views
  5369. @subsection Block agenda
  5370. @cindex block agenda
  5371. @cindex agenda, with block views
  5372. Another possibility is the construction of agenda views that comprise
  5373. the results of @emph{several} commands, each of which creates a block in
  5374. the agenda buffer. The available commands include @code{agenda} for the
  5375. daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
  5376. for the global TODO list (as constructed with @kbd{C-c a t}), and the
  5377. matching commands discussed above: @code{todo}, @code{tags}, and
  5378. @code{tags-todo}. Here are two examples:
  5379. @lisp
  5380. @group
  5381. (setq org-agenda-custom-commands
  5382. '(("h" "Agenda and Home-related tasks"
  5383. ((agenda "")
  5384. (tags-todo "home")
  5385. (tags "garden")))
  5386. ("o" "Agenda and Office-related tasks"
  5387. ((agenda "")
  5388. (tags-todo "work")
  5389. (tags "office")))))
  5390. @end group
  5391. @end lisp
  5392. @noindent
  5393. This will define @kbd{C-c a h} to create a multi-block view for stuff
  5394. you need to attend to at home. The resulting agenda buffer will contain
  5395. your agenda for the current week, all TODO items that carry the tag
  5396. @samp{home}, and also all lines tagged with @samp{garden}. Finally the
  5397. command @kbd{C-c a o} provides a similar view for office tasks.
  5398. @node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
  5399. @subsection Setting options for custom commands
  5400. @cindex options, for custom agenda views
  5401. Org mode contains a number of variables regulating agenda construction
  5402. and display. The global variables define the behavior for all agenda
  5403. commands, including the custom commands. However, if you want to change
  5404. some settings just for a single custom view, you can do so. Setting
  5405. options requires inserting a list of variable names and values at the
  5406. right spot in @code{org-agenda-custom-commands}. For example:
  5407. @lisp
  5408. @group
  5409. (setq org-agenda-custom-commands
  5410. '(("w" todo "WAITING"
  5411. ((org-agenda-sorting-strategy '(priority-down))
  5412. (org-agenda-prefix-format " Mixed: ")))
  5413. ("U" tags-tree "+boss-urgent"
  5414. ((org-show-following-heading nil)
  5415. (org-show-hierarchy-above nil)))
  5416. ("N" search ""
  5417. ((org-agenda-files '("~org/notes.org"))
  5418. (org-agenda-text-search-extra-files nil)))))
  5419. @end group
  5420. @end lisp
  5421. @noindent
  5422. Now the @kbd{C-c a w} command will sort the collected entries only by
  5423. priority, and the prefix format is modified to just say @samp{ Mixed: }
  5424. instead of giving the category of the entry. The sparse tags tree of
  5425. @kbd{C-c a U} will now turn out ultra-compact, because neither the
  5426. headline hierarchy above the match, nor the headline following the match
  5427. will be shown. The command @kbd{C-c a N} will do a text search limited
  5428. to only a single file.
  5429. For command sets creating a block agenda,
  5430. @code{org-agenda-custom-commands} has two separate spots for setting
  5431. options. You can add options that should be valid for just a single
  5432. command in the set, and options that should be valid for all commands in
  5433. the set. The former are just added to the command entry, the latter
  5434. must come after the list of command entries. Going back to the block
  5435. agenda example (@pxref{Block agenda}), let's change the sorting strategy
  5436. for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
  5437. the results for GARDEN tags query in the opposite order,
  5438. @code{priority-up}. This would look like this:
  5439. @lisp
  5440. @group
  5441. (setq org-agenda-custom-commands
  5442. '(("h" "Agenda and Home-related tasks"
  5443. ((agenda)
  5444. (tags-todo "home")
  5445. (tags "garden"
  5446. ((org-agenda-sorting-strategy '(priority-up)))))
  5447. ((org-agenda-sorting-strategy '(priority-down))))
  5448. ("o" "Agenda and Office-related tasks"
  5449. ((agenda)
  5450. (tags-todo "work")
  5451. (tags "office")))))
  5452. @end group
  5453. @end lisp
  5454. As you see, the values and parenthesis setting is a little complex.
  5455. When in doubt, use the customize interface to set this variable - it
  5456. fully supports its structure. Just one caveat: When setting options in
  5457. this interface, the @emph{values} are just lisp expressions. So if the
  5458. value is a string, you need to add the double quotes around the value
  5459. yourself.
  5460. @node Exporting Agenda Views, Using the agenda elsewhere, Setting Options, Custom agenda views
  5461. @subsection Exporting Agenda Views
  5462. @cindex agenda views, exporting
  5463. If you are away from your computer, it can be very useful to have a
  5464. printed version of some agenda views to carry around. Org mode can
  5465. export custom agenda views as plain text, HTML@footnote{You need to
  5466. install Hrvoje Niksic' @file{htmlize.el}.} postscript, and iCalendar
  5467. files. If you want to do this only occasionally, use the command
  5468. @table @kbd
  5469. @kindex C-x C-w
  5470. @item C-x C-w
  5471. @cindex exporting agenda views
  5472. @cindex agenda views, exporting
  5473. Write the agenda view to a file. Depending on the extension of the
  5474. selected file name, the view will be exported as HTML (extension
  5475. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}),
  5476. iCalendar (extension @file{.ics}), or plain text (any other extension).
  5477. Use the variable @code{org-agenda-exporter-settings} to
  5478. set options for @file{ps-print} and for @file{htmlize} to be used during
  5479. export, for example
  5480. @lisp
  5481. (setq org-agenda-exporter-settings
  5482. '((ps-number-of-columns 2)
  5483. (ps-landscape-mode t)
  5484. (htmlize-output-type 'css)))
  5485. @end lisp
  5486. @end table
  5487. If you need to export certain agenda views frequently, you can associate
  5488. any custom agenda command with a list of output file names
  5489. @footnote{If you want to store standard views like the weekly agenda
  5490. or the global TODO list as well, you need to define custom commands for
  5491. them in order to be able to specify file names.}. Here is an example
  5492. that first does define custom commands for the agenda and the global
  5493. todo list, together with a number of files to which to export them.
  5494. Then we define two block agenda commands and specify file names for them
  5495. as well. File names can be relative to the current working directory,
  5496. or absolute.
  5497. @lisp
  5498. @group
  5499. (setq org-agenda-custom-commands
  5500. '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
  5501. ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
  5502. ("h" "Agenda and Home-related tasks"
  5503. ((agenda "")
  5504. (tags-todo "home")
  5505. (tags "garden"))
  5506. nil
  5507. ("~/views/home.html"))
  5508. ("o" "Agenda and Office-related tasks"
  5509. ((agenda)
  5510. (tags-todo "work")
  5511. (tags "office"))
  5512. nil
  5513. ("~/views/office.ps" "~/calendars/office.ics"))))
  5514. @end group
  5515. @end lisp
  5516. The extension of the file name determines the type of export. If it is
  5517. @file{.html}, Org mode will use the @file{htmlize.el} package to convert
  5518. the buffer to HTML and save it to this file name. If the extension is
  5519. @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
  5520. postscript output. If the extension is @file{.ics}, iCalendar export is
  5521. run export over all files that were used to construct the agenda, and
  5522. limit the export to entries listed in the agenda now. Any other
  5523. extension produces a plain ASCII file.
  5524. The export files are @emph{not} created when you use one of those
  5525. commands interactively because this might use too much overhead.
  5526. Instead, there is a special command to produce @emph{all} specified
  5527. files in one step:
  5528. @table @kbd
  5529. @kindex C-c a e
  5530. @item C-c a e
  5531. Export all agenda views that have export file names associated with
  5532. them.
  5533. @end table
  5534. You can use the options section of the custom agenda commands to also
  5535. set options for the export commands. For example:
  5536. @lisp
  5537. (setq org-agenda-custom-commands
  5538. '(("X" agenda ""
  5539. ((ps-number-of-columns 2)
  5540. (ps-landscape-mode t)
  5541. (org-agenda-prefix-format " [ ] ")
  5542. (org-agenda-with-colors nil)
  5543. (org-agenda-remove-tags t))
  5544. ("theagenda.ps"))))
  5545. @end lisp
  5546. @noindent
  5547. This command sets two options for the postscript exporter, to make it
  5548. print in two columns in landscape format - the resulting page can be cut
  5549. in two and then used in a paper agenda. The remaining settings modify
  5550. the agenda prefix to omit category and scheduling information, and
  5551. instead include a checkbox to check off items. We also remove the tags
  5552. to make the lines compact, and we don't want to use colors for the
  5553. black-and-white printer. Settings specified in
  5554. @code{org-agenda-exporter-settings} will also apply, but the settings
  5555. in @code{org-agenda-custom-commands} take precedence.
  5556. @noindent
  5557. From the command line you may also use
  5558. @example
  5559. emacs -f org-batch-store-agenda-views -kill
  5560. @end example
  5561. @noindent
  5562. or, if you need to modify some parameters
  5563. @example
  5564. emacs -eval '(org-batch-store-agenda-views \
  5565. org-agenda-ndays 30 \
  5566. org-agenda-start-day "2007-11-01" \
  5567. org-agenda-include-diary nil \
  5568. org-agenda-files (quote ("~/org/project.org")))' \
  5569. -kill
  5570. @end example
  5571. @noindent
  5572. which will create the agenda views restricted to the file
  5573. @file{~/org/project.org}, without diary entries and with 30 days
  5574. extent.
  5575. @node Using the agenda elsewhere, , Exporting Agenda Views, Custom agenda views
  5576. @subsection Using agenda information outside of Org
  5577. @cindex agenda, pipe
  5578. @cindex Scripts, for agenda processing
  5579. Org provides commands to access agenda information for the command
  5580. line in emacs batch mode. This extracted information can be sent
  5581. directly to a printer, or it can be read by a program that does further
  5582. processing of the data. The first of these commands is the function
  5583. @code{org-batch-agenda}, that produces an agenda view and sends it as
  5584. ASCII text to STDOUT. The command takes a single string as parameter.
  5585. If the string has length 1, it is used as a key to one of the commands
  5586. you have configured in @code{org-agenda-custom-commands}, basically any
  5587. key you can use after @kbd{C-c a}. For example, to directly print the
  5588. current TODO list, you could use
  5589. @example
  5590. emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
  5591. @end example
  5592. If the parameter is a string with 2 or more characters, it is used as a
  5593. tags/todo match string. For example, to print your local shopping list
  5594. (all items with the tag @samp{shop}, but excluding the tag
  5595. @samp{NewYork}), you could use
  5596. @example
  5597. emacs -batch -l ~/.emacs \
  5598. -eval '(org-batch-agenda "+shop-NewYork")' | lpr
  5599. @end example
  5600. @noindent
  5601. You may also modify parameters on the fly like this:
  5602. @example
  5603. emacs -batch -l ~/.emacs \
  5604. -eval '(org-batch-agenda "a" \
  5605. org-agenda-ndays 30 \
  5606. org-agenda-include-diary nil \
  5607. org-agenda-files (quote ("~/org/project.org")))' \
  5608. | lpr
  5609. @end example
  5610. @noindent
  5611. which will produce a 30 day agenda, fully restricted to the Org file
  5612. @file{~/org/projects.org}, not even including the diary.
  5613. If you want to process the agenda data in more sophisticated ways, you
  5614. can use the command @code{org-batch-agenda-csv} to get a comma-separated
  5615. list of values for each agenda item. Each line in the output will
  5616. contain a number of fields separated by commas. The fields in a line
  5617. are:
  5618. @example
  5619. category @r{The category of the item}
  5620. head @r{The headline, without TODO kwd, TAGS and PRIORITY}
  5621. type @r{The type of the agenda entry, can be}
  5622. todo @r{selected in TODO match}
  5623. tagsmatch @r{selected in tags match}
  5624. diary @r{imported from diary}
  5625. deadline @r{a deadline}
  5626. scheduled @r{scheduled}
  5627. timestamp @r{appointment, selected by timestamp}
  5628. closed @r{entry was closed on date}
  5629. upcoming-deadline @r{warning about nearing deadline}
  5630. past-scheduled @r{forwarded scheduled item}
  5631. block @r{entry has date block including date}
  5632. todo @r{The TODO keyword, if any}
  5633. tags @r{All tags including inherited ones, separated by colons}
  5634. date @r{The relevant date, like 2007-2-14}
  5635. time @r{The time, like 15:00-16:50}
  5636. extra @r{String with extra planning info}
  5637. priority-l @r{The priority letter if any was given}
  5638. priority-n @r{The computed numerical priority}
  5639. @end example
  5640. @noindent
  5641. Time and date will only be given if a timestamp (or deadline/scheduled)
  5642. lead to the selection of the item.
  5643. A CSV list like this is very easy to use in a post processing script.
  5644. For example, here is a Perl program that gets the TODO list from
  5645. Emacs/Org and prints all the items, preceded by a checkbox:
  5646. @example
  5647. @group
  5648. #!/usr/bin/perl
  5649. # define the Emacs command to run
  5650. $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
  5651. # run it and capture the output
  5652. $agenda = qx@{$cmd 2>/dev/null@};
  5653. # loop over all lines
  5654. foreach $line (split(/\n/,$agenda)) @{
  5655. # get the individual values
  5656. ($category,$head,$type,$todo,$tags,$date,$time,$extra,
  5657. $priority_l,$priority_n) = split(/,/,$line);
  5658. # proccess and print
  5659. print "[ ] $head\n";
  5660. @}
  5661. @end group
  5662. @end example
  5663. @node Agenda column view, , Custom agenda views, Agenda Views
  5664. @section Using column view in the agenda
  5665. @cindex column view, in agenda
  5666. @cindex agenda, column view
  5667. Column view (@pxref{Column view}) is normally used to view and edit
  5668. properties embedded in the hierarchical structure of an Org file. It can be
  5669. quite useful to use column view also from the agenda, where entries are
  5670. collected by certain criteria.
  5671. @table @kbd
  5672. @kindex C-c C-x C-c
  5673. @item C-c C-x C-c
  5674. Turn on column view in the agenda.
  5675. @end table
  5676. To understand how to use this properly, it is important to realize that the
  5677. entries in the agenda are no longer in their proper outline environment.
  5678. This causes the following issues:
  5679. @enumerate
  5680. @item
  5681. Org needs to make a decision which @code{COLUMNS} format to use. Since the
  5682. entries in the agenda are collected from different files, and different files
  5683. may have different @code{COLUMNS} formats, this is a non-trivial problem.
  5684. Org first checks if the variable @code{org-overriding-columns-format} is
  5685. currently set, and if yes takes the format from there. Otherwise it takes
  5686. the format associated with the first item in the agenda, or, if that item
  5687. does not have a specific format (defined in a property, or in it's file), it
  5688. uses @code{org-columns-default-format}.
  5689. @item
  5690. If any of the columns has a summary type defined (@pxref{Column attributes}),
  5691. turning on column view in the agenda will visit all relevant agenda files and
  5692. make sure that the computations of this property are up to date. This is
  5693. also true for the special @code{CLOCKSUM} property. Org will then sum the
  5694. values displayed in the agenda. In the daily/weekly agenda, the sums will
  5695. cover a single day, in all other views they cover the entire block. It is
  5696. vital to realize that the agenda may show the same entry @emph{twice} (for
  5697. example as scheduled and as a deadline), and it may show two entries from the
  5698. same hierarchy (for example a @emph{parent} and it's @emph{child}). In these
  5699. cases, the summation in the agenda will lead to incorrect results because
  5700. some values will count double.
  5701. @item
  5702. When the column view in the agenda shows the @code{CLOCKSUM}, that is always
  5703. the entire clocked time for this item. So even in the daily/weekly agenda,
  5704. the clocksum listed in column view may originate from times outside the
  5705. current view. This has the advantage that you can compare these values with
  5706. a column listing the planned total effort for a task - one of the major
  5707. applications for column view in the agenda. If you want information about
  5708. clocked time in the displayed period use clock table mode (press @kbd{R} in
  5709. the agenda).
  5710. @end enumerate
  5711. @node Embedded LaTeX, Exporting, Agenda Views, Top
  5712. @chapter Embedded LaTeX
  5713. @cindex @TeX{} interpretation
  5714. @cindex La@TeX{} interpretation
  5715. Plain ASCII is normally sufficient for almost all note taking. One
  5716. exception, however, are scientific notes which need to be able to contain
  5717. mathematical symbols and the occasional formula. La@TeX{}@footnote{La@TeX{}
  5718. is a macro system based on Donald E. Knuth's @TeX{} system. Many of the
  5719. features described here as ``La@TeX{}'' are really from @TeX{}, but for
  5720. simplicity I am blurring this distinction.} is widely used to typeset
  5721. scientific documents. Org mode supports embedding La@TeX{} code into its
  5722. files, because many academics are used to reading La@TeX{} source code, and
  5723. because it can be readily processed into images for HTML production.
  5724. It is not necessary to mark La@TeX{} macros and code in any special way.
  5725. If you observe a few conventions, Org mode knows how to find it and what
  5726. to do with it.
  5727. @menu
  5728. * Math symbols:: TeX macros for symbols and Greek letters
  5729. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  5730. * LaTeX fragments:: Complex formulas made easy
  5731. * Processing LaTeX fragments:: Previewing LaTeX processing
  5732. * CDLaTeX mode:: Speed up entering of formulas
  5733. @end menu
  5734. @node Math symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
  5735. @section Math symbols
  5736. @cindex math symbols
  5737. @cindex TeX macros
  5738. You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
  5739. to indicate the Greek letter, or @samp{\to} to indicate an arrow.
  5740. Completion for these macros is available, just type @samp{\} and maybe a
  5741. few letters, and press @kbd{M-@key{TAB}} to see possible completions.
  5742. Unlike La@TeX{} code, Org mode allows these macros to be present
  5743. without surrounding math delimiters, for example:
  5744. @example
  5745. Angles are written as Greek letters \alpha, \beta and \gamma.
  5746. @end example
  5747. During HTML export (@pxref{HTML export}), these symbols are translated
  5748. into the proper syntax for HTML, for the above examples this is
  5749. @samp{&alpha;} and @samp{&rarr;}, respectively. If you need such a symbol
  5750. inside a word, terminate it like this: @samp{\Aacute@{@}stor}.
  5751. @node Subscripts and superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
  5752. @section Subscripts and superscripts
  5753. @cindex subscript
  5754. @cindex superscript
  5755. Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
  5756. and subscripts. Again, these can be used without embedding them in
  5757. math-mode delimiters. To increase the readability of ASCII text, it is
  5758. not necessary (but OK) to surround multi-character sub- and superscripts
  5759. with curly braces. For example
  5760. @example
  5761. The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
  5762. the sun is R_@{sun@} = 6.96 x 10^8 m.
  5763. @end example
  5764. To avoid interpretation as raised or lowered text, you can quote
  5765. @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
  5766. During HTML export (@pxref{HTML export}), subscript and superscripts
  5767. are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
  5768. @node LaTeX fragments, Processing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
  5769. @section LaTeX fragments
  5770. @cindex LaTeX fragments
  5771. With symbols, sub- and superscripts, HTML is pretty much at its end when
  5772. it comes to representing mathematical formulas@footnote{Yes, there is
  5773. MathML, but that is not yet fully supported by many browsers, and there
  5774. is no decent converter for turning La@TeX{} or ASCII representations of
  5775. formulas into MathML. So for the time being, converting formulas into
  5776. images seems the way to go.}. More complex expressions need a dedicated
  5777. formula processor. To this end, Org mode can contain arbitrary La@TeX{}
  5778. fragments. It provides commands to preview the typeset result of these
  5779. fragments, and upon export to HTML, all fragments will be converted to
  5780. images and inlined into the HTML document@footnote{The La@TeX{} export
  5781. will not use images for displaying La@TeX{} fragments but include these
  5782. fragments directly into the La@TeX{} code.}. For this to work you
  5783. need to be on a system with a working La@TeX{} installation. You also
  5784. need the @file{dvipng} program, available at
  5785. @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
  5786. will be used when processing a fragment can be configured with the
  5787. variable @code{org-format-latex-header}.
  5788. La@TeX{} fragments don't need any special marking at all. The following
  5789. snippets will be identified as La@TeX{} source code:
  5790. @itemize @bullet
  5791. @item
  5792. Environments of any kind. The only requirement is that the
  5793. @code{\begin} statement appears on a new line, preceded by only
  5794. whitespace.
  5795. @item
  5796. Text within the usual La@TeX{} math delimiters. To avoid conflicts with
  5797. currency specifications, single @samp{$} characters are only recognized
  5798. as math delimiters if the enclosed text contains at most two line breaks,
  5799. is directly attached to the @samp{$} characters with no whitespace in
  5800. between, and if the closing @samp{$} is followed by whitespace or
  5801. punctuation. For the other delimiters, there is no such restriction, so
  5802. when in doubt, use @samp{\(...\)} as inline math delimiters.
  5803. @end itemize
  5804. @noindent For example:
  5805. @example
  5806. \begin@{equation@} % arbitrary environments,
  5807. x=\sqrt@{b@} % even tables, figures
  5808. \end@{equation@} % etc
  5809. If $a^2=b$ and \( b=2 \), then the solution must be
  5810. either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
  5811. @end example
  5812. @noindent
  5813. If you need any of the delimiter ASCII sequences for other purposes, you
  5814. can configure the option @code{org-format-latex-options} to deselect the
  5815. ones you do not wish to have interpreted by the La@TeX{} converter.
  5816. @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
  5817. @section Processing LaTeX fragments
  5818. @cindex LaTeX fragments, preview
  5819. La@TeX{} fragments can be processed to produce a preview images of the
  5820. typeset expressions:
  5821. @table @kbd
  5822. @kindex C-c C-x C-l
  5823. @item C-c C-x C-l
  5824. Produce a preview image of the La@TeX{} fragment at point and overlay it
  5825. over the source code. If there is no fragment at point, process all
  5826. fragments in the current entry (between two headlines). When called
  5827. with a prefix argument, process the entire subtree. When called with
  5828. two prefix arguments, or when the cursor is before the first headline,
  5829. process the entire buffer.
  5830. @kindex C-c C-c
  5831. @item C-c C-c
  5832. Remove the overlay preview images.
  5833. @end table
  5834. During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
  5835. converted into images and inlined into the document if the following
  5836. setting is active:
  5837. @lisp
  5838. (setq org-export-with-LaTeX-fragments t)
  5839. @end lisp
  5840. @node CDLaTeX mode, , Processing LaTeX fragments, Embedded LaTeX
  5841. @section Using CDLaTeX to enter math
  5842. @cindex CDLaTeX
  5843. CDLaTeX mode is a minor mode that is normally used in combination with a
  5844. major La@TeX{} mode like AUCTeX in order to speed-up insertion of
  5845. environments and math templates. Inside Org mode, you can make use of
  5846. some of the features of CDLaTeX mode. You need to install
  5847. @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
  5848. AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
  5849. Don't use CDLaTeX mode itself under Org mode, but use the light
  5850. version @code{org-cdlatex-mode} that comes as part of Org mode. Turn it
  5851. on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
  5852. Org files with
  5853. @lisp
  5854. (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
  5855. @end lisp
  5856. When this mode is enabled, the following features are present (for more
  5857. details see the documentation of CDLaTeX mode):
  5858. @itemize @bullet
  5859. @kindex C-c @{
  5860. @item
  5861. Environment templates can be inserted with @kbd{C-c @{}.
  5862. @item
  5863. @kindex @key{TAB}
  5864. The @key{TAB} key will do template expansion if the cursor is inside a
  5865. La@TeX{} fragment@footnote{Org mode has a method to test if the cursor is
  5866. inside such a fragment, see the documentation of the function
  5867. @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
  5868. expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
  5869. correctly inside the first brace. Another @key{TAB} will get you into
  5870. the second brace. Even outside fragments, @key{TAB} will expand
  5871. environment abbreviations at the beginning of a line. For example, if
  5872. you write @samp{equ} at the beginning of a line and press @key{TAB},
  5873. this abbreviation will be expanded to an @code{equation} environment.
  5874. To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
  5875. @item
  5876. @kindex _
  5877. @kindex ^
  5878. Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
  5879. characters together with a pair of braces. If you use @key{TAB} to move
  5880. out of the braces, and if the braces surround only a single character or
  5881. macro, they are removed again (depending on the variable
  5882. @code{cdlatex-simplify-sub-super-scripts}).
  5883. @item
  5884. @kindex `
  5885. Pressing the backquote @kbd{`} followed by a character inserts math
  5886. macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
  5887. after the backquote, a help window will pop up.
  5888. @item
  5889. @kindex '
  5890. Pressing the normal quote @kbd{'} followed by another character modifies
  5891. the symbol before point with an accent or a font. If you wait more than
  5892. 1.5 seconds after the backquote, a help window will pop up. Character
  5893. modification will work only inside La@TeX{} fragments, outside the quote
  5894. is normal.
  5895. @end itemize
  5896. @node Exporting, Publishing, Embedded LaTeX, Top
  5897. @chapter Exporting
  5898. @cindex exporting
  5899. Org mode documents can be exported into a variety of other formats. For
  5900. printing and sharing of notes, ASCII export produces a readable and
  5901. simple version of an Org file. HTML export allows you to publish a
  5902. notes file on the web, while the XOXO format provides a solid base for
  5903. exchange with a broad range of other applications. La@TeX{} export lets
  5904. you use Org mode and its structured editing functions to easily create
  5905. La@TeX{} files. To incorporate entries with associated times like
  5906. deadlines or appointments into a desktop calendar program like iCal,
  5907. Org mode can also produce extracts in the iCalendar format. Currently
  5908. Org mode only supports export, not import of these different formats.
  5909. @menu
  5910. * Markup rules:: Which structures are recognized?
  5911. * Export options:: Per-file export settings
  5912. * The export dispatcher:: How to access exporter commands
  5913. * ASCII export:: Exporting to plain ASCII
  5914. * HTML export:: Exporting to HTML
  5915. * LaTeX export:: Exporting to LaTeX
  5916. * XOXO export:: Exporting to XOXO
  5917. * iCalendar export:: Exporting in iCalendar format
  5918. @end menu
  5919. @node Markup rules, Export options, Exporting, Exporting
  5920. @section Markup rules
  5921. When exporting Org mode documents, the exporter tries to reflect the
  5922. structure of the document as accurately as possible in the back-end. Since
  5923. export targets like HTML or La@TeX{} allow much richer formatting, Org mode
  5924. has rules how to prepare text for rich export. This section summarizes the
  5925. markup rule used in an Org mode buffer.
  5926. @menu
  5927. * Document title:: How the document title is determined
  5928. * Headings and sections:: The main structure of the exported document
  5929. * Table of contents:: If, where, how to create a table of contents
  5930. * Initial text:: Text before the first headline
  5931. * Lists:: Plain lists are exported
  5932. * Paragraphs:: What determines beginning and ending
  5933. * Literal examples:: Source code and other examples
  5934. * Include files:: Include the contents of a file during export
  5935. * Tables exported:: Tables are exported richly
  5936. * Footnotes:: Numbers like [1]
  5937. * Emphasis and monospace:: To bold or not to bold
  5938. * TeX macros and LaTeX fragments:: Create special, rich export.
  5939. * Horizontal rules:: A line across the page
  5940. * Comment lines:: Some lines will not be exported
  5941. @end menu
  5942. @node Document title, Headings and sections, Markup rules, Markup rules
  5943. @subheading Document title
  5944. @cindex document title, markup rules
  5945. @noindent
  5946. The title of the exported document is taken from the special line
  5947. @example
  5948. #+TITLE: This is the title of the document
  5949. @end example
  5950. @noindent
  5951. If this line does not exist, the title is derived from the first non-empty,
  5952. non-comment line in the buffer. If no such line exists, or if you have
  5953. turned off exporting of the text before the first headline (see below), the
  5954. title will be the file name without extension.
  5955. If you are exporting only a subtree by marking is as the region, the heading
  5956. of the subtree will become the title of the document. If the subtree has a
  5957. property @code{EXPORT_TITLE}, that will take precedence.
  5958. @node Headings and sections, Table of contents, Document title, Markup rules
  5959. @subheading Headings and sections
  5960. @cindex headings and sections, markup rules
  5961. The outline structure of the document as described in @ref{Document
  5962. Structure} forms the basis for defining sections of the exported document.
  5963. However, since the outline structure is also used for (for example) lists of
  5964. tasks, only the first three outline levels will be used as headings. Deeper
  5965. levels will become itemized lists. You can change the location of this
  5966. switch, globally by setting the variable @code{org-headline-levels}, or on a
  5967. per file basis with a line
  5968. @example
  5969. #+OPTIONS: H:4
  5970. @end example
  5971. @node Table of contents, Initial text, Headings and sections, Markup rules
  5972. @subheading Table of contents
  5973. @cindex table of contents, markup rules
  5974. The table of contents is normally inserted directly before the first headline
  5975. of the file. If you would like to get it to a different location, insert the
  5976. string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
  5977. location. The depth of the table of contents is by default the same as the
  5978. number of headline levels, but you can choose a smaller number or turn off
  5979. the table of contents entirely by configuring the variable
  5980. @code{org-export-with-toc}, or on a per-file basis with a line like
  5981. @example
  5982. #+OPTIONS: toc:2 (only to two levels in TOC)
  5983. #+OPTIONS: toc:nil (no TOC at all)
  5984. @end example
  5985. @node Initial text, Lists, Table of contents, Markup rules
  5986. @subheading Text before the first headline
  5987. @cindex text before first headline, markup rules
  5988. @cindex #+TEXT
  5989. Org mode normally exports the text before the first headline, and even uses
  5990. the first line as the document title. The text will be fully marked up. If
  5991. you need to include literal HTML or La@TeX{} code, use the special constructs
  5992. described below in the sections for the individual exporters.
  5993. Some people like to use the space before the first headline for setup and
  5994. internal links and therefore would like to control the exported text before
  5995. the first headline in a different way. You can do so by setting the variable
  5996. @code{org-export-skip-text-before-1st-heading} to @code{t}. On a per-file
  5997. basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
  5998. @noindent
  5999. If you still want to have some text before the first headline, use the
  6000. @code{#+TEXT} construct:
  6001. @example
  6002. #+OPTIONS: skip:t
  6003. #+TEXT: This text will go before the *first* headline.
  6004. #+TEXT: [TABLE-OF-CONTENTS]
  6005. #+TEXT: This goes between the table of contents and the first headline
  6006. @end example
  6007. @node Lists, Paragraphs, Initial text, Markup rules
  6008. @subheading Lists
  6009. @cindex lists, markup rules
  6010. Plain lists as described in @ref{Plain lists} are translated to the back-ends
  6011. syntax for such lists. Most back-ends support unordered, ordered, and
  6012. description lists.
  6013. @node Paragraphs, Literal examples, Lists, Markup rules
  6014. @subheading Paragraphs, line breaks, and quoting
  6015. @cindex paragraphs, markup rules
  6016. Paragraphs are separated by at least one empty line. If you need to enforce
  6017. a line break within a paragraph, use @samp{\\} at the end of a line.
  6018. To keep the line breaks in a region, but otherwise use normal formatting, you
  6019. can use this construct, which can also be used to format poetry.
  6020. @example
  6021. #+BEGIN_VERSE
  6022. Great clouds overhead
  6023. Tiny black birds rise and fall
  6024. Snow covers Emacs
  6025. -- AlexSchroeder
  6026. #+END_VERSE
  6027. @end example
  6028. When quoting a passage from another document, it is customary to format this
  6029. as a paragraph that is indented on both the left and the right margin. You
  6030. can include quotations in Org mode documents like this:
  6031. @example
  6032. #+BEGIN_QUOTE
  6033. Everything should be made as simple as possible,
  6034. but not any simpler -- Albert Einstein
  6035. #+END_QUOTE
  6036. @end example
  6037. @node Literal examples, Include files, Paragraphs, Markup rules
  6038. @subheading Literal examples
  6039. @cindex literal examples, markup rules
  6040. You can include literal examples that should not be subjected to
  6041. markup. Such examples will be typeset in monospace, so this is well suited
  6042. for source code and similar examples.
  6043. @cindex #+BEGIN_EXAMPLE
  6044. @example
  6045. #+BEGIN_EXAMPLE
  6046. Some example from a text file.
  6047. #+END_EXAMPLE
  6048. @end example
  6049. For simplicity when using small examples, you can also start the example
  6050. lines with a colon:
  6051. @example
  6052. : Some example from a text file.
  6053. @end example
  6054. @cindex formatting source code, markup rules
  6055. If the example is source code from a programming language, or any other text
  6056. that can be marked up by font-lock in Emacs, you can ask for the example to
  6057. look like the fontified Emacs buffer@footnote{Currently this works only for
  6058. the HTML back-end, and requires the @file{htmlize.el} package version 1.34 or
  6059. later.}. This is done with the @samp{src} block, where you also need to
  6060. specify the name of the major mode that should be used to fontify the
  6061. example:
  6062. @cindex #+BEGIN_SRC
  6063. @example
  6064. #+BEGIN_SRC emacs-lisp
  6065. (defun org-xor (a b)
  6066. "Exclusive or."
  6067. (if a (not b) b))
  6068. #+END_SRC
  6069. @end example
  6070. @table @kbd
  6071. @kindex C-c '
  6072. @item C-c '
  6073. Edit the source code example at point in its native mode. This works by
  6074. switching to an indirect buffer, narrowing the buffer and switching to the
  6075. other mode. You need to exit by pressing @kbd{C-c '} again. Fixed-width
  6076. regions (where each line starts with a colon followed by a space) will be
  6077. edited using @code{artist-mode}@footnote{You may select a different-mode with
  6078. the variable @code{org-edit-fixed-width-region-mode}.} to allow creating
  6079. ASCII drawings easily. Using this command in an empty line will create a new
  6080. fixed-width region.
  6081. @end table
  6082. @node Include files, Tables exported, Literal examples, Markup rules
  6083. @subheading Include files
  6084. @cindex include files, markup rules
  6085. During export, you can include the content of another file. For example, to
  6086. include your .emacs file, you could use:
  6087. @cindex #+INCLUDE
  6088. @example
  6089. #+INCLUDE: "~/.emacs" src emacs-lisp
  6090. @end example
  6091. The optional second and third parameter are the markup (@samp{quote},
  6092. @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
  6093. language for formatting the contents. The markup is optional, if it is not
  6094. given, the text will be assumed to be in Org mode format and will be
  6095. processed normally. The include line will also allow additional keyword
  6096. parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
  6097. first line and for each following line. For example, to include a file as an
  6098. item, use
  6099. @example
  6100. #+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
  6101. @end example
  6102. @table @kbd
  6103. @kindex C-c '
  6104. @item C-c '
  6105. Visit the include file at point.
  6106. @end table
  6107. @node Tables exported, Footnotes, Include files, Markup rules
  6108. @subheading Tables
  6109. @cindex tables, markup rules
  6110. Both the native Org mode tables (@pxref{Tables}) and tables formatted with
  6111. the @file{table.el} package will be exported properly. For Org mode tables,
  6112. the lines before the first horizontal separator line will become table header
  6113. lines.
  6114. @node Footnotes, Emphasis and monospace, Tables exported, Markup rules
  6115. @subheading Footnotes
  6116. @cindex footnotes, markup rules
  6117. @cindex @file{footnote.el}
  6118. @kindex C-c !
  6119. Numbers in square brackets are treated as footnote markers, and lines
  6120. starting with such a marker are interpreted as the footnote itself. You can
  6121. use the Emacs package @file{footnote.el} to create footnotes@footnote{The
  6122. @file{footnote} package uses @kbd{C-c !} to invoke its commands. This
  6123. binding conflicts with the Org mode command for inserting inactive time
  6124. stamps. You could use the variable @code{footnote-prefix} to switch
  6125. footnotes commands to another key. Or, if you are too used to this binding,
  6126. you could use @code{org-replace-disputed-keys} and @code{org-disputed-keys}
  6127. to change the settings in Org.}. For example:
  6128. @example
  6129. The Org homepage[1] now looks a lot better than it used to.
  6130. [1] The link is: http://orgmode.org
  6131. @end example
  6132. @node Emphasis and monospace, TeX macros and LaTeX fragments, Footnotes, Markup rules
  6133. @subheading Emphasis and monospace
  6134. @cindex underlined text, markup rules
  6135. @cindex bold text, markup rules
  6136. @cindex italic text, markup rules
  6137. @cindex verbatim text, markup rules
  6138. @cindex code text, markup rules
  6139. @cindex strike-through text, markup rules
  6140. You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
  6141. and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
  6142. in the code and verbatim string is not processed for Org mode specific
  6143. syntax, it is exported verbatim.
  6144. @node TeX macros and LaTeX fragments, Horizontal rules, Emphasis and monospace, Markup rules
  6145. @subheading @TeX{} macros and La@TeX{} fragments
  6146. @cindex LaTeX fragments, markup rules
  6147. @cindex TeX macros, markup rules
  6148. @cindex HTML entities
  6149. @cindex LaTeX entities
  6150. A @TeX{}-like syntax is used to specify special characters. Where possible,
  6151. these will be transformed into the native format of the exporter back-end.
  6152. Strings like @code{\alpha} will be exported as @code{&alpha;} in the HTML
  6153. output, and as @code{$\alpha$} in the La@TeX{} output. Similarly,
  6154. @code{\nbsp} will become @code{&nbsp;} in HTML and @code{~} in La@TeX{}.
  6155. This applies for a large number of entities, with names taken from both HTML
  6156. and La@TeX{}, see the variable @code{org-html-entities} for the complete
  6157. list. If you are unsure about a name, use @kbd{M-@key{TAB}} for completion
  6158. after having types the backslash and maybe a few characters
  6159. (@pxref{Completion}).
  6160. La@TeX{} fragments are converted into images for HTML export, and they are
  6161. written literally into the La@TeX{} export. See also @ref{Embedded LaTeX}.
  6162. Finally, @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
  6163. @samp{...} are all converted into special commands creating hyphens of
  6164. different lengths or a compact set of dots.
  6165. @node Horizontal rules, Comment lines, TeX macros and LaTeX fragments, Markup rules
  6166. @subheading Horizontal rules
  6167. @cindex horizontal rules, markup rules
  6168. A line consisting of only dashes, and at least 5 of them, will be
  6169. exported as a horizontal line (@samp{<hr/>} in HTML).
  6170. @node Comment lines, , Horizontal rules, Markup rules
  6171. @subheading Comment lines
  6172. @cindex comment lines
  6173. @cindex exporting, not
  6174. Lines starting with @samp{#} in column zero are treated as comments and will
  6175. never be exported. Also entire subtrees starting with the word
  6176. @samp{COMMENT} will never be exported. Finally, regions surrounded by
  6177. @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
  6178. @table @kbd
  6179. @kindex C-c ;
  6180. @item C-c ;
  6181. Toggle the COMMENT keyword at the beginning of an entry.
  6182. @end table
  6183. @node Export options, The export dispatcher, Markup rules, Exporting
  6184. @section Export options
  6185. @cindex options, for export
  6186. @cindex completion, of option keywords
  6187. The exporter recognizes special lines in the buffer which provide
  6188. additional information. These lines may be put anywhere in the file.
  6189. The whole set of lines can be inserted into the buffer with @kbd{C-c
  6190. C-e t}. For individual lines, a good way to make sure the keyword is
  6191. correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
  6192. (@pxref{Completion}).
  6193. @table @kbd
  6194. @kindex C-c C-e t
  6195. @item C-c C-e t
  6196. Insert template with export options, see example below.
  6197. @end table
  6198. @cindex #+TITLE:
  6199. @cindex #+AUTHOR:
  6200. @cindex #+DATE:
  6201. @cindex #+EMAIL:
  6202. @cindex #+LANGUAGE:
  6203. @cindex #+TEXT:
  6204. @cindex #+OPTIONS:
  6205. @cindex #+LINK_UP:
  6206. @cindex #+LINK_HOME:
  6207. @example
  6208. #+TITLE: the title to be shown (default is the buffer name)
  6209. #+AUTHOR: the author (default taken from @code{user-full-name})
  6210. #+DATE: A date, fixed, of a format string for @code{format-time-string}
  6211. #+EMAIL: his/her email address (default from @code{user-mail-address})
  6212. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  6213. #+TEXT: Some descriptive text to be inserted at the beginning.
  6214. #+TEXT: Several lines may be given.
  6215. #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
  6216. #+LINK_UP: the ``up'' link of an exported page
  6217. #+LINK_HOME: the ``home'' link of an exported page
  6218. @end example
  6219. @noindent
  6220. The OPTIONS line is a compact@footnote{If you want to configure many options
  6221. this way, you can use several OPTIONS lines.} form to specify export settings. Here
  6222. you can:
  6223. @cindex headline levels
  6224. @cindex section-numbers
  6225. @cindex table of contents
  6226. @cindex line-break preservation
  6227. @cindex quoted HTML tags
  6228. @cindex fixed-width sections
  6229. @cindex tables
  6230. @cindex @TeX{}-like syntax for sub- and superscripts
  6231. @cindex footnotes
  6232. @cindex special strings
  6233. @cindex emphasized text
  6234. @cindex @TeX{} macros
  6235. @cindex La@TeX{} fragments
  6236. @cindex author info, in export
  6237. @cindex time info, in export
  6238. @example
  6239. H: @r{set the number of headline levels for export}
  6240. num: @r{turn on/off section-numbers}
  6241. toc: @r{turn on/off table of contents, or set level limit (integer)}
  6242. \n: @r{turn on/off line-break-preservation}
  6243. @@: @r{turn on/off quoted HTML tags}
  6244. :: @r{turn on/off fixed-width sections}
  6245. |: @r{turn on/off tables}
  6246. ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
  6247. @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
  6248. @r{the simple @code{a_b} will be left as it is.}
  6249. -: @r{turn on/off conversion of special strings.}
  6250. f: @r{turn on/off footnotes like this[1].}
  6251. *: @r{turn on/off emphasized text (bold, italic, underlined)}
  6252. TeX: @r{turn on/off simple @TeX{} macros in plain text}
  6253. LaTeX: @r{turn on/off La@TeX{} fragments}
  6254. skip: @r{turn on/off skipping the text before the first heading}
  6255. author: @r{turn on/off inclusion of author name/email into exported file}
  6256. creator: @r{turn on/off inclusion of creator info into exported file}
  6257. timestamp: @r{turn on/off inclusion creation time into exported file}
  6258. d: @r{turn on/off inclusion of drawers}
  6259. @end example
  6260. These options take effect in both the HTML and La@TeX{} export, except
  6261. for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
  6262. @code{nil} for the La@TeX{} export.
  6263. When exporting only a single subtree by selecting it with @kbd{C-c @@} before
  6264. calling an export command, the subtree can overrule some of the file's export
  6265. settings with properties @code{EXPORT_FILE_NAME}, @code{EXPORT_TITLE},
  6266. @code{EXPORT_TEXT}, and @code{EXPORT_OPTIONS}.
  6267. @node The export dispatcher, ASCII export, Export options, Exporting
  6268. @section The export dispatcher
  6269. @cindex dispatcher, for export commands
  6270. All export commands can be reached using the export dispatcher, which is a
  6271. prefix key that prompts for an additional key specifying the command.
  6272. Normally the entire file is exported, but if there is an active region that
  6273. contains one outline tree, the first heading is used as document title and
  6274. the subtrees are exported.
  6275. @table @kbd
  6276. @kindex C-c C-e
  6277. @item C-c C-e
  6278. Dispatcher for export and publishing commands. Displays a help-window
  6279. listing the additional key(s) needed to launch an export or publishing
  6280. command. The prefix arg is passed through to the exporter. If the option
  6281. @code{org-export-run-in-background} is set, Org will run the command in the
  6282. background if that seems useful for the specific command (i.e. commands that
  6283. write to a file).
  6284. @kindex C-c C-e v
  6285. @item C-c C-e v
  6286. Like @kbd{C-c C-e}, but only export the text that is currently visible
  6287. (i.e. not hidden by outline visibility).
  6288. @kindex C-u C-u C-c C-e
  6289. @item C-u C-u C-c C-e
  6290. Call an the exporter, but reverse the setting of
  6291. @code{org-export-run-in-background}, i.e. request background processing if
  6292. not set, or force processing in the current Emacs process if st.
  6293. @end table
  6294. @node ASCII export, HTML export, The export dispatcher, Exporting
  6295. @section ASCII export
  6296. @cindex ASCII export
  6297. ASCII export produces a simple and very readable version of an Org mode
  6298. file.
  6299. @cindex region, active
  6300. @cindex active region
  6301. @cindex Transient mark mode
  6302. @table @kbd
  6303. @kindex C-c C-e a
  6304. @item C-c C-e a
  6305. Export as ASCII file. For an org file @file{myfile.org}, the ASCII file
  6306. will be @file{myfile.txt}. The file will be overwritten without
  6307. warning. If there is an active region, only the region will be
  6308. exported. If the selected region is a single tree@footnote{To select the
  6309. current subtree, use @kbd{C-c @@}.}, the tree head will
  6310. become the document title. If the tree head entry has or inherits an
  6311. @code{EXPORT_FILE_NAME} property, that name will be used for the
  6312. export.
  6313. @kindex C-c C-e v a
  6314. @item C-c C-e v a
  6315. Export only the visible part of the document.
  6316. @end table
  6317. @cindex headline levels, for exporting
  6318. In the exported version, the first 3 outline levels will become
  6319. headlines, defining a general document structure. Additional levels
  6320. will be exported as itemized lists. If you want that transition to occur
  6321. at a different level, specify it with a prefix argument. For example,
  6322. @example
  6323. @kbd{C-1 C-c C-e a}
  6324. @end example
  6325. @noindent
  6326. creates only top level headlines and does the rest as items. When
  6327. headlines are converted to items, the indentation of the text following
  6328. the headline is changed to fit nicely under the item. This is done with
  6329. the assumption that the first body line indicates the base indentation of
  6330. the body text. Any indentation larger than this is adjusted to preserve
  6331. the layout relative to the first line. Should there be lines with less
  6332. indentation than the first, these are left alone.
  6333. @node HTML export, LaTeX export, ASCII export, Exporting
  6334. @section HTML export
  6335. @cindex HTML export
  6336. Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
  6337. HTML formatting, in ways similar to John Grubers @emph{markdown}
  6338. language, but with additional support for tables.
  6339. @menu
  6340. * HTML Export commands:: How to invoke HTML export
  6341. * Quoting HTML tags:: Using direct HTML in Org mode
  6342. * Links:: Transformation of links for HTML
  6343. * Images:: How to include images
  6344. * CSS support:: Changing the appearance of the output
  6345. * Javascript support:: Info and Folding in a web browser
  6346. @end menu
  6347. @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
  6348. @subsection HTML export commands
  6349. @cindex region, active
  6350. @cindex active region
  6351. @cindex Transient mark mode
  6352. @table @kbd
  6353. @kindex C-c C-e h
  6354. @item C-c C-e h
  6355. Export as HTML file @file{myfile.html}. For an org file @file{myfile.org},
  6356. the ASCII file will be @file{myfile.html}. The file will be overwritten
  6357. without warning. If there is an active region, only the region will be
  6358. exported. If the selected region is a single tree@footnote{To select the
  6359. current subtree, use @kbd{C-c @@}.}, the tree head will become the document
  6360. title. If the tree head entry has or inherits an @code{EXPORT_FILE_NAME}
  6361. property, that name will be used for the export.
  6362. @kindex C-c C-e b
  6363. @item C-c C-e b
  6364. Export as HTML file and immediately open it with a browser.
  6365. @kindex C-c C-e H
  6366. @item C-c C-e H
  6367. Export to a temporary buffer, do not create a file.
  6368. @kindex C-c C-e R
  6369. @item C-c C-e R
  6370. Export the active region to a temporary buffer. With a prefix argument, do
  6371. not produce the file header and footer, but just the plain HTML section for
  6372. the region. This is good for cut-and-paste operations.
  6373. @kindex C-c C-e v h
  6374. @kindex C-c C-e v b
  6375. @kindex C-c C-e v H
  6376. @kindex C-c C-e v R
  6377. @item C-c C-e v h
  6378. @item C-c C-e v b
  6379. @item C-c C-e v H
  6380. @item C-c C-e v R
  6381. Export only the visible part of the document.
  6382. @item M-x org-export-region-as-html
  6383. Convert the region to HTML under the assumption that it was Org mode
  6384. syntax before. This is a global command that can be invoked in any
  6385. buffer.
  6386. @item M-x org-replace-region-by-HTML
  6387. Replace the active region (assumed to be in Org mode syntax) by HTML
  6388. code.
  6389. @end table
  6390. @cindex headline levels, for exporting
  6391. In the exported version, the first 3 outline levels will become headlines,
  6392. defining a general document structure. Additional levels will be exported as
  6393. itemized lists. If you want that transition to occur at a different level,
  6394. specify it with a numeric prefix argument. For example,
  6395. @example
  6396. @kbd{C-2 C-c C-e b}
  6397. @end example
  6398. @noindent
  6399. creates two levels of headings and does the rest as items.
  6400. @node Quoting HTML tags, Links, HTML Export commands, HTML export
  6401. @subsection Quoting HTML tags
  6402. Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
  6403. @samp{&gt;} in HTML export. If you want to include simple HTML tags
  6404. which should be interpreted as such, mark them with @samp{@@} as in
  6405. @samp{@@<b>bold text@@</b>}. Note that this really works only for
  6406. simple tags. For more extensive HTML that should be copied verbatim to
  6407. the exported file use either
  6408. @example
  6409. #+HTML: Literal HTML code for export
  6410. @end example
  6411. @noindent or
  6412. @cindex #+BEGIN_HTML
  6413. @example
  6414. #+BEGIN_HTML
  6415. All lines between these markers are exported literally
  6416. #+END_HTML
  6417. @end example
  6418. @node Links, Images, Quoting HTML tags, HTML export
  6419. @subsection Links
  6420. @cindex links, in HTML export
  6421. @cindex internal links, in HTML export
  6422. @cindex external links, in HTML export
  6423. Internal links (@pxref{Internal links}) will continue to work in HTML
  6424. files only if they match a dedicated @samp{<<target>>}. Automatic links
  6425. created by radio targets (@pxref{Radio targets}) will also work in the
  6426. HTML file. Links to external files will still work if the HTML file is
  6427. in the same directory as the Org file. Links to other @file{.org}
  6428. files will be translated into HTML links under the assumption that an
  6429. HTML version also exists of the linked file. For information related to
  6430. linking files while publishing them to a publishing directory see
  6431. @ref{Publishing links}.
  6432. If you want to specify attributes for links, you can do so using a special
  6433. syntax. Here is an example that sets @code{alt} and @code{title} attributes
  6434. for an inlined image:
  6435. @example
  6436. [[./img/a.jpg@{@{alt="This is image A" title="Image with no action"@}@}]]
  6437. @end example
  6438. @node Images, CSS support, Links, HTML export
  6439. @subsection Images
  6440. @cindex images, inline in HTML
  6441. @cindex inlining images in HTML
  6442. HTML export can inline images given as links in the Org file, and
  6443. it can make an image the clickable part of a link. By
  6444. default@footnote{but see the variable
  6445. @code{org-export-html-inline-images}}, images are inlined if a link does
  6446. not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
  6447. while @samp{[[file:myimg.jpg][the image]]} will just produce a link
  6448. @samp{the image} that points to the image. If the description part
  6449. itself is a @code{file:} link or a @code{http:} URL pointing to an
  6450. image, this image will be inlined and activated so that clicking on the
  6451. image will activate the link. For example, to include a thumbnail that
  6452. will link to a high resolution version of the image, you could use:
  6453. @example
  6454. [[file:highres.jpg][file:thumb.jpg]]
  6455. @end example
  6456. @noindent
  6457. and you could use @code{http} addresses just as well.
  6458. @node CSS support, Javascript support, Images, HTML export
  6459. @subsection CSS support
  6460. @cindex CSS, for HTML export
  6461. @cindex HTML export, CSS
  6462. You can also give style information for the exported file. The HTML
  6463. exporter assigns the following CSS classes to appropriate parts of the
  6464. document - your style specifications may change these:
  6465. @example
  6466. .todo @r{TODO keywords}
  6467. .done @r{the DONE keyword}
  6468. .timestamp @r{time stamp}
  6469. .timestamp-kwd @r{keyword associated with a time stamp, like SCHEDULED}
  6470. .tag @r{tag in a headline}
  6471. .target @r{target for links}
  6472. @end example
  6473. Each exported files contains a compact default style that defines these
  6474. classes in a basic way. You may overwrite these settings, or add to them by
  6475. using the variables @code{org-export-html-style} (for Org-wide settings) and
  6476. @code{org-export-html-style-extra} (for more granular settings, like
  6477. file-local settings). If you want to use a file-local style, you may use
  6478. file variables, best wrapped into a COMMENT section at the end of the outline
  6479. tree. For example@footnote{Under Emacs 21, the continuation lines for a
  6480. variable value should have no @samp{#} at the start of the line.}:
  6481. @example
  6482. * COMMENT html style specifications
  6483. # Local Variables:
  6484. # org-export-html-style-extra:
  6485. # "<style>
  6486. # p @{font-weight: normal; color: gray; @}
  6487. # h1 @{color: black; @}
  6488. # </style>"
  6489. # End:
  6490. @end example
  6491. Remember to execute @kbd{M-x normal-mode} after changing this to make the new
  6492. style immediately visible to Emacs. This command restarts Org mode for the
  6493. current buffer and forces Emacs to re-evaluate the local variables section in
  6494. the buffer.
  6495. @c FIXME: More about header and footer styles
  6496. @c FIXME: Talk about links and targets.
  6497. @node Javascript support, , CSS support, HTML export
  6498. @subsection Javascript supported display of web pages
  6499. @emph{Sebastian Rose} has written a JavaScript program especially designed to
  6500. enhance the web viewing experience of HTML files created with Org. This
  6501. program allows to view large files in two different ways. The first one is
  6502. an @emph{Info}-like mode where each section is displayed separately and
  6503. navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
  6504. as well, press @kbd{?} for an overview of the available keys). The second
  6505. view type is a @emph{folding} view much like Org provides it inside Emacs.
  6506. The script is available at @url{http://orgmode.org/org-info.js} and you can
  6507. find the documentation for it at
  6508. @url{http://orgmode.org/worg/code/org-info-js/org-info.js.html}. We are
  6509. serving the script from our site, but if you use it a lot, you might not want
  6510. to be dependent on @url{orgmode.org} and prefer to install a local copy on
  6511. your own web server.
  6512. To use the script, you need to make sure that the @file{org-jsinfo.el} module
  6513. gets loaded. It should be loaded by default, try @kbd{M-x customize-variable
  6514. @key{RET} org-modules @key{RET}} to convince yourself that this is indeed the
  6515. case. All it then takes to make use of the program is adding a single line
  6516. to the Org file:
  6517. @example
  6518. #+INFOJS_OPT: view:info toc:nil
  6519. @end example
  6520. @noindent
  6521. If this line is found, the HTML header will automatically contain the code
  6522. needed to invoke the script. Using the line above, you can set the following
  6523. viewing options:
  6524. @example
  6525. path: @r{The path to the script. The default is to grab the script from}
  6526. @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
  6527. @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
  6528. view: @r{Initial view when website is first shown. Possible values are:}
  6529. info @r{Info-like interface with one section per page.}
  6530. overview @r{Folding interface, initially showing only top-level.}
  6531. content @r{Folding interface, starting with all headlines visible.}
  6532. showall @r{Folding interface, all headlines and text visible.}
  6533. sdepth: @r{Maximum headline level that will still become an independent}
  6534. @r{section for info and folding modes. The default is taken from}
  6535. @r{@code{org-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
  6536. @r{If this is smaller than in @code{org-headline-levels}, each}
  6537. @r{info/folding section can still contain children headlines.}
  6538. toc: @r{Should the table of content @emph{initially} be visible?}
  6539. @r{Even when @code{nil}, you can always get to the toc with @kbd{i}.}
  6540. tdepth: @r{The depth of the table of contents. The defaults are taken from}
  6541. @r{the variables @code{org-headline-levels} and @code{org-export-with-toc}.}
  6542. ftoc: @r{Does the css of the page specify a fixed position for the toc?}
  6543. @r{If yes, the toc will never be displayed as a section.}
  6544. ltoc: @r{Should there be short contents (children) in each section?}
  6545. mouse: @r{Headings are highlighted when the mouse is over them. Should be}
  6546. @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
  6547. buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the}
  6548. @r{default), only one such button will be present.}
  6549. @end example
  6550. You can choose default values for these options by customizing the variable
  6551. @code{org-infojs-options}. If you always want to apply the script to your
  6552. pages, configure the variable @code{org-export-html-use-infojs}.
  6553. @node LaTeX export, XOXO export, HTML export, Exporting
  6554. @section LaTeX export
  6555. @cindex LaTeX export
  6556. Org mode contains a La@TeX{} exporter written by Bastien Guerry.
  6557. @menu
  6558. * LaTeX export commands:: How to invoke LaTeX export
  6559. * Quoting LaTeX code:: Incorporating literal LaTeX code
  6560. * Sectioning structure:: Changing sectioning in LaTeX output
  6561. @end menu
  6562. @node LaTeX export commands, Quoting LaTeX code, LaTeX export, LaTeX export
  6563. @subsection LaTeX export commands
  6564. @table @kbd
  6565. @kindex C-c C-e l
  6566. @item C-c C-e l
  6567. Export as La@TeX{} file @file{myfile.tex}. For an org file
  6568. @file{myfile.org}, the ASCII file will be @file{myfile.tex}. The file will
  6569. be overwritten without warning. If there is an active region, only the
  6570. region will be exported. If the selected region is a single tree@footnote{To
  6571. select the current subtree, use @kbd{C-c @@}.}, the tree head will become the
  6572. document title. If the tree head entry has or inherits an
  6573. @code{EXPORT_FILE_NAME} property, that name will be used for the export.
  6574. @kindex C-c C-e L
  6575. @item C-c C-e L
  6576. Export to a temporary buffer, do not create a file.
  6577. @kindex C-c C-e v l
  6578. @kindex C-c C-e v L
  6579. @item C-c C-e v l
  6580. @item C-c C-e v L
  6581. Export only the visible part of the document.
  6582. @item M-x org-export-region-as-latex
  6583. Convert the region to La@TeX{} under the assumption that it was Org mode
  6584. syntax before. This is a global command that can be invoked in any
  6585. buffer.
  6586. @item M-x org-replace-region-by-latex
  6587. Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
  6588. code.
  6589. @end table
  6590. @cindex headline levels, for exporting
  6591. In the exported version, the first 3 outline levels will become
  6592. headlines, defining a general document structure. Additional levels
  6593. will be exported as description lists. The exporter can ignore them or
  6594. convert them to a custom string depending on
  6595. @code{org-latex-low-levels}.
  6596. If you want that transition to occur at a different level, specify it
  6597. with a numeric prefix argument. For example,
  6598. @example
  6599. @kbd{C-2 C-c C-e l}
  6600. @end example
  6601. @noindent
  6602. creates two levels of headings and does the rest as items.
  6603. @node Quoting LaTeX code, Sectioning structure, LaTeX export commands, LaTeX export
  6604. @subsection Quoting LaTeX code
  6605. Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
  6606. inserted into the La@TeX{} file. Furthermore, you can add special code
  6607. that should only be present in La@TeX{} export with the following
  6608. constructs:
  6609. @example
  6610. #+LaTeX: Literal LaTeX code for export
  6611. @end example
  6612. @noindent or
  6613. @cindex #+BEGIN_LaTeX
  6614. @example
  6615. #+BEGIN_LaTeX
  6616. All lines between these markers are exported literally
  6617. #+END_LaTeX
  6618. @end example
  6619. @node Sectioning structure, , Quoting LaTeX code, LaTeX export
  6620. @subsection Sectioning structure
  6621. @cindex LaTeX class
  6622. @cindex LaTeX sectioning structure
  6623. By default, the La@TeX{} output uses the class @code{article}.
  6624. You can change this globally by setting a different value for
  6625. @code{org-export-latex-default-class} or locally by adding an option
  6626. like @code{#+LaTeX_CLASS: myclass} in your file. The class should be
  6627. listed in @code{org-export-latex-classes}, where you can also define the
  6628. sectioning structure for each class.
  6629. @node XOXO export, iCalendar export, LaTeX export, Exporting
  6630. @section XOXO export
  6631. @cindex XOXO export
  6632. Org mode contains an exporter that produces XOXO-style output.
  6633. Currently, this exporter only handles the general outline structure and
  6634. does not interpret any additional Org mode features.
  6635. @table @kbd
  6636. @kindex C-c C-e x
  6637. @item C-c C-e x
  6638. Export as XOXO file @file{myfile.html}.
  6639. @kindex C-c C-e v
  6640. @item C-c C-e v x
  6641. Export only the visible part of the document.
  6642. @end table
  6643. @node iCalendar export, , XOXO export, Exporting
  6644. @section iCalendar export
  6645. @cindex iCalendar export
  6646. Some people like to use Org mode for keeping track of projects, but still
  6647. prefer a standard calendar application for anniversaries and appointments.
  6648. In this case it can be useful to have deadlines and other time-stamped items
  6649. in Org files show up in the calendar application. Org mode can export
  6650. calendar information in the standard iCalendar format. If you also want to
  6651. have TODO entries included in the export, configure the variable
  6652. @code{org-icalendar-include-todo}. iCalendar export will export plain time
  6653. stamps as VEVENT, and TODO items as VTODO. It will also create events from
  6654. deadlines that are in non-TODO items. Deadlines and scheduling dates in TODO
  6655. items will be used to set the start and due dates for the todo
  6656. entry@footnote{See the variables @code{org-icalendar-use-deadline} and
  6657. @code{org-icalendar-use-scheduled}.}.
  6658. The iCalendar standard requires each entry to have a globally unique
  6659. identifier (UID). Org creates these identifiers during export. If you set
  6660. the variable @code{org-icalendar-store-UID}, the UID will be stored in the
  6661. @code{:ID:} property of the entry and re-used next time you report this
  6662. entry. Since a single entry can give rise to multiple iCalendar entries (as
  6663. a timestamp, a deadline, a scheduled item, and as a TODO item), Org adds
  6664. prefixes to the UID, depending on what triggered the inclusion of the entry.
  6665. In this way the UID remains unique, but a synchronization program can still
  6666. figure out from which entry all the different instances originate.
  6667. @table @kbd
  6668. @kindex C-c C-e i
  6669. @item C-c C-e i
  6670. Create iCalendar entries for the current file and store them in the same
  6671. directory, using a file extension @file{.ics}.
  6672. @kindex C-c C-e I
  6673. @item C-c C-e I
  6674. Like @kbd{C-c C-e i}, but do this for all files in
  6675. @code{org-agenda-files}. For each of these files, a separate iCalendar
  6676. file will be written.
  6677. @kindex C-c C-e c
  6678. @item C-c C-e c
  6679. Create a single large iCalendar file from all files in
  6680. @code{org-agenda-files} and write it to the file given by
  6681. @code{org-combined-agenda-icalendar-file}.
  6682. @end table
  6683. The export will honor SUMMARY, DESCRIPTION and LOCATION properties if
  6684. the selected entries have them. If not, the summary will be derived
  6685. from the headline, and the description from the body (limited to
  6686. @code{org-icalendar-include-body} characters).
  6687. How this calendar is best read and updated, that depends on the application
  6688. you are using. The FAQ covers this issue.
  6689. @node Publishing, Miscellaneous, Exporting, Top
  6690. @chapter Publishing
  6691. @cindex publishing
  6692. Org includes@footnote{@file{org-publish.el} is not distributed with
  6693. Emacs 21, if you are still using Emacs 21, you need you need to download
  6694. this file separately.} a publishing management system that allows you to
  6695. configure automatic HTML conversion of @emph{projects} composed of
  6696. interlinked org files. This system is called @emph{org-publish}. You can
  6697. also configure org-publish to automatically upload your exported HTML
  6698. pages and related attachments, such as images and source code files, to
  6699. a web server. Org-publish turns Org into a web-site authoring tool.
  6700. You can also use Org-publish to convert files into La@TeX{}, or even
  6701. combine HTML and La@TeX{} conversion so that files are available in both
  6702. formats on the server@footnote{Since La@TeX{} files on a server are not
  6703. that helpful, you surely want to perform further conversion on them --
  6704. e.g. convert them to @code{PDF} format.}.
  6705. Org-publish has been contributed to Org by David O'Toole.
  6706. @menu
  6707. * Configuration:: Defining projects
  6708. * Sample configuration:: Example projects
  6709. * Triggering publication:: Publication commands
  6710. @end menu
  6711. @node Configuration, Sample configuration, Publishing, Publishing
  6712. @section Configuration
  6713. Publishing needs significant configuration to specify files, destination
  6714. and many other properties of a project.
  6715. @menu
  6716. * Project alist:: The central configuration variable
  6717. * Sources and destinations:: From here to there
  6718. * Selecting files:: What files are part of the project?
  6719. * Publishing action:: Setting the function doing the publishing
  6720. * Publishing options:: Tweaking HTML export
  6721. * Publishing links:: Which links keep working after publishing?
  6722. * Project page index:: Publishing a list of project files
  6723. @end menu
  6724. @node Project alist, Sources and destinations, Configuration, Configuration
  6725. @subsection The variable @code{org-publish-project-alist}
  6726. @cindex org-publish-project-alist
  6727. @cindex projects, for publishing
  6728. Org-publish is configured almost entirely through setting the value of
  6729. one variable, called @code{org-publish-project-alist}.
  6730. Each element of the list configures one project, and may be in one of
  6731. the two following forms:
  6732. @lisp
  6733. ("project-name" :property value :property value ...)
  6734. @r{or}
  6735. ("project-name" :components ("project-name" "project-name" ...))
  6736. @end lisp
  6737. In both cases, projects are configured by specifying property values.
  6738. A project defines the set of files that will be published, as well as
  6739. the publishing configuration to use when publishing those files. When
  6740. a project takes the second form listed above, the individual members
  6741. of the ``components'' property are taken to be components of the
  6742. project, which group together files requiring different publishing
  6743. options. When you publish such a ``meta-project'' all the components
  6744. will also publish.
  6745. @node Sources and destinations, Selecting files, Project alist, Configuration
  6746. @subsection Sources and destinations for files
  6747. @cindex directories, for publishing
  6748. Most properties are optional, but some should always be set. In
  6749. particular, org-publish needs to know where to look for source files,
  6750. and where to put published files.
  6751. @multitable @columnfractions 0.3 0.7
  6752. @item @code{:base-directory}
  6753. @tab Directory containing publishing source files
  6754. @item @code{:publishing-directory}
  6755. @tab Directory (possibly remote) where output files will be published.
  6756. @item @code{:preparation-function}
  6757. @tab Function called before starting the publishing process, for example to
  6758. run @code{make} for updating files to be published.
  6759. @item @code{:completion-function}
  6760. @tab Function called after finishing the publishing process, for example to
  6761. change permissions of the resulting files.
  6762. @end multitable
  6763. @noindent
  6764. @node Selecting files, Publishing action, Sources and destinations, Configuration
  6765. @subsection Selecting files
  6766. @cindex files, selecting for publishing
  6767. By default, all files with extension @file{.org} in the base directory
  6768. are considered part of the project. This can be modified by setting the
  6769. properties
  6770. @multitable @columnfractions 0.25 0.75
  6771. @item @code{:base-extension}
  6772. @tab Extension (without the dot!) of source files. This actually is a
  6773. regular expression.
  6774. @item @code{:exclude}
  6775. @tab Regular expression to match file names that should not be
  6776. published, even though they have been selected on the basis of their
  6777. extension.
  6778. @item @code{:include}
  6779. @tab List of files to be included regardless of @code{:base-extension}
  6780. and @code{:exclude}.
  6781. @end multitable
  6782. @node Publishing action, Publishing options, Selecting files, Configuration
  6783. @subsection Publishing action
  6784. @cindex action, for publishing
  6785. Publishing means that a file is copied to the destination directory and
  6786. possibly transformed in the process. The default transformation is to
  6787. export Org files as HTML files, and this is done by the function
  6788. @code{org-publish-org-to-html} which calls the HTML exporter
  6789. (@pxref{HTML export}). But you also can publish your files in La@TeX{} by
  6790. using the function @code{org-publish-org-to-latex} instead. Other files
  6791. like images only need to be copied to the publishing destination. For
  6792. non-Org files, you need to specify the publishing function.
  6793. @multitable @columnfractions 0.3 0.7
  6794. @item @code{:publishing-function}
  6795. @tab Function executing the publication of a file. This may also be a
  6796. list of functions, which will all be called in turn.
  6797. @end multitable
  6798. The function must accept two arguments: a property list containing at
  6799. least a @code{:publishing-directory} property, and the name of the file
  6800. to be published. It should take the specified file, make the necessary
  6801. transformation (if any) and place the result into the destination folder.
  6802. You can write your own publishing function, but @code{org-publish}
  6803. provides one for attachments (files that only need to be copied):
  6804. @code{org-publish-attachment}.
  6805. @node Publishing options, Publishing links, Publishing action, Configuration
  6806. @subsection Options for the HTML/LaTeX exporters
  6807. @cindex options, for publishing
  6808. The property list can be used to set many export options for the HTML
  6809. and La@TeX{} exporters. In most cases, these properties correspond to user
  6810. variables in Org. The table below lists these properties along
  6811. with the variable they belong to. See the documentation string for the
  6812. respective variable for details.
  6813. @multitable @columnfractions 0.3 0.7
  6814. @item @code{:language} @tab @code{org-export-default-language}
  6815. @item @code{:headline-levels} @tab @code{org-export-headline-levels}
  6816. @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
  6817. @item @code{:table-of-contents} @tab @code{org-export-with-toc}
  6818. @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
  6819. @item @code{:emphasize} @tab @code{org-export-with-emphasize}
  6820. @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
  6821. @item @code{:special-strings} @tab @code{org-export-with-special-strings}
  6822. @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
  6823. @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
  6824. @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
  6825. @item @code{:timestamps} @tab @code{org-export-with-timestamps}
  6826. @item @code{:author-info} @tab @code{org-export-author-info}
  6827. @item @code{:creator-info} @tab @code{org-export-creator-info}
  6828. @item @code{:tags} @tab @code{org-export-with-tags}
  6829. @item @code{:tables} @tab @code{org-export-with-tables}
  6830. @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
  6831. @item @code{:style} @tab @code{org-export-html-style}
  6832. @item @code{:style-extra} @tab @code{org-export-html-style-extra}
  6833. @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
  6834. @item @code{:inline-images} @tab @code{org-export-html-inline-images}
  6835. @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
  6836. @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
  6837. @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
  6838. @item @code{:preamble} @tab @code{org-export-html-preamble}
  6839. @item @code{:postamble} @tab @code{org-export-html-postamble}
  6840. @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
  6841. @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
  6842. @item @code{:author} @tab @code{user-full-name}
  6843. @item @code{:email} @tab @code{user-mail-address}
  6844. @end multitable
  6845. If you use several email addresses, separate them by a semi-column.
  6846. Most of the @code{org-export-with-*} variables have the same effect in
  6847. both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
  6848. @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
  6849. La@TeX{} export.
  6850. When a property is given a value in @code{org-publish-project-alist},
  6851. its setting overrides the value of the corresponding user variable (if
  6852. any) during publishing. Options set within a file (@pxref{Export
  6853. options}), however, override everything.
  6854. @node Publishing links, Project page index, Publishing options, Configuration
  6855. @subsection Links between published files
  6856. @cindex links, publishing
  6857. To create a link from one Org file to another, you would use
  6858. something like @samp{[[file:foo.org][The foo]]} or simply
  6859. @samp{file:foo.org.} (@pxref{Hyperlinks}). Upon publishing this link
  6860. becomes a link to @file{foo.html}. In this way, you can interlink the
  6861. pages of your "org web" project and the links will work as expected when
  6862. you publish them to HTML.
  6863. You may also link to related files, such as images. Provided you are
  6864. careful with relative pathnames, and provided you have also configured
  6865. @code{org-publish} to upload the related files, these links will work
  6866. too. @ref{Complex example} for an example of this usage.
  6867. Sometime an Org file to be published may contain links that are
  6868. only valid in your production environment, but not in the publishing
  6869. location. In this case, use the property
  6870. @multitable @columnfractions 0.4 0.6
  6871. @item @code{:link-validation-function}
  6872. @tab Function to validate links
  6873. @end multitable
  6874. @noindent
  6875. to define a function for checking link validity. This function must
  6876. accept two arguments, the file name and a directory relative to which
  6877. the file name is interpreted in the production environment. If this
  6878. function returns @code{nil}, then the HTML generator will only insert a
  6879. description into the HTML file, but no link. One option for this
  6880. function is @code{org-publish-validate-link} which checks if the given
  6881. file is part of any project in @code{org-publish-project-alist}.
  6882. @node Project page index, , Publishing links, Configuration
  6883. @subsection Project page index
  6884. @cindex index, of published pages
  6885. The following properties may be used to control publishing of an
  6886. index of files or summary page for a given project.
  6887. @multitable @columnfractions 0.25 0.75
  6888. @item @code{:auto-index}
  6889. @tab When non-nil, publish an index during org-publish-current-project or
  6890. org-publish-all.
  6891. @item @code{:index-filename}
  6892. @tab Filename for output of index. Defaults to @file{index.org} (which
  6893. becomes @file{index.html}).
  6894. @item @code{:index-title}
  6895. @tab Title of index page. Defaults to name of file.
  6896. @item @code{:index-function}
  6897. @tab Plug-in function to use for generation of index.
  6898. Defaults to @code{org-publish-org-index}, which generates a plain list
  6899. of links to all files in the project.
  6900. @end multitable
  6901. @node Sample configuration, Triggering publication, Configuration, Publishing
  6902. @section Sample configuration
  6903. Below we provide two example configurations. The first one is a simple
  6904. project publishing only a set of Org files. The second example is
  6905. more complex, with a multi-component project.
  6906. @menu
  6907. * Simple example:: One-component publishing
  6908. * Complex example:: A multi-component publishing example
  6909. @end menu
  6910. @node Simple example, Complex example, Sample configuration, Sample configuration
  6911. @subsection Example: simple publishing configuration
  6912. This example publishes a set of Org files to the @file{public_html}
  6913. directory on the local machine.
  6914. @lisp
  6915. (setq org-publish-project-alist
  6916. '(("org"
  6917. :base-directory "~/org/"
  6918. :publishing-directory "~/public_html"
  6919. :section-numbers nil
  6920. :table-of-contents nil
  6921. :style "<link rel=stylesheet
  6922. href=\"../other/mystyle.css\"
  6923. type=\"text/css\">")))
  6924. @end lisp
  6925. @node Complex example, , Simple example, Sample configuration
  6926. @subsection Example: complex publishing configuration
  6927. This more complicated example publishes an entire website, including
  6928. org files converted to HTML, image files, emacs lisp source code, and
  6929. style sheets. The publishing-directory is remote and private files are
  6930. excluded.
  6931. To ensure that links are preserved, care should be taken to replicate
  6932. your directory structure on the web server, and to use relative file
  6933. paths. For example, if your org files are kept in @file{~/org} and your
  6934. publishable images in @file{~/images}, you'd link to an image with
  6935. @c
  6936. @example
  6937. file:../images/myimage.png
  6938. @end example
  6939. @c
  6940. On the web server, the relative path to the image should be the
  6941. same. You can accomplish this by setting up an "images" folder in the
  6942. right place on the web server, and publishing images to it.
  6943. @lisp
  6944. (setq org-publish-project-alist
  6945. '(("orgfiles"
  6946. :base-directory "~/org/"
  6947. :base-extension "org"
  6948. :publishing-directory "/ssh:user@@host:~/html/notebook/"
  6949. :publishing-function org-publish-org-to-html
  6950. :exclude "PrivatePage.org" ;; regexp
  6951. :headline-levels 3
  6952. :section-numbers nil
  6953. :table-of-contents nil
  6954. :style "<link rel=stylesheet
  6955. href=\"../other/mystyle.css\" type=\"text/css\">"
  6956. :auto-preamble t
  6957. :auto-postamble nil)
  6958. ("images"
  6959. :base-directory "~/images/"
  6960. :base-extension "jpg\\|gif\\|png"
  6961. :publishing-directory "/ssh:user@@host:~/html/images/"
  6962. :publishing-function org-publish-attachment)
  6963. ("other"
  6964. :base-directory "~/other/"
  6965. :base-extension "css\\|el"
  6966. :publishing-directory "/ssh:user@@host:~/html/other/"
  6967. :publishing-function org-publish-attachment)
  6968. ("website" :components ("orgfiles" "images" "other"))))
  6969. @end lisp
  6970. @node Triggering publication, , Sample configuration, Publishing
  6971. @section Triggering publication
  6972. Once org-publish is properly configured, you can publish with the
  6973. following functions:
  6974. @table @kbd
  6975. @item C-c C-e C
  6976. Prompt for a specific project and publish all files that belong to it.
  6977. @item C-c C-e P
  6978. Publish the project containing the current file.
  6979. @item C-c C-e F
  6980. Publish only the current file.
  6981. @item C-c C-e A
  6982. Publish all projects.
  6983. @end table
  6984. Org uses timestamps to track when a file has changed. The above
  6985. functions normally only publish changed files. You can override this and
  6986. force publishing of all files by giving a prefix argument.
  6987. @node Miscellaneous, Extensions, Publishing, Top
  6988. @chapter Miscellaneous
  6989. @menu
  6990. * Completion:: M-TAB knows what you need
  6991. * Customization:: Adapting Org to your taste
  6992. * In-buffer settings:: Overview of the #+KEYWORDS
  6993. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  6994. * Clean view:: Getting rid of leading stars in the outline
  6995. * TTY keys:: Using Org on a tty
  6996. * Interaction:: Other Emacs packages
  6997. * Bugs:: Things which do not work perfectly
  6998. @end menu
  6999. @node Completion, Customization, Miscellaneous, Miscellaneous
  7000. @section Completion
  7001. @cindex completion, of @TeX{} symbols
  7002. @cindex completion, of TODO keywords
  7003. @cindex completion, of dictionary words
  7004. @cindex completion, of option keywords
  7005. @cindex completion, of tags
  7006. @cindex completion, of property keys
  7007. @cindex completion, of link abbreviations
  7008. @cindex @TeX{} symbol completion
  7009. @cindex TODO keywords completion
  7010. @cindex dictionary word completion
  7011. @cindex option keyword completion
  7012. @cindex tag completion
  7013. @cindex link abbreviations, completion of
  7014. Org supports in-buffer completion. This type of completion does
  7015. not make use of the minibuffer. You simply type a few letters into
  7016. the buffer and use the key to complete text right there.
  7017. @table @kbd
  7018. @kindex M-@key{TAB}
  7019. @item M-@key{TAB}
  7020. Complete word at point
  7021. @itemize @bullet
  7022. @item
  7023. At the beginning of a headline, complete TODO keywords.
  7024. @item
  7025. After @samp{\}, complete @TeX{} symbols supported by the exporter.
  7026. @item
  7027. After @samp{*}, complete headlines in the current buffer so that they
  7028. can be used in search links like @samp{[[*find this headline]]}.
  7029. @item
  7030. After @samp{:} in a headline, complete tags. The list of tags is taken
  7031. from the variable @code{org-tag-alist} (possibly set through the
  7032. @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
  7033. dynamically from all tags used in the current buffer.
  7034. @item
  7035. After @samp{:} and not in a headline, complete property keys. The list
  7036. of keys is constructed dynamically from all keys used in the current
  7037. buffer.
  7038. @item
  7039. After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
  7040. @item
  7041. After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
  7042. @samp{OPTIONS} which set file-specific options for Org mode. When the
  7043. option keyword is already complete, pressing @kbd{M-@key{TAB}} again
  7044. will insert example settings for this keyword.
  7045. @item
  7046. In the line after @samp{#+STARTUP: }, complete startup keywords,
  7047. i.e. valid keys for this line.
  7048. @item
  7049. Elsewhere, complete dictionary words using Ispell.
  7050. @end itemize
  7051. @end table
  7052. @node Customization, In-buffer settings, Completion, Miscellaneous
  7053. @section Customization
  7054. @cindex customization
  7055. @cindex options, for customization
  7056. @cindex variables, for customization
  7057. There are more than 180 variables that can be used to customize
  7058. Org. For the sake of compactness of the manual, I am not
  7059. describing the variables here. A structured overview of customization
  7060. variables is available with @kbd{M-x org-customize}. Or select
  7061. @code{Browse Org Group} from the @code{Org->Customization} menu. Many
  7062. settings can also be activated on a per-file basis, by putting special
  7063. lines into the buffer (@pxref{In-buffer settings}).
  7064. @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
  7065. @section Summary of in-buffer settings
  7066. @cindex in-buffer settings
  7067. @cindex special keywords
  7068. Org mode uses special lines in the buffer to define settings on a
  7069. per-file basis. These lines start with a @samp{#+} followed by a
  7070. keyword, a colon, and then individual words defining a setting. Several
  7071. setting words can be in the same line, but you can also have multiple
  7072. lines for the keyword. While these settings are described throughout
  7073. the manual, here is a summary. After changing any of those lines in the
  7074. buffer, press @kbd{C-c C-c} with the cursor still in the line to
  7075. activate the changes immediately. Otherwise they become effective only
  7076. when the file is visited again in a new Emacs session.
  7077. @table @kbd
  7078. @item #+ARCHIVE: %s_done::
  7079. This line sets the archive location for the agenda file. It applies for
  7080. all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
  7081. of the file. The first such line also applies to any entries before it.
  7082. The corresponding variable is @code{org-archive-location}.
  7083. @item #+CATEGORY:
  7084. This line sets the category for the agenda file. The category applies
  7085. for all subsequent lines until the next @samp{#+CATEGORY} line, or the
  7086. end of the file. The first such line also applies to any entries before it.
  7087. @item #+COLUMNS: %25ITEM .....
  7088. Set the default format for columns view. This format applies when
  7089. columns view is invoked in location where no @code{COLUMNS} property
  7090. applies.
  7091. @item #+CONSTANTS: name1=value1 ...
  7092. Set file-local values for constants to be used in table formulas. This
  7093. line set the local variable @code{org-table-formula-constants-local}.
  7094. The global version of this variable is
  7095. @code{org-table-formula-constants}.
  7096. @item #+FILETAGS: :tag1:tag2:tag3:
  7097. Set tags that can be inherited by any entry in the file, including the
  7098. top-level entries.
  7099. @item #+DRAWERS: NAME1 .....
  7100. Set the file-local set of drawers. The corresponding global variable is
  7101. @code{org-drawers}.
  7102. @item #+LINK: linkword replace
  7103. These lines (several are allowed) specify link abbreviations.
  7104. @xref{Link abbreviations}. The corresponding variable is
  7105. @code{org-link-abbrev-alist}.
  7106. @item #+PRIORITIES: highest lowest default
  7107. This line sets the limits and the default for the priorities. All three
  7108. must be either letters A-Z or numbers 0-9. The highest priority must
  7109. have a lower ASCII number that the lowest priority.
  7110. @item #+PROPERTY: Property_Name Value
  7111. This line sets a default inheritance value for entries in the current
  7112. buffer, most useful for specifying the allowed values of a property.
  7113. @item #+SETUPFILE: file
  7114. This line defines a file that holds more in-buffer setup. Normally this is
  7115. entirely ignored. Only when the buffer is parsed for option-setting lines
  7116. (i.e. when starting Org mode for a file, when pressing @kbd{C-c C-c} in a
  7117. settings line, or when exporting), then the contents of this file are parsed
  7118. as if they had been included in the buffer. In particlar, the file can be
  7119. any other Org mode file with internal setup. You can visit the file the
  7120. cursor is in the line with @kbd{C-c '}.
  7121. @item #+STARTUP:
  7122. This line sets options to be used at startup of Org mode, when an
  7123. Org file is being visited. The first set of options deals with the
  7124. initial visibility of the outline tree. The corresponding variable for
  7125. global default settings is @code{org-startup-folded}, with a default
  7126. value @code{t}, which means @code{overview}.
  7127. @cindex @code{overview}, STARTUP keyword
  7128. @cindex @code{content}, STARTUP keyword
  7129. @cindex @code{showall}, STARTUP keyword
  7130. @example
  7131. overview @r{top-level headlines only}
  7132. content @r{all headlines}
  7133. showall @r{no folding at all, show everything}
  7134. @end example
  7135. Then there are options for aligning tables upon visiting a file. This
  7136. is useful in files containing narrowed table columns. The corresponding
  7137. variable is @code{org-startup-align-all-tables}, with a default value
  7138. @code{nil}.
  7139. @cindex @code{align}, STARTUP keyword
  7140. @cindex @code{noalign}, STARTUP keyword
  7141. @example
  7142. align @r{align all tables}
  7143. noalign @r{don't align tables on startup}
  7144. @end example
  7145. Logging closing and reinstating TODO items, and clock intervals
  7146. (variables @code{org-log-done}, @code{org-log-note-clock-out}, and
  7147. @code{org-log-repeat}) can be configured using these options.
  7148. @cindex @code{logdone}, STARTUP keyword
  7149. @cindex @code{lognotedone}, STARTUP keyword
  7150. @cindex @code{nologdone}, STARTUP keyword
  7151. @cindex @code{lognoteclock-out}, STARTUP keyword
  7152. @cindex @code{nolognoteclock-out}, STARTUP keyword
  7153. @cindex @code{logrepeat}, STARTUP keyword
  7154. @cindex @code{lognoterepeat}, STARTUP keyword
  7155. @cindex @code{nologrepeat}, STARTUP keyword
  7156. @example
  7157. logdone @r{record a timestamp when an item is marked DONE}
  7158. lognotedone @r{record timestamp and a note when DONE}
  7159. nologdone @r{don't record when items are marked DONE}
  7160. logrepeat @r{record a time when reinstating a repeating item}
  7161. lognoterepeat @r{record a note when reinstating a repeating item}
  7162. nologrepeat @r{do not record when reinstating repeating item}
  7163. lognoteclock-out @r{record a note when clocking out}
  7164. nolognoteclock-out @r{don't record a note when clocking out}
  7165. @end example
  7166. Here are the options for hiding leading stars in outline headings, and for
  7167. indenting outlines. The corresponding variables are
  7168. @code{org-hide-leading-stars} and @code{org-odd-levels-only}, both with a
  7169. default setting @code{nil} (meaning @code{showstars} and @code{oddeven}).
  7170. @cindex @code{hidestars}, STARTUP keyword
  7171. @cindex @code{showstars}, STARTUP keyword
  7172. @cindex @code{odd}, STARTUP keyword
  7173. @cindex @code{even}, STARTUP keyword
  7174. @example
  7175. hidestars @r{make all but one of the stars starting a headline invisible.}
  7176. showstars @r{show all stars starting a headline}
  7177. indent @r{virtual indentation according to outline level}
  7178. noindent @r{no virtual indentation according to outline level}
  7179. odd @r{allow only odd outline levels (1,3,...)}
  7180. oddeven @r{allow all outline levels}
  7181. @end example
  7182. To turn on custom format overlays over time stamps (variables
  7183. @code{org-put-time-stamp-overlays} and
  7184. @code{org-time-stamp-overlay-formats}), use
  7185. @cindex @code{customtime}, STARTUP keyword
  7186. @example
  7187. customtime @r{overlay custom time format}
  7188. @end example
  7189. The following options influence the table spreadsheet (variable
  7190. @code{constants-unit-system}).
  7191. @cindex @code{constcgs}, STARTUP keyword
  7192. @cindex @code{constSI}, STARTUP keyword
  7193. @example
  7194. constcgs @r{@file{constants.el} should use the c-g-s unit system}
  7195. constSI @r{@file{constants.el} should use the SI unit system}
  7196. @end example
  7197. @item #+TAGS: TAG1(c1) TAG2(c2)
  7198. These lines (several such lines are allowed) specify the valid tags in
  7199. this file, and (potentially) the corresponding @emph{fast tag selection}
  7200. keys. The corresponding variable is @code{org-tag-alist}.
  7201. @item #+TBLFM:
  7202. This line contains the formulas for the table directly above the line.
  7203. @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS, #+DATE:
  7204. These lines provide settings for exporting files. For more details see
  7205. @ref{Export options}.
  7206. @item #+SEQ_TODO: #+TYP_TODO:
  7207. These lines set the TODO keywords and their interpretation in the
  7208. current file. The corresponding variables are @code{org-todo-keywords}
  7209. and @code{org-todo-interpretation}.
  7210. @end table
  7211. @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
  7212. @section The very busy C-c C-c key
  7213. @kindex C-c C-c
  7214. @cindex C-c C-c, overview
  7215. The key @kbd{C-c C-c} has many purposes in Org, which are all
  7216. mentioned scattered throughout this manual. One specific function of
  7217. this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
  7218. other circumstances it means something like @emph{Hey Org, look
  7219. here and update according to what you see here}. Here is a summary of
  7220. what this means in different contexts.
  7221. @itemize @minus
  7222. @item
  7223. If there are highlights in the buffer from the creation of a sparse
  7224. tree, or from clock display, remove these highlights.
  7225. @item
  7226. If the cursor is in one of the special @code{#+KEYWORD} lines, this
  7227. triggers scanning the buffer for these lines and updating the
  7228. information.
  7229. @item
  7230. If the cursor is inside a table, realign the table. This command
  7231. works even if the automatic table editor has been turned off.
  7232. @item
  7233. If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
  7234. the entire table.
  7235. @item
  7236. If the cursor is inside a table created by the @file{table.el} package,
  7237. activate that table.
  7238. @item
  7239. If the current buffer is a remember buffer, close the note and file it.
  7240. With a prefix argument, file it, without further interaction, to the
  7241. default location.
  7242. @item
  7243. If the cursor is on a @code{<<<target>>>}, update radio targets and
  7244. corresponding links in this buffer.
  7245. @item
  7246. If the cursor is in a property line or at the start or end of a property
  7247. drawer, offer property commands.
  7248. @item
  7249. If the cursor is in a plain list item with a checkbox, toggle the status
  7250. of the checkbox.
  7251. @item
  7252. If the cursor is on a numbered item in a plain list, renumber the
  7253. ordered list.
  7254. @item
  7255. If the cursor is on the @code{#+BEGIN} line of a dynamical block, the
  7256. block is updated.
  7257. @end itemize
  7258. @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
  7259. @section A cleaner outline view
  7260. @cindex hiding leading stars
  7261. @cindex dynamic indentation
  7262. @cindex odd-levels-only outlines
  7263. @cindex clean outline view
  7264. Some people find it noisy and distracting that the Org headlines are starting
  7265. with a potentially large number of stars, and that text below the headlines
  7266. is not indented. This is not really a problem when you are writing a book
  7267. where the outline headings are really section headlines. However, in a more
  7268. list-oriented outline, it is clear that an indented structure is a lot
  7269. cleaner, as can be seen by comparing the two columns in the following
  7270. example:
  7271. @example
  7272. @group
  7273. * Top level headline | * Top level headline
  7274. ** Second level | * Second level
  7275. *** 3rd level | * 3rd level
  7276. some text | some text
  7277. *** 3rd level | * 3rd level
  7278. more text | more text
  7279. * Another top level headline | * Another top level headline
  7280. @end group
  7281. @end example
  7282. @noindent
  7283. It is non-trivial to make such a look work in Emacs, but Org contains three
  7284. separate features that, combined, achieve just that.
  7285. @enumerate
  7286. @item
  7287. @emph{Indentation of text below headlines}@*
  7288. You may indent text below each headline to make the left boundary line up
  7289. with the headline, like
  7290. @example
  7291. *** 3rd level
  7292. more text, now indented
  7293. @end example
  7294. A good way to get this indentation is by hand, and Org supports this with
  7295. paragraph filling, line wrapping, and structure editing@footnote{See also the
  7296. variable @code{org-adapt-indentation}.} preserving or adapting the
  7297. indentation appropriate. A different approach would be to have a way to
  7298. automatically indent lines according to outline structure by adding overlays
  7299. or text properties. But I have not yet found a robust and efficient way to
  7300. do this in large files.
  7301. @item
  7302. @emph{Hiding leading stars}@* You can modify the display in such a way that
  7303. all leading stars become invisible. To do this in a global way, configure
  7304. the variable @code{org-hide-leading-stars} or change this on a per-file basis
  7305. with
  7306. @example
  7307. #+STARTUP: hidestars
  7308. @end example
  7309. @noindent
  7310. Note that the opposite behavior is selected with @code{showstars}.
  7311. With hidden stars, the tree becomes:
  7312. @example
  7313. @group
  7314. * Top level headline
  7315. * Second level
  7316. * 3rd level
  7317. ...
  7318. @end group
  7319. @end example
  7320. @noindent
  7321. Note that the leading stars are not truly replaced by whitespace, they
  7322. are only fontified with the face @code{org-hide} that uses the
  7323. background color as font color. If you are not using either white or
  7324. black background, you may have to customize this face to get the wanted
  7325. effect. Another possibility is to set this font such that the extra
  7326. stars are @i{almost} invisible, for example using the color
  7327. @code{grey90} on a white background.
  7328. @item
  7329. Things become cleaner still if you skip all the even levels and use only odd
  7330. levels 1, 3, 5..., effectively adding two stars to go from one outline level
  7331. to the next. In this way we get the outline view shown at the beginning of
  7332. this section. In order to make the structure editing and export commands
  7333. handle this convention correctly, configure the variable
  7334. @code{org-odd-levels-only}, or set this on a per-file basis with one of the
  7335. following lines:
  7336. @example
  7337. #+STARTUP: odd
  7338. #+STARTUP: oddeven
  7339. @end example
  7340. You can convert an Org file from single-star-per-level to the
  7341. double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
  7342. RET} in that file. The reverse operation is @kbd{M-x
  7343. org-convert-to-oddeven-levels}.
  7344. @end enumerate
  7345. @node TTY keys, Interaction, Clean view, Miscellaneous
  7346. @section Using Org on a tty
  7347. @cindex tty key bindings
  7348. Because Org contains a large number of commands, by default much of
  7349. Org's core commands are bound to keys that are generally not
  7350. accessible on a tty, such as the cursor keys (@key{left}, @key{right},
  7351. @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
  7352. together with modifiers like @key{Meta} and/or @key{Shift}. To access
  7353. these commands on a tty when special keys are unavailable, the following
  7354. alternative bindings can be used. The tty bindings below will likely be
  7355. more cumbersome; you may find for some of the bindings below that a
  7356. customized work-around suits you better. For example, changing a time
  7357. stamp is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
  7358. tty you would rather use @kbd{C-c .} to re-insert the timestamp.
  7359. @multitable @columnfractions 0.15 0.2 0.2
  7360. @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
  7361. @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
  7362. @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
  7363. @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
  7364. @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}}
  7365. @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
  7366. @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
  7367. @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
  7368. @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
  7369. @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
  7370. @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
  7371. @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
  7372. @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
  7373. @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab
  7374. @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab
  7375. @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab
  7376. @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab
  7377. @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
  7378. @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
  7379. @end multitable
  7380. @node Interaction, Bugs, TTY keys, Miscellaneous
  7381. @section Interaction with other packages
  7382. @cindex packages, interaction with other
  7383. Org lives in the world of GNU Emacs and interacts in various ways
  7384. with other code out there.
  7385. @menu
  7386. * Cooperation:: Packages Org cooperates with
  7387. * Conflicts:: Packages that lead to conflicts
  7388. @end menu
  7389. @node Cooperation, Conflicts, Interaction, Interaction
  7390. @subsection Packages that Org cooperates with
  7391. @table @asis
  7392. @cindex @file{calc.el}
  7393. @item @file{calc.el} by Dave Gillespie
  7394. Org uses the Calc package for implementing spreadsheet
  7395. functionality in its tables (@pxref{The spreadsheet}). Org
  7396. checks for the availability of Calc by looking for the function
  7397. @code{calc-eval} which should be autoloaded in your setup if Calc has
  7398. been installed properly. As of Emacs 22, Calc is part of the Emacs
  7399. distribution. Another possibility for interaction between the two
  7400. packages is using Calc for embedded calculations. @xref{Embedded Mode,
  7401. , Embedded Mode, Calc, GNU Emacs Calc Manual}.
  7402. @cindex @file{constants.el}
  7403. @item @file{constants.el} by Carsten Dominik
  7404. In a table formula (@pxref{The spreadsheet}), it is possible to use
  7405. names for natural constants or units. Instead of defining your own
  7406. constants in the variable @code{org-table-formula-constants}, install
  7407. the @file{constants} package which defines a large number of constants
  7408. and units, and lets you use unit prefixes like @samp{M} for
  7409. @samp{Mega} etc. You will need version 2.0 of this package, available
  7410. at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
  7411. the function @code{constants-get}, which has to be autoloaded in your
  7412. setup. See the installation instructions in the file
  7413. @file{constants.el}.
  7414. @item @file{cdlatex.el} by Carsten Dominik
  7415. @cindex @file{cdlatex.el}
  7416. Org mode can make use of the CDLaTeX package to efficiently enter
  7417. La@TeX{} fragments into Org files. See @ref{CDLaTeX mode}.
  7418. @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
  7419. @cindex @file{imenu.el}
  7420. Imenu allows menu access to an index of items in a file. Org mode
  7421. supports Imenu - all you need to do to get the index is the following:
  7422. @lisp
  7423. (add-hook 'org-mode-hook
  7424. (lambda () (imenu-add-to-menubar "Imenu")))
  7425. @end lisp
  7426. By default the index is two levels deep - you can modify the depth using
  7427. the option @code{org-imenu-depth}.
  7428. @item @file{remember.el} by John Wiegley
  7429. @cindex @file{remember.el}
  7430. Org cooperates with remember, see @ref{Remember}.
  7431. @file{Remember.el} is not part of Emacs, find it on the web.
  7432. @item @file{speedbar.el} by Eric M. Ludlam
  7433. @cindex @file{speedbar.el}
  7434. Speedbar is a package that creates a special frame displaying files and
  7435. index items in files. Org mode supports Speedbar and allows you to
  7436. drill into Org files directly from the Speedbar. It also allows to
  7437. restrict the scope of agenda commands to a file or a subtree by using
  7438. the command @kbd{<} in the Speedbar frame.
  7439. @cindex @file{table.el}
  7440. @item @file{table.el} by Takaaki Ota
  7441. @kindex C-c C-c
  7442. @cindex table editor, @file{table.el}
  7443. @cindex @file{table.el}
  7444. Complex ASCII tables with automatic line wrapping, column- and
  7445. row-spanning, and alignment can be created using the Emacs table
  7446. package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
  7447. and also part of Emacs 22).
  7448. When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org mode
  7449. will call @command{table-recognize-table} and move the cursor into the
  7450. table. Inside a table, the keymap of Org mode is inactive. In order
  7451. to execute Org mode-related commands, leave the table.
  7452. @table @kbd
  7453. @kindex C-c C-c
  7454. @item C-c C-c
  7455. Recognize @file{table.el} table. Works when the cursor is in a
  7456. table.el table.
  7457. @c
  7458. @kindex C-c ~
  7459. @item C-c ~
  7460. Insert a table.el table. If there is already a table at point, this
  7461. command converts it between the table.el format and the Org mode
  7462. format. See the documentation string of the command
  7463. @code{org-convert-table} for the restrictions under which this is
  7464. possible.
  7465. @end table
  7466. @file{table.el} is part of Emacs 22.
  7467. @cindex @file{footnote.el}
  7468. @item @file{footnote.el} by Steven L. Baur
  7469. Org mode recognizes numerical footnotes as provided by this package
  7470. (@pxref{Footnotes}).
  7471. @end table
  7472. @node Conflicts, , Cooperation, Interaction
  7473. @subsection Packages that lead to conflicts with Org mode
  7474. @table @asis
  7475. @cindex @file{allout.el}
  7476. @item @file{allout.el} by Ken Manheimer
  7477. Startup of Org may fail with the error message
  7478. @code{(wrong-type-argument keymapp nil)} when there is an outdated
  7479. version @file{allout.el} on the load path, for example the version
  7480. distributed with Emacs 21.x. Upgrade to Emacs 22 and this problem will
  7481. disappear. If for some reason you cannot do this, make sure that org.el
  7482. is loaded @emph{before} @file{allout.el}, for example by putting
  7483. @code{(require 'org)} early enough into your @file{.emacs} file.
  7484. @cindex @file{CUA.el}
  7485. @item @file{CUA.el} by Kim. F. Storm
  7486. Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by
  7487. CUA mode (as well as pc-select-mode and s-region-mode) to select and
  7488. extend the region. If you want to use one of these packages along with
  7489. Org, configure the variable @code{org-replace-disputed-keys}. When
  7490. set, Org will move the following key bindings in Org files, and
  7491. in the agenda buffer (but not during date selection).
  7492. @example
  7493. S-UP -> M-p S-DOWN -> M-n
  7494. S-LEFT -> M-- S-RIGHT -> M-+
  7495. @end example
  7496. Yes, these are unfortunately more difficult to remember. If you want
  7497. to have other replacement keys, look at the variable
  7498. @code{org-disputed-keys}.
  7499. @item @file{windmove.el} by Hovav Shacham
  7500. @cindex @file{windmove.el}
  7501. Also this package uses the @kbd{S-<cursor>} keys, so everything written
  7502. in the paragraph above about CUA mode also applies here.
  7503. @cindex @file{footnote.el}
  7504. @item @file{footnote.el} by Steven L. Baur
  7505. Org supports the syntax of the footnote package, but only the
  7506. numerical footnote markers. Also, the default key for footnote
  7507. commands, @kbd{C-c !} is already used by Org. You could use the
  7508. variable @code{footnote-prefix} to switch footnotes commands to another
  7509. key. Or, you could use @code{org-replace-disputed-keys} and
  7510. @code{org-disputed-keys} to change the settings in Org.
  7511. @end table
  7512. @node Bugs, , Interaction, Miscellaneous
  7513. @section Bugs
  7514. @cindex bugs
  7515. Here is a list of things that should work differently, but which I
  7516. have found too hard to fix.
  7517. @itemize @bullet
  7518. @item
  7519. If a table field starts with a link, and if the corresponding table
  7520. column is narrowed (@pxref{Narrow columns}) to a width too small to
  7521. display the link, the field would look entirely empty even though it is
  7522. not. To prevent this, Org throws an error. The work-around is to
  7523. make the column wide enough to fit the link, or to add some text (at
  7524. least 2 characters) before the link in the same field.
  7525. @item
  7526. Narrowing table columns does not work on XEmacs, because the
  7527. @code{format} function does not transport text properties.
  7528. @item
  7529. Text in an entry protected with the @samp{QUOTE} keyword should not
  7530. autowrap.
  7531. @item
  7532. When the application called by @kbd{C-c C-o} to open a file link fails
  7533. (for example because the application does not exist or refuses to open
  7534. the file), it does so silently. No error message is displayed.
  7535. @item
  7536. Recalculating a table line applies the formulas from left to right.
  7537. If a formula uses @emph{calculated} fields further down the row,
  7538. multiple recalculation may be needed to get all fields consistent. You
  7539. may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
  7540. recalculate until convergence.
  7541. @item
  7542. The exporters work well, but could be made more efficient.
  7543. @end itemize
  7544. @node Extensions, Hacking, Miscellaneous, Top
  7545. @appendix Extensions
  7546. This appendix lists the extension modules that have been written for Org.
  7547. Many of these extensions live in the @file{contrib} directory of the Org
  7548. distribution, others are available somewhere on the web.
  7549. @menu
  7550. * Extensions in the contrib directory:: These come with the Org distro
  7551. * Other extensions:: These you have to find on the web.
  7552. @end menu
  7553. @node Extensions in the contrib directory, Other extensions, Extensions, Extensions
  7554. @section Extensions in the @file{contrib} directory
  7555. @table @asis
  7556. @item @file{org-annotate-file.el} by @i{Philip Jackson}
  7557. Annotate a file with org syntax, in a separate file, with links back to
  7558. the annotated file.
  7559. @item @file{org-annotation-helper.el} by @i{Bastien Guerry and Daniel E. German}
  7560. Call @i{remember} directly from Firefox/Opera, or from Adobe Reader.
  7561. When activating a special link or bookmark, Emacs receives a trigger to
  7562. create a note with a link back to the website. Requires some setup, a
  7563. detailes description is in
  7564. @file{contrib/packages/org-annotation-helper}.
  7565. @item @file{org-bookmark.el} by @i{Tokuya Kameshima}
  7566. Support for links to Emacs bookmarks.
  7567. @item @file{org-depend.el} by @i{Carsten Dominik}
  7568. TODO dependencies for Org-mode. Make TODO state changes in one entry
  7569. trigger changes in another, or be blocked by the state of another
  7570. entry. Also, easily create chains of TODO items with exactly one
  7571. active item at any time.
  7572. @item @file{org-elisp-symbol.el} by @i{Bastien Guerry}
  7573. Org links to emacs-lisp symbols. This can create annotated links that
  7574. exactly point to the definition location of a variable of function.
  7575. @item @file{org-eval.el} by @i{Carsten Dominik}
  7576. The @code{<lisp>} tag, adapted from Emacs Wiki and Emacs Muse, allows
  7577. to include text in a document that is the result of evaluating some
  7578. code. Other scripting languages like @code{perl} can be supported with
  7579. this package as well.
  7580. @item @file{org-expiry.el} by @i{Bastien Guerry}
  7581. Expiry mechanism for Org entries.
  7582. @item @file{org-indent.el} by @i{Carsten Dominik}
  7583. Dynamic indentation of Org outlines. The plan is to indent an outline
  7584. according to level, but so far this is too hard for a proper and stable
  7585. implementation. Still, it works somewhat.
  7586. @item @file{org-interactive-query.el} by @i{Christopher League}
  7587. Interactive modification of tags queries. After running a general
  7588. query in Org, this package allows to narrow down the results by adding
  7589. more tags or keywords.
  7590. @item @file{org-mairix.el} by @i{Georg C. F. Greve}
  7591. Hook mairix search into Org for different MUAs.
  7592. @item @file{org-man.el} by @i{Carsten Dominik}
  7593. Support for links to manpages in Org-mode.
  7594. @item @file{org-mtags.el} by @i{Carsten Dominik}
  7595. Support for some Muse-like tags in Org-mode. This package allows you
  7596. to write @code{<example>} and @code{<src>} and other syntax copied from
  7597. Emacs Muse, right inside an Org file. The goal here is to make it easy
  7598. to publish the same file using either org-publish or Muse.
  7599. @item @file{org-panel.el} by @i{Lennard Borgman}
  7600. Simplified and display-aided access to some Org commands.
  7601. @item @file{org-registry.el} by @i{Bastien Guerry}
  7602. A registry for Org links, to find out from where links point to a given
  7603. file or location.
  7604. @item @file{org2rem.el} by @i{Bastien Guerry}
  7605. Convert org appointments into reminders for the @file{remind} program.
  7606. @item @file{org-screen.el} by @i{Andrew Hyatt}
  7607. Visit screen sessions through Org-mode links.
  7608. @item @file{org-toc.el} by @i{Bastien Guerry}
  7609. Table of contents in a separate buffer, with fast access to sections
  7610. and easy visibility cycling.
  7611. @item @file{orgtbl-sqlinsert.el} by @i{Jason Riedy}
  7612. Convert Org-mode tables to SQL insertions. Documentation for this can
  7613. be found on the Worg pages.
  7614. @end table
  7615. @node Other extensions, , Extensions in the contrib directory, Extensions
  7616. @section Other extensions
  7617. @i{TO BE DONE}
  7618. @node Hacking, History and Acknowledgments, Extensions, Top
  7619. @appendix Hacking
  7620. This appendix covers some aspects where users can extend the functionality of
  7621. Org.
  7622. @menu
  7623. * Adding hyperlink types:: New custom link types
  7624. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  7625. * Dynamic blocks:: Automatically filled blocks
  7626. * Special agenda views:: Customized views
  7627. * Using the property API:: Writing programs that use entry properties
  7628. * Using the mapping API:: Mapping over all or selected entries
  7629. @end menu
  7630. @node Adding hyperlink types, Tables in arbitrary syntax, Hacking, Hacking
  7631. @section Adding hyperlink types
  7632. @cindex hyperlinks, adding new types
  7633. Org has a large number of hyperlink types built-in
  7634. (@pxref{Hyperlinks}). If you would like to add new link types, it
  7635. provides an interface for doing so. Lets look at an example file
  7636. @file{org-man.el} that will add support for creating links like
  7637. @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
  7638. emacs:
  7639. @lisp
  7640. ;;; org-man.el - Support for links to manpages in Org
  7641. (require 'org)
  7642. (org-add-link-type "man" 'org-man-open)
  7643. (add-hook 'org-store-link-functions 'org-man-store-link)
  7644. (defcustom org-man-command 'man
  7645. "The Emacs command to be used to display a man page."
  7646. :group 'org-link
  7647. :type '(choice (const man) (const woman)))
  7648. (defun org-man-open (path)
  7649. "Visit the manpage on PATH.
  7650. PATH should be a topic that can be thrown at the man command."
  7651. (funcall org-man-command path))
  7652. (defun org-man-store-link ()
  7653. "Store a link to a manpage."
  7654. (when (memq major-mode '(Man-mode woman-mode))
  7655. ;; This is a man page, we do make this link
  7656. (let* ((page (org-man-get-page-name))
  7657. (link (concat "man:" page))
  7658. (description (format "Manpage for %s" page)))
  7659. (org-store-link-props
  7660. :type "man"
  7661. :link link
  7662. :description description))))
  7663. (defun org-man-get-page-name ()
  7664. "Extract the page name from the buffer name."
  7665. ;; This works for both `Man-mode' and `woman-mode'.
  7666. (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
  7667. (match-string 1 (buffer-name))
  7668. (error "Cannot create link to this man page")))
  7669. (provide 'org-man)
  7670. ;;; org-man.el ends here
  7671. @end lisp
  7672. @noindent
  7673. You would activate this new link type in @file{.emacs} with
  7674. @lisp
  7675. (require 'org-man)
  7676. @end lisp
  7677. @noindent
  7678. Lets go through the file and see what it does.
  7679. @enumerate
  7680. @item
  7681. It does @code{(require 'org)} to make sure that @file{org.el} has been
  7682. loaded.
  7683. @item
  7684. The next line calls @code{org-add-link-type} to define a new link type
  7685. with prefix @samp{man}. The call also contains the name of a function
  7686. that will be called to follow such a link.
  7687. @item
  7688. The next line adds a function to @code{org-store-link-functions}, in
  7689. order to allow the command @kbd{C-c l} to record a useful link in a
  7690. buffer displaying a man page.
  7691. @end enumerate
  7692. The rest of the file defines the necessary variables and functions.
  7693. First there is a customization variable that determines which emacs
  7694. command should be used to display man pages. There are two options,
  7695. @code{man} and @code{woman}. Then the function to follow a link is
  7696. defined. It gets the link path as an argument - in this case the link
  7697. path is just a topic for the manual command. The function calls the
  7698. value of @code{org-man-command} to display the man page.
  7699. Finally the function @code{org-man-store-link} is defined. When you try
  7700. to store a link with @kbd{C-c l}, also this function will be called to
  7701. try to make a link. The function must first decide if it is supposed to
  7702. create the link for this buffer type, we do this by checking the value
  7703. of the variable @code{major-mode}. If not, the function must exit and
  7704. return the value @code{nil}. If yes, the link is created by getting the
  7705. manual topic from the buffer name and prefixing it with the string
  7706. @samp{man:}. Then it must call the command @code{org-store-link-props}
  7707. and set the @code{:type} and @code{:link} properties. Optionally you
  7708. can also set the @code{:description} property to provide a default for
  7709. the link description when the link is later inserted into an Org
  7710. buffer with @kbd{C-c C-l}.
  7711. @node Tables in arbitrary syntax, Dynamic blocks, Adding hyperlink types, Hacking
  7712. @section Tables and lists in arbitrary syntax
  7713. @cindex tables, in other modes
  7714. @cindex lists, in other modes
  7715. @cindex Orgtbl mode
  7716. Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
  7717. frequent feature request has been to make it work with native tables in
  7718. specific languages, for example La@TeX{}. However, this is extremely
  7719. hard to do in a general way, would lead to a customization nightmare,
  7720. and would take away much of the simplicity of the Orgtbl mode table
  7721. editor.
  7722. This appendix describes a different approach. We keep the Orgtbl mode
  7723. table in its native format (the @i{source table}), and use a custom
  7724. function to @i{translate} the table to the correct syntax, and to
  7725. @i{install} it in the right location (the @i{target table}). This puts
  7726. the burden of writing conversion functions on the user, but it allows
  7727. for a very flexible system.
  7728. Bastien added the ability to do the same with lists. You can use Org's
  7729. facilities to edit and structure lists by turning @code{orgstruct-mode}
  7730. on, then locally exporting such lists in another format (HTML, La@TeX{}
  7731. or Texinfo.)
  7732. @menu
  7733. * Radio tables:: Sending and receiving
  7734. * A LaTeX example:: Step by step, almost a tutorial
  7735. * Translator functions:: Copy and modify
  7736. * Radio lists:: Doing the same for lists
  7737. @end menu
  7738. @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
  7739. @subsection Radio tables
  7740. @cindex radio tables
  7741. To define the location of the target table, you first need to create two
  7742. lines that are comments in the current mode, but contain magic words for
  7743. Orgtbl mode to find. Orgtbl mode will insert the translated table
  7744. between these lines, replacing whatever was there before. For example:
  7745. @example
  7746. /* BEGIN RECEIVE ORGTBL table_name */
  7747. /* END RECEIVE ORGTBL table_name */
  7748. @end example
  7749. @noindent
  7750. Just above the source table, we put a special line that tells
  7751. Orgtbl mode how to translate this table and where to install it. For
  7752. example:
  7753. @example
  7754. #+ORGTBL: SEND table_name translation_function arguments....
  7755. @end example
  7756. @noindent
  7757. @code{table_name} is the reference name for the table that is also used
  7758. in the receiver lines. @code{translation_function} is the Lisp function
  7759. that does the translation. Furthermore, the line can contain a list of
  7760. arguments (alternating key and value) at the end. The arguments will be
  7761. passed as a property list to the translation function for
  7762. interpretation. A few standard parameters are already recognized and
  7763. acted upon before the translation function is called:
  7764. @table @code
  7765. @item :skip N
  7766. Skip the first N lines of the table. Hlines do count as separate lines for
  7767. this parameter!
  7768. @item :skipcols (n1 n2 ...)
  7769. List of columns that should be skipped. If the table has a column with
  7770. calculation marks, that column is automatically discarded as well.
  7771. Please note that the translator function sees the table @emph{after} the
  7772. removal of these columns, the function never knows that there have been
  7773. additional columns.
  7774. @end table
  7775. @noindent
  7776. The one problem remaining is how to keep the source table in the buffer
  7777. without disturbing the normal workings of the file, for example during
  7778. compilation of a C file or processing of a La@TeX{} file. There are a
  7779. number of different solutions:
  7780. @itemize @bullet
  7781. @item
  7782. The table could be placed in a block comment if that is supported by the
  7783. language. For example, in C mode you could wrap the table between
  7784. @samp{/*} and @samp{*/} lines.
  7785. @item
  7786. Sometimes it is possible to put the table after some kind of @i{END}
  7787. statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
  7788. in La@TeX{}.
  7789. @item
  7790. You can just comment the table line by line whenever you want to process
  7791. the file, and uncomment it whenever you need to edit the table. This
  7792. only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
  7793. make this comment-toggling very easy, in particular if you bind it to a
  7794. key.
  7795. @end itemize
  7796. @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
  7797. @subsection A LaTeX example of radio tables
  7798. @cindex LaTeX, and Orgtbl mode
  7799. The best way to wrap the source table in La@TeX{} is to use the
  7800. @code{comment} environment provided by @file{comment.sty}. It has to be
  7801. activated by placing @code{\usepackage@{comment@}} into the document
  7802. header. Orgtbl mode can insert a radio table skeleton@footnote{By
  7803. default this works only for La@TeX{}, HTML, and Texinfo. Configure the
  7804. variable @code{orgtbl-radio-tables} to install templates for other
  7805. modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
  7806. be prompted for a table name, lets say we use @samp{salesfigures}. You
  7807. will then get the following template:
  7808. @cindex #+ORGTBL: SEND
  7809. @example
  7810. % BEGIN RECEIVE ORGTBL salesfigures
  7811. % END RECEIVE ORGTBL salesfigures
  7812. \begin@{comment@}
  7813. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  7814. | | |
  7815. \end@{comment@}
  7816. @end example
  7817. @noindent
  7818. The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
  7819. @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
  7820. into the receiver location with name @code{salesfigures}. You may now
  7821. fill in the table, feel free to use the spreadsheet features@footnote{If
  7822. the @samp{#+TBLFM} line contains an odd number of dollar characters,
  7823. this may cause problems with font-lock in LaTeX mode. As shown in the
  7824. example you can fix this by adding an extra line inside the
  7825. @code{comment} environment that is used to balance the dollar
  7826. expressions. If you are using AUCTeX with the font-latex library, a
  7827. much better solution is to add the @code{comment} environment to the
  7828. variable @code{LaTeX-verbatim-environments}.}:
  7829. @example
  7830. % BEGIN RECEIVE ORGTBL salesfigures
  7831. % END RECEIVE ORGTBL salesfigures
  7832. \begin@{comment@}
  7833. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  7834. | Month | Days | Nr sold | per day |
  7835. |-------+------+---------+---------|
  7836. | Jan | 23 | 55 | 2.4 |
  7837. | Feb | 21 | 16 | 0.8 |
  7838. | March | 22 | 278 | 12.6 |
  7839. #+TBLFM: $4=$3/$2;%.1f
  7840. % $ (optional extra dollar to keep font-lock happy, see footnote)
  7841. \end@{comment@}
  7842. @end example
  7843. @noindent
  7844. When you are done, press @kbd{C-c C-c} in the table to get the converted
  7845. table inserted between the two marker lines.
  7846. Now lets assume you want to make the table header by hand, because you
  7847. want to control how columns are aligned etc. In this case we make sure
  7848. that the table translator does skip the first 2 lines of the source
  7849. table, and tell the command to work as a @i{splice}, i.e. to not produce
  7850. header and footer commands of the target table:
  7851. @example
  7852. \begin@{tabular@}@{lrrr@}
  7853. Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
  7854. % BEGIN RECEIVE ORGTBL salesfigures
  7855. % END RECEIVE ORGTBL salesfigures
  7856. \end@{tabular@}
  7857. %
  7858. \begin@{comment@}
  7859. #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
  7860. | Month | Days | Nr sold | per day |
  7861. |-------+------+---------+---------|
  7862. | Jan | 23 | 55 | 2.4 |
  7863. | Feb | 21 | 16 | 0.8 |
  7864. | March | 22 | 278 | 12.6 |
  7865. #+TBLFM: $4=$3/$2;%.1f
  7866. \end@{comment@}
  7867. @end example
  7868. The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
  7869. Orgtbl mode. It uses a @code{tabular} environment to typeset the table
  7870. and marks horizontal lines with @code{\hline}. Furthermore, it
  7871. interprets the following parameters (see also @ref{Translator functions}):
  7872. @table @code
  7873. @item :splice nil/t
  7874. When set to t, return only table body lines, don't wrap them into a
  7875. tabular environment. Default is nil.
  7876. @item :fmt fmt
  7877. A format to be used to wrap each field, should contain @code{%s} for the
  7878. original field value. For example, to wrap each field value in dollars,
  7879. you could use @code{:fmt "$%s$"}. This may also be a property list with
  7880. column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
  7881. A function of one argument can be used in place of the strings; the
  7882. function must return a formatted string.
  7883. @item :efmt efmt
  7884. Use this format to print numbers with exponentials. The format should
  7885. have @code{%s} twice for inserting mantissa and exponent, for example
  7886. @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
  7887. may also be a property list with column numbers and formats, for example
  7888. @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
  7889. @code{efmt} has been applied to a value, @code{fmt} will also be
  7890. applied. Similar to @code{fmt}, functions of two arguments can be
  7891. supplied instead of strings.
  7892. @end table
  7893. @node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
  7894. @subsection Translator functions
  7895. @cindex HTML, and Orgtbl mode
  7896. @cindex translator function
  7897. Orgtbl mode has several translator functions built-in: @code{orgtbl-to-csv}
  7898. (comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values)
  7899. @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and @code{orgtbl-to-texinfo}.
  7900. Except for @code{orgtbl-to-html}@footnote{The HTML translator uses the same
  7901. code that produces tables during HTML export.}, these all use a generic
  7902. translator, @code{orgtbl-to-generic}. For example, @code{orgtbl-to-latex}
  7903. itself is a very short function that computes the column definitions for the
  7904. @code{tabular} environment, defines a few field and line separators and then
  7905. hands over to the generic translator. Here is the entire code:
  7906. @lisp
  7907. @group
  7908. (defun orgtbl-to-latex (table params)
  7909. "Convert the Orgtbl mode TABLE to LaTeX."
  7910. (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
  7911. org-table-last-alignment ""))
  7912. (params2
  7913. (list
  7914. :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
  7915. :tend "\\end@{tabular@}"
  7916. :lstart "" :lend " \\\\" :sep " & "
  7917. :efmt "%s\\,(%s)" :hline "\\hline")))
  7918. (orgtbl-to-generic table (org-combine-plists params2 params))))
  7919. @end group
  7920. @end lisp
  7921. As you can see, the properties passed into the function (variable
  7922. @var{PARAMS}) are combined with the ones newly defined in the function
  7923. (variable @var{PARAMS2}). The ones passed into the function (i.e. the
  7924. ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
  7925. would like to use the La@TeX{} translator, but wanted the line endings to
  7926. be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
  7927. overrule the default with
  7928. @example
  7929. #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
  7930. @end example
  7931. For a new language, you can either write your own converter function in
  7932. analogy with the La@TeX{} translator, or you can use the generic function
  7933. directly. For example, if you have a language where a table is started
  7934. with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
  7935. started with @samp{!BL!}, ended with @samp{!EL!} and where the field
  7936. separator is a TAB, you could call the generic translator like this (on
  7937. a single line!):
  7938. @example
  7939. #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
  7940. :lstart "!BL! " :lend " !EL!" :sep "\t"
  7941. @end example
  7942. @noindent
  7943. Please check the documentation string of the function
  7944. @code{orgtbl-to-generic} for a full list of parameters understood by
  7945. that function and remember that you can pass each of them into
  7946. @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
  7947. using the generic function.
  7948. Of course you can also write a completely new function doing complicated
  7949. things the generic translator cannot do. A translator function takes
  7950. two arguments. The first argument is the table, a list of lines, each
  7951. line either the symbol @code{hline} or a list of fields. The second
  7952. argument is the property list containing all parameters specified in the
  7953. @samp{#+ORGTBL: SEND} line. The function must return a single string
  7954. containing the formatted table. If you write a generally useful
  7955. translator, please post it on @code{emacs-orgmode@@gnu.org} so that
  7956. others can benefit from your work.
  7957. @node Radio lists, , Translator functions, Tables in arbitrary syntax
  7958. @subsection Radio lists
  7959. @cindex radio lists
  7960. @cindex org-list-insert-radio-list
  7961. Sending and receiving radio lists works exactly the same way than
  7962. sending and receiving radio tables (@pxref{Radio tables}) @footnote{You
  7963. need to load the @code{org-export-latex.el} package to use radio lists
  7964. since the relevant code is there for now.}. As for radio tables, you
  7965. can insert radio lists templates in HTML, La@TeX{} and Texinfo modes by
  7966. calling @code{org-list-insert-radio-list}.
  7967. Here are the differences with radio tables:
  7968. @itemize @minus
  7969. @item
  7970. Use @code{ORGLST} instead of @code{ORGTBL}.
  7971. @item
  7972. The available translation functions for radio lists don't take
  7973. parameters.
  7974. @item
  7975. `C-c C-c' will work when pressed on the first item of the list.
  7976. @end itemize
  7977. Here is a La@TeX{} example. Let's say that you have this in your
  7978. La@TeX{} file:
  7979. @example
  7980. % BEGIN RECEIVE ORGLST to-buy
  7981. % END RECEIVE ORGLST to-buy
  7982. \begin@{comment@}
  7983. #+ORGLIST: SEND to-buy orgtbl-to-latex
  7984. - a new house
  7985. - a new computer
  7986. + a new keyboard
  7987. + a new mouse
  7988. - a new life
  7989. \end@{comment@}
  7990. @end example
  7991. Pressing `C-c C-c' on @code{a new house} and will insert the converted
  7992. La@TeX{} list between the two marker lines.
  7993. @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
  7994. @section Dynamic blocks
  7995. @cindex dynamic blocks
  7996. Org documents can contain @emph{dynamic blocks}. These are
  7997. specially marked regions that are updated by some user-written function.
  7998. A good example for such a block is the clock table inserted by the
  7999. command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
  8000. Dynamic block are enclosed by a BEGIN-END structure that assigns a name
  8001. to the block and can also specify parameters for the function producing
  8002. the content of the block.
  8003. #+BEGIN:dynamic block
  8004. @example
  8005. #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
  8006. #+END:
  8007. @end example
  8008. Dynamic blocks are updated with the following commands
  8009. @table @kbd
  8010. @kindex C-c C-x C-u
  8011. @item C-c C-x C-u
  8012. Update dynamic block at point.
  8013. @kindex C-u C-c C-x C-u
  8014. @item C-u C-c C-x C-u
  8015. Update all dynamic blocks in the current file.
  8016. @end table
  8017. Updating a dynamic block means to remove all the text between BEGIN and
  8018. END, parse the BEGIN line for parameters and then call the specific
  8019. writer function for this block to insert the new content. If you want
  8020. to use the original content in the writer function, you can use the
  8021. extra parameter @code{:content}.
  8022. For a block with name @code{myblock}, the writer function is
  8023. @code{org-dblock-write:myblock} with as only parameter a property list
  8024. with the parameters given in the begin line. Here is a trivial example
  8025. of a block that keeps track of when the block update function was last
  8026. run:
  8027. @example
  8028. #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
  8029. #+END:
  8030. @end example
  8031. @noindent
  8032. The corresponding block writer function could look like this:
  8033. @lisp
  8034. (defun org-dblock-write:block-update-time (params)
  8035. (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
  8036. (insert "Last block update at: "
  8037. (format-time-string fmt (current-time)))))
  8038. @end lisp
  8039. If you want to make sure that all dynamic blocks are always up-to-date,
  8040. you could add the function @code{org-update-all-dblocks} to a hook, for
  8041. example @code{before-save-hook}. @code{org-update-all-dblocks} is
  8042. written in a way that is does nothing in buffers that are not in
  8043. @code{org-mode}.
  8044. @node Special agenda views, Using the property API, Dynamic blocks, Hacking
  8045. @section Special agenda views
  8046. @cindex agenda views, user-defined
  8047. Org provides a special hook that can be used to narrow down the
  8048. selection made by any of the agenda views. You may specify a function
  8049. that is used at each match to verify if the match should indeed be part
  8050. of the agenda view, and if not, how much should be skipped.
  8051. Let's say you want to produce a list of projects that contain a WAITING
  8052. tag anywhere in the project tree. Let's further assume that you have
  8053. marked all tree headings that define a project with the TODO keyword
  8054. PROJECT. In this case you would run a TODO search for the keyword
  8055. PROJECT, but skip the match unless there is a WAITING tag anywhere in
  8056. the subtree belonging to the project line.
  8057. To achieve this, you must write a function that searches the subtree for
  8058. the tag. If the tag is found, the function must return @code{nil} to
  8059. indicate that this match should not be skipped. If there is no such
  8060. tag, return the location of the end of the subtree, to indicate that
  8061. search should continue from there.
  8062. @lisp
  8063. (defun my-skip-unless-waiting ()
  8064. "Skip trees that are not waiting"
  8065. (let ((subtree-end (save-excursion (org-end-of-subtree t))))
  8066. (if (re-search-forward ":waiting:" subtree-end t)
  8067. nil ; tag found, do not skip
  8068. subtree-end))) ; tag not found, continue after end of subtree
  8069. @end lisp
  8070. Now you may use this function in an agenda custom command, for example
  8071. like this:
  8072. @lisp
  8073. (org-add-agenda-custom-command
  8074. '("b" todo "PROJECT"
  8075. ((org-agenda-skip-function 'my-org-waiting-projects)
  8076. (org-agenda-overriding-header "Projects waiting for something: "))))
  8077. @end lisp
  8078. Note that this also binds @code{org-agenda-overriding-header} to get a
  8079. meaningful header in the agenda view.
  8080. A general way to create custom searches is to base them on a search for
  8081. entries with a certain level limit. If you want to study all entries with
  8082. your custom search function, simply do a search for @samp{LEVEL>0}, and then
  8083. use @code{org-agenda-skip-function} to select the entries you really want to
  8084. have.
  8085. You may also put a Lisp form into @code{org-agenda-skip-function}. In
  8086. particular, you may use the functions @code{org-agenda-skip-entry-if}
  8087. and @code{org-agenda-skip-subtree-if} in this form, for example:
  8088. @table @code
  8089. @item '(org-agenda-skip-entry-if 'scheduled)
  8090. Skip current entry if it has been scheduled.
  8091. @item '(org-agenda-skip-entry-if 'notscheduled)
  8092. Skip current entry if it has not been scheduled.
  8093. @item '(org-agenda-skip-entry-if 'deadline)
  8094. Skip current entry if it has a deadline.
  8095. @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
  8096. Skip current entry if it has a deadline, or if it is scheduled.
  8097. @item '(org-agenda-skip-entry 'regexp "regular expression")
  8098. Skip current entry if the regular expression matches in the entry.
  8099. @item '(org-agenda-skip-entry 'notregexp "regular expression")
  8100. Skip current entry unless the regular expression matches.
  8101. @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
  8102. Same as above, but check and skip the entire subtree.
  8103. @end table
  8104. Therefore we could also have written the search for WAITING projects
  8105. like this, even without defining a special function:
  8106. @lisp
  8107. (org-add-agenda-custom-command
  8108. '("b" todo "PROJECT"
  8109. ((org-agenda-skip-function '(org-agenda-skip-subtree-if
  8110. 'regexp ":waiting:"))
  8111. (org-agenda-overriding-header "Projects waiting for something: "))))
  8112. @end lisp
  8113. @node Using the property API, Using the mapping API, Special agenda views, Hacking
  8114. @section Using the property API
  8115. @cindex API, for properties
  8116. @cindex properties, API
  8117. Here is a description of the functions that can be used to work with
  8118. properties.
  8119. @defun org-entry-properties &optional pom which
  8120. Get all properties of the entry at point-or-marker POM.
  8121. This includes the TODO keyword, the tags, time strings for deadline,
  8122. scheduled, and clocking, and any additional properties defined in the
  8123. entry. The return value is an alist, keys may occur multiple times
  8124. if the property key was used several times.
  8125. POM may also be nil, in which case the current entry is used.
  8126. If WHICH is nil or `all', get all properties. If WHICH is
  8127. `special' or `standard', only get that subclass.
  8128. @end defun
  8129. @defun org-entry-get pom property &optional inherit
  8130. Get value of PROPERTY for entry at point-or-marker POM. By default,
  8131. this only looks at properties defined locally in the entry. If INHERIT
  8132. is non-nil and the entry does not have the property, then also check
  8133. higher levels of the hierarchy. If INHERIT is the symbol
  8134. @code{selective}, use inheritance if and only if the setting of
  8135. @code{org-use-property-inheritance} selects PROPERTY for inheritance.
  8136. @end defun
  8137. @defun org-entry-delete pom property
  8138. Delete the property PROPERTY from entry at point-or-marker POM.
  8139. @end defun
  8140. @defun org-entry-put pom property value
  8141. Set PROPERTY to VALUE for entry at point-or-marker POM.
  8142. @end defun
  8143. @defun org-buffer-property-keys &optional include-specials
  8144. Get all property keys in the current buffer.
  8145. @end defun
  8146. @defun org-insert-property-drawer
  8147. Insert a property drawer at point.
  8148. @end defun
  8149. @defun org-entry-add-to-multivalued-property pom property value
  8150. Treat the value of the property PROPERTY as a whitespace-separated list of
  8151. values and make sure that VALUE is in this list.
  8152. @end defun
  8153. @defun org-entry-remove-from-multivalued-property pom property value
  8154. Treat the value of the property PROPERTY as a whitespace-separated list of
  8155. values and make sure that VALUE is @emph{not} in this list.
  8156. @end defun
  8157. @defun org-entry-member-in-multivalued-property pom property value
  8158. Treat the value of the property PROPERTY as a whitespace-separated list of
  8159. values and check if VALUE is in this list.
  8160. @end defun
  8161. @node Using the mapping API, , Using the property API, Hacking
  8162. @section Using the mapping API
  8163. @cindex API, for mapping
  8164. @cindex mapping entries, API
  8165. Org has sophisticated mapping capabilities to find all entries satisfying
  8166. certain criteria. Internally, this functionality is used to produce agenda
  8167. views, but there is also an API that can be used to execute arbitrary
  8168. functions for each or selected entries. The main entry point for this API
  8169. is:
  8170. @defun org-map-entries func &optional match scope &rest skip
  8171. Call FUNC at each headline selected by MATCH in SCOPE.
  8172. FUNC is a function or a lisp form. The function will be called without
  8173. arguments, with the cursor positioned at the beginning of the headline.
  8174. The return values of all calls to the function will be collected and
  8175. returned as a list.
  8176. MATCH is a tags/property/todo match as it is used in the agenda tags view.
  8177. Only headlines that are matched by this query will be considered during
  8178. the iteration. When MATCH is nil or t, all headlines will be
  8179. visited by the iteration.
  8180. SCOPE determines the scope of this command. It can be any of:
  8181. @example
  8182. nil @r{the current buffer, respecting the restriction if any}
  8183. tree @r{the subtree started with the entry at point}
  8184. file @r{the current buffer, without restriction}
  8185. file-with-archives
  8186. @r{the current buffer, and any archives associated with it}
  8187. agenda @r{all agenda files}
  8188. agenda-with-archives
  8189. @r{all agenda files with any archive files associated with them}
  8190. (file1 file2 ...)
  8191. @r{if this is a list, all files in the list will be scanned}
  8192. @end example
  8193. The remaining args are treated as settings for the skipping facilities of
  8194. the scanner. The following items can be given here:
  8195. @example
  8196. archive @r{skip trees with the archive tag}
  8197. comment @r{skip trees with the COMMENT keyword}
  8198. function or Lisp form
  8199. @r{will be used as value for @code{org-agenda-skip-function},}
  8200. @r{so whenever the the function returns t, FUNC}
  8201. @r{will not be called for that entry and search will}
  8202. @r{continue from the point where the function leaves it}
  8203. @end example
  8204. @end defun
  8205. The function given to that mapping routine can really do anything you like.
  8206. It can uce the property API (@pxref{Using the property API}) to gather more
  8207. information about the entry, or in order to change metadate in the entry.
  8208. Here are a couple of functions that might be handy:
  8209. @defun org-todo &optional arg
  8210. Change the TODO state of the entry, see the docstring of the functions for
  8211. the many possible values for the argument ARG.
  8212. @end defun
  8213. @defun org-priority &optional action
  8214. Change the priority of the entry, see the docstring of this function for the
  8215. possible values for ACTION.
  8216. @end defun
  8217. @defun org-toggle-tag tag &optional onoff
  8218. Toggle the tag TAG in the current entry. Setting ONOFF to either @code{on}
  8219. or @code{off} will not toggle tag, but ensure that it is either on or off.
  8220. @end defun
  8221. @defun org-promote
  8222. Promote the current entry.
  8223. @end defun
  8224. @defun org-demote
  8225. Demote the current entry.
  8226. @end defun
  8227. Here is a simple example that will turn all entries in the current file with
  8228. a tag @code{TOMORROW} into TODO entries with the keyword @code{UPCOMING}.
  8229. Entries in comment trees and in archive trees will be ignored.
  8230. @lisp
  8231. (org-map-entries
  8232. '(org-todo "UPCOMING")
  8233. "+TOMORROW" 'file 'archive 'comment)
  8234. @end lisp
  8235. The following example counts the number of entries with TODO keyword
  8236. @code{WAITING}, in all agenda files.
  8237. @lisp
  8238. (length (org-map-entries t "/+WAITING" nil 'agenda))
  8239. @end lisp
  8240. @node History and Acknowledgments, Main Index, Hacking, Top
  8241. @appendix History and Acknowledgments
  8242. @cindex acknowledgments
  8243. @cindex history
  8244. @cindex thanks
  8245. Org was borne in 2003, out of frustration over the user interface
  8246. of the Emacs Outline mode. I was trying to organize my notes and
  8247. projects, and using Emacs seemed to be the natural way to go. However,
  8248. having to remember eleven different commands with two or three keys per
  8249. command, only to hide and show parts of the outline tree, that seemed
  8250. entirely unacceptable to me. Also, when using outlines to take notes, I
  8251. constantly want to restructure the tree, organizing it parallel to my
  8252. thoughts and plans. @emph{Visibility cycling} and @emph{structure
  8253. editing} were originally implemented in the package
  8254. @file{outline-magic.el}, but quickly moved to the more general
  8255. @file{org.el}. As this environment became comfortable for project
  8256. planning, the next step was adding @emph{TODO entries}, basic @emph{time
  8257. stamps}, and @emph{table support}. These areas highlight the two main
  8258. goals that Org still has today: To create a new, outline-based,
  8259. plain text mode with innovative and intuitive editing features, and to
  8260. incorporate project planning functionality directly into a notes file.
  8261. A special thanks goes to @i{Bastien Guerry} who has not only writen a large
  8262. number of extensions to Org (most of them integrated into the core by now),
  8263. but has also helped the development and maintenance of Org so much that he
  8264. should be considered co-author of this package.
  8265. Since the first release, literally thousands of emails to me or on
  8266. @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
  8267. reports, feedback, new ideas, and sometimes patches and add-on code.
  8268. Many thanks to everyone who has helped to improve this package. I am
  8269. trying to keep here a list of the people who had significant influence
  8270. in shaping one or more aspects of Org. The list may not be
  8271. complete, if I have forgotten someone, please accept my apologies and
  8272. let me know.
  8273. @itemize @bullet
  8274. @item
  8275. @i{Russel Adams} came up with the idea for drawers.
  8276. @item
  8277. @i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
  8278. @item
  8279. @i{Christophe Bataillon} created the great unicorn logo that we use on the
  8280. Org-mode website.
  8281. @item
  8282. @i{Alex Bochannek} provided a patch for rounding time stamps.
  8283. @item
  8284. @i{Charles Cave}'s suggestion sparked the implementation of templates
  8285. for Remember.
  8286. @item
  8287. @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
  8288. specified time.
  8289. @item
  8290. @i{Gregory Chernov} patched support for lisp forms into table
  8291. calculations and improved XEmacs compatibility, in particular by porting
  8292. @file{nouline.el} to XEmacs.
  8293. @item
  8294. @i{Sacha Chua} suggested to copy some linking code from Planner.
  8295. @item
  8296. @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
  8297. came up with the idea of properties, and that there should be an API for
  8298. them.
  8299. @item
  8300. @i{Kees Dullemond} used to edit projects lists directly in HTML and so
  8301. inspired some of the early development, including HTML export. He also
  8302. asked for a way to narrow wide table columns.
  8303. @item
  8304. @i{Christian Egli} converted the documentation into Texinfo format,
  8305. patched CSS formatting into the HTML exporter, and inspired the agenda.
  8306. @item
  8307. @i{David Emery} provided a patch for custom CSS support in exported
  8308. HTML agendas.
  8309. @item
  8310. @i{Nic Ferrier} contributed mailcap and XOXO support.
  8311. @item
  8312. @i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
  8313. @item
  8314. @i{John Foerch} figured out how to make incremental search show context
  8315. around a match in a hidden outline tree.
  8316. @item
  8317. @i{Niels Giesen} had the idea to automatically archive DONE trees.
  8318. @item
  8319. @i{Bastien Guerry} wrote the La@TeX{} exporter and @file{org-bibtex.el}, and
  8320. has been prolific with patches, ideas, and bug reports.
  8321. @item
  8322. @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
  8323. @item
  8324. @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
  8325. task state change logging, and the clocktable. His clear explanations have
  8326. been critical when we started to adopt the GIT version control system.
  8327. @item
  8328. @i{Manuel Hermenegildo} has contributed various ideas, small fixed and
  8329. patches.
  8330. @item
  8331. @i{Phil Jackson} wrote @file{org-irc.el}.
  8332. @item
  8333. @i{Scott Jaderholm} proposed footnotes, control over whitespace between
  8334. folded entries, and column view for properties.
  8335. @item
  8336. @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
  8337. @item
  8338. @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
  8339. provided frequent feedback and some patches.
  8340. @item
  8341. @i{Jason F. McBrayer} suggested agenda export to CSV format.
  8342. @item
  8343. @i{Max Mikhanosha} came up with the idea of refiling.
  8344. @item
  8345. @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
  8346. basis.
  8347. @item
  8348. @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
  8349. happy.
  8350. @item
  8351. @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file
  8352. and to be able to quickly restrict the agenda to a subtree.
  8353. @item
  8354. @i{Todd Neal} provided patches for links to Info files and elisp forms.
  8355. @item
  8356. @i{Tim O'Callaghan} suggested in-file links, search options for general
  8357. file links, and TAGS.
  8358. @item
  8359. @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
  8360. into Japanese.
  8361. @item
  8362. @i{Oliver Oppitz} suggested multi-state TODO items.
  8363. @item
  8364. @i{Scott Otterson} sparked the introduction of descriptive text for
  8365. links, among other things.
  8366. @item
  8367. @i{Pete Phillips} helped during the development of the TAGS feature, and
  8368. provided frequent feedback.
  8369. @item
  8370. @i{T.V. Raman} reported bugs and suggested improvements.
  8371. @item
  8372. @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
  8373. control.
  8374. @item
  8375. @i{Kevin Rogers} contributed code to access VM files on remote hosts.
  8376. @item
  8377. @i{Sebastian Rose} wrote @file{org-info.js}, a Java script for displaying
  8378. webpages derived from Org using an Info-like, or a folding interface with
  8379. single key navigation.
  8380. @item
  8381. @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
  8382. conflict with @file{allout.el}.
  8383. @item
  8384. @i{Jason Riedy} generalized the send-receive mechanism for orgtbl tables with
  8385. extensive patches.
  8386. @item
  8387. @i{Philip Rooke} created the Org reference card, provided lots
  8388. of feedback, developed and applied standards to the Org documentation.
  8389. @item
  8390. @i{Christian Schlauer} proposed angular brackets around links, among
  8391. other things.
  8392. @item
  8393. Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
  8394. @file{organizer-mode.el}.
  8395. @item
  8396. @i{Ilya Shlyakhter} proposed the Archive Sibling.
  8397. @item
  8398. @i{Daniel Sinder} came up with the idea of internal archiving by locking
  8399. subtrees.
  8400. @item
  8401. @i{Dale Smith} proposed link abbreviations.
  8402. @item
  8403. @i{James TD Smith} has contributed a large number of patches for useful
  8404. tweaks and features.
  8405. @item
  8406. @i{Adam Spiers} asked for global linking commands, inspired the link
  8407. extension system, added support for mairix, and proposed the mapping API.
  8408. @item
  8409. @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
  8410. chapter about publishing.
  8411. @item
  8412. @i{J@"urgen Vollmer} contributed code generating the table of contents
  8413. in HTML output.
  8414. @item
  8415. @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
  8416. keyword.
  8417. @item
  8418. @i{David Wainberg} suggested archiving, and improvements to the linking
  8419. system.
  8420. @item
  8421. @i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
  8422. @file{muse.el}, which have similar goals as Org. Initially the
  8423. development of Org was fully independent because I was not aware of the
  8424. existence of these packages. But with time I have accasionally looked
  8425. at John's code and learned a lot from it. John has also contributed a
  8426. number of great ideas and patches directly to Org, including the file
  8427. @code{org-mac-message.el}'
  8428. @item
  8429. @i{Carsten Wimmer} suggested some changes and helped fix a bug in
  8430. linking to Gnus.
  8431. @item
  8432. @i{Roland Winkler} requested additional key bindings to make Org
  8433. work on a tty.
  8434. @item
  8435. @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
  8436. and contributed various ideas and code snippets.
  8437. @end itemize
  8438. @node Main Index, Key Index, History and Acknowledgments, Top
  8439. @unnumbered The Main Index
  8440. @printindex cp
  8441. @node Key Index, , Main Index, Top
  8442. @unnumbered Key Index
  8443. @printindex ky
  8444. @bye
  8445. @ignore
  8446. arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
  8447. @end ignore
  8448. @c Local variables:
  8449. @c ispell-local-dictionary: "en_US-w_accents"
  8450. @c ispell-local-pdict: "./.aspell.org.pws"
  8451. @c fill-column: 77
  8452. @c End: