org.texi 508 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594
  1. \input texinfo
  2. @c %**start of header
  3. @setfilename ../../info/org
  4. @settitle The Org Manual
  5. @set VERSION 6.34
  6. @set DATE January 2010
  7. @c Version and Contact Info
  8. @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
  9. @set AUTHOR Carsten Dominik
  10. @set MAINTAINER Carsten Dominik
  11. @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
  12. @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
  13. @c %**end of header
  14. @finalout
  15. @c Macro definitions
  16. @iftex
  17. @c @hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}
  18. @end iftex
  19. @macro Ie {}
  20. I.e.,
  21. @end macro
  22. @macro ie {}
  23. i.e.,
  24. @end macro
  25. @macro Eg {}
  26. E.g.,
  27. @end macro
  28. @macro eg {}
  29. e.g.,
  30. @end macro
  31. @c Subheadings inside a table.
  32. @macro tsubheading{text}
  33. @ifinfo
  34. @subsubheading \text\
  35. @end ifinfo
  36. @ifnotinfo
  37. @item @b{\text\}
  38. @end ifnotinfo
  39. @end macro
  40. @copying
  41. This manual is for Org version @value{VERSION}.
  42. Copyright @copyright{} 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation
  43. @quotation
  44. Permission is granted to copy, distribute and/or modify this document
  45. under the terms of the GNU Free Documentation License, Version 1.3 or
  46. any later version published by the Free Software Foundation; with no
  47. Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
  48. and with the Back-Cover Texts as in (a) below. A copy of the license
  49. is included in the section entitled ``GNU Free Documentation License.''
  50. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  51. modify this GNU manual. Buying copies from the FSF supports it in
  52. developing GNU and promoting software freedom.''
  53. This document is part of a collection distributed under the GNU Free
  54. Documentation License. If you want to distribute this document
  55. separately from the collection, you can do so by adding a copy of the
  56. license to the document, as described in section 6 of the license.
  57. @end quotation
  58. @end copying
  59. @dircategory Emacs
  60. @direntry
  61. * Org Mode: (org). Outline-based notes management and organizer
  62. @end direntry
  63. @titlepage
  64. @title The Org Manual
  65. @subtitle Release @value{VERSION}
  66. @author by Carsten Dominik
  67. @c The following two commands start the copyright page.
  68. @page
  69. @vskip 0pt plus 1filll
  70. @insertcopying
  71. @end titlepage
  72. @c Output the table of contents at the beginning.
  73. @contents
  74. @ifnottex
  75. @node Top, Introduction, (dir), (dir)
  76. @top Org Mode Manual
  77. @insertcopying
  78. @end ifnottex
  79. @menu
  80. * Introduction:: Getting started
  81. * Document Structure:: A tree works like your brain
  82. * Tables:: Pure magic for quick formatting
  83. * Hyperlinks:: Notes in context
  84. * TODO Items:: Every tree branch can be a TODO item
  85. * Tags:: Tagging headlines and matching sets of tags
  86. * Properties and Columns:: Storing information about an entry
  87. * Dates and Times:: Making items useful for planning
  88. * Capture - Refile - Archive:: The ins and outs for projects
  89. * Agenda Views:: Collecting information into views
  90. * Markup:: Prepare text for rich export
  91. * Exporting:: Sharing and publishing of notes
  92. * Publishing:: Create a web site of linked Org files
  93. * Miscellaneous:: All the rest which did not fit elsewhere
  94. * Hacking:: How to hack your way around
  95. * MobileOrg:: Viewing and capture on a mobile device
  96. * History and Acknowledgments:: How Org came into being
  97. * Main Index:: An index of Org's concepts and features
  98. * Key Index:: Key bindings and where they are described
  99. * Variable Index:: Variables mentioned in the manual
  100. @detailmenu
  101. --- The Detailed Node Listing ---
  102. Introduction
  103. * Summary:: Brief summary of what Org does
  104. * Installation:: How to install a downloaded version of Org
  105. * Activation:: How to activate Org for certain buffers
  106. * Feedback:: Bug reports, ideas, patches etc.
  107. * Conventions:: Type-setting conventions in the manual
  108. Document Structure
  109. * Outlines:: Org is based on Outline mode
  110. * Headlines:: How to typeset Org tree headlines
  111. * Visibility cycling:: Show and hide, much simplified
  112. * Motion:: Jumping to other headlines
  113. * Structure editing:: Changing sequence and level of headlines
  114. * Sparse trees:: Matches embedded in context
  115. * Plain lists:: Additional structure within an entry
  116. * Drawers:: Tucking stuff away
  117. * Blocks:: Folding blocks
  118. * Footnotes:: How footnotes are defined in Org's syntax
  119. * Orgstruct mode:: Structure editing outside Org
  120. Tables
  121. * Built-in table editor:: Simple tables
  122. * Column width and alignment:: Overrule the automatic settings
  123. * Column groups:: Grouping to trigger vertical lines
  124. * Orgtbl mode:: The table editor as minor mode
  125. * The spreadsheet:: The table editor has spreadsheet capabilities
  126. * Org-Plot:: Plotting from org tables
  127. The spreadsheet
  128. * References:: How to refer to another field or range
  129. * Formula syntax for Calc:: Using Calc to compute stuff
  130. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  131. * Field formulas:: Formulas valid for a single field
  132. * Column formulas:: Formulas valid for an entire column
  133. * Editing and debugging formulas:: Fixing formulas
  134. * Updating the table:: Recomputing all dependent fields
  135. * Advanced features:: Field names, parameters and automatic recalc
  136. Hyperlinks
  137. * Link format:: How links in Org are formatted
  138. * Internal links:: Links to other places in the current file
  139. * External links:: URL-like links to the world
  140. * Handling links:: Creating, inserting and following
  141. * Using links outside Org:: Linking from my C source code?
  142. * Link abbreviations:: Shortcuts for writing complex links
  143. * Search options:: Linking to a specific location
  144. * Custom searches:: When the default search is not enough
  145. Internal links
  146. * Radio targets:: Make targets trigger links in plain text
  147. TODO Items
  148. * TODO basics:: Marking and displaying TODO entries
  149. * TODO extensions:: Workflow and assignments
  150. * Progress logging:: Dates and notes for progress
  151. * Priorities:: Some things are more important than others
  152. * Breaking down tasks:: Splitting a task into manageable pieces
  153. * Checkboxes:: Tick-off lists
  154. Extended use of TODO keywords
  155. * Workflow states:: From TODO to DONE in steps
  156. * TODO types:: I do this, Fred does the rest
  157. * Multiple sets in one file:: Mixing it all, and still finding your way
  158. * Fast access to TODO states:: Single letter selection of a state
  159. * Per-file keywords:: Different files, different requirements
  160. * Faces for TODO keywords:: Highlighting states
  161. * TODO dependencies:: When one task needs to wait for others
  162. Progress logging
  163. * Closing items:: When was this entry marked DONE?
  164. * Tracking TODO state changes:: When did the status change?
  165. * Tracking your habits:: How consistent have you been?
  166. Tags
  167. * Tag inheritance:: Tags use the tree structure of the outline
  168. * Setting tags:: How to assign tags to a headline
  169. * Tag searches:: Searching for combinations of tags
  170. Properties and Columns
  171. * Property syntax:: How properties are spelled out
  172. * Special properties:: Access to other Org mode features
  173. * Property searches:: Matching property values
  174. * Property inheritance:: Passing values down the tree
  175. * Column view:: Tabular viewing and editing
  176. * Property API:: Properties for Lisp programmers
  177. Column view
  178. * Defining columns:: The COLUMNS format property
  179. * Using column view:: How to create and use column view
  180. * Capturing column view:: A dynamic block for column view
  181. Defining columns
  182. * Scope of column definitions:: Where defined, where valid?
  183. * Column attributes:: Appearance and content of a column
  184. Dates and Times
  185. * Timestamps:: Assigning a time to a tree entry
  186. * Creating timestamps:: Commands which insert timestamps
  187. * Deadlines and scheduling:: Planning your work
  188. * Clocking work time:: Tracking how long you spend on a task
  189. * Resolving idle time:: Resolving time if you've been idle
  190. * Effort estimates:: Planning work effort in advance
  191. * Relative timer:: Notes with a running timer
  192. Creating timestamps
  193. * The date/time prompt:: How Org mode helps you entering date and time
  194. * Custom time format:: Making dates look different
  195. Deadlines and scheduling
  196. * Inserting deadline/schedule:: Planning items
  197. * Repeated tasks:: Items that show up again and again
  198. Capture - Refile - Archive
  199. * Remember:: Capture new tasks/ideas with little interruption
  200. * Attachments:: Add files to tasks.
  201. * RSS Feeds:: Getting input from RSS feeds
  202. * Protocols:: External (e.g. Browser) access to Emacs and Org
  203. * Refiling notes:: Moving a tree from one place to another
  204. * Archiving:: What to do with finished projects
  205. Remember
  206. * Setting up Remember for Org:: Some code for .emacs to get things going
  207. * Remember templates:: Define the outline of different note types
  208. * Storing notes:: Directly get the note to where it belongs
  209. Archiving
  210. * Moving subtrees:: Moving a tree to an archive file
  211. * Internal archiving:: Switch off a tree but keep i in the file
  212. Agenda Views
  213. * Agenda files:: Files being searched for agenda information
  214. * Agenda dispatcher:: Keyboard access to agenda views
  215. * Built-in agenda views:: What is available out of the box?
  216. * Presentation and sorting:: How agenda items are prepared for display
  217. * Agenda commands:: Remote editing of Org trees
  218. * Custom agenda views:: Defining special searches and views
  219. * Exporting Agenda Views:: Writing a view to a file
  220. * Agenda column view:: Using column view for collected entries
  221. The built-in agenda views
  222. * Weekly/daily agenda:: The calendar page with current tasks
  223. * Global TODO list:: All unfinished action items
  224. * Matching tags and properties:: Structured information with fine-tuned search
  225. * Timeline:: Time-sorted view for single file
  226. * Search view:: Find entries by searching for text
  227. * Stuck projects:: Find projects you need to review
  228. Presentation and sorting
  229. * Categories:: Not all tasks are equal
  230. * Time-of-day specifications:: How the agenda knows the time
  231. * Sorting of agenda items:: The order of things
  232. Custom agenda views
  233. * Storing searches:: Type once, use often
  234. * Block agenda:: All the stuff you need in a single buffer
  235. * Setting Options:: Changing the rules
  236. Markup for rich export
  237. * Structural markup elements:: The basic structure as seen by the exporter
  238. * Images and tables:: Tables and Images will be included
  239. * Literal examples:: Source code examples with special formatting
  240. * Include files:: Include additional files into a document
  241. * Macro replacement:: Use macros to create complex output
  242. * Embedded LaTeX:: LaTeX can be freely used inside Org documents
  243. Structural markup elements
  244. * Document title:: Where the title is taken from
  245. * Headings and sections:: The document structure as seen by the exporter
  246. * Table of contents:: The if and where of the table of contents
  247. * Initial text:: Text before the first heading?
  248. * Lists:: Lists
  249. * Paragraphs:: Paragraphs
  250. * Footnote markup:: Footnotes
  251. * Emphasis and monospace:: Bold, italic, etc.
  252. * Horizontal rules:: Make a line
  253. * Comment lines:: What will *not* be exported
  254. Embedded La@TeX{}
  255. * Special symbols:: Greek letters and other symbols
  256. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  257. * LaTeX fragments:: Complex formulas made easy
  258. * Previewing LaTeX fragments:: What will this snippet look like?
  259. * CDLaTeX mode:: Speed up entering of formulas
  260. Exporting
  261. * Selective export:: Using tags to select and exclude trees
  262. * Export options:: Per-file export settings
  263. * The export dispatcher:: How to access exporter commands
  264. * ASCII export:: Exporting to plain ASCII
  265. * HTML export:: Exporting to HTML
  266. * LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
  267. * DocBook export:: Exporting to DocBook
  268. * Freemind export:: Exporting to Freemind mind maps
  269. * XOXO export:: Exporting to XOXO
  270. * iCalendar export:: Exporting in iCalendar format
  271. HTML export
  272. * HTML Export commands:: How to invoke HTML export
  273. * Quoting HTML tags:: Using direct HTML in Org mode
  274. * Links in HTML export:: How links will be interpreted and formatted
  275. * Tables in HTML export:: How to modify the formatting of tables
  276. * Images in HTML export:: How to insert figures into HTML output
  277. * Text areas in HTML export:: An alternative way to show an example
  278. * CSS support:: Changing the appearance of the output
  279. * Javascript support:: Info and Folding in a web browser
  280. La@TeX{} and PDF export
  281. * LaTeX/PDF export commands:: Which key invokes which commands
  282. * Quoting LaTeX code:: Incorporating literal La@TeX{} code
  283. * Sectioning structure:: Changing sectioning in La@TeX{} output
  284. * Tables in LaTeX export:: Options for exporting tables to La@TeX{}
  285. * Images in LaTeX export:: How to insert figures into La@TeX{} output
  286. * Beamer class export:: Turning the file into a presentation
  287. DocBook export
  288. * DocBook export commands:: How to invoke DocBook export
  289. * Quoting DocBook code:: Incorporating DocBook code in Org files
  290. * Recursive sections:: Recursive sections in DocBook
  291. * Tables in DocBook export:: Tables are exported as HTML tables
  292. * Images in DocBook export:: How to insert figures into DocBook output
  293. * Special characters:: How to handle special characters
  294. Publishing
  295. * Configuration:: Defining projects
  296. * Uploading files:: How to get files up on the server
  297. * Sample configuration:: Example projects
  298. * Triggering publication:: Publication commands
  299. Configuration
  300. * Project alist:: The central configuration variable
  301. * Sources and destinations:: From here to there
  302. * Selecting files:: What files are part of the project?
  303. * Publishing action:: Setting the function doing the publishing
  304. * Publishing options:: Tweaking HTML export
  305. * Publishing links:: Which links keep working after publishing?
  306. * Project page index:: Publishing a list of project files
  307. Sample configuration
  308. * Simple example:: One-component publishing
  309. * Complex example:: A multi-component publishing example
  310. Miscellaneous
  311. * Completion:: M-TAB knows what you need
  312. * Speed keys:: Electic commands at the beginning of a headline
  313. * Customization:: Adapting Org to your taste
  314. * In-buffer settings:: Overview of the #+KEYWORDS
  315. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  316. * Clean view:: Getting rid of leading stars in the outline
  317. * TTY keys:: Using Org on a tty
  318. * Interaction:: Other Emacs packages
  319. Interaction with other packages
  320. * Cooperation:: Packages Org cooperates with
  321. * Conflicts:: Packages that lead to conflicts
  322. Hacking
  323. * Hooks:: Who to reach into Org's internals
  324. * Add-on packages:: Available extensions
  325. * Adding hyperlink types:: New custom link types
  326. * Context-sensitive commands:: How to add functionality to such commands
  327. * Tables in arbitrary syntax:: Orgtbl for La@TeX{} and other programs
  328. * Dynamic blocks:: Automatically filled blocks
  329. * Special agenda views:: Customized views
  330. * Extracting agenda information:: Postprocessing of agenda information
  331. * Using the property API:: Writing programs that use entry properties
  332. * Using the mapping API:: Mapping over all or selected entries
  333. Tables and lists in arbitrary syntax
  334. * Radio tables:: Sending and receiving radio tables
  335. * A LaTeX example:: Step by step, almost a tutorial
  336. * Translator functions:: Copy and modify
  337. * Radio lists:: Doing the same for lists
  338. MobileOrg
  339. * Setting up the staging area:: Where to interact with the mobile device
  340. * Pushing to MobileOrg:: Uploading Org files and agendas
  341. * Pulling from MobileOrg:: Integrating captured and flagged items
  342. @end detailmenu
  343. @end menu
  344. @node Introduction, Document Structure, Top, Top
  345. @chapter Introduction
  346. @cindex introduction
  347. @menu
  348. * Summary:: Brief summary of what Org does
  349. * Installation:: How to install a downloaded version of Org
  350. * Activation:: How to activate Org for certain buffers
  351. * Feedback:: Bug reports, ideas, patches etc.
  352. * Conventions:: Type-setting conventions in the manual
  353. @end menu
  354. @node Summary, Installation, Introduction, Introduction
  355. @section Summary
  356. @cindex summary
  357. Org is a mode for keeping notes, maintaining TODO lists, and doing
  358. project planning with a fast and effective plain-text system.
  359. Org develops organizational tasks around NOTES files that contain
  360. lists or information about projects as plain text. Org is
  361. implemented on top of Outline mode, which makes it possible to keep the
  362. content of large files well structured. Visibility cycling and
  363. structure editing help to work with the tree. Tables are easily created
  364. with a built-in table editor. Org supports TODO items, deadlines,
  365. timestamps, and scheduling. It dynamically compiles entries into an
  366. agenda that utilizes and smoothly integrates much of the Emacs calendar
  367. and diary. Plain text URL-like links connect to websites, emails,
  368. Usenet messages, BBDB entries, and any files related to the projects.
  369. For printing and sharing of notes, an Org file can be exported as a
  370. structured ASCII file, as HTML, or (TODO and agenda items only) as an
  371. iCalendar file. It can also serve as a publishing tool for a set of
  372. linked web pages.
  373. An important design aspect that distinguishes Org from, for example,
  374. Planner/Muse is that it encourages you to store every piece of information
  375. only once. In Planner, you have project pages, day pages and possibly
  376. other files, duplicating some information such as tasks. In Org,
  377. you only have notes files. In your notes you mark entries as tasks, and
  378. label them with tags and timestamps. All necessary lists, like a
  379. schedule for the day, the agenda for a meeting, tasks lists selected by
  380. tags, etc., are created dynamically when you need them.
  381. Org keeps simple things simple. When first fired up, it should
  382. feel like a straightforward, easy to use outliner. Complexity is not
  383. imposed, but a large amount of functionality is available when you need
  384. it. Org is a toolbox and can be used in different ways, for
  385. example as:
  386. @example
  387. @r{@bullet{} an outline extension with visibility cycling and structure editing}
  388. @r{@bullet{} an ASCII system and table editor for taking structured notes}
  389. @r{@bullet{} an ASCII table editor with spreadsheet-like capabilities}
  390. @r{@bullet{} a TODO list editor}
  391. @r{@bullet{} a full agenda and planner with deadlines and work scheduling}
  392. @pindex GTD, Getting Things Done
  393. @r{@bullet{} an environment to implement David Allen's GTD system}
  394. @r{@bullet{} a basic database application}
  395. @r{@bullet{} a simple hypertext system, with HTML and La@TeX{} export}
  396. @r{@bullet{} a publishing tool to create a set of interlinked webpages}
  397. @end example
  398. Org's automatic, context-sensitive table editor with spreadsheet
  399. capabilities can be integrated into any major mode by activating the
  400. minor Orgtbl mode. Using a translation step, it can be used to maintain
  401. tables in arbitrary file types, for example in La@TeX{}. The structure
  402. editing and list creation capabilities can be used outside Org with
  403. the minor Orgstruct mode.
  404. @cindex FAQ
  405. There is a website for Org which provides links to the newest
  406. version of Org, as well as additional information, frequently asked
  407. questions (FAQ), links to tutorials, etc@. This page is located at
  408. @uref{http://orgmode.org}.
  409. @page
  410. @node Installation, Activation, Summary, Introduction
  411. @section Installation
  412. @cindex installation
  413. @cindex XEmacs
  414. @b{Important:} @i{If you are using a version of Org that is part of the Emacs
  415. distribution or an XEmacs package, please skip this section and go directly
  416. to @ref{Activation}.}
  417. If you have downloaded Org from the Web, either as a distribution @file{.zip}
  418. or @file{.tar} file, or as a Git archive, you must take the following steps
  419. to install it: go into the unpacked Org distribution directory and edit the
  420. top section of the file @file{Makefile}. You must set the name of the Emacs
  421. binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
  422. directories where local Lisp and Info files are kept. If you don't have
  423. access to the system-wide directories, you can simply run Org directly from
  424. the distribution directory by adding the @file{lisp} subdirectory to the
  425. Emacs load path. To do this, add the following line to @file{.emacs}:
  426. @example
  427. (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
  428. @end example
  429. @noindent
  430. If you plan to use code from the @file{contrib} subdirectory, do a similar
  431. step for this directory:
  432. @example
  433. (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
  434. @end example
  435. @sp 2
  436. @cartouche
  437. XEmacs users now need to install the file @file{noutline.el} from
  438. the @file{xemacs} sub-directory of the Org distribution. Use the
  439. command:
  440. @example
  441. make install-noutline
  442. @end example
  443. @end cartouche
  444. @sp 2
  445. @noindent Now byte-compile the Lisp files with the shell command:
  446. @example
  447. make
  448. @end example
  449. @noindent If you are running Org from the distribution directory, this is
  450. all. If you want to install Org into the system directories, use (as
  451. administrator)
  452. @example
  453. make install
  454. @end example
  455. Installing Info files is system dependent, because of differences in the
  456. @file{install-info} program. In Debian it copies the info files into the
  457. correct directory and modifies the info directory file. In many other
  458. systems, the files need to be copied to the correct directory separately, and
  459. @file{install-info} then only modifies the directory file. Check your system
  460. documentation to find out which of the following commands you need:
  461. @example
  462. make install-info
  463. make install-info-debian
  464. @end example
  465. Then add the following line to @file{.emacs}. It is needed so that
  466. Emacs can autoload functions that are located in files not immediately loaded
  467. when Org-mode starts.
  468. @lisp
  469. (require 'org-install)
  470. @end lisp
  471. Do not forget to activate Org as described in the following section.
  472. @page
  473. @node Activation, Feedback, Installation, Introduction
  474. @section Activation
  475. @cindex activation
  476. @cindex autoload
  477. @cindex global key bindings
  478. @cindex key bindings, global
  479. @iftex
  480. @b{Important:} @i{If you use copy-and-paste to copy Lisp code from the
  481. PDF documentation as viewed by some PDF viewers to your @file{.emacs} file, the
  482. single-quote character comes out incorrectly and the code will not work.
  483. You need to fix the single-quotes by hand, or copy from Info
  484. documentation.}
  485. @end iftex
  486. Add the following lines to your @file{.emacs} file. The last three lines
  487. define @emph{global} keys for the commands @command{org-store-link},
  488. @command{org-agenda}, and @command{org-iswitchb}---please choose suitable
  489. keys yourself.
  490. @lisp
  491. ;; The following lines are always needed. Choose your own keys.
  492. (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  493. (global-set-key "\C-cl" 'org-store-link)
  494. (global-set-key "\C-ca" 'org-agenda)
  495. (global-set-key "\C-cb" 'org-iswitchb)
  496. @end lisp
  497. Furthermore, you must activate @code{font-lock-mode} in Org
  498. buffers, because significant functionality depends on font-locking being
  499. active. You can do this with either one of the following two lines
  500. (XEmacs users must use the second option):
  501. @lisp
  502. (global-font-lock-mode 1) ; for all buffers
  503. (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
  504. @end lisp
  505. @cindex Org mode, turning on
  506. With this setup, all files with extension @samp{.org} will be put
  507. into Org mode. As an alternative, make the first line of a file look
  508. like this:
  509. @example
  510. MY PROJECTS -*- mode: org; -*-
  511. @end example
  512. @vindex org-insert-mode-line-in-empty-file
  513. @noindent which will select Org mode for this buffer no matter what
  514. the file's name is. See also the variable
  515. @code{org-insert-mode-line-in-empty-file}.
  516. Many commands in Org work on the region if the region is @i{active}. To make
  517. use of this, you need to have @code{transient-mark-mode}
  518. (@code{zmacs-regions} in XEmacs) turned on. In Emacs 23 this is the default,
  519. in Emacs 22 you need to do this yourself with
  520. @lisp
  521. (transient-mark-mode 1)
  522. @end lisp
  523. @noindent If you do not like @code{transient-mark-mode}, you can create an
  524. active region by using the mouse to select a region, or pressing
  525. @kbd{C-@key{SPC}} twice before moving the cursor.
  526. @node Feedback, Conventions, Activation, Introduction
  527. @section Feedback
  528. @cindex feedback
  529. @cindex bug reports
  530. @cindex maintainer
  531. @cindex author
  532. If you find problems with Org, or if you have questions, remarks, or ideas
  533. about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}.
  534. If you are not a member of the mailing list, your mail will be passed to the
  535. list after a moderator has approved it.
  536. For bug reports, please provide as much information as possible, including
  537. the version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org
  538. (@kbd{M-x org-version @key{RET}}), as well as the Org related setup in
  539. @file{.emacs}. The easiest way to do this is to use the command
  540. @example
  541. @kbd{M-x org-submit-bug-report}
  542. @end example
  543. @noindent which will put all this information into an Emacs mail buffer so
  544. that you only need to add your description. If you re not sending the Email
  545. from within Emacs, please copy and paste the content into your Email program.
  546. If an error occurs, a backtrace can be very useful (see below on how to
  547. create one). Often a small example file helps, along with clear information
  548. about:
  549. @enumerate
  550. @item What exactly did you do?
  551. @item What did you expect to happen?
  552. @item What happened instead?
  553. @end enumerate
  554. @noindent Thank you for helping to improve this mode.
  555. @subsubheading How to create a useful backtrace
  556. @cindex backtrace of an error
  557. If working with Org produces an error with a message you don't
  558. understand, you may have hit a bug. The best way to report this is by
  559. providing, in addition to what was mentioned above, a @emph{backtrace}.
  560. This is information from the built-in debugger about where and how the
  561. error occurred. Here is how to produce a useful backtrace:
  562. @enumerate
  563. @item
  564. Reload uncompiled versions of all Org-mode Lisp files. The backtrace
  565. contains much more information if it is produced with uncompiled code.
  566. To do this, use
  567. @example
  568. C-u M-x org-reload RET
  569. @end example
  570. @noindent
  571. or select @code{Org -> Refresh/Reload -> Reload Org uncompiled} from the
  572. menu.
  573. @item
  574. Go to the @code{Options} menu and select @code{Enter Debugger on Error}
  575. (XEmacs has this option in the @code{Troubleshooting} sub-menu).
  576. @item
  577. Do whatever you have to do to hit the error. Don't forget to
  578. document the steps you take.
  579. @item
  580. When you hit the error, a @file{*Backtrace*} buffer will appear on the
  581. screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
  582. attach it to your bug report.
  583. @end enumerate
  584. @node Conventions, , Feedback, Introduction
  585. @section Typesetting conventions used in this manual
  586. Org uses three types of keywords: TODO keywords, tags, and property
  587. names. In this manual we use the following conventions:
  588. @table @code
  589. @item TODO
  590. @itemx WAITING
  591. TODO keywords are written with all capitals, even if they are
  592. user-defined.
  593. @item boss
  594. @itemx ARCHIVE
  595. User-defined tags are written in lowercase; built-in tags with special
  596. meaning are written with all capitals.
  597. @item Release
  598. @itemx PRIORITY
  599. User-defined properties are capitalized; built-in properties with
  600. special meaning are written with all capitals.
  601. @end table
  602. @node Document Structure, Tables, Introduction, Top
  603. @chapter Document Structure
  604. @cindex document structure
  605. @cindex structure of document
  606. Org is based on Outline mode and provides flexible commands to
  607. edit the structure of the document.
  608. @menu
  609. * Outlines:: Org is based on Outline mode
  610. * Headlines:: How to typeset Org tree headlines
  611. * Visibility cycling:: Show and hide, much simplified
  612. * Motion:: Jumping to other headlines
  613. * Structure editing:: Changing sequence and level of headlines
  614. * Sparse trees:: Matches embedded in context
  615. * Plain lists:: Additional structure within an entry
  616. * Drawers:: Tucking stuff away
  617. * Blocks:: Folding blocks
  618. * Footnotes:: How footnotes are defined in Org's syntax
  619. * Orgstruct mode:: Structure editing outside Org
  620. @end menu
  621. @node Outlines, Headlines, Document Structure, Document Structure
  622. @section Outlines
  623. @cindex outlines
  624. @cindex Outline mode
  625. Org is implemented on top of Outline mode. Outlines allow a
  626. document to be organized in a hierarchical structure, which (at least
  627. for me) is the best representation of notes and thoughts. An overview
  628. of this structure is achieved by folding (hiding) large parts of the
  629. document to show only the general document structure and the parts
  630. currently being worked on. Org greatly simplifies the use of
  631. outlines by compressing the entire show/hide functionality into a single
  632. command, @command{org-cycle}, which is bound to the @key{TAB} key.
  633. @node Headlines, Visibility cycling, Outlines, Document Structure
  634. @section Headlines
  635. @cindex headlines
  636. @cindex outline tree
  637. @vindex org-special-ctrl-a/e
  638. Headlines define the structure of an outline tree. The headlines in
  639. Org start with one or more stars, on the left margin@footnote{See
  640. the variable @code{org-special-ctrl-a/e} to configure special behavior
  641. of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
  642. @example
  643. * Top level headline
  644. ** Second level
  645. *** 3rd level
  646. some text
  647. *** 3rd level
  648. more text
  649. * Another top level headline
  650. @end example
  651. @noindent Some people find the many stars too noisy and would prefer an
  652. outline that has whitespace followed by a single star as headline
  653. starters. @ref{Clean view}, describes a setup to realize this.
  654. @vindex org-cycle-separator-lines
  655. An empty line after the end of a subtree is considered part of it and
  656. will be hidden when the subtree is folded. However, if you leave at
  657. least two empty lines, one empty line will remain visible after folding
  658. the subtree, in order to structure the collapsed view. See the
  659. variable @code{org-cycle-separator-lines} to modify this behavior.
  660. @node Visibility cycling, Motion, Headlines, Document Structure
  661. @section Visibility cycling
  662. @cindex cycling, visibility
  663. @cindex visibility cycling
  664. @cindex trees, visibility
  665. @cindex show hidden text
  666. @cindex hide text
  667. Outlines make it possible to hide parts of the text in the buffer.
  668. Org uses just two commands, bound to @key{TAB} and
  669. @kbd{S-@key{TAB}} to change the visibility in the buffer.
  670. @cindex subtree visibility states
  671. @cindex subtree cycling
  672. @cindex folded, subtree visibility state
  673. @cindex children, subtree visibility state
  674. @cindex subtree, subtree visibility state
  675. @table @kbd
  676. @kindex @key{TAB}
  677. @item @key{TAB}
  678. @emph{Subtree cycling}: Rotate current subtree among the states
  679. @example
  680. ,-> FOLDED -> CHILDREN -> SUBTREE --.
  681. '-----------------------------------'
  682. @end example
  683. @vindex org-cycle-emulate-tab
  684. @vindex org-cycle-global-at-bob
  685. The cursor must be on a headline for this to work@footnote{see, however,
  686. the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
  687. beginning of the buffer and the first line is not a headline, then
  688. @key{TAB} actually runs global cycling (see below)@footnote{see the
  689. option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
  690. argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
  691. @cindex global visibility states
  692. @cindex global cycling
  693. @cindex overview, global visibility state
  694. @cindex contents, global visibility state
  695. @cindex show all, global visibility state
  696. @kindex S-@key{TAB}
  697. @item S-@key{TAB}
  698. @itemx C-u @key{TAB}
  699. @emph{Global cycling}: Rotate the entire buffer among the states
  700. @example
  701. ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
  702. '--------------------------------------'
  703. @end example
  704. When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
  705. CONTENTS view up to headlines of level N will be shown. Note that inside
  706. tables, @kbd{S-@key{TAB}} jumps to the previous field.
  707. @cindex show all, command
  708. @kindex C-u C-u C-u @key{TAB}
  709. @item C-u C-u C-u @key{TAB}
  710. Show all, including drawers.
  711. @kindex C-c C-r
  712. @item C-c C-r
  713. Reveal context around point, showing the current entry, the following heading
  714. and the hierarchy above. Useful for working near a location that has been
  715. exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
  716. (@pxref{Agenda commands}). With a prefix argument show, on each
  717. level, all sibling headings.
  718. @kindex C-c C-x b
  719. @item C-c C-x b
  720. Show the current subtree in an indirect buffer@footnote{The indirect
  721. buffer
  722. @ifinfo
  723. (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
  724. @end ifinfo
  725. @ifnotinfo
  726. (see the Emacs manual for more information about indirect buffers)
  727. @end ifnotinfo
  728. will contain the entire buffer, but will be narrowed to the current
  729. tree. Editing the indirect buffer will also change the original buffer,
  730. but without affecting visibility in that buffer.}. With a numeric
  731. prefix argument N, go up to level N and then take that tree. If N is
  732. negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
  733. the previously used indirect buffer.
  734. @end table
  735. @vindex org-startup-folded
  736. @cindex @code{overview}, STARTUP keyword
  737. @cindex @code{content}, STARTUP keyword
  738. @cindex @code{showall}, STARTUP keyword
  739. @cindex @code{showeverything}, STARTUP keyword
  740. When Emacs first visits an Org file, the global state is set to
  741. OVERVIEW, i.e. only the top level headlines are visible. This can be
  742. configured through the variable @code{org-startup-folded}, or on a
  743. per-file basis by adding one of the following lines anywhere in the
  744. buffer:
  745. @example
  746. #+STARTUP: overview
  747. #+STARTUP: content
  748. #+STARTUP: showall
  749. #+STARTUP: showeverything
  750. @end example
  751. @cindex property, VISIBILITY
  752. @noindent
  753. Furthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties
  754. and Columns}) will get their visibility adapted accordingly. Allowed values
  755. for this property are @code{folded}, @code{children}, @code{content}, and
  756. @code{all}.
  757. @table @kbd
  758. @kindex C-u C-u @key{TAB}
  759. @item C-u C-u @key{TAB}
  760. Switch back to the startup visibility of the buffer, i.e. whatever is
  761. requested by startup options and @samp{VISIBILITY} properties in individual
  762. entries.
  763. @end table
  764. @node Motion, Structure editing, Visibility cycling, Document Structure
  765. @section Motion
  766. @cindex motion, between headlines
  767. @cindex jumping, to headlines
  768. @cindex headline navigation
  769. The following commands jump to other headlines in the buffer.
  770. @table @kbd
  771. @kindex C-c C-n
  772. @item C-c C-n
  773. Next heading.
  774. @kindex C-c C-p
  775. @item C-c C-p
  776. Previous heading.
  777. @kindex C-c C-f
  778. @item C-c C-f
  779. Next heading same level.
  780. @kindex C-c C-b
  781. @item C-c C-b
  782. Previous heading same level.
  783. @kindex C-c C-u
  784. @item C-c C-u
  785. Backward to higher level heading.
  786. @kindex C-c C-j
  787. @item C-c C-j
  788. Jump to a different place without changing the current outline
  789. visibility. Shows the document structure in a temporary buffer, where
  790. you can use the following keys to find your destination:
  791. @vindex org-goto-auto-isearch
  792. @example
  793. @key{TAB} @r{Cycle visibility.}
  794. @key{down} / @key{up} @r{Next/previous visible headline.}
  795. @key{RET} @r{Select this location.}
  796. @kbd{/} @r{Do a Sparse-tree search}
  797. @r{The following keys work if you turn off @code{org-goto-auto-isearch}}
  798. n / p @r{Next/previous visible headline.}
  799. f / b @r{Next/previous headline same level.}
  800. u @r{One level up.}
  801. 0-9 @r{Digit argument.}
  802. q @r{Quit}
  803. @end example
  804. @vindex org-goto-interface
  805. @noindent
  806. See also the variable @code{org-goto-interface}.
  807. @end table
  808. @node Structure editing, Sparse trees, Motion, Document Structure
  809. @section Structure editing
  810. @cindex structure editing
  811. @cindex headline, promotion and demotion
  812. @cindex promotion, of subtrees
  813. @cindex demotion, of subtrees
  814. @cindex subtree, cut and paste
  815. @cindex pasting, of subtrees
  816. @cindex cutting, of subtrees
  817. @cindex copying, of subtrees
  818. @cindex sorting, of subtrees
  819. @cindex subtrees, cut and paste
  820. @table @kbd
  821. @kindex M-@key{RET}
  822. @item M-@key{RET}
  823. @vindex org-M-RET-may-split-line
  824. Insert new heading with same level as current. If the cursor is in a
  825. plain list item, a new item is created (@pxref{Plain lists}). To force
  826. creation of a new headline, use a prefix argument, or first press @key{RET}
  827. to get to the beginning of the next line. When this command is used in
  828. the middle of a line, the line is split and the rest of the line becomes
  829. the new headline@footnote{If you do not want the line to be split,
  830. customize the variable @code{org-M-RET-may-split-line}.}. If the
  831. command is used at the beginning of a headline, the new headline is
  832. created before the current line. If at the beginning of any other line,
  833. the content of that line is made the new heading. If the command is
  834. used at the end of a folded subtree (i.e. behind the ellipses at the end
  835. of a headline), then a headline like the current one will be inserted
  836. after the end of the subtree.
  837. @kindex C-@key{RET}
  838. @item C-@key{RET}
  839. Just like @kbd{M-@key{RET}}, except when adding a new heading below the
  840. current heading, the new heading is placed after the body instead of before
  841. it. This command works from anywhere in the entry.
  842. @kindex M-S-@key{RET}
  843. @item M-S-@key{RET}
  844. @vindex org-treat-insert-todo-heading-as-state-change
  845. Insert new TODO entry with same level as current heading. See also the
  846. variable @code{org-treat-insert-todo-heading-as-state-change}.
  847. @kindex C-S-@key{RET}
  848. @item C-S-@key{RET}
  849. Insert new TODO entry with same level as current heading. Like
  850. @kbd{C-@key{RET}}, the new headline will be inserted after the current
  851. subtree.
  852. @kindex @key{TAB}
  853. @item @key{TAB} @r{in new, empty entry}
  854. In a new entry with no text yet, the first @key{TAB} demotes the entry to
  855. become a child of the previous one. The next @key{TAB} makes it a parent,
  856. and so on, all the way to top level. Yet another @key{TAB}, and you are back
  857. to the initial level.
  858. @kindex M-@key{left}
  859. @item M-@key{left}
  860. Promote current heading by one level.
  861. @kindex M-@key{right}
  862. @item M-@key{right}
  863. Demote current heading by one level.
  864. @kindex M-S-@key{left}
  865. @item M-S-@key{left}
  866. Promote the current subtree by one level.
  867. @kindex M-S-@key{right}
  868. @item M-S-@key{right}
  869. Demote the current subtree by one level.
  870. @kindex M-S-@key{up}
  871. @item M-S-@key{up}
  872. Move subtree up (swap with previous subtree of same
  873. level).
  874. @kindex M-S-@key{down}
  875. @item M-S-@key{down}
  876. Move subtree down (swap with next subtree of same level).
  877. @kindex C-c C-x C-w
  878. @item C-c C-x C-w
  879. Kill subtree, i.e. remove it from buffer but save in kill ring.
  880. With a numeric prefix argument N, kill N sequential subtrees.
  881. @kindex C-c C-x M-w
  882. @item C-c C-x M-w
  883. Copy subtree to kill ring. With a numeric prefix argument N, copy the N
  884. sequential subtrees.
  885. @kindex C-c C-x C-y
  886. @item C-c C-x C-y
  887. Yank subtree from kill ring. This does modify the level of the subtree to
  888. make sure the tree fits in nicely at the yank position. The yank level can
  889. also be specified with a numeric prefix argument, or by yanking after a
  890. headline marker like @samp{****}.
  891. @kindex C-y
  892. @item C-y
  893. @vindex org-yank-adjusted-subtrees
  894. @vindex org-yank-folded-subtrees
  895. Depending on the variables @code{org-yank-adjusted-subtrees} and
  896. @code{org-yank-folded-subtrees}, Org's internal @code{yank} command will
  897. paste subtrees folded and in a clever way, using the same command as @kbd{C-c
  898. C-x C-y}. With the default settings, no level adjustment will take place,
  899. but the yanked tree will be folded unless doing so would swallow text
  900. previously visible. Any prefix argument to this command will force a normal
  901. @code{yank} to be executed, with the prefix passed along. A good way to
  902. force a normal yank is @kbd{C-u C-y}. If you use @code{yank-pop} after a
  903. yank, it will yank previous kill items plainly, without adjustment and
  904. folding.
  905. @kindex C-c C-x c
  906. @item C-c C-x c
  907. Clone a subtree by making a number of sibling copies of it. You will be
  908. prompted for the number of copies to make, and you can also specify if any
  909. timestamps in the entry should be shifted. This can be useful, for example,
  910. to create a number of tasks related to a series of lectures to prepare. For
  911. more details, see the docstring of the command
  912. @code{org-clone-subtree-with-time-shift}.
  913. @kindex C-c C-w
  914. @item C-c C-w
  915. Refile entry or region to a different location. @xref{Refiling notes}.
  916. @kindex C-c ^
  917. @item C-c ^
  918. Sort same-level entries. When there is an active region, all entries in the
  919. region will be sorted. Otherwise the children of the current headline are
  920. sorted. The command prompts for the sorting method, which can be
  921. alphabetically, numerically, by time (first timestamp with active preferred,
  922. creation time, scheduled time, deadline time), by priority, by TODO keyword
  923. (in the sequence the keywords have been defined in the setup) or by the value
  924. of a property. Reverse sorting is possible as well. You can also supply
  925. your own function to extract the sorting key. With a @kbd{C-u} prefix,
  926. sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes, duplicate
  927. entries will also be removed.
  928. @kindex C-x n s
  929. @item C-x n s
  930. Narrow buffer to current subtree.
  931. @kindex C-x n w
  932. @item C-x n w
  933. Widen buffer to remove narrowing.
  934. @kindex C-c *
  935. @item C-c *
  936. Turn a normal line or plain list item into a headline (so that it becomes a
  937. subheading at its location). Also turn a headline into a normal line by
  938. removing the stars. If there is an active region, turn all lines in the
  939. region into headlines. If the first line in the region was an item, turn
  940. only the item lines into headlines. Finally, if the first line is a
  941. headline, remove the stars from all headlines in the region.
  942. @end table
  943. @cindex region, active
  944. @cindex active region
  945. @cindex transient mark mode
  946. When there is an active region (Transient Mark mode), promotion and
  947. demotion work on all headlines in the region. To select a region of
  948. headlines, it is best to place both point and mark at the beginning of a
  949. line, mark at the beginning of the first headline, and point at the line
  950. just after the last headline to change. Note that when the cursor is
  951. inside a table (@pxref{Tables}), the Meta-Cursor keys have different
  952. functionality.
  953. @node Sparse trees, Plain lists, Structure editing, Document Structure
  954. @section Sparse trees
  955. @cindex sparse trees
  956. @cindex trees, sparse
  957. @cindex folding, sparse trees
  958. @cindex occur, command
  959. @vindex org-show-hierarchy-above
  960. @vindex org-show-following-heading
  961. @vindex org-show-siblings
  962. @vindex org-show-entry-below
  963. An important feature of Org mode is the ability to construct @emph{sparse
  964. trees} for selected information in an outline tree, so that the entire
  965. document is folded as much as possible, but the selected information is made
  966. visible along with the headline structure above it@footnote{See also the
  967. variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
  968. @code{org-show-siblings}, and @code{org-show-entry-below} for detailed
  969. control on how much context is shown around each match.}. Just try it out
  970. and you will see immediately how it works.
  971. Org mode contains several commands creating such trees, all these
  972. commands can be accessed through a dispatcher:
  973. @table @kbd
  974. @kindex C-c /
  975. @item C-c /
  976. This prompts for an extra key to select a sparse-tree creating command.
  977. @kindex C-c / r
  978. @item C-c / r
  979. @vindex org-remove-highlights-with-change
  980. Occur. Prompts for a regexp and shows a sparse tree with all matches. If
  981. the match is in a headline, the headline is made visible. If the match is in
  982. the body of an entry, headline and body are made visible. In order to
  983. provide minimal context, also the full hierarchy of headlines above the match
  984. is shown, as well as the headline following the match. Each match is also
  985. highlighted; the highlights disappear when the buffer is changed by an
  986. editing command@footnote{This depends on the option
  987. @code{org-remove-highlights-with-change}}, or by pressing @kbd{C-c C-c}.
  988. When called with a @kbd{C-u} prefix argument, previous highlights are kept,
  989. so several calls to this command can be stacked.
  990. @end table
  991. @noindent
  992. @vindex org-agenda-custom-commands
  993. For frequently used sparse trees of specific search strings, you can
  994. use the variable @code{org-agenda-custom-commands} to define fast
  995. keyboard access to specific sparse trees. These commands will then be
  996. accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
  997. For example:
  998. @lisp
  999. (setq org-agenda-custom-commands
  1000. '(("f" occur-tree "FIXME")))
  1001. @end lisp
  1002. @noindent will define the key @kbd{C-c a f} as a shortcut for creating
  1003. a sparse tree matching the string @samp{FIXME}.
  1004. The other sparse tree commands select headings based on TODO keywords,
  1005. tags, or properties and will be discussed later in this manual.
  1006. @kindex C-c C-e v
  1007. @cindex printing sparse trees
  1008. @cindex visible text, printing
  1009. To print a sparse tree, you can use the Emacs command
  1010. @code{ps-print-buffer-with-faces} which does not print invisible parts
  1011. of the document @footnote{This does not work under XEmacs, because
  1012. XEmacs uses selective display for outlining, not text properties.}.
  1013. Or you can use the command @kbd{C-c C-e v} to export only the visible
  1014. part of the document and print the resulting file.
  1015. @node Plain lists, Drawers, Sparse trees, Document Structure
  1016. @section Plain lists
  1017. @cindex plain lists
  1018. @cindex lists, plain
  1019. @cindex lists, ordered
  1020. @cindex ordered lists
  1021. Within an entry of the outline tree, hand-formatted lists can provide
  1022. additional structure. They also provide a way to create lists of
  1023. checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
  1024. and the HTML exporter (@pxref{Exporting}) parses and formats them.
  1025. Org knows ordered lists, unordered lists, and description lists.
  1026. @itemize @bullet
  1027. @item
  1028. @emph{Unordered} list items start with @samp{-}, @samp{+}, or
  1029. @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
  1030. they will be seen as top-level headlines. Also, when you are hiding leading
  1031. stars to get a clean outline view, plain list items starting with a star are
  1032. visually indistinguishable from true headlines. In short: even though
  1033. @samp{*} is supported, it may be better to not use it for plain list items.}
  1034. as bullets.
  1035. @item
  1036. @emph{Ordered} list items start with a numeral followed by either a period or
  1037. a right parenthesis, such as @samp{1.} or @samp{1)}.
  1038. @item
  1039. @emph{Description} list items are unordered list items, and contain the
  1040. separator @samp{ :: } to separate the description @emph{term} from the
  1041. description.
  1042. @end itemize
  1043. @vindex org-empty-line-terminates-plain-lists
  1044. Items belonging to the same list must have the same indentation on the first
  1045. line. In particular, if an ordered list reaches number @samp{10.}, then the
  1046. 2--digit numbers must be written left-aligned with the other numbers in the
  1047. list. Indentation also determines the end of a list item. It ends before
  1048. the next line that is indented like the bullet/number, or less. Empty lines
  1049. are part of the previous item, so you can have several paragraphs in one
  1050. item. If you would like an empty line to terminate all currently open plain
  1051. lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
  1052. Here is an example:
  1053. @example
  1054. @group
  1055. ** Lord of the Rings
  1056. My favorite scenes are (in this order)
  1057. 1. The attack of the Rohirrim
  1058. 2. Eowyn's fight with the witch king
  1059. + this was already my favorite scene in the book
  1060. + I really like Miranda Otto.
  1061. 3. Peter Jackson being shot by Legolas
  1062. - on DVD only
  1063. He makes a really funny face when it happens.
  1064. But in the end, no individual scenes matter but the film as a whole.
  1065. Important actors in this film are:
  1066. - @b{Elijah Wood} :: He plays Frodo
  1067. - @b{Sean Austin} :: He plays Sam, Frodo's friend. I still remember
  1068. him very well from his role as Mikey Walsh in @i{The Goonies}.
  1069. @end group
  1070. @end example
  1071. Org supports these lists by tuning filling and wrapping commands to deal with
  1072. them correctly@footnote{Org only changes the filling settings for Emacs. For
  1073. XEmacs, you should use Kyle E. Jones' @file{filladapt.el}. To turn this on,
  1074. put into @file{.emacs}: @code{(require 'filladapt)}}, and by exporting them
  1075. properly (@pxref{Exporting}). Since indentation is what governs the
  1076. structure of these lists, many structural constructs like @code{#+BEGIN_...}
  1077. blocks can be indented to signal that they should be part of a list item.
  1078. The following commands act on items when the cursor is in the first line
  1079. of an item (the line with the bullet or number).
  1080. @table @kbd
  1081. @kindex @key{TAB}
  1082. @item @key{TAB}
  1083. @vindex org-cycle-include-plain-lists
  1084. Items can be folded just like headline levels. Normally this works only if
  1085. the cursor is on a plain list item. For more details, see the variable
  1086. @code{org-cycle-include-plain-lists}. to @code{integrate}, plain list items
  1087. will be treated like low-level. The level of an item is then given by the
  1088. indentation of the bullet/number. Items are always subordinate to real
  1089. headlines, however; the hierarchies remain completely separated.
  1090. If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
  1091. fixes the indentation of the current line in a heuristic way.
  1092. @kindex M-@key{RET}
  1093. @item M-@key{RET}
  1094. @vindex org-M-RET-may-split-line
  1095. Insert new item at current level. With a prefix argument, force a new
  1096. heading (@pxref{Structure editing}). If this command is used in the middle
  1097. of a line, the line is @emph{split} and the rest of the line becomes the new
  1098. item@footnote{If you do not want the line to be split, customize the variable
  1099. @code{org-M-RET-may-split-line}.}. If this command is executed in the
  1100. @emph{whitespace before a bullet or number}, the new item is created
  1101. @emph{before} the current item. If the command is executed in the white
  1102. space before the text that is part of an item but does not contain the
  1103. bullet, a bullet is added to the current line.
  1104. @kindex M-S-@key{RET}
  1105. @item M-S-@key{RET}
  1106. Insert a new item with a checkbox (@pxref{Checkboxes}).
  1107. @kindex @key{TAB}
  1108. @item @key{TAB} @r{in new, empty item}
  1109. In a new item with no text yet, the first @key{TAB} demotes the item to
  1110. become a child of the previous one. The next @key{TAB} makes it a parent,
  1111. and so on, all the way to the left margin. Yet another @key{TAB}, and you
  1112. are back to the initial level.
  1113. @kindex S-@key{up}
  1114. @kindex S-@key{down}
  1115. @item S-@key{up}
  1116. @itemx S-@key{down}
  1117. @cindex shift-selection-mode
  1118. @vindex org-support-shift-select
  1119. Jump to the previous/next item in the current list, but only if
  1120. @code{org-support-shift-select} is off. If not, you can still use paragraph
  1121. jumping commands like @kbd{C-@key{up}} and @kbd{C-@key{down}} to quite
  1122. similar effect.
  1123. @kindex M-S-@key{up}
  1124. @kindex M-S-@key{down}
  1125. @item M-S-@key{up}
  1126. @itemx M-S-@key{down}
  1127. Move the item including subitems up/down (swap with previous/next item
  1128. of same indentation). If the list is ordered, renumbering is
  1129. automatic.
  1130. @kindex M-S-@key{left}
  1131. @kindex M-S-@key{right}
  1132. @item M-S-@key{left}
  1133. @itemx M-S-@key{right}
  1134. Decrease/increase the indentation of the item, including subitems.
  1135. Initially, the item tree is selected based on current indentation.
  1136. When these commands are executed several times in direct succession,
  1137. the initially selected region is used, even if the new indentation
  1138. would imply a different hierarchy. To use the new hierarchy, break
  1139. the command chain with a cursor motion or so.
  1140. @kindex C-c C-c
  1141. @item C-c C-c
  1142. If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
  1143. state of the checkbox. If not, this command makes sure that all the
  1144. items on this list level use the same bullet. Furthermore, if this is
  1145. an ordered list, make sure the numbering is OK.
  1146. @kindex C-c -
  1147. @item C-c -
  1148. Cycle the entire list level through the different itemize/enumerate bullets
  1149. (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}). With a numeric prefix
  1150. argument N, select the Nth bullet from this list. If there is an active
  1151. region when calling this, all lines will be converted to list items. If the
  1152. first line already was a list item, any item markers will be removed from the
  1153. list. Finally, even without an active region, a normal line will be
  1154. converted into a list item.
  1155. @kindex C-c *
  1156. @item C-c *
  1157. Turn a plain list item into a headline (so that it becomes a subheading at
  1158. its location). @xref{Structure editing}, for a detailed explanation.
  1159. @kindex S-@key{left}
  1160. @kindex S-@key{right}
  1161. @item S-@key{left}/@key{right}
  1162. @vindex org-support-shift-select
  1163. This command also cycles bullet styles when the cursor in on the bullet or
  1164. anywhere in an item line, details depending on
  1165. @code{org-support-shift-select}.
  1166. @kindex C-c ^
  1167. @item C-c ^
  1168. Sort the plain list. You will be prompted for the sorting method:
  1169. numerically, alphabetically, by time, or by custom function.
  1170. @end table
  1171. @node Drawers, Blocks, Plain lists, Document Structure
  1172. @section Drawers
  1173. @cindex drawers
  1174. @cindex #+DRAWERS
  1175. @cindex visibility cycling, drawers
  1176. @vindex org-drawers
  1177. Sometimes you want to keep information associated with an entry, but you
  1178. normally don't want to see it. For this, Org mode has @emph{drawers}.
  1179. Drawers need to be configured with the variable
  1180. @code{org-drawers}@footnote{You can define drawers on a per-file basis
  1181. with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
  1182. look like this:
  1183. @example
  1184. ** This is a headline
  1185. Still outside the drawer
  1186. :DRAWERNAME:
  1187. This is inside the drawer.
  1188. :END:
  1189. After the drawer.
  1190. @end example
  1191. Visibility cycling (@pxref{Visibility cycling}) on the headline will hide and
  1192. show the entry, but keep the drawer collapsed to a single line. In order to
  1193. look inside the drawer, you need to move the cursor to the drawer line and
  1194. press @key{TAB} there. Org mode uses the @code{PROPERTIES} drawer for
  1195. storing properties (@pxref{Properties and Columns}), and you can also arrange
  1196. for state change notes (@pxref{Tracking TODO state changes}) and clock times
  1197. (@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}.
  1198. @node Blocks, Footnotes, Drawers, Document Structure
  1199. @section Blocks
  1200. @vindex org-hide-block-startup
  1201. @cindex blocks, folding
  1202. Org-mode uses begin...end blocks for various purposes from including source
  1203. code examples (@pxref{Literal examples}) to capturing time logging
  1204. information (@pxref{Clocking work time}). These blocks can be folded and
  1205. unfolded by pressing TAB in the begin line. You can also get all blocks
  1206. folded at startup by configuring the variable @code{org-hide-block-startup}
  1207. or on a per-file basis by using
  1208. @cindex @code{hideblocks}, STARTUP keyword
  1209. @cindex @code{nohideblocks}, STARTUP keyword
  1210. @example
  1211. #+STARTUP: hideblocks
  1212. #+STARTUP: nohideblocks
  1213. @end example
  1214. @node Footnotes, Orgstruct mode, Blocks, Document Structure
  1215. @section Footnotes
  1216. @cindex footnotes
  1217. Org mode supports the creation of footnotes. In contrast to the
  1218. @file{footnote.el} package, Org mode's footnotes are designed for work on a
  1219. larger document, not only for one-off documents like emails. The basic
  1220. syntax is similar to the one used by @file{footnote.el}, i.e. a footnote is
  1221. defined in a paragraph that is started by a footnote marker in square
  1222. brackets in column 0, no indentation allowed. If you need a paragraph break
  1223. inside a footnote, use the La@TeX{} idiom @samp{\par}. The footnote reference
  1224. is simply the marker in square brackets, inside text. For example:
  1225. @example
  1226. The Org homepage[fn:1] now looks a lot better than it used to.
  1227. ...
  1228. [fn:1] The link is: http://orgmode.org
  1229. @end example
  1230. Org mode extends the number-based syntax to @emph{named} footnotes and
  1231. optional inline definition. Using plain numbers as markers (as
  1232. @file{footnote.el} does) is supported for backward compatibility, but not
  1233. encouraged because of possible conflicts with La@TeX{} snippets (@pxref{Embedded
  1234. LaTeX}). Here are the valid references:
  1235. @table @code
  1236. @item [1]
  1237. A plain numeric footnote marker. Compatible with @file{footnote.el}, but not
  1238. recommended because somthing like @samp{[1]} could easily be part of a code
  1239. snippet.
  1240. @item [fn:name]
  1241. A named footnote reference, where @code{name} is a unique label word, or, for
  1242. simplicity of automatic creation, a number.
  1243. @item [fn:: This is the inline definition of this footnote]
  1244. A La@TeX{}-like anonymous footnote where the definition is given directly at the
  1245. reference point.
  1246. @item [fn:name: a definition]
  1247. An inline definition of a footnote, which also specifies a name for the note.
  1248. Since Org allows multiple references to the same note, you can then use
  1249. @code{[fn:name]} to create additional references.
  1250. @end table
  1251. @vindex org-footnote-auto-label
  1252. Footnote labels can be created automatically, or you can create names yourself.
  1253. This is handled by the variable @code{org-footnote-auto-label} and its
  1254. corresponding @code{#+STARTUP} keywords, see the docstring of that variable
  1255. for details.
  1256. @noindent The following command handles footnotes:
  1257. @table @kbd
  1258. @kindex C-c C-x f
  1259. @item C-c C-x f
  1260. The footnote action command.
  1261. When the cursor is on a footnote reference, jump to the definition. When it
  1262. is at a definition, jump to the (first) reference.
  1263. @vindex org-footnote-define-inline
  1264. @vindex org-footnote-section
  1265. @vindex org-footnote-auto-adjust
  1266. Otherwise, create a new footnote. Depending on the variable
  1267. @code{org-footnote-define-inline}@footnote{The corresponding in-buffer
  1268. setting is: @code{#+STARTUP: fninline} or @code{#+STARTUP: nofninline}}, the
  1269. definition will be placed right into the text as part of the reference, or
  1270. separately into the location determined by the variable
  1271. @code{org-footnote-section}.
  1272. When this command is called with a prefix argument, a menu of additional
  1273. options is offered:
  1274. @example
  1275. s @r{Sort the footnote definitions by reference sequence. During editing,}
  1276. @r{Org makes no effort to sort footnote definitions into a particular}
  1277. @r{sequence. If you want them sorted, use this command, which will}
  1278. @r{also move entries according to @code{org-footnote-section}. Automatic}
  1279. @r{sorting after each insertion/deletion can be configured using the}
  1280. @r{variable @code{org-footnote-auto-adjust}.}
  1281. r @r{Renumber the simple @code{fn:N} footnotes. Automatic renumbering}
  1282. @r{after each insertion/deletion can be configured using the variable}
  1283. @r{@code{org-footnote-auto-adjust}.}
  1284. S @r{Short for first @code{r}, then @code{s} action.}
  1285. n @r{Normalize the footnotes by collecting all definitions (including}
  1286. @r{inline definitions) into a special section, and then numbering them}
  1287. @r{in sequence. The references will then also be numbers. This is}
  1288. @r{meant to be the final step before finishing a document (e.g. sending}
  1289. @r{off an email). The exporters do this automatically, and so could}
  1290. @r{something like @code{message-send-hook}.}
  1291. d @r{Delete the footnote at point, and all definitions of and references}
  1292. @r{to it.}
  1293. @end example
  1294. Depending on the variable @code{org-footnote-auto-adjust}@footnote{the
  1295. corresponding in-buffer options are @code{fnadjust} and @code{nofnadjust}.},
  1296. renumbering and sorting footnotes can be automatic after each insertion or
  1297. deletion.
  1298. @kindex C-c C-c
  1299. @item C-c C-c
  1300. If the cursor is on a footnote reference, jump to the definition. If it is a
  1301. the definition, jump back to the reference. When called at a footnote
  1302. location with a prefix argument, offer the same menu as @kbd{C-c C-x f}.
  1303. @kindex C-c C-o
  1304. @kindex mouse-1
  1305. @kindex mouse-2
  1306. @item C-c C-o @r{or} mouse-1/2
  1307. Footnote labels are also links to the corresponding definition/reference, and
  1308. you can use the usual commands to follow these links.
  1309. @end table
  1310. @node Orgstruct mode, , Footnotes, Document Structure
  1311. @section The Orgstruct minor mode
  1312. @cindex Orgstruct mode
  1313. @cindex minor mode for structure editing
  1314. If you like the intuitive way the Org mode structure editing and list
  1315. formatting works, you might want to use these commands in other modes like
  1316. Text mode or Mail mode as well. The minor mode @code{orgstruct-mode} makes
  1317. this possible. Toggle the mode with @kbd{M-x orgstruct-mode}, or
  1318. turn it on by default, for example in Mail mode, with one of:
  1319. @lisp
  1320. (add-hook 'mail-mode-hook 'turn-on-orgstruct)
  1321. (add-hook 'mail-mode-hook 'turn-on-orgstruct++)
  1322. @end lisp
  1323. When this mode is active and the cursor is on a line that looks to Org like a
  1324. headline or the first line of a list item, most structure editing commands
  1325. will work, even if the same keys normally have different functionality in the
  1326. major mode you are using. If the cursor is not in one of those special
  1327. lines, Orgstruct mode lurks silently in the shadow. When you use
  1328. @code{orgstruct++-mode}, Org will also export indentation and autofill
  1329. settings into that mode, and detect item context after the first line of an
  1330. item.
  1331. @node Tables, Hyperlinks, Document Structure, Top
  1332. @chapter Tables
  1333. @cindex tables
  1334. @cindex editing tables
  1335. Org comes with a fast and intuitive table editor. Spreadsheet-like
  1336. calculations are supported in connection with the Emacs @file{calc}
  1337. package
  1338. @ifinfo
  1339. (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
  1340. @end ifinfo
  1341. @ifnotinfo
  1342. (see the Emacs Calculator manual for more information about the Emacs
  1343. calculator).
  1344. @end ifnotinfo
  1345. @menu
  1346. * Built-in table editor:: Simple tables
  1347. * Column width and alignment:: Overrule the automatic settings
  1348. * Column groups:: Grouping to trigger vertical lines
  1349. * Orgtbl mode:: The table editor as minor mode
  1350. * The spreadsheet:: The table editor has spreadsheet capabilities
  1351. * Org-Plot:: Plotting from org tables
  1352. @end menu
  1353. @node Built-in table editor, Column width and alignment, Tables, Tables
  1354. @section The built-in table editor
  1355. @cindex table editor, built-in
  1356. Org makes it easy to format tables in plain ASCII. Any line with
  1357. @samp{|} as the first non-whitespace character is considered part of a
  1358. table. @samp{|} is also the column separator. A table might look like
  1359. this:
  1360. @example
  1361. | Name | Phone | Age |
  1362. |-------+-------+-----|
  1363. | Peter | 1234 | 17 |
  1364. | Anna | 4321 | 25 |
  1365. @end example
  1366. A table is re-aligned automatically each time you press @key{TAB} or
  1367. @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
  1368. the next field (@key{RET} to the next row) and creates new table rows
  1369. at the end of the table or before horizontal lines. The indentation
  1370. of the table is set by the first line. Any line starting with
  1371. @samp{|-} is considered as a horizontal separator line and will be
  1372. expanded on the next re-align to span the whole table width. So, to
  1373. create the above table, you would only type
  1374. @example
  1375. |Name|Phone|Age|
  1376. |-
  1377. @end example
  1378. @noindent and then press @key{TAB} to align the table and start filling in
  1379. fields. Even faster would be to type @code{|Name|Phone|Age} followed by
  1380. @kbd{C-c @key{RET}}.
  1381. @vindex org-enable-table-editor
  1382. @vindex org-table-auto-blank-field
  1383. When typing text into a field, Org treats @key{DEL},
  1384. @key{Backspace}, and all character keys in a special way, so that
  1385. inserting and deleting avoids shifting other fields. Also, when
  1386. typing @emph{immediately after the cursor was moved into a new field
  1387. with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
  1388. field is automatically made blank. If this behavior is too
  1389. unpredictable for you, configure the variables
  1390. @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
  1391. @table @kbd
  1392. @tsubheading{Creation and conversion}
  1393. @kindex C-c |
  1394. @item C-c |
  1395. Convert the active region to table. If every line contains at least one
  1396. TAB character, the function assumes that the material is tab separated.
  1397. If every line contains a comma, comma-separated values (CSV) are assumed.
  1398. If not, lines are split at whitespace into fields. You can use a prefix
  1399. argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
  1400. C-u} forces TAB, and a numeric argument N indicates that at least N
  1401. consecutive spaces, or alternatively a TAB will be the separator.
  1402. @*
  1403. If there is no active region, this command creates an empty Org
  1404. table. But it's easier just to start typing, like
  1405. @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
  1406. @tsubheading{Re-aligning and field motion}
  1407. @kindex C-c C-c
  1408. @item C-c C-c
  1409. Re-align the table without moving the cursor.
  1410. @c
  1411. @kindex @key{TAB}
  1412. @item @key{TAB}
  1413. Re-align the table, move to the next field. Creates a new row if
  1414. necessary.
  1415. @c
  1416. @kindex S-@key{TAB}
  1417. @item S-@key{TAB}
  1418. Re-align, move to previous field.
  1419. @c
  1420. @kindex @key{RET}
  1421. @item @key{RET}
  1422. Re-align the table and move down to next row. Creates a new row if
  1423. necessary. At the beginning or end of a line, @key{RET} still does
  1424. NEWLINE, so it can be used to split a table.
  1425. @c
  1426. @kindex M-a
  1427. @item M-a
  1428. Move to beginning of the current table field, or on to the previous field.
  1429. @kindex M-e
  1430. @item M-e
  1431. Move to end of the current table field, or on to the next field.
  1432. @tsubheading{Column and row editing}
  1433. @kindex M-@key{left}
  1434. @kindex M-@key{right}
  1435. @item M-@key{left}
  1436. @itemx M-@key{right}
  1437. Move the current column left/right.
  1438. @c
  1439. @kindex M-S-@key{left}
  1440. @item M-S-@key{left}
  1441. Kill the current column.
  1442. @c
  1443. @kindex M-S-@key{right}
  1444. @item M-S-@key{right}
  1445. Insert a new column to the left of the cursor position.
  1446. @c
  1447. @kindex M-@key{up}
  1448. @kindex M-@key{down}
  1449. @item M-@key{up}
  1450. @itemx M-@key{down}
  1451. Move the current row up/down.
  1452. @c
  1453. @kindex M-S-@key{up}
  1454. @item M-S-@key{up}
  1455. Kill the current row or horizontal line.
  1456. @c
  1457. @kindex M-S-@key{down}
  1458. @item M-S-@key{down}
  1459. Insert a new row above the current row. With a prefix argument, the line is
  1460. created below the current one.
  1461. @c
  1462. @kindex C-c -
  1463. @item C-c -
  1464. Insert a horizontal line below current row. With a prefix argument, the line
  1465. is created above the current line.
  1466. @c
  1467. @kindex C-c @key{RET}
  1468. @item C-c @key{RET}
  1469. Insert a horizontal line below current row, and move the cursor into the row
  1470. below that line.
  1471. @c
  1472. @kindex C-c ^
  1473. @item C-c ^
  1474. Sort the table lines in the region. The position of point indicates the
  1475. column to be used for sorting, and the range of lines is the range
  1476. between the nearest horizontal separator lines, or the entire table. If
  1477. point is before the first column, you will be prompted for the sorting
  1478. column. If there is an active region, the mark specifies the first line
  1479. and the sorting column, while point should be in the last line to be
  1480. included into the sorting. The command prompts for the sorting type
  1481. (alphabetically, numerically, or by time). When called with a prefix
  1482. argument, alphabetic sorting will be case-sensitive.
  1483. @tsubheading{Regions}
  1484. @kindex C-c C-x M-w
  1485. @item C-c C-x M-w
  1486. Copy a rectangular region from a table to a special clipboard. Point and
  1487. mark determine edge fields of the rectangle. If there is no active region,
  1488. copy just the current field. The process ignores horizontal separator lines.
  1489. @c
  1490. @kindex C-c C-x C-w
  1491. @item C-c C-x C-w
  1492. Copy a rectangular region from a table to a special clipboard, and
  1493. blank all fields in the rectangle. So this is the ``cut'' operation.
  1494. @c
  1495. @kindex C-c C-x C-y
  1496. @item C-c C-x C-y
  1497. Paste a rectangular region into a table.
  1498. The upper left corner ends up in the current field. All involved fields
  1499. will be overwritten. If the rectangle does not fit into the present table,
  1500. the table is enlarged as needed. The process ignores horizontal separator
  1501. lines.
  1502. @c
  1503. @kindex M-@key{RET}
  1504. @itemx M-@kbd{RET}
  1505. Wrap several fields in a column like a paragraph. If there is an active
  1506. region, and both point and mark are in the same column, the text in the
  1507. column is wrapped to minimum width for the given number of lines. A numeric
  1508. prefix argument may be used to change the number of desired lines. If there
  1509. is no region, the current field is split at the cursor position and the text
  1510. fragment to the right of the cursor is prepended to the field one line
  1511. down. If there is no region, but you specify a prefix argument, the current
  1512. field is made blank, and the content is appended to the field above.
  1513. @tsubheading{Calculations}
  1514. @cindex formula, in tables
  1515. @cindex calculations, in tables
  1516. @cindex region, active
  1517. @cindex active region
  1518. @cindex transient mark mode
  1519. @kindex C-c +
  1520. @item C-c +
  1521. Sum the numbers in the current column, or in the rectangle defined by
  1522. the active region. The result is shown in the echo area and can
  1523. be inserted with @kbd{C-y}.
  1524. @c
  1525. @kindex S-@key{RET}
  1526. @item S-@key{RET}
  1527. @vindex org-table-copy-increment
  1528. When current field is empty, copy from first non-empty field above. When not
  1529. empty, copy current field down to next row and move cursor along with it.
  1530. Depending on the variable @code{org-table-copy-increment}, integer field
  1531. values will be incremented during copy. Integers that are too large will not
  1532. be incremented. Also, a @code{0} prefix argument temporarily disables the
  1533. increment. This key is also used by shift-selection and related modes
  1534. (@pxref{Conflicts}).
  1535. @tsubheading{Miscellaneous}
  1536. @kindex C-c `
  1537. @item C-c `
  1538. Edit the current field in a separate window. This is useful for fields that
  1539. are not fully visible (@pxref{Column width and alignment}). When called with
  1540. a @kbd{C-u} prefix, just make the full field visible, so that it can be
  1541. edited in place.
  1542. @c
  1543. @item M-x org-table-import
  1544. Import a file as a table. The table should be TAB or whitespace
  1545. separated. Use, for example, to import a spreadsheet table or data
  1546. from a database, because these programs generally can write
  1547. TAB-separated text files. This command works by inserting the file into
  1548. the buffer and then converting the region to a table. Any prefix
  1549. argument is passed on to the converter, which uses it to determine the
  1550. separator.
  1551. @item C-c |
  1552. Tables can also be imported by pasting tabular text into the Org
  1553. buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
  1554. @kbd{C-c |} command (see above under @i{Creation and conversion}).
  1555. @c
  1556. @item M-x org-table-export
  1557. @vindex org-table-export-default-format
  1558. Export the table, by default as a TAB-separated file. Use for data
  1559. exchange with, for example, spreadsheet or database programs. The format
  1560. used to export the file can be configured in the variable
  1561. @code{org-table-export-default-format}. You may also use properties
  1562. @code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
  1563. name and the format for table export in a subtree. Org supports quite
  1564. general formats for exported tables. The exporter format is the same as the
  1565. format used by Orgtbl radio tables, see @ref{Translator functions}, for a
  1566. detailed description.
  1567. @end table
  1568. If you don't like the automatic table editor because it gets in your
  1569. way on lines which you would like to start with @samp{|}, you can turn
  1570. it off with
  1571. @lisp
  1572. (setq org-enable-table-editor nil)
  1573. @end lisp
  1574. @noindent Then the only table command that still works is
  1575. @kbd{C-c C-c} to do a manual re-align.
  1576. @node Column width and alignment, Column groups, Built-in table editor, Tables
  1577. @section Column width and alignment
  1578. @cindex narrow columns in tables
  1579. @cindex alignment in tables
  1580. The width of columns is automatically determined by the table editor. And
  1581. also the alignment of a column is determined automatically from the fraction
  1582. of number-like versus non-number fields in the column.
  1583. Sometimes a single field or a few fields need to carry more text,
  1584. leading to inconveniently wide columns. To limit@footnote{This feature
  1585. does not work on XEmacs.} the width of a column, one field anywhere in
  1586. the column may contain just the string @samp{<N>} where @samp{N} is an
  1587. integer specifying the width of the column in characters. The next
  1588. re-align will then set the width of this column to no more than this
  1589. value.
  1590. @example
  1591. @group
  1592. |---+------------------------------| |---+--------|
  1593. | | | | | <6> |
  1594. | 1 | one | | 1 | one |
  1595. | 2 | two | ----\ | 2 | two |
  1596. | 3 | This is a long chunk of text | ----/ | 3 | This=> |
  1597. | 4 | four | | 4 | four |
  1598. |---+------------------------------| |---+--------|
  1599. @end group
  1600. @end example
  1601. @noindent
  1602. Fields that are wider become clipped and end in the string @samp{=>}.
  1603. Note that the full text is still in the buffer, it is only invisible.
  1604. To see the full text, hold the mouse over the field---a tool-tip window
  1605. will show the full content. To edit such a field, use the command
  1606. @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
  1607. open a new window with the full field. Edit it and finish with @kbd{C-c
  1608. C-c}.
  1609. @vindex org-startup-align-all-tables
  1610. When visiting a file containing a table with narrowed columns, the
  1611. necessary character hiding has not yet happened, and the table needs to
  1612. be aligned before it looks nice. Setting the option
  1613. @code{org-startup-align-all-tables} will realign all tables in a file
  1614. upon visiting, but also slow down startup. You can also set this option
  1615. on a per-file basis with:
  1616. @example
  1617. #+STARTUP: align
  1618. #+STARTUP: noalign
  1619. @end example
  1620. If you would like to overrule the automatic alignment of number-rich columns
  1621. to the right and of string-rich column to the left, you and use @samp{<r>} or
  1622. @samp{<l>} in a similar fashion. You may also combine alignment and field
  1623. width like this: @samp{<l10>}.
  1624. @node Column groups, Orgtbl mode, Column width and alignment, Tables
  1625. @section Column groups
  1626. @cindex grouping columns in tables
  1627. When Org exports tables, it does so by default without vertical
  1628. lines because that is visually more satisfying in general. Occasionally
  1629. however, vertical lines can be useful to structure a table into groups
  1630. of columns, much like horizontal lines can do for groups of rows. In
  1631. order to specify column groups, you can use a special row where the
  1632. first field contains only @samp{/}. The further fields can either
  1633. contain @samp{<} to indicate that this column should start a group,
  1634. @samp{>} to indicate the end of a column, or @samp{<>} to make a column
  1635. a group of its own. Boundaries between column groups will upon export be
  1636. marked with vertical lines. Here is an example:
  1637. @example
  1638. | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1639. |---+----+-----+-----+-----+---------+------------|
  1640. | / | <> | < | | > | < | > |
  1641. | # | 1 | 1 | 1 | 1 | 1 | 1 |
  1642. | # | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
  1643. | # | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
  1644. |---+----+-----+-----+-----+---------+------------|
  1645. #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2)))
  1646. @end example
  1647. It is also sufficient to just insert the column group starters after
  1648. every vertical line you'd like to have:
  1649. @example
  1650. | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1651. |----+-----+-----+-----+---------+------------|
  1652. | / | < | | | < | |
  1653. @end example
  1654. @node Orgtbl mode, The spreadsheet, Column groups, Tables
  1655. @section The Orgtbl minor mode
  1656. @cindex Orgtbl mode
  1657. @cindex minor mode for tables
  1658. If you like the intuitive way the Org table editor works, you
  1659. might also want to use it in other modes like Text mode or Mail mode.
  1660. The minor mode Orgtbl mode makes this possible. You can always toggle
  1661. the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
  1662. example in mail mode, use
  1663. @lisp
  1664. (add-hook 'mail-mode-hook 'turn-on-orgtbl)
  1665. @end lisp
  1666. Furthermore, with some special setup, it is possible to maintain tables
  1667. in arbitrary syntax with Orgtbl mode. For example, it is possible to
  1668. construct La@TeX{} tables with the underlying ease and power of
  1669. Orgtbl mode, including spreadsheet capabilities. For details, see
  1670. @ref{Tables in arbitrary syntax}.
  1671. @node The spreadsheet, Org-Plot, Orgtbl mode, Tables
  1672. @section The spreadsheet
  1673. @cindex calculations, in tables
  1674. @cindex spreadsheet capabilities
  1675. @cindex @file{calc} package
  1676. The table editor makes use of the Emacs @file{calc} package to implement
  1677. spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
  1678. derive fields from other fields. While fully featured, Org's
  1679. implementation is not identical to other spreadsheets. For example,
  1680. Org knows the concept of a @emph{column formula} that will be
  1681. applied to all non-header fields in a column without having to copy the
  1682. formula to each relevant field.
  1683. @menu
  1684. * References:: How to refer to another field or range
  1685. * Formula syntax for Calc:: Using Calc to compute stuff
  1686. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  1687. * Field formulas:: Formulas valid for a single field
  1688. * Column formulas:: Formulas valid for an entire column
  1689. * Editing and debugging formulas:: Fixing formulas
  1690. * Updating the table:: Recomputing all dependent fields
  1691. * Advanced features:: Field names, parameters and automatic recalc
  1692. @end menu
  1693. @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
  1694. @subsection References
  1695. @cindex references
  1696. To compute fields in the table from other fields, formulas must
  1697. reference other fields or ranges. In Org, fields can be referenced
  1698. by name, by absolute coordinates, and by relative coordinates. To find
  1699. out what the coordinates of a field are, press @kbd{C-c ?} in that
  1700. field, or press @kbd{C-c @}} to toggle the display of a grid.
  1701. @subsubheading Field references
  1702. @cindex field references
  1703. @cindex references, to fields
  1704. Formulas can reference the value of another field in two ways. Like in
  1705. any other spreadsheet, you may reference fields with a letter/number
  1706. combination like @code{B3}, meaning the 2nd field in the 3rd row.
  1707. @c Such references are always fixed to that field, they don't change
  1708. @c when you copy and paste a formula to a different field. So
  1709. @c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
  1710. @noindent
  1711. Org also uses another, more general operator that looks like this:
  1712. @example
  1713. @@@var{row}$@var{column}
  1714. @end example
  1715. @noindent
  1716. Column references can be absolute like @samp{1}, @samp{2},...@samp{@var{N}},
  1717. or relative to the current column like @samp{+1} or @samp{-2}.
  1718. The row specification only counts data lines and ignores horizontal
  1719. separator lines (hlines). You can use absolute row numbers
  1720. @samp{1}...@samp{@var{N}}, and row numbers relative to the current row like
  1721. @samp{+3} or @samp{-1}. Or specify the row relative to one of the
  1722. hlines: @samp{I} refers to the first hline@footnote{Note that only
  1723. hlines are counted that @emph{separate} table lines. If the table
  1724. starts with a hline above the header, it does not count.}, @samp{II} to
  1725. the second, etc@. @samp{-I} refers to the first such line above the
  1726. current line, @samp{+I} to the first such line below the current line.
  1727. You can also write @samp{III+2} which is the second data line after the
  1728. third hline in the table.
  1729. @samp{0} refers to the current row and column. Also, if you omit
  1730. either the column or the row part of the reference, the current
  1731. row/column is implied.
  1732. Org's references with @emph{unsigned} numbers are fixed references
  1733. in the sense that if you use the same reference in the formula for two
  1734. different fields, the same field will be referenced each time.
  1735. Org's references with @emph{signed} numbers are floating
  1736. references because the same reference operator can reference different
  1737. fields depending on the field being calculated by the formula.
  1738. As a special case, references like @samp{$LR5} and @samp{$LR12} can be used
  1739. to refer in a stable way to the 5th and 12th field in the last row of the
  1740. table.
  1741. Here are a few examples:
  1742. @example
  1743. @@2$3 @r{2nd row, 3rd column}
  1744. C2 @r{same as previous}
  1745. $5 @r{column 5 in the current row}
  1746. E& @r{same as previous}
  1747. @@2 @r{current column, row 2}
  1748. @@-1$-3 @r{the field one row up, three columns to the left}
  1749. @@-I$2 @r{field just under hline above current row, column 2}
  1750. @end example
  1751. @subsubheading Range references
  1752. @cindex range references
  1753. @cindex references, to ranges
  1754. You may reference a rectangular range of fields by specifying two field
  1755. references connected by two dots @samp{..}. If both fields are in the
  1756. current row, you may simply use @samp{$2..$7}, but if at least one field
  1757. is in a different row, you need to use the general @code{@@row$column}
  1758. format at least for the first field (i.e the reference must start with
  1759. @samp{@@} in order to be interpreted correctly). Examples:
  1760. @example
  1761. $1..$3 @r{First three fields in the current row.}
  1762. $P..$Q @r{Range, using column names (see under Advanced)}
  1763. @@2$1..@@4$3 @r{6 fields between these two fields.}
  1764. A2..C4 @r{Same as above.}
  1765. @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
  1766. @end example
  1767. @noindent Range references return a vector of values that can be fed
  1768. into Calc vector functions. Empty fields in ranges are normally
  1769. suppressed, so that the vector contains only the non-empty fields (but
  1770. see the @samp{E} mode switch below). If there are no non-empty fields,
  1771. @samp{[0]} is returned to avoid syntax errors in formulas.
  1772. @subsubheading Named references
  1773. @cindex named references
  1774. @cindex references, named
  1775. @cindex name, of column or field
  1776. @cindex constants, in calculations
  1777. @cindex #+CONSTANTS
  1778. @vindex org-table-formula-constants
  1779. @samp{$name} is interpreted as the name of a column, parameter or
  1780. constant. Constants are defined globally through the variable
  1781. @code{org-table-formula-constants}, and locally (for the file) through a
  1782. line like
  1783. @example
  1784. #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
  1785. @end example
  1786. @noindent
  1787. @vindex constants-unit-system
  1788. @pindex constants.el
  1789. Also properties (@pxref{Properties and Columns}) can be used as
  1790. constants in table formulas: for a property @samp{:Xyz:} use the name
  1791. @samp{$PROP_Xyz}, and the property will be searched in the current
  1792. outline entry and in the hierarchy above it. If you have the
  1793. @file{constants.el} package, it will also be used to resolve constants,
  1794. including natural constants like @samp{$h} for Planck's constant, and
  1795. units like @samp{$km} for kilometers@footnote{@file{constants.el} can
  1796. supply the values of constants in two different unit systems, @code{SI}
  1797. and @code{cgs}. Which one is used depends on the value of the variable
  1798. @code{constants-unit-system}. You can use the @code{#+STARTUP} options
  1799. @code{constSI} and @code{constcgs} to set this value for the current
  1800. buffer.}. Column names and parameters can be specified in special table
  1801. lines. These are described below, see @ref{Advanced features}. All
  1802. names must start with a letter, and further consist of letters and
  1803. numbers.
  1804. @subsubheading Remote references
  1805. @cindex remote references
  1806. @cindex references, remote
  1807. @cindex references, to a different table
  1808. @cindex name, of column or field
  1809. @cindex constants, in calculations
  1810. @cindex #+TBLNAME
  1811. You may also reference constants, fields and ranges from a different table,
  1812. either in the current file or even in a different file. The syntax is
  1813. @example
  1814. remote(NAME-OR-ID,REF)
  1815. @end example
  1816. @noindent
  1817. where NAME can be the name of a table in the current file as set by a
  1818. @code{#+TBLNAME: NAME} line before the table. It can also be the ID of an
  1819. entry, even in a different file, and the reference then refers to the first
  1820. table in that entry. REF is an absolute field or range reference as
  1821. described above for example @code{@@3$3} or @code{$somename}, valid in the
  1822. referenced table.
  1823. @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
  1824. @subsection Formula syntax for Calc
  1825. @cindex formula syntax, Calc
  1826. @cindex syntax, of formulas
  1827. A formula can be any algebraic expression understood by the Emacs
  1828. @file{Calc} package. @b{Note that @file{calc} has the
  1829. non-standard convention that @samp{/} has lower precedence than
  1830. @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
  1831. evaluation by @code{calc-eval} (@pxref{Calling Calc from
  1832. Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
  1833. Emacs Calc Manual}),
  1834. @c FIXME: The link to the Calc manual in HTML does not work.
  1835. variable substitution takes place according to the rules described above.
  1836. @cindex vectors, in table calculations
  1837. The range vectors can be directly fed into the Calc vector functions
  1838. like @samp{vmean} and @samp{vsum}.
  1839. @cindex format specifier
  1840. @cindex mode, for @file{calc}
  1841. @vindex org-calc-default-modes
  1842. A formula can contain an optional mode string after a semicolon. This
  1843. string consists of flags to influence Calc and other modes during
  1844. execution. By default, Org uses the standard Calc modes (precision
  1845. 12, angular units degrees, fraction and symbolic modes off). The display
  1846. format, however, has been changed to @code{(float 8)} to keep tables
  1847. compact. The default settings can be configured using the variable
  1848. @code{org-calc-default-modes}.
  1849. @example
  1850. p20 @r{switch the internal precision to 20 digits}
  1851. n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
  1852. D R @r{angle modes: degrees, radians}
  1853. F S @r{fraction and symbolic modes}
  1854. N @r{interpret all fields as numbers, use 0 for non-numbers}
  1855. T @r{force text interpretation}
  1856. E @r{keep empty fields in ranges}
  1857. L @r{literal}
  1858. @end example
  1859. @noindent
  1860. In addition, you may provide a @code{printf} format specifier to
  1861. reformat the final result. A few examples:
  1862. @example
  1863. $1+$2 @r{Sum of first and second field}
  1864. $1+$2;%.2f @r{Same, format result to two decimals}
  1865. exp($2)+exp($1) @r{Math functions can be used}
  1866. $0;%.1f @r{Reformat current cell to 1 decimal}
  1867. ($3-32)*5/9 @r{Degrees F -> C conversion}
  1868. $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
  1869. tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
  1870. sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
  1871. vmean($2..$7) @r{Compute column range mean, using vector function}
  1872. vmean($2..$7);EN @r{Same, but treat empty fields as 0}
  1873. taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
  1874. @end example
  1875. Calc also contains a complete set of logical operations. For example
  1876. @example
  1877. if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
  1878. @end example
  1879. @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
  1880. @subsection Emacs Lisp forms as formulas
  1881. @cindex Lisp forms, as table formulas
  1882. It is also possible to write a formula in Emacs Lisp; this can be useful
  1883. for string manipulation and control structures, if Calc's
  1884. functionality is not enough. If a formula starts with a single-quote
  1885. followed by an opening parenthesis, then it is evaluated as a Lisp form.
  1886. The evaluation should return either a string or a number. Just as with
  1887. @file{calc} formulas, you can specify modes and a printf format after a
  1888. semicolon. With Emacs Lisp forms, you need to be conscious about the way
  1889. field references are interpolated into the form. By default, a
  1890. reference will be interpolated as a Lisp string (in double-quotes)
  1891. containing the field. If you provide the @samp{N} mode switch, all
  1892. referenced elements will be numbers (non-number fields will be zero) and
  1893. interpolated as Lisp numbers, without quotes. If you provide the
  1894. @samp{L} flag, all fields will be interpolated literally, without quotes.
  1895. I.e., if you want a reference to be interpreted as a string by the Lisp
  1896. form, enclose the reference operator itself in double-quotes, like
  1897. @code{"$3"}. Ranges are inserted as space-separated fields, so you can
  1898. embed them in list or vector syntax. A few examples, note how the
  1899. @samp{N} mode is used when we do computations in Lisp.
  1900. @example
  1901. @r{Swap the first two characters of the content of column 1}
  1902. '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
  1903. @r{Add columns 1 and 2, equivalent to Calc's @code{$1+$2}}
  1904. '(+ $1 $2);N
  1905. @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
  1906. '(apply '+ '($1..$4));N
  1907. @end example
  1908. @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
  1909. @subsection Field formulas
  1910. @cindex field formula
  1911. @cindex formula, for individual table field
  1912. To assign a formula to a particular field, type it directly into the
  1913. field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
  1914. press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
  1915. the field, the formula will be stored as the formula for this field,
  1916. evaluated, and the current field replaced with the result.
  1917. @cindex #+TBLFM
  1918. Formulas are stored in a special line starting with @samp{#+TBLFM:}
  1919. directly below the table. If you typed the equation in the 4th field of
  1920. the 3rd data line in the table, the formula will look like
  1921. @samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
  1922. with the appropriate commands, @i{absolute references} (but not relative
  1923. ones) in stored formulas are modified in order to still reference the
  1924. same field. Of course this is not true if you edit the table structure
  1925. with normal editing commands---then you must fix the equations yourself.
  1926. The left-hand side of a formula may also be a named field (@pxref{Advanced
  1927. features}), or a last-row reference like @samp{$LR3}.
  1928. Instead of typing an equation into the field, you may also use the
  1929. following command
  1930. @table @kbd
  1931. @kindex C-u C-c =
  1932. @item C-u C-c =
  1933. Install a new formula for the current field. The command prompts for a
  1934. formula with default taken from the @samp{#+TBLFM:} line, applies
  1935. it to the current field, and stores it.
  1936. @end table
  1937. @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
  1938. @subsection Column formulas
  1939. @cindex column formula
  1940. @cindex formula, for table column
  1941. Often in a table, the same formula should be used for all fields in a
  1942. particular column. Instead of having to copy the formula to all fields
  1943. in that column, Org allows you to assign a single formula to an entire
  1944. column. If the table contains horizontal separator hlines, everything
  1945. before the first such line is considered part of the table @emph{header}
  1946. and will not be modified by column formulas.
  1947. To assign a formula to a column, type it directly into any field in the
  1948. column, preceded by an equal sign, like @samp{=$1+$2}. When you press
  1949. @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the field,
  1950. the formula will be stored as the formula for the current column, evaluated
  1951. and the current field replaced with the result. If the field contains only
  1952. @samp{=}, the previously stored formula for this column is used. For each
  1953. column, Org will only remember the most recently used formula. In the
  1954. @samp{#+TBLFM:} line, column formulas will look like @samp{$4=$1+$2}. The left-hand
  1955. side of a column formula cannot currently be the name of column, it
  1956. must be the numeric column reference.
  1957. Instead of typing an equation into the field, you may also use the
  1958. following command:
  1959. @table @kbd
  1960. @kindex C-c =
  1961. @item C-c =
  1962. Install a new formula for the current column and replace current field with
  1963. the result of the formula. The command prompts for a formula, with default
  1964. taken from the @samp{#+TBLFM} line, applies it to the current field and
  1965. stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
  1966. will apply it to that many consecutive fields in the current column.
  1967. @end table
  1968. @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
  1969. @subsection Editing and debugging formulas
  1970. @cindex formula editing
  1971. @cindex editing, of table formulas
  1972. @vindex org-table-use-standard-references
  1973. You can edit individual formulas in the minibuffer or directly in the
  1974. field. Org can also prepare a special buffer with all active
  1975. formulas of a table. When offering a formula for editing, Org
  1976. converts references to the standard format (like @code{B3} or @code{D&})
  1977. if possible. If you prefer to only work with the internal format (like
  1978. @code{@@3$2} or @code{$4}), configure the variable
  1979. @code{org-table-use-standard-references}.
  1980. @table @kbd
  1981. @kindex C-c =
  1982. @kindex C-u C-c =
  1983. @item C-c =
  1984. @itemx C-u C-c =
  1985. Edit the formula associated with the current column/field in the
  1986. minibuffer. See @ref{Column formulas}, and @ref{Field formulas}.
  1987. @kindex C-u C-u C-c =
  1988. @item C-u C-u C-c =
  1989. Re-insert the active formula (either a
  1990. field formula, or a column formula) into the current field, so that you
  1991. can edit it directly in the field. The advantage over editing in the
  1992. minibuffer is that you can use the command @kbd{C-c ?}.
  1993. @kindex C-c ?
  1994. @item C-c ?
  1995. While editing a formula in a table field, highlight the field(s)
  1996. referenced by the reference at the cursor position in the formula.
  1997. @kindex C-c @}
  1998. @item C-c @}
  1999. Toggle the display of row and column numbers for a table, using
  2000. overlays. These are updated each time the table is aligned; you can
  2001. force it with @kbd{C-c C-c}.
  2002. @kindex C-c @{
  2003. @item C-c @{
  2004. Toggle the formula debugger on and off. See below.
  2005. @kindex C-c '
  2006. @item C-c '
  2007. Edit all formulas for the current table in a special buffer, where the
  2008. formulas will be displayed one per line. If the current field has an
  2009. active formula, the cursor in the formula editor will mark it.
  2010. While inside the special buffer, Org will automatically highlight
  2011. any field or range reference at the cursor position. You may edit,
  2012. remove and add formulas, and use the following commands:
  2013. @table @kbd
  2014. @kindex C-c C-c
  2015. @kindex C-x C-s
  2016. @item C-c C-c
  2017. @itemx C-x C-s
  2018. Exit the formula editor and store the modified formulas. With @kbd{C-u}
  2019. prefix, also apply the new formulas to the entire table.
  2020. @kindex C-c C-q
  2021. @item C-c C-q
  2022. Exit the formula editor without installing changes.
  2023. @kindex C-c C-r
  2024. @item C-c C-r
  2025. Toggle all references in the formula editor between standard (like
  2026. @code{B3}) and internal (like @code{@@3$2}).
  2027. @kindex @key{TAB}
  2028. @item @key{TAB}
  2029. Pretty-print or indent Lisp formula at point. When in a line containing
  2030. a Lisp formula, format the formula according to Emacs Lisp rules.
  2031. Another @key{TAB} collapses the formula back again. In the open
  2032. formula, @key{TAB} re-indents just like in Emacs Lisp mode.
  2033. @kindex M-@key{TAB}
  2034. @item M-@key{TAB}
  2035. Complete Lisp symbols, just like in Emacs Lisp mode.
  2036. @kindex S-@key{up}
  2037. @kindex S-@key{down}
  2038. @kindex S-@key{left}
  2039. @kindex S-@key{right}
  2040. @item S-@key{up}/@key{down}/@key{left}/@key{right}
  2041. Shift the reference at point. For example, if the reference is
  2042. @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
  2043. This also works for relative references and for hline references.
  2044. @kindex M-S-@key{up}
  2045. @kindex M-S-@key{down}
  2046. @item M-S-@key{up}/@key{down}
  2047. Move the test line for column formulas in the Org buffer up and
  2048. down.
  2049. @kindex M-@key{up}
  2050. @kindex M-@key{down}
  2051. @item M-@key{up}/@key{down}
  2052. Scroll the window displaying the table.
  2053. @kindex C-c @}
  2054. @item C-c @}
  2055. Turn the coordinate grid in the table on and off.
  2056. @end table
  2057. @end table
  2058. Making a table field blank does not remove the formula associated with
  2059. the field, because that is stored in a different line (the @samp{#+TBLFM}
  2060. line)---during the next recalculation the field will be filled again.
  2061. To remove a formula from a field, you have to give an empty reply when
  2062. prompted for the formula, or to edit the @samp{#+TBLFM} line.
  2063. @kindex C-c C-c
  2064. You may edit the @samp{#+TBLFM} directly and re-apply the changed
  2065. equations with @kbd{C-c C-c} in that line or with the normal
  2066. recalculation commands in the table.
  2067. @subsubheading Debugging formulas
  2068. @cindex formula debugging
  2069. @cindex debugging, of table formulas
  2070. When the evaluation of a formula leads to an error, the field content
  2071. becomes the string @samp{#ERROR}. If you would like see what is going
  2072. on during variable substitution and calculation in order to find a bug,
  2073. turn on formula debugging in the @code{Tbl} menu and repeat the
  2074. calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
  2075. field. Detailed information will be displayed.
  2076. @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
  2077. @subsection Updating the table
  2078. @cindex recomputing table fields
  2079. @cindex updating, table
  2080. Recalculation of a table is normally not automatic, but needs to be
  2081. triggered by a command. See @ref{Advanced features}, for a way to make
  2082. recalculation at least semi-automatic.
  2083. In order to recalculate a line of a table or the entire table, use the
  2084. following commands:
  2085. @table @kbd
  2086. @kindex C-c *
  2087. @item C-c *
  2088. Recalculate the current row by first applying the stored column formulas
  2089. from left to right, and all field formulas in the current row.
  2090. @c
  2091. @kindex C-u C-c *
  2092. @item C-u C-c *
  2093. @kindex C-u C-c C-c
  2094. @itemx C-u C-c C-c
  2095. Recompute the entire table, line by line. Any lines before the first
  2096. hline are left alone, assuming that these are part of the table header.
  2097. @c
  2098. @kindex C-u C-u C-c *
  2099. @kindex C-u C-u C-c C-c
  2100. @item C-u C-u C-c *
  2101. @itemx C-u C-u C-c C-c
  2102. Iterate the table by recomputing it until no further changes occur.
  2103. This may be necessary if some computed fields use the value of other
  2104. fields that are computed @i{later} in the calculation sequence.
  2105. @end table
  2106. @node Advanced features, , Updating the table, The spreadsheet
  2107. @subsection Advanced features
  2108. If you want the recalculation of fields to happen automatically, or if
  2109. you want to be able to assign @i{names} to fields and columns, you need
  2110. to reserve the first column of the table for special marking characters.
  2111. @table @kbd
  2112. @kindex C-#
  2113. @item C-#
  2114. Rotate the calculation mark in first column through the states @samp{ },
  2115. @samp{#}, @samp{*}, @samp{!}, @samp{$}. When there is an active region,
  2116. change all marks in the region.
  2117. @end table
  2118. Here is an example of a table that collects exam results of students and
  2119. makes use of these features:
  2120. @example
  2121. @group
  2122. |---+---------+--------+--------+--------+-------+------|
  2123. | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
  2124. |---+---------+--------+--------+--------+-------+------|
  2125. | ! | | P1 | P2 | P3 | Tot | |
  2126. | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
  2127. | ^ | | m1 | m2 | m3 | mt | |
  2128. |---+---------+--------+--------+--------+-------+------|
  2129. | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
  2130. | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
  2131. |---+---------+--------+--------+--------+-------+------|
  2132. | | Average | | | | 29.7 | |
  2133. | ^ | | | | | at | |
  2134. | $ | max=50 | | | | | |
  2135. |---+---------+--------+--------+--------+-------+------|
  2136. #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
  2137. @end group
  2138. @end example
  2139. @noindent @b{Important}: please note that for these special tables,
  2140. recalculating the table with @kbd{C-u C-c *} will only affect rows that
  2141. are marked @samp{#} or @samp{*}, and fields that have a formula assigned
  2142. to the field itself. The column formulas are not applied in rows with
  2143. empty first field.
  2144. @cindex marking characters, tables
  2145. The marking characters have the following meaning:
  2146. @table @samp
  2147. @item !
  2148. The fields in this line define names for the columns, so that you may
  2149. refer to a column as @samp{$Tot} instead of @samp{$6}.
  2150. @item ^
  2151. This row defines names for the fields @emph{above} the row. With such
  2152. a definition, any formula in the table may use @samp{$m1} to refer to
  2153. the value @samp{10}. Also, if you assign a formula to a names field, it
  2154. will be stored as @samp{$name=...}.
  2155. @item _
  2156. Similar to @samp{^}, but defines names for the fields in the row
  2157. @emph{below}.
  2158. @item $
  2159. Fields in this row can define @emph{parameters} for formulas. For
  2160. example, if a field in a @samp{$} row contains @samp{max=50}, then
  2161. formulas in this table can refer to the value 50 using @samp{$max}.
  2162. Parameters work exactly like constants, only that they can be defined on
  2163. a per-table basis.
  2164. @item #
  2165. Fields in this row are automatically recalculated when pressing
  2166. @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
  2167. is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
  2168. lines will be left alone by this command.
  2169. @item *
  2170. Selects this line for global recalculation with @kbd{C-u C-c *}, but
  2171. not for automatic recalculation. Use this when automatic
  2172. recalculation slows down editing too much.
  2173. @item
  2174. Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
  2175. All lines that should be recalculated should be marked with @samp{#}
  2176. or @samp{*}.
  2177. @item /
  2178. Do not export this line. Useful for lines that contain the narrowing
  2179. @samp{<N>} markers or column group markers.
  2180. @end table
  2181. Finally, just to whet your appetite for what can be done with the
  2182. fantastic @file{calc.el} package, here is a table that computes the Taylor
  2183. series of degree @code{n} at location @code{x} for a couple of
  2184. functions.
  2185. @example
  2186. @group
  2187. |---+-------------+---+-----+--------------------------------------|
  2188. | | Func | n | x | Result |
  2189. |---+-------------+---+-----+--------------------------------------|
  2190. | # | exp(x) | 1 | x | 1 + x |
  2191. | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
  2192. | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
  2193. | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
  2194. | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
  2195. | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
  2196. |---+-------------+---+-----+--------------------------------------|
  2197. #+TBLFM: $5=taylor($2,$4,$3);n3
  2198. @end group
  2199. @end example
  2200. @node Org-Plot, , The spreadsheet, Tables
  2201. @section Org-Plot
  2202. @cindex graph, in tables
  2203. @cindex plot tables using gnuplot
  2204. @cindex #+PLOT
  2205. Org-Plot can produce 2D and 3D graphs of information stored in org tables
  2206. using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
  2207. @uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html}. To see
  2208. this in action, ensure that you have both Gnuplot and Gnuplot mode installed
  2209. on your system, then call @code{org-plot/gnuplot} on the following table.
  2210. @example
  2211. @group
  2212. #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
  2213. | Sede | Max cites | H-index |
  2214. |-----------+-----------+---------|
  2215. | Chile | 257.72 | 21.39 |
  2216. | Leeds | 165.77 | 19.68 |
  2217. | Sao Paolo | 71.00 | 11.50 |
  2218. | Stockholm | 134.19 | 14.33 |
  2219. | Morelia | 257.56 | 17.67 |
  2220. @end group
  2221. @end example
  2222. Notice that Org Plot is smart enough to apply the table's headers as labels.
  2223. Further control over the labels, type, content, and appearance of plots can
  2224. be exercised through the @code{#+PLOT:} lines preceding a table. See below
  2225. for a complete list of Org-plot options. For more information and examples
  2226. see the Org-plot tutorial at
  2227. @uref{http://orgmode.org/worg/org-tutorials/org-plot.php}.
  2228. @subsubheading Plot Options
  2229. @table @code
  2230. @item set
  2231. Specify any @command{gnuplot} option to be set when graphing.
  2232. @item title
  2233. Specify the title of the plot.
  2234. @item ind
  2235. Specify which column of the table to use as the @code{x} axis.
  2236. @item deps
  2237. Specify the columns to graph as a Lisp style list, surrounded by parentheses
  2238. and separated by spaces for example @code{dep:(3 4)} to graph the third and
  2239. fourth columns (defaults to graphing all other columns aside from the @code{ind}
  2240. column).
  2241. @item type
  2242. Specify whether the plot will be @code{2d}, @code{3d}, or @code{grid}.
  2243. @item with
  2244. Specify a @code{with} option to be inserted for every col being plotted
  2245. (e.g. @code{lines}, @code{points}, @code{boxes}, @code{impulses}, etc...).
  2246. Defaults to @code{lines}.
  2247. @item file
  2248. If you want to plot to a file, specify @code{"@var{path/to/desired/output-file}"}.
  2249. @item labels
  2250. List of labels to be used for the deps (defaults to the column headers if
  2251. they exist).
  2252. @item line
  2253. Specify an entire line to be inserted in the Gnuplot script.
  2254. @item map
  2255. When plotting @code{3d} or @code{grid} types, set this to @code{t} to graph a
  2256. flat mapping rather than a @code{3d} slope.
  2257. @item timefmt
  2258. Specify format of Org-mode timestamps as they will be parsed by Gnuplot.
  2259. Defaults to @samp{%Y-%m-%d-%H:%M:%S}.
  2260. @item script
  2261. If you want total control, you can specify a script file (place the file name
  2262. between double-quotes) which will be used to plot. Before plotting, every
  2263. instance of @code{$datafile} in the specified script will be replaced with
  2264. the path to the generated data file. Note: even if you set this option, you
  2265. may still want to specify the plot type, as that can impact the content of
  2266. the data file.
  2267. @end table
  2268. @node Hyperlinks, TODO Items, Tables, Top
  2269. @chapter Hyperlinks
  2270. @cindex hyperlinks
  2271. Like HTML, Org provides links inside a file, external links to
  2272. other files, Usenet articles, emails, and much more.
  2273. @menu
  2274. * Link format:: How links in Org are formatted
  2275. * Internal links:: Links to other places in the current file
  2276. * External links:: URL-like links to the world
  2277. * Handling links:: Creating, inserting and following
  2278. * Using links outside Org:: Linking from my C source code?
  2279. * Link abbreviations:: Shortcuts for writing complex links
  2280. * Search options:: Linking to a specific location
  2281. * Custom searches:: When the default search is not enough
  2282. @end menu
  2283. @node Link format, Internal links, Hyperlinks, Hyperlinks
  2284. @section Link format
  2285. @cindex link format
  2286. @cindex format, of links
  2287. Org will recognize plain URL-like links and activate them as
  2288. clickable links. The general link format, however, looks like this:
  2289. @example
  2290. [[link][description]] @r{or alternatively} [[link]]
  2291. @end example
  2292. @noindent
  2293. Once a link in the buffer is complete (all brackets present), Org
  2294. will change the display so that @samp{description} is displayed instead
  2295. of @samp{[[link][description]]} and @samp{link} is displayed instead of
  2296. @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
  2297. which by default is an underlined face. You can directly edit the
  2298. visible part of a link. Note that this can be either the @samp{link}
  2299. part (if there is no description) or the @samp{description} part. To
  2300. edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
  2301. cursor on the link.
  2302. If you place the cursor at the beginning or just behind the end of the
  2303. displayed text and press @key{BACKSPACE}, you will remove the
  2304. (invisible) bracket at that location. This makes the link incomplete
  2305. and the internals are again displayed as plain text. Inserting the
  2306. missing bracket hides the link internals again. To show the
  2307. internal structure of all links, use the menu entry
  2308. @code{Org->Hyperlinks->Literal links}.
  2309. @node Internal links, External links, Link format, Hyperlinks
  2310. @section Internal links
  2311. @cindex internal links
  2312. @cindex links, internal
  2313. @cindex targets, for links
  2314. @cindex property, CUSTOM_ID
  2315. If the link does not look like a URL, it is considered to be internal in the
  2316. current file. The most important case is a link like
  2317. @samp{[[#my-custom-id]]} which will link to the entry with the
  2318. @code{CUSTOM_ID} property @samp{my-custom-id}. Such custom IDs are very good
  2319. for HTML export (@pxref{HTML export}) where they produce pretty section
  2320. links. You are responsible yourself to make sure these custom IDs are unique
  2321. in a file.
  2322. Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]}
  2323. lead to a text search in the current file.
  2324. The link can be followed with @kbd{C-c C-o} when the cursor is on the link,
  2325. or with a mouse click (@pxref{Handling links}). Links to custom IDs will
  2326. point to the corresponding headline. The preferred match for a text link is
  2327. a @i{dedicated target}: the same string in double angular brackets. Targets
  2328. may be located anywhere; sometimes it is convenient to put them into a
  2329. comment line. For example
  2330. @example
  2331. # <<My Target>>
  2332. @end example
  2333. @noindent In HTML export (@pxref{HTML export}), such targets will become
  2334. named anchors for direct access through @samp{http} links@footnote{Note that
  2335. text before the first headline is usually not exported, so the first such
  2336. target should be after the first headline, or in the line directly before the
  2337. first headline.}.
  2338. If no dedicated target exists, Org will search for the words in the link. In
  2339. the above example the search would be for @samp{my target}. Links starting
  2340. with a star like @samp{*My Target} restrict the search to
  2341. headlines@footnote{To insert a link targeting a headline, in-buffer
  2342. completion can be used. Just type a star followed by a few optional letters
  2343. into the buffer and press @kbd{M-@key{TAB}}. All headlines in the current
  2344. buffer will be offered as completions. @xref{Handling links}, for more
  2345. commands creating links.}. When searching, Org mode will first try an
  2346. exact match, but then move on to more and more lenient searches. For
  2347. example, the link @samp{[[*My Targets]]} will find any of the following:
  2348. @example
  2349. ** My targets
  2350. ** TODO my targets are bright
  2351. ** my 20 targets are
  2352. @end example
  2353. Following a link pushes a mark onto Org's own mark ring. You can
  2354. return to the previous position with @kbd{C-c &}. Using this command
  2355. several times in direct succession goes back to positions recorded
  2356. earlier.
  2357. @menu
  2358. * Radio targets:: Make targets trigger links in plain text
  2359. @end menu
  2360. @node Radio targets, , Internal links, Internal links
  2361. @subsection Radio targets
  2362. @cindex radio targets
  2363. @cindex targets, radio
  2364. @cindex links, radio targets
  2365. Org can automatically turn any occurrences of certain target names
  2366. in normal text into a link. So without explicitly creating a link, the
  2367. text connects to the target radioing its position. Radio targets are
  2368. enclosed by triple angular brackets. For example, a target @samp{<<<My
  2369. Target>>>} causes each occurrence of @samp{my target} in normal text to
  2370. become activated as a link. The Org file is scanned automatically
  2371. for radio targets only when the file is first loaded into Emacs. To
  2372. update the target list during editing, press @kbd{C-c C-c} with the
  2373. cursor on or at a target.
  2374. @node External links, Handling links, Internal links, Hyperlinks
  2375. @section External links
  2376. @cindex links, external
  2377. @cindex external links
  2378. @cindex links, external
  2379. @cindex Gnus links
  2380. @cindex BBDB links
  2381. @cindex IRC links
  2382. @cindex URL links
  2383. @cindex file links
  2384. @cindex VM links
  2385. @cindex RMAIL links
  2386. @cindex WANDERLUST links
  2387. @cindex MH-E links
  2388. @cindex USENET links
  2389. @cindex SHELL links
  2390. @cindex Info links
  2391. @cindex Elisp links
  2392. Org supports links to files, websites, Usenet and email messages,
  2393. BBDB database entries and links to both IRC conversations and their
  2394. logs. External links are URL-like locators. They start with a short
  2395. identifying string followed by a colon. There can be no space after
  2396. the colon. The following list shows examples for each link type.
  2397. @example
  2398. http://www.astro.uva.nl/~dominik @r{on the web}
  2399. file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
  2400. /home/dominik/images/jupiter.jpg @r{same as above}
  2401. file:papers/last.pdf @r{file, relative path}
  2402. ./papers/last.pdf @r{same as above}
  2403. file:sometextfile::NNN @r{file with line number to jump to}
  2404. file:projects.org @r{another Org file}
  2405. file:projects.org::some words @r{text search in Org file}
  2406. file:projects.org::*task title @r{heading search in Org file}
  2407. docview:papers/last.pdf::NNN @r{open file in doc-view mode at page NNN}
  2408. id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID}
  2409. news:comp.emacs @r{Usenet link}
  2410. mailto:adent@@galaxy.net @r{Mail link}
  2411. vm:folder @r{VM folder link}
  2412. vm:folder#id @r{VM message link}
  2413. vm://myself@@some.where.org/folder#id @r{VM on remote machine}
  2414. wl:folder @r{WANDERLUST folder link}
  2415. wl:folder#id @r{WANDERLUST message link}
  2416. mhe:folder @r{MH-E folder link}
  2417. mhe:folder#id @r{MH-E message link}
  2418. rmail:folder @r{RMAIL folder link}
  2419. rmail:folder#id @r{RMAIL message link}
  2420. gnus:group @r{Gnus group link}
  2421. gnus:group#id @r{Gnus article link}
  2422. bbdb:R.*Stallman @r{BBDB link (with regexp)}
  2423. irc:/irc.com/#emacs/bob @r{IRC link}
  2424. shell:ls *.org @r{A shell command}
  2425. elisp:org-agenda @r{Interactive Elisp command}
  2426. elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate}
  2427. @end example
  2428. A link should be enclosed in double brackets and may contain a
  2429. descriptive text to be displayed instead of the URL (@pxref{Link
  2430. format}), for example:
  2431. @example
  2432. [[http://www.gnu.org/software/emacs/][GNU Emacs]]
  2433. @end example
  2434. @noindent
  2435. If the description is a file name or URL that points to an image, HTML
  2436. export (@pxref{HTML export}) will inline the image as a clickable
  2437. button. If there is no description at all and the link points to an
  2438. image,
  2439. that image will be inlined into the exported HTML file.
  2440. @cindex square brackets, around links
  2441. @cindex plain text external links
  2442. Org also finds external links in the normal text and activates them
  2443. as links. If spaces must be part of the link (for example in
  2444. @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
  2445. about the end of the link, enclose them in square brackets.
  2446. @node Handling links, Using links outside Org, External links, Hyperlinks
  2447. @section Handling links
  2448. @cindex links, handling
  2449. Org provides methods to create a link in the correct syntax, to
  2450. insert it into an Org file, and to follow the link.
  2451. @table @kbd
  2452. @kindex C-c l
  2453. @cindex storing links
  2454. @item C-c l
  2455. Store a link to the current location. This is a @emph{global} command (you
  2456. must create the key binding yourself) which can be used in any buffer to
  2457. create a link. The link will be stored for later insertion into an Org
  2458. buffer (see below). What kind of link will be created depends on the current
  2459. buffer:
  2460. @b{Org-mode buffers}@*
  2461. For Org files, if there is a @samp{<<target>>} at the cursor, the link points
  2462. to the target. Otherwise it points to the current headline, which will also
  2463. be the description.
  2464. @vindex org-link-to-org-use-id
  2465. @cindex property, CUSTOM_ID
  2466. @cindex property, ID
  2467. If the headline has a @code{CUSTOM_ID} property, a link to this custom ID
  2468. will be stored. In addition or alternatively (depending on the value of
  2469. @code{org-link-to-org-use-id}), a globally unique @code{ID} property will be
  2470. created and/or used to construct a link. So using this command in Org
  2471. buffers will potentially create two links: a human-readable from the custom
  2472. ID, and one that is globally unique and works even if the entry is moved from
  2473. file to file. Later, when inserting the link, you need to decide which one
  2474. to use.
  2475. @b{Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus}@*
  2476. Pretty much all Emacs mail clients are supported. The link will point to the
  2477. current article, or, in some GNUS buffers, to the group. The description is
  2478. constructed from the author and the subject.
  2479. @b{Web browsers: W3 and W3M}@*
  2480. Here the link will be the current URL, with the page title as description.
  2481. @b{Contacts: BBDB}@*
  2482. Links created in a BBDB buffer will point to the current entry.
  2483. @b{Chat: IRC}@*
  2484. @vindex org-irc-link-to-logs
  2485. For IRC links, if you set the variable @code{org-irc-link-to-logs} to
  2486. @code{t}, a @samp{file:/} style link to the relevant point in the logs for
  2487. the current conversation is created. Otherwise an @samp{irc:/} style link to
  2488. the user/channel/server under the point will be stored.
  2489. @b{Other files}@*
  2490. For any other files, the link will point to the file, with a search string
  2491. (@pxref{Search options}) pointing to the contents of the current line. If
  2492. there is an active region, the selected words will form the basis of the
  2493. search string. If the automatically created link is not working correctly or
  2494. accurately enough, you can write custom functions to select the search string
  2495. and to do the search for particular file types---see @ref{Custom searches}.
  2496. The key binding @kbd{C-c l} is only a suggestion---see @ref{Installation}.
  2497. @b{Agenda view}@*
  2498. When the cursor is in an agenda view, the created link points to the
  2499. entry referenced by the current line.
  2500. @c
  2501. @kindex C-c C-l
  2502. @cindex link completion
  2503. @cindex completion, of links
  2504. @cindex inserting links
  2505. @item C-c C-l
  2506. @vindex org-keep-stored-link-after-insertion
  2507. Insert a link@footnote{ Note that you don't have to use this command to
  2508. insert a link. Links in Org are plain text, and you can type or paste them
  2509. straight into the buffer. By using this command, the links are automatically
  2510. enclosed in double brackets, and you will be asked for the optional
  2511. descriptive text.}. This prompts for a link to be inserted into the buffer.
  2512. You can just type a link, using text for an internal link, or one of the link
  2513. type prefixes mentioned in the examples above. The link will be inserted
  2514. into the buffer@footnote{After insertion of a stored link, the link will be
  2515. removed from the list of stored links. To keep it in the list later use, use
  2516. a triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
  2517. @code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
  2518. If some text was selected when this command is called, the selected text
  2519. becomes the default description.
  2520. @b{Inserting stored links}@*
  2521. All links stored during the
  2522. current session are part of the history for this prompt, so you can access
  2523. them with @key{up} and @key{down} (or @kbd{M-p/n}).
  2524. @b{Completion support}@* Completion with @key{TAB} will help you to insert
  2525. valid link prefixes like @samp{http:} or @samp{ftp:}, including the prefixes
  2526. defined through link abbreviations (@pxref{Link abbreviations}). If you
  2527. press @key{RET} after inserting only the @var{prefix}, Org will offer
  2528. specific completion support for some link types@footnote{This works by
  2529. calling a special function @code{org-PREFIX-complete-link}.} For
  2530. example, if you type @kbd{file @key{RET}}, file name completion (alternative
  2531. access: @kbd{C-u C-c C-l}, see below) will be offered, and after @kbd{bbdb
  2532. @key{RET}} you can complete contact names.
  2533. @kindex C-u C-c C-l
  2534. @cindex file name completion
  2535. @cindex completion, of file names
  2536. @item C-u C-c C-l
  2537. When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
  2538. a file will be inserted and you may use file name completion to select
  2539. the name of the file. The path to the file is inserted relative to the
  2540. directory of the current Org file, if the linked file is in the current
  2541. directory or in a sub-directory of it, or if the path is written relative
  2542. to the current directory using @samp{../}. Otherwise an absolute path
  2543. is used, if possible with @samp{~/} for your home directory. You can
  2544. force an absolute path with two @kbd{C-u} prefixes.
  2545. @c
  2546. @item C-c C-l @r{(with cursor on existing link)}
  2547. When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
  2548. link and description parts of the link.
  2549. @c
  2550. @cindex following links
  2551. @kindex C-c C-o
  2552. @kindex RET
  2553. @item C-c C-o @r{or} @key{RET}
  2554. @vindex org-file-apps
  2555. Open link at point. This will launch a web browser for URLs (using
  2556. @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
  2557. the corresponding links, and execute the command in a shell link. When the
  2558. cursor is on an internal link, this commands runs the corresponding search.
  2559. When the cursor is on a TAG list in a headline, it creates the corresponding
  2560. TAGS view. If the cursor is on a timestamp, it compiles the agenda for that
  2561. date. Furthermore, it will visit text and remote files in @samp{file:} links
  2562. with Emacs and select a suitable application for local non-text files.
  2563. Classification of files is based on file extension only. See option
  2564. @code{org-file-apps}. If you want to override the default application and
  2565. visit the file with Emacs, use a @kbd{C-u} prefix. If you want to avoid
  2566. opening in Emacs, use a @kbd{C-u C-u} prefix.@*
  2567. If the cursor is on a headline, but not on a link, offer all links in the
  2568. headline and entry text.
  2569. @c
  2570. @kindex mouse-2
  2571. @kindex mouse-1
  2572. @item mouse-2
  2573. @itemx mouse-1
  2574. On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
  2575. would. Under Emacs 22, @kbd{mouse-1} will also follow a link.
  2576. @c
  2577. @kindex mouse-3
  2578. @item mouse-3
  2579. @vindex org-display-internal-link-with-indirect-buffer
  2580. Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
  2581. internal links to be displayed in another window@footnote{See the
  2582. variable @code{org-display-internal-link-with-indirect-buffer}}.
  2583. @c
  2584. @cindex mark ring
  2585. @kindex C-c %
  2586. @item C-c %
  2587. Push the current position onto the mark ring, to be able to return
  2588. easily. Commands following an internal link do this automatically.
  2589. @c
  2590. @cindex links, returning to
  2591. @kindex C-c &
  2592. @item C-c &
  2593. Jump back to a recorded position. A position is recorded by the
  2594. commands following internal links, and by @kbd{C-c %}. Using this
  2595. command several times in direct succession moves through a ring of
  2596. previously recorded positions.
  2597. @c
  2598. @kindex C-c C-x C-n
  2599. @kindex C-c C-x C-p
  2600. @cindex links, finding next/previous
  2601. @item C-c C-x C-n
  2602. @itemx C-c C-x C-p
  2603. Move forward/backward to the next link in the buffer. At the limit of
  2604. the buffer, the search fails once, and then wraps around. The key
  2605. bindings for this are really too long, you might want to bind this also
  2606. to @kbd{C-n} and @kbd{C-p}
  2607. @lisp
  2608. (add-hook 'org-load-hook
  2609. (lambda ()
  2610. (define-key 'org-mode-map "\C-n" 'org-next-link)
  2611. (define-key 'org-mode-map "\C-p" 'org-previous-link)))
  2612. @end lisp
  2613. @end table
  2614. @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
  2615. @section Using links outside Org
  2616. You can insert and follow links that have Org syntax not only in
  2617. Org, but in any Emacs buffer. For this, you should create two
  2618. global commands, like this (please select suitable global keys
  2619. yourself):
  2620. @lisp
  2621. (global-set-key "\C-c L" 'org-insert-link-global)
  2622. (global-set-key "\C-c o" 'org-open-at-point-global)
  2623. @end lisp
  2624. @node Link abbreviations, Search options, Using links outside Org, Hyperlinks
  2625. @section Link abbreviations
  2626. @cindex link abbreviations
  2627. @cindex abbreviation, links
  2628. Long URLs can be cumbersome to type, and often many similar links are
  2629. needed in a document. For this you can use link abbreviations. An
  2630. abbreviated link looks like this
  2631. @example
  2632. [[linkword:tag][description]]
  2633. @end example
  2634. @noindent
  2635. @vindex org-link-abbrev-alist
  2636. where the tag is optional. The @i{linkword} must be a word; letter, numbers,
  2637. @samp{-}, and @samp{_} are allowed here. Abbreviations are resolved
  2638. according to the information in the variable @code{org-link-abbrev-alist}
  2639. that relates the linkwords to replacement text. Here is an example:
  2640. @lisp
  2641. @group
  2642. (setq org-link-abbrev-alist
  2643. '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
  2644. ("google" . "http://www.google.com/search?q=")
  2645. ("ads" . "http://adsabs.harvard.edu/cgi-bin/
  2646. nph-abs_connect?author=%s&db_key=AST")))
  2647. @end group
  2648. @end lisp
  2649. If the replacement text contains the string @samp{%s}, it will be
  2650. replaced with the tag. Otherwise the tag will be appended to the string
  2651. in order to create the link. You may also specify a function that will
  2652. be called with the tag as the only argument to create the link.
  2653. With the above setting, you could link to a specific bug with
  2654. @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
  2655. @code{[[google:OrgMode]]} and find out what the Org author is
  2656. doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
  2657. If you need special abbreviations just for a single Org buffer, you
  2658. can define them in the file with
  2659. @cindex #+LINK
  2660. @example
  2661. #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
  2662. #+LINK: google http://www.google.com/search?q=%s
  2663. @end example
  2664. @noindent
  2665. In-buffer completion (@pxref{Completion}) can be used after @samp{[} to
  2666. complete link abbreviations. You may also define a function
  2667. @code{org-PREFIX-complete-link} that implements special (e.g. completion)
  2668. support for inserting such a link with @kbd{C-c C-l}. Such a function should
  2669. not accept any arguments, and return the full link with prefix.
  2670. @node Search options, Custom searches, Link abbreviations, Hyperlinks
  2671. @section Search options in file links
  2672. @cindex search option in file links
  2673. @cindex file links, searching
  2674. File links can contain additional information to make Emacs jump to a
  2675. particular location in the file when following a link. This can be a
  2676. line number or a search option after a double@footnote{For backward
  2677. compatibility, line numbers can also follow a single colon.} colon. For
  2678. example, when the command @kbd{C-c l} creates a link (@pxref{Handling
  2679. links}) to a file, it encodes the words in the current line as a search
  2680. string that can be used to find this line back later when following the
  2681. link with @kbd{C-c C-o}.
  2682. Here is the syntax of the different ways to attach a search to a file
  2683. link, together with an explanation:
  2684. @example
  2685. [[file:~/code/main.c::255]]
  2686. [[file:~/xx.org::My Target]]
  2687. [[file:~/xx.org::*My Target]]
  2688. [[file:~/xx.org::/regexp/]]
  2689. @end example
  2690. @table @code
  2691. @item 255
  2692. Jump to line 255.
  2693. @item My Target
  2694. Search for a link target @samp{<<My Target>>}, or do a text search for
  2695. @samp{my target}, similar to the search in internal links, see
  2696. @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
  2697. link will become an HTML reference to the corresponding named anchor in
  2698. the linked file.
  2699. @item *My Target
  2700. In an Org file, restrict search to headlines.
  2701. @item /regexp/
  2702. Do a regular expression search for @code{regexp}. This uses the Emacs
  2703. command @code{occur} to list all matches in a separate window. If the
  2704. target file is in Org mode, @code{org-occur} is used to create a
  2705. sparse tree with the matches.
  2706. @c If the target file is a directory,
  2707. @c @code{grep} will be used to search all files in the directory.
  2708. @end table
  2709. As a degenerate case, a file link with an empty file name can be used
  2710. to search the current file. For example, @code{[[file:::find me]]} does
  2711. a search for @samp{find me} in the current file, just as
  2712. @samp{[[find me]]} would.
  2713. @node Custom searches, , Search options, Hyperlinks
  2714. @section Custom Searches
  2715. @cindex custom search strings
  2716. @cindex search strings, custom
  2717. The default mechanism for creating search strings and for doing the
  2718. actual search related to a file link may not work correctly in all
  2719. cases. For example, Bib@TeX{} database files have many entries like
  2720. @samp{year="1993"} which would not result in good search strings,
  2721. because the only unique identification for a Bib@TeX{} entry is the
  2722. citation key.
  2723. @vindex org-create-file-search-functions
  2724. @vindex org-execute-file-search-functions
  2725. If you come across such a problem, you can write custom functions to set
  2726. the right search string for a particular file type, and to do the search
  2727. for the string in the file. Using @code{add-hook}, these functions need
  2728. to be added to the hook variables
  2729. @code{org-create-file-search-functions} and
  2730. @code{org-execute-file-search-functions}. See the docstring for these
  2731. variables for more information. Org actually uses this mechanism
  2732. for Bib@TeX{} database files, and you can use the corresponding code as
  2733. an implementation example. See the file @file{org-bibtex.el}.
  2734. @node TODO Items, Tags, Hyperlinks, Top
  2735. @chapter TODO Items
  2736. @cindex TODO items
  2737. Org mode does not maintain TODO lists as separate documents@footnote{Of
  2738. course, you can make a document that contains only long lists of TODO items,
  2739. but this is not required.}. Instead, TODO items are an integral part of the
  2740. notes file, because TODO items usually come up while taking notes! With Org
  2741. mode, simply mark any entry in a tree as being a TODO item. In this way,
  2742. information is not duplicated, and the entire context from which the TODO
  2743. item emerged is always present.
  2744. Of course, this technique for managing TODO items scatters them
  2745. throughout your notes file. Org mode compensates for this by providing
  2746. methods to give you an overview of all the things that you have to do.
  2747. @menu
  2748. * TODO basics:: Marking and displaying TODO entries
  2749. * TODO extensions:: Workflow and assignments
  2750. * Progress logging:: Dates and notes for progress
  2751. * Priorities:: Some things are more important than others
  2752. * Breaking down tasks:: Splitting a task into manageable pieces
  2753. * Checkboxes:: Tick-off lists
  2754. @end menu
  2755. @node TODO basics, TODO extensions, TODO Items, TODO Items
  2756. @section Basic TODO functionality
  2757. Any headline becomes a TODO item when it starts with the word
  2758. @samp{TODO}, for example:
  2759. @example
  2760. *** TODO Write letter to Sam Fortune
  2761. @end example
  2762. @noindent
  2763. The most important commands to work with TODO entries are:
  2764. @table @kbd
  2765. @kindex C-c C-t
  2766. @cindex cycling, of TODO states
  2767. @item C-c C-t
  2768. Rotate the TODO state of the current item among
  2769. @example
  2770. ,-> (unmarked) -> TODO -> DONE --.
  2771. '--------------------------------'
  2772. @end example
  2773. The same rotation can also be done ``remotely'' from the timeline and
  2774. agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
  2775. @kindex C-u C-c C-t
  2776. @item C-u C-c C-t
  2777. Select a specific keyword using completion or (if it has been set up)
  2778. the fast selection interface. For the latter, you need to assign keys
  2779. to TODO states, see @ref{Per-file keywords}, and @ref{Setting tags}, for
  2780. more information.
  2781. @kindex S-@key{right}
  2782. @kindex S-@key{left}
  2783. @vindex org-treat-S-cursor-todo-selection-as-state-change
  2784. @item S-@key{right}
  2785. @itemx S-@key{left}
  2786. Select the following/preceding TODO state, similar to cycling. Useful
  2787. mostly if more than two TODO states are possible (@pxref{TODO
  2788. extensions}). See also @ref{Conflicts}, for a discussion of the interaction
  2789. with @code{shift-selection-mode}. See also the variable
  2790. @code{org-treat-S-cursor-todo-selection-as-state-change}.
  2791. @kindex C-c C-v
  2792. @kindex C-c / t
  2793. @cindex sparse tree, for TODO
  2794. @item C-c C-v
  2795. @itemx C-c / t
  2796. @vindex org-todo-keywords
  2797. View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds the
  2798. entire buffer, but shows all TODO items and the headings hierarchy above
  2799. them. With a prefix argument, search for a specific TODO. You will be
  2800. prompted for the keyword, and you can also give a list of keywords like
  2801. @code{KWD1|KWD2|...} to list entries that match any one of these keywords.
  2802. With numeric prefix argument N, show the tree for the Nth keyword in the
  2803. variable @code{org-todo-keywords}. With two prefix arguments, find all TODO
  2804. and DONE entries.
  2805. @kindex C-c a t
  2806. @item C-c a t
  2807. Show the global TODO list. Collects the TODO items from all agenda
  2808. files (@pxref{Agenda Views}) into a single buffer. The new buffer will
  2809. be in @code{agenda-mode}, which provides commands to examine and
  2810. manipulate the TODO entries from the new buffer (@pxref{Agenda
  2811. commands}). @xref{Global TODO list}, for more information.
  2812. @kindex S-M-@key{RET}
  2813. @item S-M-@key{RET}
  2814. Insert a new TODO entry below the current one.
  2815. @end table
  2816. @noindent
  2817. @vindex org-todo-state-tags-triggers
  2818. Changing a TODO state can also trigger tag changes. See the docstring of the
  2819. option @code{org-todo-state-tags-triggers} for details.
  2820. @node TODO extensions, Progress logging, TODO basics, TODO Items
  2821. @section Extended use of TODO keywords
  2822. @cindex extended TODO keywords
  2823. @vindex org-todo-keywords
  2824. By default, marked TODO entries have one of only two states: TODO and
  2825. DONE. Org mode allows you to classify TODO items in more complex ways
  2826. with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
  2827. special setup, the TODO keyword system can work differently in different
  2828. files.
  2829. Note that @i{tags} are another way to classify headlines in general and
  2830. TODO items in particular (@pxref{Tags}).
  2831. @menu
  2832. * Workflow states:: From TODO to DONE in steps
  2833. * TODO types:: I do this, Fred does the rest
  2834. * Multiple sets in one file:: Mixing it all, and still finding your way
  2835. * Fast access to TODO states:: Single letter selection of a state
  2836. * Per-file keywords:: Different files, different requirements
  2837. * Faces for TODO keywords:: Highlighting states
  2838. * TODO dependencies:: When one task needs to wait for others
  2839. @end menu
  2840. @node Workflow states, TODO types, TODO extensions, TODO extensions
  2841. @subsection TODO keywords as workflow states
  2842. @cindex TODO workflow
  2843. @cindex workflow states as TODO keywords
  2844. You can use TODO keywords to indicate different @emph{sequential} states
  2845. in the process of working on an item, for example@footnote{Changing
  2846. this variable only becomes effective after restarting Org mode in a
  2847. buffer.}:
  2848. @lisp
  2849. (setq org-todo-keywords
  2850. '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
  2851. @end lisp
  2852. The vertical bar separates the TODO keywords (states that @emph{need
  2853. action}) from the DONE states (which need @emph{no further action}). If
  2854. you don't provide the separator bar, the last state is used as the DONE
  2855. state.
  2856. @cindex completion, of TODO keywords
  2857. With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
  2858. to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
  2859. also use a numeric prefix argument to quickly select a specific state. For
  2860. example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
  2861. Or you can use @kbd{S-@key{left}} to go backward through the sequence. If you
  2862. define many keywords, you can use in-buffer completion
  2863. (@pxref{Completion}) or even a special one-key selection scheme
  2864. (@pxref{Fast access to TODO states}) to insert these words into the
  2865. buffer. Changing a TODO state can be logged with a timestamp, see
  2866. @ref{Tracking TODO state changes}, for more information.
  2867. @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
  2868. @subsection TODO keywords as types
  2869. @cindex TODO types
  2870. @cindex names as TODO keywords
  2871. @cindex types as TODO keywords
  2872. The second possibility is to use TODO keywords to indicate different
  2873. @emph{types} of action items. For example, you might want to indicate
  2874. that items are for ``work'' or ``home''. Or, when you work with several
  2875. people on a single project, you might want to assign action items
  2876. directly to persons, by using their names as TODO keywords. This would
  2877. be set up like this:
  2878. @lisp
  2879. (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
  2880. @end lisp
  2881. In this case, different keywords do not indicate a sequence, but rather
  2882. different types. So the normal work flow would be to assign a task to a
  2883. person, and later to mark it DONE. Org mode supports this style by adapting
  2884. the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
  2885. @kbd{t} command in the timeline and agenda buffers.}. When used several
  2886. times in succession, it will still cycle through all names, in order to first
  2887. select the right type for a task. But when you return to the item after some
  2888. time and execute @kbd{C-c C-t} again, it will switch from any name directly
  2889. to DONE. Use prefix arguments or completion to quickly select a specific
  2890. name. You can also review the items of a specific TODO type in a sparse tree
  2891. by using a numeric prefix to @kbd{C-c C-v}. For example, to see all things
  2892. Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect Lucy's items
  2893. from all agenda files into a single buffer, you would use the numeric prefix
  2894. argument as well when creating the global TODO list: @kbd{C-3 C-c t}.
  2895. @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
  2896. @subsection Multiple keyword sets in one file
  2897. @cindex TODO keyword sets
  2898. Sometimes you may want to use different sets of TODO keywords in
  2899. parallel. For example, you may want to have the basic
  2900. @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
  2901. separate state indicating that an item has been canceled (so it is not
  2902. DONE, but also does not require action). Your setup would then look
  2903. like this:
  2904. @lisp
  2905. (setq org-todo-keywords
  2906. '((sequence "TODO" "|" "DONE")
  2907. (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
  2908. (sequence "|" "CANCELED")))
  2909. @end lisp
  2910. The keywords should all be different, this helps Org mode to keep track
  2911. of which subsequence should be used for a given entry. In this setup,
  2912. @kbd{C-c C-t} only operates within a subsequence, so it switches from
  2913. @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
  2914. (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
  2915. select the correct sequence. Besides the obvious ways like typing a
  2916. keyword or using completion, you may also apply the following commands:
  2917. @table @kbd
  2918. @kindex C-S-@key{right}
  2919. @kindex C-S-@key{left}
  2920. @kindex C-u C-u C-c C-t
  2921. @item C-u C-u C-c C-t
  2922. @itemx C-S-@key{right}
  2923. @itemx C-S-@key{left}
  2924. These keys jump from one TODO subset to the next. In the above example,
  2925. @kbd{C-u C-u C-c C-t} or @kbd{C-S-@key{right}} would jump from @code{TODO} or
  2926. @code{DONE} to @code{REPORT}, and any of the words in the second row to
  2927. @code{CANCELED}. Note that the @kbd{C-S-} key binding conflict with
  2928. @code{shift-selection-mode} (@pxref{Conflicts}).
  2929. @kindex S-@key{right}
  2930. @kindex S-@key{left}
  2931. @item S-@key{right}
  2932. @itemx S-@key{left}
  2933. @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through @emph{all}
  2934. keywords from all sets, so for example @kbd{S-@key{<right>}} would switch
  2935. from @code{DONE} to @code{REPORT} in the example above. See also
  2936. @ref{Conflicts}, for a discussion of the interaction with
  2937. @code{shift-selection-mode}.
  2938. @end table
  2939. @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
  2940. @subsection Fast access to TODO states
  2941. If you would like to quickly change an entry to an arbitrary TODO state
  2942. instead of cycling through the states, you can set up keys for
  2943. single-letter access to the states. This is done by adding the section
  2944. key after each keyword, in parentheses. For example:
  2945. @lisp
  2946. (setq org-todo-keywords
  2947. '((sequence "TODO(t)" "|" "DONE(d)")
  2948. (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
  2949. (sequence "|" "CANCELED(c)")))
  2950. @end lisp
  2951. @vindex org-fast-tag-selection-include-todo
  2952. If you then press @code{C-c C-t} followed by the selection key, the entry
  2953. will be switched to this state. @key{SPC} can be used to remove any TODO
  2954. keyword from an entry.@footnote{Check also the variable
  2955. @code{org-fast-tag-selection-include-todo}, it allows you to change the TODO
  2956. state through the tags interface (@pxref{Setting tags}), in case you like to
  2957. mingle the two concepts. Note that this means you need to come up with
  2958. unique keys across both sets of keywords.}
  2959. @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
  2960. @subsection Setting up keywords for individual files
  2961. @cindex keyword options
  2962. @cindex per-file keywords
  2963. @cindex #+TODO
  2964. @cindex #+TYP_TODO
  2965. @cindex #+SEQ_TODO
  2966. It can be very useful to use different aspects of the TODO mechanism in
  2967. different files. For file-local settings, you need to add special lines
  2968. to the file which set the keywords and interpretation for that file
  2969. only. For example, to set one of the two examples discussed above, you
  2970. need one of the following lines, starting in column zero anywhere in the
  2971. file:
  2972. @example
  2973. #+TODO: TODO FEEDBACK VERIFY | DONE CANCELED
  2974. @end example
  2975. @noindent (you may also write @code{#+SEQ_TODO} to be explicit about the
  2976. interpretation, but it means the same as @code{#+TODO}), or
  2977. @example
  2978. #+TYP_TODO: Fred Sara Lucy Mike | DONE
  2979. @end example
  2980. A setup for using several sets in parallel would be:
  2981. @example
  2982. #+TODO: TODO | DONE
  2983. #+TODO: REPORT BUG KNOWNCAUSE | FIXED
  2984. #+TODO: | CANCELED
  2985. @end example
  2986. @cindex completion, of option keywords
  2987. @kindex M-@key{TAB}
  2988. @noindent To make sure you are using the correct keyword, type
  2989. @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
  2990. @cindex DONE, final TODO keyword
  2991. Remember that the keywords after the vertical bar (or the last keyword
  2992. if no bar is there) must always mean that the item is DONE (although you
  2993. may use a different word). After changing one of these lines, use
  2994. @kbd{C-c C-c} with the cursor still in the line to make the changes
  2995. known to Org mode@footnote{Org mode parses these lines only when
  2996. Org mode is activated after visiting a file. @kbd{C-c C-c} with the
  2997. cursor in a line starting with @samp{#+} is simply restarting Org mode
  2998. for the current buffer.}.
  2999. @node Faces for TODO keywords, TODO dependencies, Per-file keywords, TODO extensions
  3000. @subsection Faces for TODO keywords
  3001. @cindex faces, for TODO keywords
  3002. @vindex org-todo @r{(face)}
  3003. @vindex org-done @r{(face)}
  3004. @vindex org-todo-keyword-faces
  3005. Org mode highlights TODO keywords with special faces: @code{org-todo}
  3006. for keywords indicating that an item still has to be acted upon, and
  3007. @code{org-done} for keywords indicating that an item is finished. If
  3008. you are using more than 2 different states, you might want to use
  3009. special faces for some of them. This can be done using the variable
  3010. @code{org-todo-keyword-faces}. For example:
  3011. @lisp
  3012. @group
  3013. (setq org-todo-keyword-faces
  3014. '(("TODO" . org-warning)
  3015. ("DEFERRED" . shadow)
  3016. ("CANCELED" . (:foreground "blue" :weight bold))))
  3017. @end group
  3018. @end lisp
  3019. While using a list with face properties as shown for CANCELED
  3020. @emph{should} work, this does not aways seem to be the case. If
  3021. necessary, define a special face and use that.
  3022. @node TODO dependencies, , Faces for TODO keywords, TODO extensions
  3023. @subsection TODO dependencies
  3024. @cindex TODO dependencies
  3025. @cindex dependencies, of TODO states
  3026. @vindex org-enforce-todo-dependencies
  3027. @cindex property, ORDERED
  3028. The structure of Org files (hierarchy and lists) makes it easy to define TODO
  3029. dependencies. Usually, a parent TODO task should not be marked DONE until
  3030. all subtasks (defined as children tasks) are marked as DONE. And sometimes
  3031. there is a logical sequence to a number of (sub)tasks, so that one task
  3032. cannot be acted upon before all siblings above it are done. If you customize
  3033. the variable @code{org-enforce-todo-dependencies}, Org will block entries
  3034. from changing state to DONE while they have children that are not DONE.
  3035. Furthermore, if an entry has a property @code{ORDERED}, each of its children
  3036. will be blocked until all earlier siblings are marked DONE. Here is an
  3037. example:
  3038. @example
  3039. * TODO Blocked until (two) is done
  3040. ** DONE one
  3041. ** TODO two
  3042. * Parent
  3043. :PROPERTIES:
  3044. :ORDERED: t
  3045. :END:
  3046. ** TODO a
  3047. ** TODO b, needs to wait for (a)
  3048. ** TODO c, needs to wait for (a) and (b)
  3049. @end example
  3050. @table @kbd
  3051. @kindex C-c C-x o
  3052. @item C-c C-x o
  3053. @vindex org-track-ordered-property-with-tag
  3054. @cindex property, ORDERED
  3055. Toggle the @code{ORDERED} property of the current entry. A property is used
  3056. for this behavior because this should be local to the current entry, not
  3057. inherited like a tag. However, if you would like to @i{track} the value of
  3058. this property with a tag for better visibility, customize the variable
  3059. @code{org-track-ordered-property-with-tag}.
  3060. @kindex C-u C-u C-u C-c C-t
  3061. @item C-u C-u C-u C-c C-t
  3062. Change TODO state, circumventing any state blocking.
  3063. @end table
  3064. @vindex org-agenda-dim-blocked-tasks
  3065. If you set the variable @code{org-agenda-dim-blocked-tasks}, TODO entries
  3066. that cannot be closed because of such dependencies will be shown in a dimmed
  3067. font or even made invisible in agenda views (@pxref{Agenda Views}).
  3068. @cindex checkboxes and TODO dependencies
  3069. @vindex org-enforce-todo-dependencies
  3070. You can also block changes of TODO states by looking at checkboxes
  3071. (@pxref{Checkboxes}). If you set the variable
  3072. @code{org-enforce-todo-checkbox-dependencies}, an entry that has unchecked
  3073. checkboxes will be blocked from switching to DONE.
  3074. If you need more complex dependency structures, for example dependencies
  3075. between entries in different trees or files, check out the contributed
  3076. module @file{org-depend.el}.
  3077. @page
  3078. @node Progress logging, Priorities, TODO extensions, TODO Items
  3079. @section Progress logging
  3080. @cindex progress logging
  3081. @cindex logging, of progress
  3082. Org mode can automatically record a timestamp and possibly a note when
  3083. you mark a TODO item as DONE, or even each time you change the state of
  3084. a TODO item. This system is highly configurable, settings can be on a
  3085. per-keyword basis and can be localized to a file or even a subtree. For
  3086. information on how to clock working time for a task, see @ref{Clocking
  3087. work time}.
  3088. @menu
  3089. * Closing items:: When was this entry marked DONE?
  3090. * Tracking TODO state changes:: When did the status change?
  3091. * Tracking your habits:: How consistent have you been?
  3092. @end menu
  3093. @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
  3094. @subsection Closing items
  3095. The most basic logging is to keep track of @emph{when} a certain TODO
  3096. item was finished. This is achieved with@footnote{The corresponding
  3097. in-buffer setting is: @code{#+STARTUP: logdone}}.
  3098. @lisp
  3099. (setq org-log-done 'time)
  3100. @end lisp
  3101. @noindent
  3102. Then each time you turn an entry from a TODO (not-done) state into any
  3103. of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
  3104. just after the headline. If you turn the entry back into a TODO item
  3105. through further state cycling, that line will be removed again. If you
  3106. want to record a note along with the timestamp, use@footnote{The
  3107. corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
  3108. @lisp
  3109. (setq org-log-done 'note)
  3110. @end lisp
  3111. @noindent
  3112. You will then be prompted for a note, and that note will be stored below
  3113. the entry with a @samp{Closing Note} heading.
  3114. In the timeline (@pxref{Timeline}) and in the agenda
  3115. (@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
  3116. display the TODO items with a @samp{CLOSED} timestamp on each day,
  3117. giving you an overview of what has been done.
  3118. @node Tracking TODO state changes, Tracking your habits, Closing items, Progress logging
  3119. @subsection Tracking TODO state changes
  3120. @cindex drawer, for state change recording
  3121. @vindex org-log-states-order-reversed
  3122. @vindex org-log-into-drawer
  3123. @cindex property, LOG_INTO_DRAWER
  3124. When TODO keywords are used as workflow states (@pxref{Workflow states}), you
  3125. might want to keep track of when a state change occurred and maybe take a
  3126. note about this change. You can either record just a timestamp, or a
  3127. time-stamped note for a change. These records will be inserted after the
  3128. headline as an itemized list, newest first@footnote{See the variable
  3129. @code{org-log-states-order-reversed}}. When taking a lot of notes, you might
  3130. want to get the notes out of the way into a drawer (@pxref{Drawers}).
  3131. Customize the variable @code{org-log-into-drawer} to get this
  3132. behavior---the recommended drawer for this is called @code{LOGBOOK}. You can
  3133. also overrule the setting of this variable for a subtree by setting a
  3134. @code{LOG_INTO_DRAWER} property.
  3135. Since it is normally too much to record a note for every state, Org mode
  3136. expects configuration on a per-keyword basis for this. This is achieved by
  3137. adding special markers @samp{!} (for a timestamp) and @samp{@@} (for a note)
  3138. in parentheses after each keyword. For example, with the setting
  3139. @lisp
  3140. (setq org-todo-keywords
  3141. '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
  3142. @end lisp
  3143. @noindent
  3144. @vindex org-log-done
  3145. you not only define global TODO keywords and fast access keys, but also
  3146. request that a time is recorded when the entry is set to
  3147. DONE@footnote{It is possible that Org mode will record two timestamps
  3148. when you are using both @code{org-log-done} and state change logging.
  3149. However, it will never prompt for two notes---if you have configured
  3150. both, the state change recording note will take precedence and cancel
  3151. the @samp{Closing Note}.}, and that a note is recorded when switching to
  3152. WAIT or CANCELED. The setting for WAIT is even more special: the
  3153. @samp{!} after the slash means that in addition to the note taken when
  3154. entering the state, a timestamp should be recorded when @i{leaving} the
  3155. WAIT state, if and only if the @i{target} state does not configure
  3156. logging for entering it. So it has no effect when switching from WAIT
  3157. to DONE, because DONE is configured to record a timestamp only. But
  3158. when switching from WAIT back to TODO, the @samp{/!} in the WAIT
  3159. setting now triggers a timestamp even though TODO has no logging
  3160. configured.
  3161. You can use the exact same syntax for setting logging preferences local
  3162. to a buffer:
  3163. @example
  3164. #+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
  3165. @end example
  3166. @cindex property, LOGGING
  3167. In order to define logging settings that are local to a subtree or a
  3168. single item, define a LOGGING property in this entry. Any non-empty
  3169. LOGGING property resets all logging settings to nil. You may then turn
  3170. on logging for this specific tree using STARTUP keywords like
  3171. @code{lognotedone} or @code{logrepeat}, as well as adding state specific
  3172. settings like @code{TODO(!)}. For example
  3173. @example
  3174. * TODO Log each state with only a time
  3175. :PROPERTIES:
  3176. :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
  3177. :END:
  3178. * TODO Only log when switching to WAIT, and when repeating
  3179. :PROPERTIES:
  3180. :LOGGING: WAIT(@@) logrepeat
  3181. :END:
  3182. * TODO No logging at all
  3183. :PROPERTIES:
  3184. :LOGGING: nil
  3185. :END:
  3186. @end example
  3187. @node Tracking your habits, , Tracking TODO state changes, Progress logging
  3188. @subsection Tracking your habits
  3189. @cindex habits
  3190. Org has the ability to track the consistency of a special category of TODOs,
  3191. called ``habits''. A habit has the following properties:
  3192. @enumerate
  3193. @item
  3194. You have enabled the @code{habits} module by customizing the variable
  3195. @code{org-modules}.
  3196. @item
  3197. The habit is a TODO, with a TODO keyword representing an open state.
  3198. @item
  3199. The property @code{STYLE} is set to the value @code{habit}.
  3200. @item
  3201. The TODO has a scheduled date, with a @code{.+} style repeat interval.
  3202. @item
  3203. The TODO may also have minimum and maximum ranges specified by using the
  3204. syntax @samp{.+2d/3d}, which says that you want to do the task at least every
  3205. three days, but at most every two days.
  3206. @item
  3207. You must also have state logging for the @code{DONE} state enabled, in order
  3208. for historical data to be represented in the consistency graph. If it's not
  3209. enabled it's not an error, but the consistency graphs will be largely
  3210. meaningless.
  3211. @end enumerate
  3212. To give you an idea of what the above rules look like in action, here's an
  3213. actual habit with some history:
  3214. @example
  3215. ** TODO Shave
  3216. SCHEDULED: <2009-10-17 Sat .+2d/4d>
  3217. - State "DONE" from "TODO" [2009-10-15 Thu]
  3218. - State "DONE" from "TODO" [2009-10-12 Mon]
  3219. - State "DONE" from "TODO" [2009-10-10 Sat]
  3220. - State "DONE" from "TODO" [2009-10-04 Sun]
  3221. - State "DONE" from "TODO" [2009-10-02 Fri]
  3222. - State "DONE" from "TODO" [2009-09-29 Tue]
  3223. - State "DONE" from "TODO" [2009-09-25 Fri]
  3224. - State "DONE" from "TODO" [2009-09-19 Sat]
  3225. - State "DONE" from "TODO" [2009-09-16 Wed]
  3226. - State "DONE" from "TODO" [2009-09-12 Sat]
  3227. :PROPERTIES:
  3228. :STYLE: habit
  3229. :LAST_REPEAT: [2009-10-19 Mon 00:36]
  3230. :END:
  3231. @end example
  3232. What this habit says is: I want to shave at most every 2 days (given by the
  3233. @code{SCHEDULED} date and repeat interval) and at least every 4 days. If
  3234. today is the 15th, then the habit first appears in the agenda on Oct 17,
  3235. after the minimum of 2 days has elapsed, and will appear overdue on Oct 19,
  3236. after four days have elapsed.
  3237. What's really useful about habits is that they are displayed along with a
  3238. consistency graph, to show how consistent you've been at getting that task
  3239. done in the past. This graph shows every day that the task was done over the
  3240. past three weeks, with colors for each day. The colors used are:
  3241. @table @code
  3242. @item Blue
  3243. If the task wasn't to be done yet on that day.
  3244. @item Green
  3245. If the task could have been done on that day.
  3246. @item Yellow
  3247. If the task was going to be overdue the next day.
  3248. @item Red
  3249. If the task was overdue on that day.
  3250. @end table
  3251. In addition to coloring each day, the day is also marked with an asterix if
  3252. the task was actually done that day, and an exclamation mark to show where
  3253. the current day falls in the graph.
  3254. There are several configuration variables that can be used to change the way
  3255. habits are displayed in the agenda.
  3256. @table @code
  3257. @item org-habit-graph-column
  3258. The buffer column at which the consistency graph should be drawn. This will
  3259. overwrite any text in that column, so it's a good idea to keep your habits'
  3260. titles brief and to the point.
  3261. @item org-habit-preceding-days
  3262. The amount of history, in days before today, to appear in consistency graphs.
  3263. @item org-habit-following-days
  3264. The number of days after today that will appear in consistency graphs.
  3265. @item org-habit-show-habits-only-for-today
  3266. If non-nil, only show habits in today's agenda view. This is set to true by
  3267. default.
  3268. @end table
  3269. Lastly, pressing @kbd{K} in the agenda buffer will cause habits to
  3270. temporarily be disabled and they won't appear at all. Press @kbd{K} again to
  3271. bring them back. They are also subject to tag filtering, if you have habits
  3272. which should only be done in certain contexts, for example.
  3273. @node Priorities, Breaking down tasks, Progress logging, TODO Items
  3274. @section Priorities
  3275. @cindex priorities
  3276. If you use Org mode extensively, you may end up enough TODO items that
  3277. it starts to make sense to prioritize them. Prioritizing can be done by
  3278. placing a @emph{priority cookie} into the headline of a TODO item, like
  3279. this
  3280. @example
  3281. *** TODO [#A] Write letter to Sam Fortune
  3282. @end example
  3283. @noindent
  3284. By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
  3285. @samp{C}. @samp{A} is the highest priority. An entry without a cookie
  3286. is treated as priority @samp{B}. Priorities make a difference only in
  3287. the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have
  3288. no inherent meaning to Org mode.
  3289. Priorities can be attached to any outline tree entries; they do not need
  3290. to be TODO items.
  3291. @table @kbd
  3292. @kindex @kbd{C-c ,}
  3293. @item @kbd{C-c ,}
  3294. Set the priority of the current headline. The command prompts for a
  3295. priority character @samp{A}, @samp{B} or @samp{C}. When you press
  3296. @key{SPC} instead, the priority cookie is removed from the headline.
  3297. The priorities can also be changed ``remotely'' from the timeline and
  3298. agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
  3299. @c
  3300. @kindex S-@key{up}
  3301. @kindex S-@key{down}
  3302. @item S-@key{up}
  3303. @itemx S-@key{down}
  3304. @vindex org-priority-start-cycle-with-default
  3305. Increase/decrease priority of current headline@footnote{See also the option
  3306. @code{org-priority-start-cycle-with-default}.}. Note that these keys are
  3307. also used to modify timestamps (@pxref{Creating timestamps}). See also
  3308. @ref{Conflicts}, for a discussion of the interaction with
  3309. @code{shift-selection-mode}.
  3310. @end table
  3311. @vindex org-highest-priority
  3312. @vindex org-lowest-priority
  3313. @vindex org-default-priority
  3314. You can change the range of allowed priorities by setting the variables
  3315. @code{org-highest-priority}, @code{org-lowest-priority}, and
  3316. @code{org-default-priority}. For an individual buffer, you may set
  3317. these values (highest, lowest, default) like this (please make sure that
  3318. the highest priority is earlier in the alphabet than the lowest
  3319. priority):
  3320. @cindex #+PRIORITIES
  3321. @example
  3322. #+PRIORITIES: A C B
  3323. @end example
  3324. @node Breaking down tasks, Checkboxes, Priorities, TODO Items
  3325. @section Breaking tasks down into subtasks
  3326. @cindex tasks, breaking down
  3327. @cindex statistics, for TODO items
  3328. @vindex org-agenda-todo-list-sublevels
  3329. It is often advisable to break down large tasks into smaller, manageable
  3330. subtasks. You can do this by creating an outline tree below a TODO item,
  3331. with detailed subtasks on the tree@footnote{To keep subtasks out of the
  3332. global TODO list, see the @code{org-agenda-todo-list-sublevels}.}. To keep
  3333. the overview over the fraction of subtasks that are already completed, insert
  3334. either @samp{[/]} or @samp{[%]} anywhere in the headline. These cookies will
  3335. be updates each time the todo status of a child changes, or when pressing
  3336. @kbd{C-c C-c} on the cookie. For example:
  3337. @example
  3338. * Organize Party [33%]
  3339. ** TODO Call people [1/2]
  3340. *** TODO Peter
  3341. *** DONE Sarah
  3342. ** TODO Buy food
  3343. ** DONE Talk to neighbor
  3344. @end example
  3345. @cindex property, COOKIE_DATA
  3346. If a heading has both checkboxes and TODO children below it, the meaning of
  3347. the statistics cookie become ambiguous. Set the property
  3348. @code{COOKIE_DATA} to either @samp{checkbox} or @samp{todo} to resolve
  3349. this issue.
  3350. @vindex org-hierarchical-todo-statistics
  3351. If you would like to have the statistics cookie count any TODO entries in the
  3352. subtree (not just direct children), configure the variable
  3353. @code{org-hierarchical-todo-statistics}. To do this for a single subtree,
  3354. include the word @samp{recursive} into the value of the @code{COOKIE_DATA}
  3355. property.
  3356. @example
  3357. * Parent capturing statistics [2/20]
  3358. :PROPERTIES:
  3359. :COOKIE_DATA: todo recursive
  3360. :END:
  3361. @end example
  3362. If you would like a TODO entry to automatically change to DONE
  3363. when all children are done, you can use the following setup:
  3364. @example
  3365. (defun org-summary-todo (n-done n-not-done)
  3366. "Switch entry to DONE when all subentries are done, to TODO otherwise."
  3367. (let (org-log-done org-log-states) ; turn off logging
  3368. (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
  3369. (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
  3370. @end example
  3371. Another possibility is the use of checkboxes to identify (a hierarchy of) a
  3372. large number of subtasks (@pxref{Checkboxes}).
  3373. @node Checkboxes, , Breaking down tasks, TODO Items
  3374. @section Checkboxes
  3375. @cindex checkboxes
  3376. Every item in a plain list (@pxref{Plain lists}) can be made into a
  3377. checkbox by starting it with the string @samp{[ ]}. This feature is
  3378. similar to TODO items (@pxref{TODO Items}), but is more lightweight.
  3379. Checkboxes are not included into the global TODO list, so they are often
  3380. great to split a task into a number of simple steps. Or you can use
  3381. them in a shopping list. To toggle a checkbox, use @kbd{C-c C-c}, or
  3382. use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}).
  3383. Here is an example of a checkbox list.
  3384. @example
  3385. * TODO Organize party [2/4]
  3386. - [-] call people [1/3]
  3387. - [ ] Peter
  3388. - [X] Sarah
  3389. - [ ] Sam
  3390. - [X] order food
  3391. - [ ] think about what music to play
  3392. - [X] talk to the neighbors
  3393. @end example
  3394. Checkboxes work hierarchically, so if a checkbox item has children that
  3395. are checkboxes, toggling one of the children checkboxes will make the
  3396. parent checkbox reflect if none, some, or all of the children are
  3397. checked.
  3398. @cindex statistics, for checkboxes
  3399. @cindex checkbox statistics
  3400. @cindex property, COOKIE_DATA
  3401. @vindex org-hierarchical-checkbox-statistics
  3402. The @samp{[2/4]} and @samp{[1/3]} in the first and second line are cookies
  3403. indicating how many checkboxes present in this entry have been checked off,
  3404. and the total number of checkboxes present. This can give you an idea on how
  3405. many checkboxes remain, even without opening a folded entry. The cookies can
  3406. be placed into a headline or into (the first line of) a plain list item.
  3407. Each cookie covers checkboxes of direct children structurally below the
  3408. headline/item on which the cookie appears@footnote{Set the variable
  3409. @code{org-hierarchical-checkbox-statistics} if you want such cookies to
  3410. represent the all checkboxes below the cookie, not just the direct
  3411. children.}. You have to insert the cookie yourself by typing either
  3412. @samp{[/]} or @samp{[%]}. With @samp{[/]} you get an @samp{n out of m}
  3413. result, as in the examples above. With @samp{[%]} you get information about
  3414. the percentage of checkboxes checked (in the above example, this would be
  3415. @samp{[50%]} and @samp{[33%]}, respectively). In a headline, a cookie can
  3416. count either checkboxes below the heading or TODO states of children, and it
  3417. will display whatever was changed last. Set the property @code{COOKIE_DATA}
  3418. to either @samp{checkbox} or @samp{todo} to resolve this issue.
  3419. @cindex blocking, of checkboxes
  3420. @cindex checkbox blocking
  3421. @cindex property, ORDERED
  3422. If the current outline node has an @code{ORDERED} property, checkboxes must
  3423. be checked off in sequence, and an error will be thrown if you try to check
  3424. off a box while there are unchecked boxes above it.
  3425. @noindent The following commands work with checkboxes:
  3426. @table @kbd
  3427. @kindex C-c C-c
  3428. @item C-c C-c
  3429. Toggle checkbox status or (with prefix arg) checkbox presence at point. With
  3430. double prefix argument, set it to @samp{[-]}, which is considered to be an
  3431. intermediate state.
  3432. @kindex C-c C-x C-b
  3433. @item C-c C-x C-b
  3434. Toggle checkbox status or (with prefix arg) checkbox presence at point. With
  3435. double prefix argument, set it to @samp{[-]}, which is considered to be an
  3436. intermediate state.
  3437. @itemize @minus
  3438. @item
  3439. If there is an active region, toggle the first checkbox in the region
  3440. and set all remaining boxes to the same status as the first. With a prefix
  3441. arg, add or remove the checkbox for all items in the region.
  3442. @item
  3443. If the cursor is in a headline, toggle checkboxes in the region between
  3444. this headline and the next (so @emph{not} the entire subtree).
  3445. @item
  3446. If there is no active region, just toggle the checkbox at point.
  3447. @end itemize
  3448. @kindex M-S-@key{RET}
  3449. @item M-S-@key{RET}
  3450. Insert a new item with a checkbox.
  3451. This works only if the cursor is already in a plain list item
  3452. (@pxref{Plain lists}).
  3453. @kindex C-c C-x o
  3454. @item C-c C-x o
  3455. @vindex org-track-ordered-property-with-tag
  3456. @cindex property, ORDERED
  3457. Toggle the @code{ORDERED} property of the entry, to toggle if checkboxes must
  3458. be checked off in sequence. A property is used for this behavior because
  3459. this should be local to the current entry, not inherited like a tag.
  3460. However, if you would like to @i{track} the value of this property with a tag
  3461. for better visibility, customize the variable
  3462. @code{org-track-ordered-property-with-tag}.
  3463. @kindex C-c #
  3464. @item C-c #
  3465. Update the statistics cookie in the current outline entry. When called with
  3466. a @kbd{C-u} prefix, update the entire file. Checkbox statistic cookies are
  3467. updated automatically if you toggle checkboxes with @kbd{C-c C-c} and make
  3468. new ones with @kbd{M-S-@key{RET}}. TODO statistics cookies update when
  3469. changing TODO states. If you delete boxes/entries or add/change them by
  3470. hand, use this command to get things back into sync. Or simply toggle any
  3471. entry twice (checkboxes with @kbd{C-c C-c}).
  3472. @end table
  3473. @node Tags, Properties and Columns, TODO Items, Top
  3474. @chapter Tags
  3475. @cindex tags
  3476. @cindex headline tagging
  3477. @cindex matching, tags
  3478. @cindex sparse tree, tag based
  3479. An excellent way to implement labels and contexts for cross-correlating
  3480. information is to assign @i{tags} to headlines. Org mode has extensive
  3481. support for tags.
  3482. @vindex org-tag-faces
  3483. Every headline can contain a list of tags; they occur at the end of the
  3484. headline. Tags are normal words containing letters, numbers, @samp{_}, and
  3485. @samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
  3486. @samp{:work:}. Several tags can be specified, as in @samp{:work:urgent:}.
  3487. Tags will by default be in bold face with the same color as the headline.
  3488. You may specify special faces for specific tags using the variable
  3489. @code{org-tag-faces}, in much the same way as you can for TODO keywords
  3490. (@pxref{Faces for TODO keywords}).
  3491. @menu
  3492. * Tag inheritance:: Tags use the tree structure of the outline
  3493. * Setting tags:: How to assign tags to a headline
  3494. * Tag searches:: Searching for combinations of tags
  3495. @end menu
  3496. @node Tag inheritance, Setting tags, Tags, Tags
  3497. @section Tag inheritance
  3498. @cindex tag inheritance
  3499. @cindex inheritance, of tags
  3500. @cindex sublevels, inclusion into tags match
  3501. @i{Tags} make use of the hierarchical structure of outline trees. If a
  3502. heading has a certain tag, all subheadings will inherit the tag as
  3503. well. For example, in the list
  3504. @example
  3505. * Meeting with the French group :work:
  3506. ** Summary by Frank :boss:notes:
  3507. *** TODO Prepare slides for him :action:
  3508. @end example
  3509. @noindent
  3510. the final heading will have the tags @samp{:work:}, @samp{:boss:},
  3511. @samp{:notes:}, and @samp{:action:} even though the final heading is not
  3512. explicitly marked with those tags. You can also set tags that all entries in
  3513. a file should inherit just as if these tags were defined in a hypothetical
  3514. level zero that surrounds the entire file. Use a line like this@footnote{As
  3515. with all these in-buffer settings, pressing @kbd{C-c C-c} activates any
  3516. changes in the line.}:
  3517. @cindex #+FILETAGS
  3518. @example
  3519. #+FILETAGS: :Peter:Boss:Secret:
  3520. @end example
  3521. @noindent
  3522. @vindex org-use-tag-inheritance
  3523. @vindex org-tags-exclude-from-inheritance
  3524. To limit tag inheritance to specific tags, or to turn it off entirely, use
  3525. the variables @code{org-use-tag-inheritance} and
  3526. @code{org-tags-exclude-from-inheritance}.
  3527. @vindex org-tags-match-list-sublevels
  3528. When a headline matches during a tags search while tag inheritance is turned
  3529. on, all the sublevels in the same tree will (for a simple match form) match
  3530. as well@footnote{This is only true if the search does not involve more
  3531. complex tests including properties (@pxref{Property searches}).}. The list
  3532. of matches may then become very long. If you only want to see the first tags
  3533. match in a subtree, configure the variable
  3534. @code{org-tags-match-list-sublevels} (not recommended).
  3535. @node Setting tags, Tag searches, Tag inheritance, Tags
  3536. @section Setting tags
  3537. @cindex setting tags
  3538. @cindex tags, setting
  3539. @kindex M-@key{TAB}
  3540. Tags can simply be typed into the buffer at the end of a headline.
  3541. After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
  3542. also a special command for inserting tags:
  3543. @table @kbd
  3544. @kindex C-c C-q
  3545. @item C-c C-q
  3546. @cindex completion, of tags
  3547. @vindex org-tags-column
  3548. Enter new tags for the current headline. Org mode will either offer
  3549. completion or a special single-key interface for setting tags, see
  3550. below. After pressing @key{RET}, the tags will be inserted and aligned
  3551. to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
  3552. tags in the current buffer will be aligned to that column, just to make
  3553. things look nice. TAGS are automatically realigned after promotion,
  3554. demotion, and TODO state changes (@pxref{TODO basics}).
  3555. @kindex C-c C-c
  3556. @item C-c C-c
  3557. When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
  3558. @end table
  3559. @vindex org-tag-alist
  3560. Org will support tag insertion based on a @emph{list of tags}. By
  3561. default this list is constructed dynamically, containing all tags
  3562. currently used in the buffer. You may also globally specify a hard list
  3563. of tags with the variable @code{org-tag-alist}. Finally you can set
  3564. the default tags for a given file with lines like
  3565. @cindex #+TAGS
  3566. @example
  3567. #+TAGS: @@work @@home @@tennisclub
  3568. #+TAGS: laptop car pc sailboat
  3569. @end example
  3570. If you have globally defined your preferred set of tags using the
  3571. variable @code{org-tag-alist}, but would like to use a dynamic tag list
  3572. in a specific file, add an empty TAGS option line to that file:
  3573. @example
  3574. #+TAGS:
  3575. @end example
  3576. @vindex org-tag-persistent-alist
  3577. If you have a preferred set of tags that you would like to use in every file,
  3578. in addition to those defined on a per-file basis by TAGS option lines, then
  3579. you may specify a list of tags with the variable
  3580. @code{org-tag-persistent-alist}. You may turn this off on a per-file basis
  3581. by adding a STARTUP option line to that file:
  3582. @example
  3583. #+STARTUP: noptag
  3584. @end example
  3585. By default Org mode uses the standard minibuffer completion facilities for
  3586. entering tags. However, it also implements another, quicker, tag selection
  3587. method called @emph{fast tag selection}. This allows you to select and
  3588. deselect tags with just a single key press. For this to work well you should
  3589. assign unique letters to most of your commonly used tags. You can do this
  3590. globally by configuring the variable @code{org-tag-alist} in your
  3591. @file{.emacs} file. For example, you may find the need to tag many items in
  3592. different files with @samp{:@@home:}. In this case you can set something
  3593. like:
  3594. @lisp
  3595. (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
  3596. @end lisp
  3597. @noindent If the tag is only relevant to the file you are working on, then you
  3598. can instead set the TAGS option line as:
  3599. @example
  3600. #+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
  3601. @end example
  3602. @noindent The tags interface will show the available tags in a splash
  3603. window. If you want to start a new line after a specific tag, insert
  3604. @samp{\n} into the tag list
  3605. @example
  3606. #+TAGS: @@work(w) @@home(h) @@tennisclub(t) \n laptop(l) pc(p)
  3607. @end example
  3608. @noindent or write them in two lines:
  3609. @example
  3610. #+TAGS: @@work(w) @@home(h) @@tennisclub(t)
  3611. #+TAGS: laptop(l) pc(p)
  3612. @end example
  3613. @noindent
  3614. You can also group together tags that are mutually exclusive by using
  3615. braces, as in:
  3616. @example
  3617. #+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
  3618. @end example
  3619. @noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
  3620. and @samp{@@tennisclub} should be selected. Multiple such groups are allowed.
  3621. @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
  3622. these lines to activate any changes.
  3623. @noindent
  3624. To set these mutually exclusive groups in the variable @code{org-tags-alist},
  3625. you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
  3626. of the braces. Similarly, you can use @code{:newline} to indicate a line
  3627. break. The previous example would be set globally by the following
  3628. configuration:
  3629. @lisp
  3630. (setq org-tag-alist '((:startgroup . nil)
  3631. ("@@work" . ?w) ("@@home" . ?h)
  3632. ("@@tennisclub" . ?t)
  3633. (:endgroup . nil)
  3634. ("laptop" . ?l) ("pc" . ?p)))
  3635. @end lisp
  3636. If at least one tag has a selection key then pressing @kbd{C-c C-c} will
  3637. automatically present you with a special interface, listing inherited tags,
  3638. the tags of the current headline, and a list of all valid tags with
  3639. corresponding keys@footnote{Keys will automatically be assigned to tags which
  3640. have no configured keys.}. In this interface, you can use the following
  3641. keys:
  3642. @table @kbd
  3643. @item a-z...
  3644. Pressing keys assigned to tags will add or remove them from the list of
  3645. tags in the current line. Selecting a tag in a group of mutually
  3646. exclusive tags will turn off any other tags from that group.
  3647. @kindex @key{TAB}
  3648. @item @key{TAB}
  3649. Enter a tag in the minibuffer, even if the tag is not in the predefined
  3650. list. You will be able to complete on all tags present in the buffer.
  3651. @kindex @key{SPC}
  3652. @item @key{SPC}
  3653. Clear all tags for this line.
  3654. @kindex @key{RET}
  3655. @item @key{RET}
  3656. Accept the modified set.
  3657. @item C-g
  3658. Abort without installing changes.
  3659. @item q
  3660. If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
  3661. @item !
  3662. Turn off groups of mutually exclusive tags. Use this to (as an
  3663. exception) assign several tags from such a group.
  3664. @item C-c
  3665. Toggle auto-exit after the next change (see below).
  3666. If you are using expert mode, the first @kbd{C-c} will display the
  3667. selection window.
  3668. @end table
  3669. @noindent
  3670. This method lets you assign tags to a headline with very few keys. With
  3671. the above setup, you could clear the current tags and set @samp{@@home},
  3672. @samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
  3673. C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to
  3674. @samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
  3675. alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
  3676. @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
  3677. @key{RET} @key{RET}}.
  3678. @vindex org-fast-tag-selection-single-key
  3679. If you find that most of the time you need only a single key press to
  3680. modify your list of tags, set the variable
  3681. @code{org-fast-tag-selection-single-key}. Then you no longer have to
  3682. press @key{RET} to exit fast tag selection---it will immediately exit
  3683. after the first change. If you then occasionally need more keys, press
  3684. @kbd{C-c} to turn off auto-exit for the current tag selection process
  3685. (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
  3686. C-c}). If you set the variable to the value @code{expert}, the special
  3687. window is not even shown for single-key tag selection, it comes up only
  3688. when you press an extra @kbd{C-c}.
  3689. @vindex org-complete-tags-always-offer-all-agenda-tags
  3690. As said before, when setting tags and @code{org-tag-alist} is nil, then the
  3691. list of tags in the current buffer is used. Normally, this behavior is very
  3692. convenient, except in org remember buffers (@pxref{Remember}), because there
  3693. are no tags that can be calculated dynamically. Here, you most probably want
  3694. to have completion for all tags in all agenda files. This can be done by
  3695. setting @code{org-complete-tags-always-offer-all-agenda-tags} to non-nil in
  3696. those buffers.
  3697. @lisp
  3698. (add-hook 'org-remember-mode-hook
  3699. (lambda ()
  3700. (set (make-local-variable
  3701. 'org-complete-tags-always-offer-all-agenda-tags)
  3702. t)))
  3703. @end lisp
  3704. Of course, you can also set it to @code{t} globally if you always want to
  3705. have completion of all tags in all agenda files.
  3706. @node Tag searches, , Setting tags, Tags
  3707. @section Tag searches
  3708. @cindex tag searches
  3709. @cindex searching for tags
  3710. Once a system of tags has been set up, it can be used to collect related
  3711. information into special lists.
  3712. @table @kbd
  3713. @kindex C-c \
  3714. @kindex C-c / m
  3715. @item C-c \
  3716. @itemx C-c / m
  3717. Create a sparse tree with all headlines matching a tags search. With a
  3718. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  3719. @kindex C-c a m
  3720. @item C-c a m
  3721. Create a global list of tag matches from all agenda files.
  3722. @xref{Matching tags and properties}.
  3723. @kindex C-c a M
  3724. @item C-c a M
  3725. @vindex org-tags-match-list-sublevels
  3726. Create a global list of tag matches from all agenda files, but check
  3727. only TODO items and force checking subitems (see variable
  3728. @code{org-tags-match-list-sublevels}).
  3729. @end table
  3730. These commands all prompt for a match string which allows basic Boolean logic
  3731. like @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and
  3732. @samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entries
  3733. which are tagged, like @samp{Kathy} or @samp{Sally}. The full syntax of the search
  3734. string is rich and allows also matching against TODO keywords, entry levels
  3735. and properties. For a complete description with many examples, see
  3736. @ref{Matching tags and properties}.
  3737. @node Properties and Columns, Dates and Times, Tags, Top
  3738. @chapter Properties and Columns
  3739. @cindex properties
  3740. Properties are a set of key-value pairs associated with an entry. There
  3741. are two main applications for properties in Org mode. First, properties
  3742. are like tags, but with a value. Second, you can use properties to
  3743. implement (very basic) database capabilities in an Org buffer. For
  3744. an example of the first application, imagine maintaining a file where
  3745. you document bugs and plan releases for a piece of software. Instead of
  3746. using tags like @code{:release_1:}, @code{:release_2:}, one can use a
  3747. property, say @code{:Release:}, that in different subtrees has different
  3748. values, such as @code{1.0} or @code{2.0}. For an example of the second
  3749. application of properties, imagine keeping track of your music CDs,
  3750. where properties could be things such as the album, artist, date of
  3751. release, number of tracks, and so on.
  3752. Properties can be conveniently edited and viewed in column view
  3753. (@pxref{Column view}).
  3754. @menu
  3755. * Property syntax:: How properties are spelled out
  3756. * Special properties:: Access to other Org mode features
  3757. * Property searches:: Matching property values
  3758. * Property inheritance:: Passing values down the tree
  3759. * Column view:: Tabular viewing and editing
  3760. * Property API:: Properties for Lisp programmers
  3761. @end menu
  3762. @node Property syntax, Special properties, Properties and Columns, Properties and Columns
  3763. @section Property syntax
  3764. @cindex property syntax
  3765. @cindex drawer, for properties
  3766. Properties are key-value pairs. They need to be inserted into a special
  3767. drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
  3768. is specified on a single line, with the key (surrounded by colons)
  3769. first, and the value after it. Here is an example:
  3770. @example
  3771. * CD collection
  3772. ** Classic
  3773. *** Goldberg Variations
  3774. :PROPERTIES:
  3775. :Title: Goldberg Variations
  3776. :Composer: J.S. Bach
  3777. :Artist: Glen Gould
  3778. :Publisher: Deutsche Grammophon
  3779. :NDisks: 1
  3780. :END:
  3781. @end example
  3782. You may define the allowed values for a particular property @samp{:Xyz:}
  3783. by setting a property @samp{:Xyz_ALL:}. This special property is
  3784. @emph{inherited}, so if you set it in a level 1 entry, it will apply to
  3785. the entire tree. When allowed values are defined, setting the
  3786. corresponding property becomes easier and is less prone to typing
  3787. errors. For the example with the CD collection, we can predefine
  3788. publishers and the number of disks in a box like this:
  3789. @example
  3790. * CD collection
  3791. :PROPERTIES:
  3792. :NDisks_ALL: 1 2 3 4
  3793. :Publisher_ALL: "Deutsche Grammophon" Philips EMI
  3794. :END:
  3795. @end example
  3796. If you want to set properties that can be inherited by any entry in a
  3797. file, use a line like
  3798. @cindex property, _ALL
  3799. @cindex #+PROPERTY
  3800. @example
  3801. #+PROPERTY: NDisks_ALL 1 2 3 4
  3802. @end example
  3803. @vindex org-global-properties
  3804. Property values set with the global variable
  3805. @code{org-global-properties} can be inherited by all entries in all
  3806. Org files.
  3807. @noindent
  3808. The following commands help to work with properties:
  3809. @table @kbd
  3810. @kindex M-@key{TAB}
  3811. @item M-@key{TAB}
  3812. After an initial colon in a line, complete property keys. All keys used
  3813. in the current file will be offered as possible completions.
  3814. @kindex C-c C-x p
  3815. @item C-c C-x p
  3816. Set a property. This prompts for a property name and a value. If
  3817. necessary, the property drawer is created as well.
  3818. @item M-x org-insert-property-drawer
  3819. Insert a property drawer into the current entry. The drawer will be
  3820. inserted early in the entry, but after the lines with planning
  3821. information like deadlines.
  3822. @kindex C-c C-c
  3823. @item C-c C-c
  3824. With the cursor in a property drawer, this executes property commands.
  3825. @item C-c C-c s
  3826. Set a property in the current entry. Both the property and the value
  3827. can be inserted using completion.
  3828. @kindex S-@key{right}
  3829. @kindex S-@key{left}
  3830. @item S-@key{left}/@key{right}
  3831. Switch property at point to the next/previous allowed value.
  3832. @item C-c C-c d
  3833. Remove a property from the current entry.
  3834. @item C-c C-c D
  3835. Globally remove a property, from all entries in the current file.
  3836. @item C-c C-c c
  3837. Compute the property at point, using the operator and scope from the
  3838. nearest column format definition.
  3839. @end table
  3840. @node Special properties, Property searches, Property syntax, Properties and Columns
  3841. @section Special properties
  3842. @cindex properties, special
  3843. Special properties provide an alternative access method to Org mode
  3844. features, like the TODO state or the priority of an entry, discussed in the
  3845. previous chapters. This interface exists so that you can include
  3846. these states in a column view (@pxref{Column view}), or to use them in
  3847. queries. The following property names are special and should not be
  3848. used as keys in the properties drawer:
  3849. @cindex property, special, TODO
  3850. @cindex property, special, TAGS
  3851. @cindex property, special, ALLTAGS
  3852. @cindex property, special, CATEGORY
  3853. @cindex property, special, PRIORITY
  3854. @cindex property, special, DEADLINE
  3855. @cindex property, special, SCHEDULED
  3856. @cindex property, special, CLOSED
  3857. @cindex property, special, TIMESTAMP
  3858. @cindex property, special, TIMESTAMP_IA
  3859. @cindex property, special, CLOCKSUM
  3860. @c guessing that ITEM is needed in this area; also, should this list be sorted?
  3861. @cindex property, special, ITEM
  3862. @example
  3863. TODO @r{The TODO keyword of the entry.}
  3864. TAGS @r{The tags defined directly in the headline.}
  3865. ALLTAGS @r{All tags, including inherited ones.}
  3866. CATEGORY @r{The category of an entry.}
  3867. PRIORITY @r{The priority of the entry, a string with a single letter.}
  3868. DEADLINE @r{The deadline time string, without the angular brackets.}
  3869. SCHEDULED @r{The scheduling timestamp, without the angular brackets.}
  3870. CLOSED @r{When was this entry closed?}
  3871. TIMESTAMP @r{The first keyword-less timestamp in the entry.}
  3872. TIMESTAMP_IA @r{The first inactive timestamp in the entry.}
  3873. CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
  3874. @r{must be run first to compute the values.}
  3875. ITEM @r{The content of the entry.}
  3876. @end example
  3877. @node Property searches, Property inheritance, Special properties, Properties and Columns
  3878. @section Property searches
  3879. @cindex properties, searching
  3880. @cindex searching, of properties
  3881. To create sparse trees and special lists with selection based on properties,
  3882. the same commands are used as for tag searches (@pxref{Tag searches}).
  3883. @table @kbd
  3884. @kindex C-c \
  3885. @kindex C-c / m
  3886. @item C-c \
  3887. @itemx C-c / m
  3888. Create a sparse tree with all matching entries. With a
  3889. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  3890. @kindex C-c a m
  3891. @item C-c a m
  3892. Create a global list of tag/property matches from all agenda files.
  3893. @xref{Matching tags and properties}.
  3894. @kindex C-c a M
  3895. @item C-c a M
  3896. @vindex org-tags-match-list-sublevels
  3897. Create a global list of tag matches from all agenda files, but check
  3898. only TODO items and force checking of subitems (see variable
  3899. @code{org-tags-match-list-sublevels}).
  3900. @end table
  3901. The syntax for the search string is described in @ref{Matching tags and
  3902. properties}.
  3903. There is also a special command for creating sparse trees based on a
  3904. single property:
  3905. @table @kbd
  3906. @kindex C-c / p
  3907. @item C-c / p
  3908. Create a sparse tree based on the value of a property. This first
  3909. prompts for the name of a property, and then for a value. A sparse tree
  3910. is created with all entries that define this property with the given
  3911. value. If you enclose the value into curly braces, it is interpreted as
  3912. a regular expression and matched against the property values.
  3913. @end table
  3914. @node Property inheritance, Column view, Property searches, Properties and Columns
  3915. @section Property Inheritance
  3916. @cindex properties, inheritance
  3917. @cindex inheritance, of properties
  3918. @vindex org-use-property-inheritance
  3919. The outline structure of Org-mode documents lends itself for an
  3920. inheritance model of properties: if the parent in a tree has a certain
  3921. property, the children can inherit this property. Org mode does not
  3922. turn this on by default, because it can slow down property searches
  3923. significantly and is often not needed. However, if you find inheritance
  3924. useful, you can turn it on by setting the variable
  3925. @code{org-use-property-inheritance}. It may be set to @code{t} to make
  3926. all properties inherited from the parent, to a list of properties
  3927. that should be inherited, or to a regular expression that matches
  3928. inherited properties.
  3929. Org mode has a few properties for which inheritance is hard-coded, at
  3930. least for the special applications for which they are used:
  3931. @cindex property, COLUMNS
  3932. @table @code
  3933. @item COLUMNS
  3934. The @code{:COLUMNS:} property defines the format of column view
  3935. (@pxref{Column view}). It is inherited in the sense that the level
  3936. where a @code{:COLUMNS:} property is defined is used as the starting
  3937. point for a column view table, independently of the location in the
  3938. subtree from where columns view is turned on.
  3939. @item CATEGORY
  3940. @cindex property, CATEGORY
  3941. For agenda view, a category set through a @code{:CATEGORY:} property
  3942. applies to the entire subtree.
  3943. @item ARCHIVE
  3944. @cindex property, ARCHIVE
  3945. For archiving, the @code{:ARCHIVE:} property may define the archive
  3946. location for the entire subtree (@pxref{Moving subtrees}).
  3947. @item LOGGING
  3948. @cindex property, LOGGING
  3949. The LOGGING property may define logging settings for an entry or a
  3950. subtree (@pxref{Tracking TODO state changes}).
  3951. @end table
  3952. @node Column view, Property API, Property inheritance, Properties and Columns
  3953. @section Column view
  3954. A great way to view and edit properties in an outline tree is
  3955. @emph{column view}. In column view, each outline node is turned into a
  3956. table row. Columns in this table provide access to properties of the
  3957. entries. Org mode implements columns by overlaying a tabular structure
  3958. over the headline of each item. While the headlines have been turned
  3959. into a table row, you can still change the visibility of the outline
  3960. tree. For example, you get a compact table by switching to CONTENTS
  3961. view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
  3962. is active), but you can still open, read, and edit the entry below each
  3963. headline. Or, you can switch to column view after executing a sparse
  3964. tree command and in this way get a table only for the selected items.
  3965. Column view also works in agenda buffers (@pxref{Agenda Views}) where
  3966. queries have collected selected items, possibly from a number of files.
  3967. @menu
  3968. * Defining columns:: The COLUMNS format property
  3969. * Using column view:: How to create and use column view
  3970. * Capturing column view:: A dynamic block for column view
  3971. @end menu
  3972. @node Defining columns, Using column view, Column view, Column view
  3973. @subsection Defining columns
  3974. @cindex column view, for properties
  3975. @cindex properties, column view
  3976. Setting up a column view first requires defining the columns. This is
  3977. done by defining a column format line.
  3978. @menu
  3979. * Scope of column definitions:: Where defined, where valid?
  3980. * Column attributes:: Appearance and content of a column
  3981. @end menu
  3982. @node Scope of column definitions, Column attributes, Defining columns, Defining columns
  3983. @subsubsection Scope of column definitions
  3984. To define a column format for an entire file, use a line like
  3985. @cindex #+COLUMNS
  3986. @example
  3987. #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3988. @end example
  3989. To specify a format that only applies to a specific tree, add a
  3990. @code{:COLUMNS:} property to the top node of that tree, for example:
  3991. @example
  3992. ** Top node for columns view
  3993. :PROPERTIES:
  3994. :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3995. :END:
  3996. @end example
  3997. If a @code{:COLUMNS:} property is present in an entry, it defines columns
  3998. for the entry itself, and for the entire subtree below it. Since the
  3999. column definition is part of the hierarchical structure of the document,
  4000. you can define columns on level 1 that are general enough for all
  4001. sublevels, and more specific columns further down, when you edit a
  4002. deeper part of the tree.
  4003. @node Column attributes, , Scope of column definitions, Defining columns
  4004. @subsubsection Column attributes
  4005. A column definition sets the attributes of a column. The general
  4006. definition looks like this:
  4007. @example
  4008. %[@var{width}]@var{property}[(@var{title})][@{@var{summary-type}@}]
  4009. @end example
  4010. @noindent
  4011. Except for the percent sign and the property name, all items are
  4012. optional. The individual parts have the following meaning:
  4013. @example
  4014. @var{width} @r{An integer specifying the width of the column in characters.}
  4015. @r{If omitted, the width will be determined automatically.}
  4016. @var{property} @r{The property that should be edited in this column.}
  4017. @r{Special properties representing meta data are allowed here}
  4018. @r{as well (@pxref{Special properties})}
  4019. (title) @r{The header text for the column. If omitted, the}
  4020. @r{property name is used.}
  4021. @{@var{summary-type}@} @r{The summary type. If specified, the column values for}
  4022. @r{parent nodes are computed from the children.}
  4023. @r{Supported summary types are:}
  4024. @{+@} @r{Sum numbers in this column.}
  4025. @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.}
  4026. @{$@} @r{Currency, short for @samp{+;%.2f}.}
  4027. @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
  4028. @{X@} @r{Checkbox status, @samp{[X]} if all children are @samp{[X]}.}
  4029. @{X/@} @r{Checkbox status, @samp{[n/m]}.}
  4030. @{X%@} @r{Checkbox status, @samp{[n%]}.}
  4031. @{min@} @r{Smallest number in column.}
  4032. @{max@} @r{Largest number.}
  4033. @{mean@} @r{Arithmetic mean of numbers.}
  4034. @{:min@} @r{Smallest time value in column.}
  4035. @{:max@} @r{Largest time value.}
  4036. @{:mean@} @r{Arithmetic mean of time values.}
  4037. @{@@min@} @r{Minimum age (in days/hours/mins/seconds).}
  4038. @{@@max@} @r{Maximum age (in days/hours/mins/seconds).}
  4039. @{@@mean@} @r{Arithmetic mean of ages (in days/hours/mins/seconds).}
  4040. @end example
  4041. @noindent
  4042. Be aware that you can only have one summary type for any property you
  4043. include. Subsequent columns referencing the same property will all display the
  4044. same summary information.
  4045. Here is an example for a complete columns definition, along with allowed
  4046. values.
  4047. @example
  4048. :COLUMNS: %25ITEM %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.}
  4049. %10Time_Estimate@{:@} %CLOCKSUM
  4050. :Owner_ALL: Tammy Mark Karl Lisa Don
  4051. :Status_ALL: "In progress" "Not started yet" "Finished" ""
  4052. :Approved_ALL: "[ ]" "[X]"
  4053. @end example
  4054. @noindent
  4055. The first column, @samp{%25ITEM}, means the first 25 characters of the
  4056. item itself, i.e. of the headline. You probably always should start the
  4057. column definition with the @samp{ITEM} specifier. The other specifiers
  4058. create columns @samp{Owner} with a list of names as allowed values, for
  4059. @samp{Status} with four different possible values, and for a checkbox
  4060. field @samp{Approved}. When no width is given after the @samp{%}
  4061. character, the column will be exactly as wide as it needs to be in order
  4062. to fully display all values. The @samp{Approved} column does have a
  4063. modified title (@samp{Approved?}, with a question mark). Summaries will
  4064. be created for the @samp{Time_Estimate} column by adding time duration
  4065. expressions like HH:MM, and for the @samp{Approved} column, by providing
  4066. an @samp{[X]} status if all children have been checked. The
  4067. @samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
  4068. in the subtree.
  4069. @node Using column view, Capturing column view, Defining columns, Column view
  4070. @subsection Using column view
  4071. @table @kbd
  4072. @tsubheading{Turning column view on and off}
  4073. @kindex C-c C-x C-c
  4074. @item C-c C-x C-c
  4075. @vindex org-columns-default-format
  4076. Turn on column view. If the cursor is before the first headline in the file,
  4077. column view is turned on for the entire file, using the @code{#+COLUMNS}
  4078. definition. If the cursor is somewhere inside the outline, this command
  4079. searches the hierarchy, up from point, for a @code{:COLUMNS:} property that
  4080. defines a format. When one is found, the column view table is established
  4081. for the tree starting at the entry that contains the @code{:COLUMNS:}
  4082. property. If no such property is found, the format is taken from the
  4083. @code{#+COLUMNS} line or from the variable @code{org-columns-default-format},
  4084. and column view is established for the current entry and its subtree.
  4085. @kindex r
  4086. @item r
  4087. Recreate the column view, to include recent changes made in the buffer.
  4088. @kindex g
  4089. @item g
  4090. Same as @kbd{r}.
  4091. @kindex q
  4092. @item q
  4093. Exit column view.
  4094. @tsubheading{Editing values}
  4095. @item @key{left} @key{right} @key{up} @key{down}
  4096. Move through the column view from field to field.
  4097. @kindex S-@key{left}
  4098. @kindex S-@key{right}
  4099. @item S-@key{left}/@key{right}
  4100. Switch to the next/previous allowed value of the field. For this, you
  4101. have to have specified allowed values for a property.
  4102. @item 1..9,0
  4103. Directly select the nth allowed value, @kbd{0} selects the 10th value.
  4104. @kindex n
  4105. @kindex p
  4106. @itemx n / p
  4107. Same as @kbd{S-@key{left}/@key{right}}
  4108. @kindex e
  4109. @item e
  4110. Edit the property at point. For the special properties, this will
  4111. invoke the same interface that you normally use to change that
  4112. property. For example, when editing a TAGS property, the tag completion
  4113. or fast selection interface will pop up.
  4114. @kindex C-c C-c
  4115. @item C-c C-c
  4116. When there is a checkbox at point, toggle it.
  4117. @kindex v
  4118. @item v
  4119. View the full value of this property. This is useful if the width of
  4120. the column is smaller than that of the value.
  4121. @kindex a
  4122. @item a
  4123. Edit the list of allowed values for this property. If the list is found
  4124. in the hierarchy, the modified values is stored there. If no list is
  4125. found, the new value is stored in the first entry that is part of the
  4126. current column view.
  4127. @tsubheading{Modifying the table structure}
  4128. @kindex <
  4129. @kindex >
  4130. @item < / >
  4131. Make the column narrower/wider by one character.
  4132. @kindex S-M-@key{right}
  4133. @item S-M-@key{right}
  4134. Insert a new column, to the left of the current column.
  4135. @kindex S-M-@key{left}
  4136. @item S-M-@key{left}
  4137. Delete the current column.
  4138. @end table
  4139. @node Capturing column view, , Using column view, Column view
  4140. @subsection Capturing column view
  4141. Since column view is just an overlay over a buffer, it cannot be
  4142. exported or printed directly. If you want to capture a column view, use
  4143. a @code{columnview} dynamic block (@pxref{Dynamic blocks}). The frame
  4144. of this block looks like this:
  4145. @cindex #+BEGIN, columnview
  4146. @example
  4147. * The column view
  4148. #+BEGIN: columnview :hlines 1 :id "label"
  4149. #+END:
  4150. @end example
  4151. @noindent This dynamic block has the following parameters:
  4152. @table @code
  4153. @item :id
  4154. This is the most important parameter. Column view is a feature that is
  4155. often localized to a certain (sub)tree, and the capture block might be
  4156. at a different location in the file. To identify the tree whose view to
  4157. capture, you can use 4 values:
  4158. @cindex property, ID
  4159. @example
  4160. local @r{use the tree in which the capture block is located}
  4161. global @r{make a global view, including all headings in the file}
  4162. "file:@var{path-to-file}"
  4163. @r{run column view at the top of this file}
  4164. "@var{ID}" @r{call column view in the tree that has an @code{:ID:}}
  4165. @r{property with the value @i{label}. You can use}
  4166. @r{@kbd{M-x org-id-copy} to create a globally unique ID for}
  4167. @r{the current entry and copy it to the kill-ring.}
  4168. @end example
  4169. @item :hlines
  4170. When @code{t}, insert an hline after every line. When a number @var{N}, insert
  4171. an hline before each headline with level @code{<= @var{N}}.
  4172. @item :vlines
  4173. When set to @code{t}, force column groups to get vertical lines.
  4174. @item :maxlevel
  4175. When set to a number, don't capture entries below this level.
  4176. @item :skip-empty-rows
  4177. When set to @code{t}, skip rows where the only non-empty specifier of the
  4178. column view is @code{ITEM}.
  4179. @end table
  4180. @noindent
  4181. The following commands insert or update the dynamic block:
  4182. @table @kbd
  4183. @kindex C-c C-x i
  4184. @item C-c C-x i
  4185. Insert a dynamic block capturing a column view. You will be prompted
  4186. for the scope or ID of the view.
  4187. @kindex C-c C-c
  4188. @item C-c C-c
  4189. @kindex C-c C-x C-u
  4190. @itemx C-c C-x C-u
  4191. Update dynamic block at point. The cursor needs to be in the
  4192. @code{#+BEGIN} line of the dynamic block.
  4193. @kindex C-u C-c C-x C-u
  4194. @item C-u C-c C-x C-u
  4195. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  4196. you have several clock table blocks in a buffer.
  4197. @end table
  4198. You can add formulas to the column view table and you may add plotting
  4199. instructions in front of the table---these will survive an update of the
  4200. block. If there is a @code{#+TBLFM:} after the table, the table will
  4201. actually be recalculated automatically after an update.
  4202. An alternative way to capture and process property values into a table is
  4203. provided by Eric Schulte's @file{org-collector.el} which is a contributed
  4204. package@footnote{Contributed packages are not part of Emacs, but are
  4205. distributed with the main distribution of Org (visit
  4206. @uref{http://orgmode.org}).}. It provides a general API to collect
  4207. properties from entries in a certain scope, and arbitrary Lisp expressions to
  4208. process these values before inserting them into a table or a dynamic block.
  4209. @node Property API, , Column view, Properties and Columns
  4210. @section The Property API
  4211. @cindex properties, API
  4212. @cindex API, for properties
  4213. There is a full API for accessing and changing properties. This API can
  4214. be used by Emacs Lisp programs to work with properties and to implement
  4215. features based on them. For more information see @ref{Using the
  4216. property API}.
  4217. @node Dates and Times, Capture - Refile - Archive, Properties and Columns, Top
  4218. @chapter Dates and Times
  4219. @cindex dates
  4220. @cindex times
  4221. @cindex timestamp
  4222. @cindex date stamp
  4223. To assist project planning, TODO items can be labeled with a date and/or
  4224. a time. The specially formatted string carrying the date and time
  4225. information is called a @emph{timestamp} in Org mode. This may be a
  4226. little confusing because timestamp is often used as indicating when
  4227. something was created or last changed. However, in Org mode this term
  4228. is used in a much wider sense.
  4229. @menu
  4230. * Timestamps:: Assigning a time to a tree entry
  4231. * Creating timestamps:: Commands which insert timestamps
  4232. * Deadlines and scheduling:: Planning your work
  4233. * Clocking work time:: Tracking how long you spend on a task
  4234. * Resolving idle time:: Resolving time if you've been idle
  4235. * Effort estimates:: Planning work effort in advance
  4236. * Relative timer:: Notes with a running timer
  4237. @end menu
  4238. @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
  4239. @section Timestamps, deadlines, and scheduling
  4240. @cindex timestamps
  4241. @cindex ranges, time
  4242. @cindex date stamps
  4243. @cindex deadlines
  4244. @cindex scheduling
  4245. A timestamp is a specification of a date (possibly with a time or a range of
  4246. times) in a special format, either @samp{<2003-09-16 Tue>} or
  4247. @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
  4248. 12:00-12:30>}@footnote{This is inspired by the standard ISO 6801 date/time
  4249. format. To use an alternative format, see @ref{Custom time format}.}. A
  4250. timestamp can appear anywhere in the headline or body of an Org tree entry.
  4251. Its presence causes entries to be shown on specific dates in the agenda
  4252. (@pxref{Weekly/daily agenda}). We distinguish:
  4253. @table @var
  4254. @item Plain timestamp; Event; Appointment
  4255. @cindex timestamp
  4256. A simple timestamp just assigns a date/time to an item. This is just
  4257. like writing down an appointment or event in a paper agenda. In the
  4258. timeline and agenda displays, the headline of an entry associated with a
  4259. plain timestamp will be shown exactly on that date.
  4260. @example
  4261. * Meet Peter at the movies <2006-11-01 Wed 19:15>
  4262. * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
  4263. @end example
  4264. @item Timestamp with repeater interval
  4265. @cindex timestamp, with repeater interval
  4266. A timestamp may contain a @emph{repeater interval}, indicating that it
  4267. applies not only on the given date, but again and again after a certain
  4268. interval of N days (d), weeks (w), months (m), or years (y). The
  4269. following will show up in the agenda every Wednesday:
  4270. @example
  4271. * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
  4272. @end example
  4273. @item Diary-style sexp entries
  4274. For more complex date specifications, Org mode supports using the
  4275. special sexp diary entries implemented in the Emacs calendar/diary
  4276. package. For example
  4277. @example
  4278. * The nerd meeting on every 2nd Thursday of the month
  4279. <%%(diary-float t 4 2)>
  4280. @end example
  4281. @item Time/Date range
  4282. @cindex timerange
  4283. @cindex date range
  4284. Two timestamps connected by @samp{--} denote a range. The headline
  4285. will be shown on the first and last day of the range, and on any dates
  4286. that are displayed and fall in the range. Here is an example:
  4287. @example
  4288. ** Meeting in Amsterdam
  4289. <2004-08-23 Mon>--<2004-08-26 Thu>
  4290. @end example
  4291. @item Inactive timestamp
  4292. @cindex timestamp, inactive
  4293. @cindex inactive timestamp
  4294. Just like a plain timestamp, but with square brackets instead of
  4295. angular ones. These timestamps are inactive in the sense that they do
  4296. @emph{not} trigger an entry to show up in the agenda.
  4297. @example
  4298. * Gillian comes late for the fifth time [2006-11-01 Wed]
  4299. @end example
  4300. @end table
  4301. @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
  4302. @section Creating timestamps
  4303. @cindex creating timestamps
  4304. @cindex timestamps, creating
  4305. For Org mode to recognize timestamps, they need to be in the specific
  4306. format. All commands listed below produce timestamps in the correct
  4307. format.
  4308. @table @kbd
  4309. @kindex C-c .
  4310. @item C-c .
  4311. Prompt for a date and insert a corresponding timestamp. When the cursor is
  4312. at an existing timestamp in the buffer, the command is used to modify this
  4313. timestamp instead of inserting a new one. When this command is used twice in
  4314. succession, a time range is inserted.
  4315. @c
  4316. @kindex C-c !
  4317. @item C-c !
  4318. Like @kbd{C-c .}, but insert an inactive timestamp that will not cause
  4319. an agenda entry.
  4320. @c
  4321. @kindex C-u C-c .
  4322. @kindex C-u C-c !
  4323. @item C-u C-c .
  4324. @itemx C-u C-c !
  4325. @vindex org-time-stamp-rounding-minutes
  4326. Like @kbd{C-c .} and @kbd{C-c !}, but use the alternative format which
  4327. contains date and time. The default time can be rounded to multiples of 5
  4328. minutes, see the option @code{org-time-stamp-rounding-minutes}.
  4329. @c
  4330. @kindex C-c <
  4331. @item C-c <
  4332. Insert a timestamp corresponding to the cursor date in the Calendar.
  4333. @c
  4334. @kindex C-c >
  4335. @item C-c >
  4336. Access the Emacs calendar for the current date. If there is a
  4337. timestamp in the current line, go to the corresponding date
  4338. instead.
  4339. @c
  4340. @kindex C-c C-o
  4341. @item C-c C-o
  4342. Access the agenda for the date given by the timestamp or -range at
  4343. point (@pxref{Weekly/daily agenda}).
  4344. @c
  4345. @kindex S-@key{left}
  4346. @kindex S-@key{right}
  4347. @item S-@key{left}
  4348. @itemx S-@key{right}
  4349. Change date at cursor by one day. These key bindings conflict with
  4350. shift-selection and related modes (@pxref{Conflicts}).
  4351. @c
  4352. @kindex S-@key{up}
  4353. @kindex S-@key{down}
  4354. @item S-@key{up}
  4355. @itemx S-@key{down}
  4356. Change the item under the cursor in a timestamp. The cursor can be on a
  4357. year, month, day, hour or minute. When the timestamp contains a time range
  4358. like @samp{15:30-16:30}, modifying the first time will also shift the second,
  4359. shifting the time block with constant length. To change the length, modify
  4360. the second time. Note that if the cursor is in a headline and not at a
  4361. timestamp, these same keys modify the priority of an item.
  4362. (@pxref{Priorities}). The key bindings also conflict with shift-selection and
  4363. related modes (@pxref{Conflicts}).
  4364. @c
  4365. @kindex C-c C-y
  4366. @cindex evaluate time range
  4367. @item C-c C-y
  4368. Evaluate a time range by computing the difference between start and end.
  4369. With a prefix argument, insert result after the time range (in a table: into
  4370. the following column).
  4371. @end table
  4372. @menu
  4373. * The date/time prompt:: How Org mode helps you entering date and time
  4374. * Custom time format:: Making dates look different
  4375. @end menu
  4376. @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
  4377. @subsection The date/time prompt
  4378. @cindex date, reading in minibuffer
  4379. @cindex time, reading in minibuffer
  4380. @vindex org-read-date-prefer-future
  4381. When Org mode prompts for a date/time, the default is shown in default
  4382. date/time format, and the prompt therefore seems to ask for a specific
  4383. format. But it will in fact accept any string containing some date and/or
  4384. time information, and it is really smart about interpreting your input. You
  4385. can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
  4386. copied from an email message. Org mode will find whatever information is in
  4387. there and derive anything you have not specified from the @emph{default date
  4388. and time}. The default is usually the current date and time, but when
  4389. modifying an existing timestamp, or when entering the second stamp of a
  4390. range, it is taken from the stamp in the buffer. When filling in
  4391. information, Org mode assumes that most of the time you will want to enter a
  4392. date in the future: if you omit the month/year and the given day/month is
  4393. @i{before} today, it will assume that you mean a future date@footnote{See the
  4394. variable @code{org-read-date-prefer-future}. You may set that variable to
  4395. the symbol @code{time} to even make a time before now shift the date to
  4396. tomorrow.}. If the date has been automatically shifted into the future, the
  4397. time prompt will show this with @samp{(=>F).}
  4398. For example, let's assume that today is @b{June 13, 2006}. Here is how
  4399. various inputs will be interpreted, the items filled in by Org mode are
  4400. in @b{bold}.
  4401. @example
  4402. 3-2-5 --> 2003-02-05
  4403. 14 --> @b{2006}-@b{06}-14
  4404. 12 --> @b{2006}-@b{07}-12
  4405. Fri --> nearest Friday (defaultdate or later)
  4406. sep 15 --> @b{2006}-09-15
  4407. feb 15 --> @b{2007}-02-15
  4408. sep 12 9 --> 2009-09-12
  4409. 12:45 --> @b{2006}-@b{06}-@b{13} 12:45
  4410. 22 sept 0:34 --> @b{2006}-09-22 0:34
  4411. w4 --> ISO week for of the current year @b{2006}
  4412. 2012 w4 fri --> Friday of ISO week 4 in 2012
  4413. 2012-w04-5 --> Same as above
  4414. @end example
  4415. Furthermore you can specify a relative date by giving, as the
  4416. @emph{first} thing in the input: a plus/minus sign, a number and a
  4417. letter ([dwmy]) to indicate change in days, weeks, months, or years. With a
  4418. single plus or minus, the date is always relative to today. With a
  4419. double plus or minus, it is relative to the default date. If instead of
  4420. a single letter, you use the abbreviation of day name, the date will be
  4421. the nth such day. E.g.
  4422. @example
  4423. +0 --> today
  4424. . --> today
  4425. +4d --> four days from today
  4426. +4 --> same as above
  4427. +2w --> two weeks from today
  4428. ++5 --> five days from default date
  4429. +2tue --> second Tuesday from now.
  4430. @end example
  4431. @vindex parse-time-months
  4432. @vindex parse-time-weekdays
  4433. The function understands English month and weekday abbreviations. If
  4434. you want to use unabbreviated names and/or other languages, configure
  4435. the variables @code{parse-time-months} and @code{parse-time-weekdays}.
  4436. @cindex calendar, for selecting date
  4437. @vindex org-popup-calendar-for-date-prompt
  4438. Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
  4439. you don't need/want the calendar, configure the variable
  4440. @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
  4441. prompt, either by clicking on a date in the calendar, or by pressing
  4442. @key{RET}, the date selected in the calendar will be combined with the
  4443. information entered at the prompt. You can control the calendar fully
  4444. from the minibuffer:
  4445. @kindex <
  4446. @kindex >
  4447. @kindex mouse-1
  4448. @kindex S-@key{right}
  4449. @kindex S-@key{left}
  4450. @kindex S-@key{down}
  4451. @kindex S-@key{up}
  4452. @kindex M-S-@key{right}
  4453. @kindex M-S-@key{left}
  4454. @kindex @key{RET}
  4455. @example
  4456. > / < @r{Scroll calendar forward/backward by one month.}
  4457. mouse-1 @r{Select date by clicking on it.}
  4458. S-@key{right}/@key{left} @r{One day forward/backward.}
  4459. S-@key{down}/@key{up} @r{One week forward/backward.}
  4460. M-S-@key{right}/@key{left} @r{One month forward/backward.}
  4461. @key{RET} @r{Choose date in calendar.}
  4462. @end example
  4463. @vindex org-read-date-display-live
  4464. The actions of the date/time prompt may seem complex, but I assure you they
  4465. will grow on you, and you will start getting annoyed by pretty much any other
  4466. way of entering a date/time out there. To help you understand what is going
  4467. on, the current interpretation of your input will be displayed live in the
  4468. minibuffer@footnote{If you find this distracting, turn the display of with
  4469. @code{org-read-date-display-live}.}.
  4470. @node Custom time format, , The date/time prompt, Creating timestamps
  4471. @subsection Custom time format
  4472. @cindex custom date/time format
  4473. @cindex time format, custom
  4474. @cindex date format, custom
  4475. @vindex org-display-custom-times
  4476. @vindex org-time-stamp-custom-formats
  4477. Org mode uses the standard ISO notation for dates and times as it is
  4478. defined in ISO 8601. If you cannot get used to this and require another
  4479. representation of date and time to keep you happy, you can get it by
  4480. customizing the variables @code{org-display-custom-times} and
  4481. @code{org-time-stamp-custom-formats}.
  4482. @table @kbd
  4483. @kindex C-c C-x C-t
  4484. @item C-c C-x C-t
  4485. Toggle the display of custom formats for dates and times.
  4486. @end table
  4487. @noindent
  4488. Org mode needs the default format for scanning, so the custom date/time
  4489. format does not @emph{replace} the default format---instead it is put
  4490. @emph{over} the default format using text properties. This has the
  4491. following consequences:
  4492. @itemize @bullet
  4493. @item
  4494. You cannot place the cursor onto a timestamp anymore, only before or
  4495. after.
  4496. @item
  4497. The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
  4498. each component of a timestamp. If the cursor is at the beginning of
  4499. the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
  4500. just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
  4501. time will be changed by one minute.
  4502. @item
  4503. If the timestamp contains a range of clock times or a repeater, these
  4504. will not be overlayed, but remain in the buffer as they were.
  4505. @item
  4506. When you delete a timestamp character-by-character, it will only
  4507. disappear from the buffer after @emph{all} (invisible) characters
  4508. belonging to the ISO timestamp have been removed.
  4509. @item
  4510. If the custom timestamp format is longer than the default and you are
  4511. using dates in tables, table alignment will be messed up. If the custom
  4512. format is shorter, things do work as expected.
  4513. @end itemize
  4514. @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
  4515. @section Deadlines and scheduling
  4516. A timestamp may be preceded by special keywords to facilitate planning:
  4517. @table @var
  4518. @item DEADLINE
  4519. @cindex DEADLINE keyword
  4520. Meaning: the task (most likely a TODO item, though not necessarily) is supposed
  4521. to be finished on that date.
  4522. @vindex org-deadline-warning-days
  4523. On the deadline date, the task will be listed in the agenda. In
  4524. addition, the agenda for @emph{today} will carry a warning about the
  4525. approaching or missed deadline, starting
  4526. @code{org-deadline-warning-days} before the due date, and continuing
  4527. until the entry is marked DONE. An example:
  4528. @example
  4529. *** TODO write article about the Earth for the Guide
  4530. The editor in charge is [[bbdb:Ford Prefect]]
  4531. DEADLINE: <2004-02-29 Sun>
  4532. @end example
  4533. You can specify a different lead time for warnings for a specific
  4534. deadlines using the following syntax. Here is an example with a warning
  4535. period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
  4536. @item SCHEDULED
  4537. @cindex SCHEDULED keyword
  4538. Meaning: you are planning to start working on that task on the given
  4539. date.
  4540. @vindex org-agenda-skip-scheduled-if-done
  4541. The headline will be listed under the given date@footnote{It will still
  4542. be listed on that date after it has been marked DONE. If you don't like
  4543. this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
  4544. addition, a reminder that the scheduled date has passed will be present
  4545. in the compilation for @emph{today}, until the entry is marked DONE.
  4546. I.e. the task will automatically be forwarded until completed.
  4547. @example
  4548. *** TODO Call Trillian for a date on New Years Eve.
  4549. SCHEDULED: <2004-12-25 Sat>
  4550. @end example
  4551. @noindent
  4552. @b{Important:} Scheduling an item in Org mode should @i{not} be
  4553. understood in the same way that we understand @i{scheduling a meeting}.
  4554. Setting a date for a meeting is just a simple appointment, you should
  4555. mark this entry with a simple plain timestamp, to get this item shown
  4556. on the date where it applies. This is a frequent misunderstanding by
  4557. Org users. In Org mode, @i{scheduling} means setting a date when you
  4558. want to start working on an action item.
  4559. @end table
  4560. You may use timestamps with repeaters in scheduling and deadline
  4561. entries. Org mode will issue early and late warnings based on the
  4562. assumption that the timestamp represents the @i{nearest instance} of
  4563. the repeater. However, the use of diary sexp entries like
  4564. @c
  4565. @code{<%%(diary-float t 42)>}
  4566. @c
  4567. in scheduling and deadline timestamps is limited. Org mode does not
  4568. know enough about the internals of each sexp function to issue early and
  4569. late warnings. However, it will show the item on each day where the
  4570. sexp entry matches.
  4571. @menu
  4572. * Inserting deadline/schedule:: Planning items
  4573. * Repeated tasks:: Items that show up again and again
  4574. @end menu
  4575. @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
  4576. @subsection Inserting deadlines or schedules
  4577. The following commands allow you to quickly insert a deadline or to schedule
  4578. an item:
  4579. @table @kbd
  4580. @c
  4581. @kindex C-c C-d
  4582. @item C-c C-d
  4583. Insert @samp{DEADLINE} keyword along with a stamp. The insertion will happen
  4584. in the line directly following the headline. When called with a prefix arg,
  4585. an existing deadline will be removed from the entry. Depending on the
  4586. variable @code{org-log-redeadline}@footnote{with corresponding
  4587. @code{#+STARTUP} keywords @code{logredeadline}, @code{lognoteredeadline},
  4588. and @code{nologredeadline}}, a note will be taken when changing an existing
  4589. deadline.
  4590. @c FIXME Any CLOSED timestamp will be removed.????????
  4591. @c
  4592. @kindex C-c C-s
  4593. @item C-c C-s
  4594. Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
  4595. happen in the line directly following the headline. Any CLOSED timestamp
  4596. will be removed. When called with a prefix argument, remove the scheduling
  4597. date from the entry. Depending on the variable
  4598. @code{org-log-reschedule}@footnote{with corresponding @code{#+STARTUP}
  4599. keywords @code{logredeadline}, @code{lognoteredeadline}, and
  4600. @code{nologredeadline}}, a note will be taken when changing an existing
  4601. scheduling time.
  4602. @c
  4603. @kindex C-c C-x C-k
  4604. @kindex k a
  4605. @kindex k s
  4606. @item C-c C-x C-k
  4607. Mark the current entry for agenda action. After you have marked the entry
  4608. like this, you can open the agenda or the calendar to find an appropriate
  4609. date. With the cursor on the selected date, press @kbd{k s} or @kbd{k d} to
  4610. schedule the marked item.
  4611. @c
  4612. @kindex C-c / d
  4613. @cindex sparse tree, for deadlines
  4614. @item C-c / d
  4615. @vindex org-deadline-warning-days
  4616. Create a sparse tree with all deadlines that are either past-due, or
  4617. which will become due within @code{org-deadline-warning-days}.
  4618. With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
  4619. prefix, check that many days. For example, @kbd{C-1 C-c / d} shows
  4620. all deadlines due tomorrow.
  4621. @c
  4622. @kindex C-c / b
  4623. @item C-c / b
  4624. Sparse tree for deadlines and scheduled items before a given date.
  4625. @c
  4626. @kindex C-c / a
  4627. @item C-c / a
  4628. Sparse tree for deadlines and scheduled items after a given date.
  4629. @end table
  4630. @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
  4631. @subsection Repeated tasks
  4632. @cindex tasks, repeated
  4633. @cindex repeated tasks
  4634. Some tasks need to be repeated again and again. Org mode helps to
  4635. organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
  4636. or plain timestamp. In the following example
  4637. @example
  4638. ** TODO Pay the rent
  4639. DEADLINE: <2005-10-01 Sat +1m>
  4640. @end example
  4641. @noindent
  4642. the @code{+1m} is a repeater; the intended interpretation is that the task
  4643. has a deadline on <2005-10-01> and repeats itself every (one) month starting
  4644. from that time. If you need both a repeater and a special warning period in
  4645. a deadline entry, the repeater should come first and the warning period last:
  4646. @code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
  4647. Deadlines and scheduled items produce entries in the agenda when they
  4648. are over-due, so it is important to be able to mark such an entry as
  4649. completed once you have done so. When you mark a DEADLINE or a SCHEDULE
  4650. with the TODO keyword DONE, it will no longer produce entries in the
  4651. agenda. The problem with this is, however, that then also the
  4652. @emph{next} instance of the repeated entry will not be active. Org mode
  4653. deals with this in the following way: When you try to mark such an entry
  4654. DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
  4655. timestamp by the repeater interval, and immediately set the entry state
  4656. back to TODO. In the example above, setting the state to DONE would
  4657. actually switch the date like this:
  4658. @example
  4659. ** TODO Pay the rent
  4660. DEADLINE: <2005-11-01 Tue +1m>
  4661. @end example
  4662. @vindex org-log-repeat
  4663. A timestamp@footnote{You can change this using the option
  4664. @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
  4665. @code{lognoterepeat}, and @code{nologrepeat}. With @code{lognoterepeat}, you
  4666. will also be prompted for a note.} will be added under the deadline, to keep
  4667. a record that you actually acted on the previous instance of this deadline.
  4668. As a consequence of shifting the base date, this entry will no longer be
  4669. visible in the agenda when checking past dates, but all future instances
  4670. will be visible.
  4671. With the @samp{+1m} cookie, the date shift will always be exactly one
  4672. month. So if you have not paid the rent for three months, marking this
  4673. entry DONE will still keep it as an overdue deadline. Depending on the
  4674. task, this may not be the best way to handle it. For example, if you
  4675. forgot to call you father for 3 weeks, it does not make sense to call
  4676. him 3 times in a single day to make up for it. Finally, there are tasks
  4677. like changing batteries which should always repeat a certain time
  4678. @i{after} the last time you did it. For these tasks, Org mode has
  4679. special repeaters markers with @samp{++} and @samp{.+}. For example:
  4680. @example
  4681. ** TODO Call Father
  4682. DEADLINE: <2008-02-10 Sun ++1w>
  4683. Marking this DONE will shift the date by at least one week,
  4684. but also by as many weeks as it takes to get this date into
  4685. the future. However, it stays on a Sunday, even if you called
  4686. and marked it done on Saturday.
  4687. ** TODO Check the batteries in the smoke detectors
  4688. DEADLINE: <2005-11-01 Tue .+1m>
  4689. Marking this DONE will shift the date to one month after
  4690. today.
  4691. @end example
  4692. You may have both scheduling and deadline information for a specific
  4693. task---just make sure that the repeater intervals on both are the same.
  4694. An alternative to using a repeater is to create a number of copies of a task
  4695. subtree, with dates shifted in each copy. The command @kbd{C-c C-x c} was
  4696. created for this purpose, it is described in @ref{Structure editing}.
  4697. @node Clocking work time, Resolving idle time, Deadlines and scheduling, Dates and Times
  4698. @section Clocking work time
  4699. Org mode allows you to clock the time you spend on specific tasks in a
  4700. project. When you start working on an item, you can start the clock.
  4701. When you stop working on that task, or when you mark the task done, the
  4702. clock is stopped and the corresponding time interval is recorded. It
  4703. also computes the total time spent on each subtree of a project. And it
  4704. remembers a history or tasks recently clocked, to that you can jump quickly
  4705. between a number of tasks absorbing your time.
  4706. To save the clock history across Emacs sessions, use
  4707. @lisp
  4708. (setq org-clock-persist 'history)
  4709. (org-clock-persistence-insinuate)
  4710. @end lisp
  4711. When you clock into a new task after resuming Emacs, the incomplete
  4712. clock@footnote{To resume the clock under the assumption that you have worked
  4713. on this task while outside Emacs, use @code{(setq org-clock-persist t)}.}
  4714. will be found (@pxref{Resolving idle time}) and you will be prompted about
  4715. what to do with it.
  4716. @table @kbd
  4717. @kindex C-c C-x C-i
  4718. @item C-c C-x C-i
  4719. @vindex org-clock-into-drawer
  4720. Start the clock on the current item (clock-in). This inserts the CLOCK
  4721. keyword together with a timestamp. If this is not the first clocking of
  4722. this item, the multiple CLOCK lines will be wrapped into a
  4723. @code{:LOGBOOK:} drawer (see also the variable
  4724. @code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument,
  4725. select the task from a list of recently clocked tasks. With two @kbd{C-u
  4726. C-u} prefixes, clock into the task at point and mark it as the default task.
  4727. The default task will always be available when selecting a clocking task,
  4728. with letter @kbd{d}.@*
  4729. @cindex property: CLOCK_MODELINE_TOTAL
  4730. @cindex property: LAST_REPEAT
  4731. @vindex org-clock-modeline-total
  4732. While the clock is running, the current clocking time is shown in the mode
  4733. line, along with the title of the task. The clock time shown will be all
  4734. time ever clocked for this task and its children. If the task has an effort
  4735. estimate (@pxref{Effort estimates}), the mode line displays the current
  4736. clocking time against it@footnote{To add an effort estimate ``on the fly'',
  4737. hook a function doing this to @code{org-clock-in-prepare-hook}.} If the task
  4738. is a repeating one (@pxref{Repeated tasks}), only the time since the last
  4739. reset of the task @footnote{as recorded by the @code{LAST_REPEAT} property}
  4740. will be shown. More control over what time is shown can be exercised with
  4741. the @code{CLOCK_MODELINE_TOTAL} property. It may have the values
  4742. @code{current} to show only the current clocking instance, @code{today} to
  4743. show all time clocked on this tasks today (see also the variable
  4744. @code{org-extend-today-until}), @code{all} to include all time, or
  4745. @code{auto} which is the default@footnote{See also the variable
  4746. @code{org-clock-modeline-total}.}.@* Clicking with @kbd{mouse-1} onto the
  4747. mode line entry will pop up a menu with clocking options.
  4748. @kindex C-c C-x C-o
  4749. @item C-c C-x C-o
  4750. @vindex org-log-note-clock-out
  4751. Stop the clock (clock-out). This inserts another timestamp at the same
  4752. location where the clock was last started. It also directly computes
  4753. the resulting time in inserts it after the time range as @samp{=>
  4754. HH:MM}. See the variable @code{org-log-note-clock-out} for the
  4755. possibility to record an additional note together with the clock-out
  4756. timestamp@footnote{The corresponding in-buffer setting is:
  4757. @code{#+STARTUP: lognoteclock-out}}.
  4758. @kindex C-c C-x C-e
  4759. @item C-c C-x C-e
  4760. Update the effort estimate for the current clock task.
  4761. @kindex C-c C-y
  4762. @kindex C-c C-c
  4763. @item C-c C-y @ @ @r{or}@ @ C-c C-c
  4764. Recompute the time interval after changing one of the timestamps. This
  4765. is only necessary if you edit the timestamps directly. If you change
  4766. them with @kbd{S-@key{cursor}} keys, the update is automatic.
  4767. @kindex C-c C-t
  4768. @item C-c C-t
  4769. Changing the TODO state of an item to DONE automatically stops the clock
  4770. if it is running in this same item.
  4771. @kindex C-c C-x C-x
  4772. @item C-c C-x C-x
  4773. Cancel the current clock. This is useful if a clock was started by
  4774. mistake, or if you ended up working on something else.
  4775. @kindex C-c C-x C-j
  4776. @item C-c C-x C-j
  4777. Jump to the entry that contains the currently running clock. With a
  4778. @kbd{C-u} prefix arg, select the target task from a list of recently clocked
  4779. tasks.
  4780. @kindex C-c C-x C-d
  4781. @item C-c C-x C-d
  4782. @vindex org-remove-highlights-with-change
  4783. Display time summaries for each subtree in the current buffer. This
  4784. puts overlays at the end of each headline, showing the total time
  4785. recorded under that heading, including the time of any subheadings. You
  4786. can use visibility cycling to study the tree, but the overlays disappear
  4787. when you change the buffer (see variable
  4788. @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
  4789. @kindex C-c C-x C-r
  4790. @item C-c C-x C-r
  4791. Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
  4792. report as an Org-mode table into the current file. When the cursor is
  4793. at an existing clock table, just update it. When called with a prefix
  4794. argument, jump to the first clock report in the current document and
  4795. update it.
  4796. @cindex #+BEGIN, clocktable
  4797. @example
  4798. #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
  4799. #+END: clocktable
  4800. @end example
  4801. @noindent
  4802. If such a block already exists at point, its content is replaced by the
  4803. new table. The @samp{BEGIN} line can specify options:
  4804. @example
  4805. :maxlevel @r{Maximum level depth to which times are listed in the table.}
  4806. :emphasize @r{When @code{t}, emphasize level one and level two items.}
  4807. :scope @r{The scope to consider. This can be any of the following:}
  4808. nil @r{the current buffer or narrowed region}
  4809. file @r{the full current buffer}
  4810. subtree @r{the subtree where the clocktable is located}
  4811. tree@var{N} @r{the surrounding level @var{N} tree, for example @code{tree3}}
  4812. tree @r{the surrounding level 1 tree}
  4813. agenda @r{all agenda files}
  4814. ("file"..) @r{scan these files}
  4815. file-with-archives @r{current file and its archives}
  4816. agenda-with-archives @r{all agenda files, including archives}
  4817. :block @r{The time block to consider. This block is specified either}
  4818. @r{absolute, or relative to the current time and may be any of}
  4819. @r{these formats:}
  4820. 2007-12-31 @r{New year eve 2007}
  4821. 2007-12 @r{December 2007}
  4822. 2007-W50 @r{ISO-week 50 in 2007}
  4823. 2007 @r{the year 2007}
  4824. today, yesterday, today-@var{N} @r{a relative day}
  4825. thisweek, lastweek, thisweek-@var{N} @r{a relative week}
  4826. thismonth, lastmonth, thismonth-@var{N} @r{a relative month}
  4827. thisyear, lastyear, thisyear-@var{N} @r{a relative year}
  4828. @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
  4829. :tstart @r{A time string specifying when to start considering times.}
  4830. :tend @r{A time string specifying when to stop considering times.}
  4831. :step @r{@code{week} or @code{day}, to split the table into chunks.}
  4832. @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
  4833. :link @r{Link the item headlines in the table to their origins.}
  4834. :formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
  4835. @r{As a special case, @samp{:formula %} adds a column with % time.}
  4836. @r{If you do not specify a formula here, any existing formula.}
  4837. @r{below the clock table will survive updates and be evaluated.}
  4838. :timestamp @r{A timestamp for the entry, when available. Look for SCHEDULED,}
  4839. @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
  4840. @end example
  4841. To get a clock summary of the current level 1 tree, for the current
  4842. day, you could write
  4843. @example
  4844. #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
  4845. #+END: clocktable
  4846. @end example
  4847. @noindent
  4848. and to use a specific time range you could write@footnote{Note that all
  4849. parameters must be specified in a single line---the line is broken here
  4850. only to fit it into the manual.}
  4851. @example
  4852. #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
  4853. :tend "<2006-08-10 Thu 12:00>"
  4854. #+END: clocktable
  4855. @end example
  4856. A summary of the current subtree with % times would be
  4857. @example
  4858. #+BEGIN: clocktable :scope subtree :link t :formula %
  4859. #+END: clocktable
  4860. @end example
  4861. @kindex C-c C-c
  4862. @item C-c C-c
  4863. @kindex C-c C-x C-u
  4864. @itemx C-c C-x C-u
  4865. Update dynamic block at point. The cursor needs to be in the
  4866. @code{#+BEGIN} line of the dynamic block.
  4867. @kindex C-u C-c C-x C-u
  4868. @item C-u C-c C-x C-u
  4869. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  4870. you have several clock table blocks in a buffer.
  4871. @kindex S-@key{left}
  4872. @kindex S-@key{right}
  4873. @item S-@key{left}
  4874. @itemx S-@key{right}
  4875. Shift the current @code{:block} interval and update the table. The cursor
  4876. needs to be in the @code{#+BEGIN: clocktable} line for this command. If
  4877. @code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
  4878. @end table
  4879. The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
  4880. the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
  4881. worked on or closed during a day.
  4882. @node Resolving idle time, Effort estimates, Clocking work time, Dates and Times
  4883. @section Resolving idle time
  4884. @cindex resolve idle time
  4885. @cindex idle, resolve, dangling
  4886. If you clock in on a work item, and then walk away from your
  4887. computer---perhaps to take a phone call---you often need to ``resolve'' the
  4888. time you were away by either subtracting it from the current clock, or
  4889. applying it to another one.
  4890. @vindex org-clock-idle-time
  4891. By customizing the variable @code{org-clock-idle-time} to some integer, such
  4892. as 10 or 15, Emacs can alert you when you get back to your computer after
  4893. being idle for that many minutes@footnote{On computers using Mac OS X,
  4894. idleness is based on actual user idleness, not just Emacs' idle time. For
  4895. X11, you can install a utility program @file{x11idle.c}, available in the
  4896. UTILITIES directory of the Org git distribution, to get the same general
  4897. treatment of idleness. On other systems, idle time refers to Emacs idle time
  4898. only.}, and ask what you want to do with the idle time. There will be a
  4899. question waiting for you when you get back, indicating how much idle time has
  4900. passed (constantly updated with the current amount), as well as a set of
  4901. choices to correct the discrepancy:
  4902. @table @kbd
  4903. @item k
  4904. To keep some or all of the minutes and stay clocked in, press @kbd{k}. Org
  4905. will ask how many of the minutes to keep. Press @key{RET} to keep them all,
  4906. effectively changing nothing, or enter a number to keep that many minutes.
  4907. @item K
  4908. If you use the shift key and press @kbd{K}, it will keep however many minutes
  4909. you request and then immediately clock out of that task. If you keep all of
  4910. the minutes, this is the same as just clocking out of the current task.
  4911. @item s
  4912. To keep none of the minutes, use @kbd{s} to subtract all the away time from
  4913. the clock, and then check back in from the moment you returned.
  4914. @item S
  4915. To keep none of the minutes and just clock out at the start of the away time,
  4916. use the shift key and press @kbd{S}. Remember that using shift will always
  4917. leave you clocked out, no matter which option you choose.
  4918. @item C
  4919. To cancel the clock altogether, use @kbd{C}. Note that if instead of
  4920. cancelling you subtract the away time, and the resulting clock amount is less
  4921. than a minute, the clock will still be cancelled rather than clutter up the
  4922. log with an empty entry.
  4923. @end table
  4924. What if you subtracted those away minutes from the current clock, and now
  4925. want to apply them to a new clock? Simply clock in to any task immediately
  4926. after the subtraction. Org will notice that you have subtracted time ``on
  4927. the books'', so to speak, and will ask if you want to apply those minutes to
  4928. the next task you clock in on.
  4929. There is one other instance when this clock resolution magic occurs. Say you
  4930. were clocked in and hacking away, and suddenly your cat chased a mouse who
  4931. scared a hamster that crashed into your UPS's power button! You suddenly
  4932. lose all your buffers, but thanks to auto-save you still have your recent Org
  4933. mode changes, including your last clock in.
  4934. If you restart Emacs and clock into any task, Org will notice that you have a
  4935. dangling clock which was never clocked out from your last session. Using
  4936. that clock's starting time as the beginning of the unaccounted-for period,
  4937. Org will ask how you want to resolve that time. The logic and behavior is
  4938. identical to dealing with away time due to idleness, it's just happening due
  4939. to a recovery event rather than a set amount of idle time.
  4940. You can also check all the files visited by your Org agenda for dangling
  4941. clocks at any time using @kbd{M-x org-resolve-clocks}.
  4942. @node Effort estimates, Relative timer, Resolving idle time, Dates and Times
  4943. @section Effort estimates
  4944. @cindex effort estimates
  4945. @cindex property, Effort
  4946. @vindex org-effort-property
  4947. If you want to plan your work in a very detailed way, or if you need to
  4948. produce offers with quotations of the estimated work effort, you may want to
  4949. assign effort estimates to entries. If you are also clocking your work, you
  4950. may later want to compare the planned effort with the actual working time, a
  4951. great way to improve planning estimates. Effort estimates are stored in a
  4952. special property @samp{Effort}@footnote{You may change the property being
  4953. used with the variable @code{org-effort-property}.}. You can set the effort
  4954. for an entry with the following commands:
  4955. @table @kbd
  4956. @kindex C-c C-x e
  4957. @item C-c C-x e
  4958. Set the effort estimate for the current entry. With a numeric prefix
  4959. argument, set it to the NTH allowed value (see below). This command is also
  4960. accessible from the agenda with the @kbd{e} key.
  4961. @kindex C-c C-x C-e
  4962. @item C-c C-x C-e
  4963. Modify the effort estimate of the item currently being clocked.
  4964. @end table
  4965. Clearly the best way to work with effort estimates is through column view
  4966. (@pxref{Column view}). You should start by setting up discrete values for
  4967. effort estimates, and a @code{COLUMNS} format that displays these values
  4968. together with clock sums (if you want to clock your time). For a specific
  4969. buffer you can use
  4970. @example
  4971. #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
  4972. #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
  4973. @end example
  4974. @noindent
  4975. @vindex org-global-properties
  4976. @vindex org-columns-default-format
  4977. or, even better, you can set up these values globally by customizing the
  4978. variables @code{org-global-properties} and @code{org-columns-default-format}.
  4979. In particular if you want to use this setup also in the agenda, a global
  4980. setup may be advised.
  4981. The way to assign estimates to individual items is then to switch to column
  4982. mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
  4983. value. The values you enter will immediately be summed up in the hierarchy.
  4984. In the column next to it, any clocked time will be displayed.
  4985. @vindex org-agenda-columns-add-appointments-to-effort-sum
  4986. If you switch to column view in the daily/weekly agenda, the effort column
  4987. will summarize the estimated work effort for each day@footnote{Please note
  4988. the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
  4989. column view}).}, and you can use this to find space in your schedule. To get
  4990. an overview of the entire part of the day that is committed, you can set the
  4991. option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
  4992. appointments on a day that take place over a specified time interval will
  4993. then also be added to the load estimate of the day.
  4994. Effort estimates can be used in secondary agenda filtering that is triggered
  4995. with the @kbd{/} key in the agenda (@pxref{Agenda commands}). If you have
  4996. these estimates defined consistently, two or three key presses will narrow
  4997. down the list to stuff that fits into an available time slot.
  4998. @node Relative timer, , Effort estimates, Dates and Times
  4999. @section Taking notes with a relative timer
  5000. @cindex relative timer
  5001. When taking notes during, for example, a meeting or a video viewing, it can
  5002. be useful to have access to times relative to a starting time. Org provides
  5003. such a relative timer and make it easy to create timed notes.
  5004. @table @kbd
  5005. @kindex C-c C-x .
  5006. @item C-c C-x .
  5007. Insert a relative time into the buffer. The first time you use this, the
  5008. timer will be started. When called with a prefix argument, the timer is
  5009. restarted.
  5010. @kindex C-c C-x -
  5011. @item C-c C-x -
  5012. Insert a description list item with the current relative time. With a prefix
  5013. argument, first reset the timer to 0.
  5014. @kindex M-@key{RET}
  5015. @item M-@key{RET}
  5016. Once the timer list is started, you can also use @kbd{M-@key{RET}} to insert
  5017. new timer items.
  5018. @kindex C-c C-x ,
  5019. @item C-c C-x ,
  5020. Pause the timer, or continue it if it is already paused.
  5021. @c removed the sentence because it is redundant to the following item
  5022. @kindex C-u C-c C-x ,
  5023. @item C-u C-c C-x ,
  5024. Stop the timer. After this, you can only start a new timer, not continue the
  5025. old one. This command also removes the timer from the mode line.
  5026. @kindex C-c C-x 0
  5027. @item C-c C-x 0
  5028. Reset the timer without inserting anything into the buffer. By default, the
  5029. timer is reset to 0. When called with a @kbd{C-u} prefix, reset the timer to
  5030. specific starting offset. The user is prompted for the offset, with a
  5031. default taken from a timer string at point, if any, So this can be used to
  5032. restart taking notes after a break in the process. When called with a double
  5033. prefix argument @kbd{C-c C-u}, change all timer strings in the active region
  5034. by a certain amount. This can be used to fix timer strings if the timer was
  5035. not started at exactly the right moment.
  5036. @end table
  5037. @node Capture - Refile - Archive, Agenda Views, Dates and Times, Top
  5038. @chapter Capture - Refile - Archive
  5039. @cindex capture
  5040. An important part of any organization system is the ability to quickly
  5041. capture new ideas and tasks, and to associate reference material with them.
  5042. Org uses the @file{remember.el} package to create tasks, and stores files
  5043. related to a task (@i{attachments}) in a special directory. Once in the
  5044. system, tasks and projects need to be moved around. Moving completed project
  5045. trees to an archive file keeps the system compact and fast.
  5046. @menu
  5047. * Remember:: Capture new tasks/ideas with little interruption
  5048. * Attachments:: Add files to tasks.
  5049. * RSS Feeds:: Getting input from RSS feeds
  5050. * Protocols:: External (e.g. Browser) access to Emacs and Org
  5051. * Refiling notes:: Moving a tree from one place to another
  5052. * Archiving:: What to do with finished projects
  5053. @end menu
  5054. @node Remember, Attachments, Capture - Refile - Archive, Capture - Refile - Archive
  5055. @section Remember
  5056. @cindex @file{remember.el}
  5057. The Remember package by John Wiegley lets you store quick notes with little
  5058. interruption of your work flow. It is an excellent way to add new notes and
  5059. tasks to Org files. The @code{remember.el} package is part of Emacs 23, not
  5060. Emacs 22. See @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for
  5061. more information.
  5062. Org significantly expands the possibilities of Remember: you may define
  5063. templates for different note types, and associate target files and headlines
  5064. with specific templates. It also allows you to select the location where a
  5065. note should be stored interactively, on the fly.
  5066. @menu
  5067. * Setting up Remember for Org:: Some code for .emacs to get things going
  5068. * Remember templates:: Define the outline of different note types
  5069. * Storing notes:: Directly get the note to where it belongs
  5070. @end menu
  5071. @node Setting up Remember for Org, Remember templates, Remember, Remember
  5072. @subsection Setting up Remember for Org
  5073. The following customization will tell Remember to use Org files as
  5074. target, and to create annotations compatible with Org links.
  5075. @example
  5076. (org-remember-insinuate)
  5077. (setq org-directory "~/path/to/my/orgfiles/")
  5078. (setq org-default-notes-file (concat org-directory "/notes.org"))
  5079. (define-key global-map "\C-cr" 'org-remember)
  5080. @end example
  5081. @noindent
  5082. The last line binds the command @code{org-remember} to a global
  5083. key@footnote{Please select your own key, @kbd{C-c r} is only a
  5084. suggestion.}. @code{org-remember} basically just calls Remember,
  5085. but it makes a few things easier: if there is an active region, it will
  5086. automatically copy the region into the Remember buffer. It also allows
  5087. to jump to the buffer and location where Remember notes are being
  5088. stored: just call @code{org-remember} with a prefix argument. If you
  5089. use two prefix arguments, Org jumps to the location where the last
  5090. remember note was stored.
  5091. The Remember buffer will actually use @code{org-mode} as its major mode, so
  5092. that all editing features of Org mode are available. In addition to this, a
  5093. minor mode @code{org-remember-mode} is turned on, for the single purpose that
  5094. you can use its keymap @code{org-remember-mode-map} to overwrite some of
  5095. Org mode's key bindings.
  5096. You can also call @code{org-remember} in a special way from the agenda,
  5097. using the @kbd{k r} key combination. With this access, any timestamps
  5098. inserted by the selected Remember template (see below) will default to
  5099. the cursor date in the agenda, rather than to the current date.
  5100. @node Remember templates, Storing notes, Setting up Remember for Org, Remember
  5101. @subsection Remember templates
  5102. @cindex templates, for Remember
  5103. In combination with Org, you can use templates to generate
  5104. different types of Remember notes. For example, if you would like
  5105. to use one template to create general TODO entries, another one for
  5106. journal entries, and a third one for collecting random ideas, you could
  5107. use:
  5108. @example
  5109. (setq org-remember-templates
  5110. '(("Todo" ?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
  5111. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
  5112. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  5113. @end example
  5114. @vindex org-remember-default-headline
  5115. @vindex org-directory
  5116. @noindent In these entries, the first string is just a name, and the
  5117. character specifies how to select the template. It is useful if the
  5118. character is also the first letter of the name. The next string specifies
  5119. the template. Two more (optional) strings give the file in which, and the
  5120. headline under which, the new note should be stored. The file (if not
  5121. present or @code{nil}) defaults to @code{org-default-notes-file}, the heading
  5122. to @code{org-remember-default-headline}. If the file name is not an absolute
  5123. path, it will be interpreted relative to @code{org-directory}.
  5124. The heading can also be the symbols @code{top} or @code{bottom} to send notes
  5125. as level 1 entries to the beginning or end of the file, respectively. It may
  5126. also be the symbol @code{date-tree}. Then, a tree with year on level 1,
  5127. month on level 2 and day on level three will be build in the file, and the
  5128. entry will be filed into the tree under the current date@footnote{If the file
  5129. contains an entry with a @code{DATE_TREE} property, the entire date tree will
  5130. be build under that entry.}
  5131. An optional sixth element specifies the contexts in which the user can select
  5132. the template. This element can be a list of major modes or a function.
  5133. @code{org-remember} will first check whether the function returns @code{t} or
  5134. if we are in any of the listed major modes, and exclude templates for which
  5135. this condition is not fulfilled. Templates that do not specify this element
  5136. at all, or that use @code{nil} or @code{t} as a value will always be
  5137. selectable.
  5138. So for example:
  5139. @example
  5140. (setq org-remember-templates
  5141. '(("Bug" ?b "* BUG %?\n %i\n %a" "~/org/BUGS.org" "Bugs" (emacs-lisp-mode))
  5142. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org" "X" my-check)
  5143. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  5144. @end example
  5145. @noindent
  5146. The first template will only be available when invoking @code{org-remember}
  5147. from an buffer in @code{emacs-lisp-mode}. The second template will only be
  5148. available when the function @code{my-check} returns @code{t}. The third
  5149. template will be proposed in any context.
  5150. When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
  5151. something, Org will prompt for a key to select the template (if you have
  5152. more than one template) and then prepare the buffer like
  5153. @example
  5154. * TODO
  5155. [[file:@var{link to where you called remember}]]
  5156. @end example
  5157. @noindent
  5158. During expansion of the template, special @kbd{%}-escapes@footnote{If you
  5159. need one of these sequences literally, escape the @kbd{%} with a backslash.}
  5160. allow dynamic insertion of content:
  5161. @example
  5162. %^@{@var{prompt}@} @r{prompt the user for a string and replace this sequence with it.}
  5163. @r{You may specify a default value and a completion table with}
  5164. @r{%^@{prompt|default|completion2|completion3...@}}
  5165. @r{The arrow keys access a prompt-specific history.}
  5166. %a @r{annotation, normally the link created with @code{org-store-link}}
  5167. %A @r{like @code{%a}, but prompt for the description part}
  5168. %i @r{initial content, the region when remember is called with C-u.}
  5169. @r{The entire text will be indented like @code{%i} itself.}
  5170. %t @r{timestamp, date only}
  5171. %T @r{timestamp with date and time}
  5172. %u, %U @r{like the above, but inactive timestamps}
  5173. %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
  5174. @r{You may define a prompt like @code{%^@{Birthday@}t}}
  5175. %n @r{user name (taken from @code{user-full-name})}
  5176. %c @r{Current kill ring head.}
  5177. %x @r{Content of the X clipboard.}
  5178. %^C @r{Interactive selection of which kill or clip to use.}
  5179. %^L @r{Like @code{%^C}, but insert as link.}
  5180. %^g @r{prompt for tags, with completion on tags in target file.}
  5181. %k @r{title of currently clocked task}
  5182. %K @r{link to currently clocked task}
  5183. %^G @r{prompt for tags, with completion all tags in all agenda files.}
  5184. %^@{@var{prop}@}p @r{Prompt the user for a value for property @var{prop}}
  5185. %:keyword @r{specific information for certain link types, see below}
  5186. %[@var{file}] @r{insert the contents of the file given by @var{file}}
  5187. %(@var{sexp}) @r{evaluate Elisp @var{sexp} and replace with the result}
  5188. %! @r{immediately store note after completing the template}
  5189. @r{(skipping the @kbd{C-c C-c} that normally triggers storing)}
  5190. %& @r{jump to target location immediately after storing note}
  5191. @end example
  5192. @noindent
  5193. For specific link types, the following keywords will be
  5194. defined@footnote{If you define your own link types (@pxref{Adding
  5195. hyperlink types}), any property you store with
  5196. @code{org-store-link-props} can be accessed in remember templates in a
  5197. similar way.}:
  5198. @vindex org-from-is-user-regexp
  5199. @example
  5200. Link type | Available keywords
  5201. -------------------+----------------------------------------------
  5202. bbdb | %:name %:company
  5203. bbdb | %::server %:port %:nick
  5204. vm, wl, mh, rmail | %:type %:subject %:message-id
  5205. | %:from %:fromname %:fromaddress
  5206. | %:to %:toname %:toaddress
  5207. | %: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}.}}
  5208. gnus | %:group, @r{for messages also all email fields}
  5209. w3, w3m | %:url
  5210. info | %:file %:node
  5211. calendar | %:date"
  5212. @end example
  5213. @noindent
  5214. To place the cursor after template expansion use:
  5215. @example
  5216. %? @r{After completing the template, position cursor here.}
  5217. @end example
  5218. @noindent
  5219. If you change your mind about which template to use, call
  5220. @code{org-remember} in the remember buffer. You may then select a new
  5221. template that will be filled with the previous context information.
  5222. @node Storing notes, , Remember templates, Remember
  5223. @subsection Storing notes
  5224. @vindex org-remember-clock-out-on-exit
  5225. When you are finished preparing a note with Remember, you have to press
  5226. @kbd{C-c C-c} to file the note away. If you have started the clock in the
  5227. Remember buffer, you will first be asked if you want to clock out
  5228. now@footnote{To avoid this query, configure the variable
  5229. @code{org-remember-clock-out-on-exit}.}. If you answer @kbd{n}, the clock
  5230. will continue to run after the note was filed away.
  5231. The handler will then store the note in the file and under the headline
  5232. specified in the template, or it will use the default file and headline.
  5233. The window configuration will be restored, sending you back to the working
  5234. context before the call to Remember. To re-use the location found
  5235. during the last call to Remember, exit the Remember buffer with
  5236. @kbd{C-0 C-c C-c}, i.e. specify a zero prefix argument to @kbd{C-c C-c}.
  5237. Another special case is @kbd{C-2 C-c C-c} which files the note as a child of
  5238. the currently clocked item.
  5239. @vindex org-remember-store-without-prompt
  5240. If you want to store the note directly to a different place, use
  5241. @kbd{C-1 C-c C-c} instead to exit Remember@footnote{Configure the
  5242. variable @code{org-remember-store-without-prompt} to make this behavior
  5243. the default.}. The handler will then first prompt for a target file---if
  5244. you press @key{RET}, the value specified for the template is used.
  5245. Then the command offers the headings tree of the selected file, with the
  5246. cursor position at the default headline (if you specified one in the
  5247. template). You can either immediately press @key{RET} to get the note
  5248. placed there. Or you can use the following keys to find a different
  5249. location:
  5250. @example
  5251. @key{TAB} @r{Cycle visibility.}
  5252. @key{down} / @key{up} @r{Next/previous visible headline.}
  5253. n / p @r{Next/previous visible headline.}
  5254. f / b @r{Next/previous headline same level.}
  5255. u @r{One level up.}
  5256. @c 0-9 @r{Digit argument.}
  5257. @end example
  5258. @noindent
  5259. Pressing @key{RET} or @key{left} or @key{right}
  5260. then leads to the following result.
  5261. @vindex org-reverse-note-order
  5262. @multitable @columnfractions 0.2 0.15 0.65
  5263. @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
  5264. @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
  5265. @item @tab @tab depending on @code{org-reverse-note-order}.
  5266. @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
  5267. @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
  5268. @item @tab @tab depending on @code{org-reverse-note-order}.
  5269. @item not on headline @tab @key{RET}
  5270. @tab at cursor position, level taken from context.
  5271. @end multitable
  5272. Before inserting the text into a tree, the function ensures that the text has
  5273. a headline, i.e. a first line that starts with a @samp{*}. If not, a
  5274. headline is constructed from the current date. If you have indented the text
  5275. of the note below the headline, the indentation will be adapted if inserting
  5276. the note into the tree requires demotion from level 1.
  5277. @node Attachments, RSS Feeds, Remember, Capture - Refile - Archive
  5278. @section Attachments
  5279. @cindex attachments
  5280. @vindex org-attach-directory
  5281. It is often useful to associate reference material with an outline node/task.
  5282. Small chunks of plain text can simply be stored in the subtree of a project.
  5283. Hyperlinks (@pxref{Hyperlinks}) can be used to establish associations with
  5284. files that live elsewhere on your computer or in the cloud, like emails or
  5285. source code files belonging to a project. Another method is @i{attachments},
  5286. which are files located in a directory belonging to an outline node. Org
  5287. uses directories named by the unique ID of each entry. These directories are
  5288. located in the @file{data} directory which lives in the same directory where
  5289. your Org file lives@footnote{If you move entries or Org files from one
  5290. directory to another, you may want to configure @code{org-attach-directory}
  5291. to contain an absolute path.}. If you initialize this directory with
  5292. @code{git init}, Org will automatically commit changes when it sees them.
  5293. The attachment system has been contributed to Org by John Wiegley.
  5294. In cases where it seems better to do so, you can also attach a directory of your
  5295. choice to an entry. You can also make children inherit the attachment
  5296. directory from a parent, so that an entire subtree uses the same attached
  5297. directory.
  5298. @noindent The following commands deal with attachments.
  5299. @table @kbd
  5300. @kindex C-c C-a
  5301. @item C-c C-a
  5302. The dispatcher for commands related to the attachment system. After these
  5303. keys, a list of commands is displayed and you need to press an additional key
  5304. to select a command:
  5305. @table @kbd
  5306. @kindex C-c C-a a
  5307. @item a
  5308. @vindex org-attach-method
  5309. Select a file and move it into the task's attachment directory. The file
  5310. will be copied, moved, or linked, depending on @code{org-attach-method}.
  5311. Note that hard links are not supported on all systems.
  5312. @kindex C-c C-a c
  5313. @kindex C-c C-a m
  5314. @kindex C-c C-a l
  5315. @item c/m/l
  5316. Attach a file using the copy/move/link method.
  5317. Note that hard links are not supported on all systems.
  5318. @kindex C-c C-a n
  5319. @item n
  5320. Create a new attachment as an Emacs buffer.
  5321. @kindex C-c C-a z
  5322. @item z
  5323. Synchronize the current task with its attachment directory, in case you added
  5324. attachments yourself.
  5325. @kindex C-c C-a o
  5326. @item o
  5327. @vindex org-file-apps
  5328. Open current task's attachment. If there are more than one, prompt for a
  5329. file name first. Opening will follow the rules set by @code{org-file-apps}.
  5330. For more details, see the information on following hyperlinks
  5331. (@pxref{Handling links}).
  5332. @kindex C-c C-a O
  5333. @item O
  5334. Also open the attachment, but force opening the file in Emacs.
  5335. @kindex C-c C-a f
  5336. @item f
  5337. Open the current task's attachment directory.
  5338. @kindex C-c C-a F
  5339. @item F
  5340. Also open the directory, but force using @command{dired} in Emacs.
  5341. @kindex C-c C-a d
  5342. @item d
  5343. Select and delete a single attachment.
  5344. @kindex C-c C-a D
  5345. @item D
  5346. Delete all of a task's attachments. A safer way is to open the directory in
  5347. @command{dired} and delete from there.
  5348. @kindex C-c C-a s
  5349. @item C-c C-a s
  5350. @cindex property, ATTACH_DIR
  5351. Set a specific directory as the entry's attachment directory. This works by
  5352. putting the directory path into the @code{ATTACH_DIR} property.
  5353. @kindex C-c C-a i
  5354. @item C-c C-a i
  5355. @cindex property, ATTACH_DIR_INHERIT
  5356. Set the @code{ATTACH_DIR_INHERIT} property, so that children will use the
  5357. same directory for attachments as the parent does.
  5358. @end table
  5359. @end table
  5360. @node RSS Feeds, Protocols, Attachments, Capture - Refile - Archive
  5361. @section RSS feeds
  5362. @cindex RSS feeds
  5363. Org has the capability to add and change entries based on information found in
  5364. RSS feeds. You could use this to make a task out of each new podcast in a
  5365. podcast feed. Or you could use a phone-based note-creating service on the
  5366. web to import tasks into Org. To access feeds, you need to configure the
  5367. variable @code{org-feed-alist}. The docstring of this variable has detailed
  5368. information. Here is just an example:
  5369. @example
  5370. (setq org-feed-alist
  5371. '(("ReQall" "http://www.reqall.com/user/feeds/rss/a1b2c3....."
  5372. "~/org/feeds.org" "ReQall Entries")
  5373. @end example
  5374. @noindent
  5375. will configure that new items from the feed provided by @file{reqall.com}
  5376. will result in new entries in the file @file{~/org/feeds.org} under the
  5377. heading @samp{ReQall Entries}, whenever the following command is used:
  5378. @table @kbd
  5379. @kindex C-c C-x g
  5380. @item C-c C-x g
  5381. Collect items from the feeds configured in @code{org-feed-alist} and act upon
  5382. them.
  5383. @kindex C-c C-x G
  5384. @item C-c C-x G
  5385. Prompt for a feed name and go to the inbox configured for this feed.
  5386. @end table
  5387. Under the same headline, Org will create a drawer @samp{FEEDSTATUS} in which
  5388. it will store information about the status of items in the feed, to avoid
  5389. adding the same item several times. You should add @samp{FEEDSTATUS} to the
  5390. list of drawers in that file:
  5391. @example
  5392. #+DRAWERS: LOGBOOK PROPERTIES FEEDSTATUS
  5393. @end example
  5394. For more information, see @file{org-feed.el} and the docstring of
  5395. @code{org-feed-alist}.
  5396. @node Protocols, Refiling notes, RSS Feeds, Capture - Refile - Archive
  5397. @section Protocols for external access
  5398. @cindex protocols, for external access
  5399. @cindex emacsserver
  5400. You can set up Org for handling protocol calls from outside applications that
  5401. are passed to Emacs through the @file{emacsserver}. For example, you can
  5402. configure bookmarks in your web browser to send a link to the current page to
  5403. Org and create a note from it using Remember (@pxref{Remember}). Or you
  5404. could create a bookmark that will tell Emacs to open the local source file of
  5405. a remote website you are looking at with the browser. See
  5406. @uref{http://orgmode.org/worg/org-contrib/org-protocol.php} for detailed
  5407. documentation and setup instructions.
  5408. @node Refiling notes, Archiving, Protocols, Capture - Refile - Archive
  5409. @section Refiling notes
  5410. @cindex refiling notes
  5411. When reviewing the captured data, you may want to refile some of the entries
  5412. into a different list, for example into a project. Cutting, finding the
  5413. right location, and then pasting the note is cumbersome. To simplify this
  5414. process, you can use the following special command:
  5415. @table @kbd
  5416. @kindex C-c C-w
  5417. @item C-c C-w
  5418. @vindex org-reverse-note-order
  5419. @vindex org-refile-targets
  5420. @vindex org-refile-use-outline-path
  5421. @vindex org-outline-path-complete-in-steps
  5422. @vindex org-refile-allow-creating-parent-nodes
  5423. Refile the entry or region at point. This command offers possible locations
  5424. for refiling the entry and lets you select one with completion. The item (or
  5425. all items in the region) is filed below the target heading as a subitem.
  5426. Depending on @code{org-reverse-note-order}, it will be either the first or
  5427. last subitem.@*
  5428. By default, all level 1 headlines in the current buffer are considered to be
  5429. targets, but you can have more complex definitions across a number of files.
  5430. See the variable @code{org-refile-targets} for details. If you would like to
  5431. select a location via a file-path-like completion along the outline path, see
  5432. the variables @code{org-refile-use-outline-path} and
  5433. @code{org-outline-path-complete-in-steps}. If you would like to be able to
  5434. create new nodes as new parents for for refiling on the fly, check the
  5435. variable @code{org-refile-allow-creating-parent-nodes}.
  5436. @kindex C-u C-c C-w
  5437. @item C-u C-c C-w
  5438. Use the refile interface to jump to a heading.
  5439. @kindex C-u C-u C-c C-w
  5440. @item C-u C-u C-c C-w
  5441. Jump to the location where @code{org-refile} last moved a tree to.
  5442. @item C-2 C-c C-w
  5443. Refile as the child of the item currently being clocked.
  5444. @end table
  5445. @node Archiving, , Refiling notes, Capture - Refile - Archive
  5446. @section Archiving
  5447. @cindex archiving
  5448. When a project represented by a (sub)tree is finished, you may want
  5449. to move the tree out of the way and to stop it from contributing to the
  5450. agenda. Archiving is important to keep your working files compact and global
  5451. searches like the construction of agenda views fast.
  5452. @table @kbd
  5453. @kindex C-c C-x C-a
  5454. @item C-c C-x C-a
  5455. @vindex org-archive-default-command
  5456. Archive the current entry using the command specified in the variable
  5457. @code{org-archive-default-command}.
  5458. @end table
  5459. @menu
  5460. * Moving subtrees:: Moving a tree to an archive file
  5461. * Internal archiving:: Switch off a tree but keep i in the file
  5462. @end menu
  5463. @node Moving subtrees, Internal archiving, Archiving, Archiving
  5464. @subsection Moving a tree to the archive file
  5465. @cindex external archiving
  5466. The most common archiving action is to move a project tree to another file,
  5467. the archive file.
  5468. @table @kbd
  5469. @kindex C-c $
  5470. @kindex C-c C-x C-s
  5471. @item C-c C-x C-s@ @r{or short} @ C-c $
  5472. @vindex org-archive-location
  5473. Archive the subtree starting at the cursor position to the location
  5474. given by @code{org-archive-location}.
  5475. @kindex C-u C-c C-x C-s
  5476. @item C-u C-c C-x C-s
  5477. Check if any direct children of the current headline could be moved to
  5478. the archive. To do this, each subtree is checked for open TODO entries.
  5479. If none are found, the command offers to move it to the archive
  5480. location. If the cursor is @emph{not} on a headline when this command
  5481. is invoked, the level 1 trees will be checked.
  5482. @end table
  5483. @cindex archive locations
  5484. The default archive location is a file in the same directory as the
  5485. current file, with the name derived by appending @file{_archive} to the
  5486. current file name. For information and examples on how to change this,
  5487. see the documentation string of the variable
  5488. @code{org-archive-location}. There is also an in-buffer option for
  5489. setting this variable, for example@footnote{For backward compatibility,
  5490. the following also works: If there are several such lines in a file,
  5491. each specifies the archive location for the text below it. The first
  5492. such line also applies to any text before its definition. However,
  5493. using this method is @emph{strongly} deprecated as it is incompatible
  5494. with the outline structure of the document. The correct method for
  5495. setting multiple archive locations in a buffer is using properties.}:
  5496. @cindex #+ARCHIVE
  5497. @example
  5498. #+ARCHIVE: %s_done::
  5499. @end example
  5500. @cindex property, ARCHIVE
  5501. @noindent
  5502. If you would like to have a special ARCHIVE location for a single entry
  5503. or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
  5504. location as the value (@pxref{Properties and Columns}).
  5505. @vindex org-archive-save-context-info
  5506. When a subtree is moved, it receives a number of special properties that
  5507. record context information like the file from where the entry came, its
  5508. outline path the archiving time etc. Configure the variable
  5509. @code{org-archive-save-context-info} to adjust the amount of information
  5510. added.
  5511. @node Internal archiving, , Moving subtrees, Archiving
  5512. @subsection Internal archiving
  5513. If you want to just switch off (for agenda views) certain subtrees without
  5514. moving them to a different file, you can use the @code{ARCHIVE tag}.
  5515. A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
  5516. its location in the outline tree, but behaves in the following way:
  5517. @itemize @minus
  5518. @item
  5519. @vindex org-cycle-open-archived-trees
  5520. It does not open when you attempt to do so with a visibility cycling
  5521. command (@pxref{Visibility cycling}). You can force cycling archived
  5522. subtrees with @kbd{C-@key{TAB}}, or by setting the option
  5523. @code{org-cycle-open-archived-trees}. Also normal outline commands like
  5524. @code{show-all} will open archived subtrees.
  5525. @item
  5526. @vindex org-sparse-tree-open-archived-trees
  5527. During sparse tree construction (@pxref{Sparse trees}), matches in
  5528. archived subtrees are not exposed, unless you configure the option
  5529. @code{org-sparse-tree-open-archived-trees}.
  5530. @item
  5531. @vindex org-agenda-skip-archived-trees
  5532. During agenda view construction (@pxref{Agenda Views}), the content of
  5533. archived trees is ignored unless you configure the option
  5534. @code{org-agenda-skip-archived-trees}, in which case these trees will always
  5535. be included. In the agenda you can press @kbd{v a} to get archives
  5536. temporarily included.
  5537. @item
  5538. @vindex org-export-with-archived-trees
  5539. Archived trees are not exported (@pxref{Exporting}), only the headline
  5540. is. Configure the details using the variable
  5541. @code{org-export-with-archived-trees}.
  5542. @item
  5543. @vindex org-columns-skip-arrchived-trees
  5544. Archived trees are excluded from column view unless the variable
  5545. @code{org-columns-skip-arrchived-trees} is configured to @code{nil}.
  5546. @end itemize
  5547. The following commands help managing the ARCHIVE tag:
  5548. @table @kbd
  5549. @kindex C-c C-x a
  5550. @item C-c C-x a
  5551. Toggle the ARCHIVE tag for the current headline. When the tag is set,
  5552. the headline changes to a shadowed face, and the subtree below it is
  5553. hidden.
  5554. @kindex C-u C-c C-x a
  5555. @item C-u C-c C-x a
  5556. Check if any direct children of the current headline should be archived.
  5557. To do this, each subtree is checked for open TODO entries. If none are
  5558. found, the command offers to set the ARCHIVE tag for the child. If the
  5559. cursor is @emph{not} on a headline when this command is invoked, the
  5560. level 1 trees will be checked.
  5561. @kindex C-@kbd{TAB}
  5562. @item C-@kbd{TAB}
  5563. Cycle a tree even if it is tagged with ARCHIVE.
  5564. @kindex C-c C-x A
  5565. @item C-c C-x A
  5566. Move the current entry to the @emph{Archive Sibling}. This is a sibling of
  5567. the entry with the heading @samp{Archive} and the tag @samp{ARCHIVE}. The
  5568. entry becomes a child of that sibling and in this way retains a lot of its
  5569. original context, including inherited tags and approximate position in the
  5570. outline.
  5571. @end table
  5572. @node Agenda Views, Markup, Capture - Refile - Archive, Top
  5573. @chapter Agenda Views
  5574. @cindex agenda views
  5575. Due to the way Org works, TODO items, time-stamped items, and
  5576. tagged headlines can be scattered throughout a file or even a number of
  5577. files. To get an overview of open action items, or of events that are
  5578. important for a particular date, this information must be collected,
  5579. sorted and displayed in an organized way.
  5580. Org can select items based on various criteria and display them
  5581. in a separate buffer. Seven different view types are provided:
  5582. @itemize @bullet
  5583. @item
  5584. an @emph{agenda} that is like a calendar and shows information
  5585. for specific dates,
  5586. @item
  5587. a @emph{TODO list} that covers all unfinished
  5588. action items,
  5589. @item
  5590. a @emph{match view}, showings headlines based on the tags, properties, and
  5591. TODO state associated with them,
  5592. @item
  5593. a @emph{timeline view} that shows all events in a single Org file,
  5594. in time-sorted view,
  5595. @item
  5596. a @emph{text search view} that shows all entries from multiple files
  5597. that contain specified keywords,
  5598. @item
  5599. a @emph{stuck projects view} showing projects that currently don't move
  5600. along, and
  5601. @item
  5602. @emph{custom views} that are special searches and combinations of different
  5603. views.
  5604. @end itemize
  5605. @noindent
  5606. The extracted information is displayed in a special @emph{agenda
  5607. buffer}. This buffer is read-only, but provides commands to visit the
  5608. corresponding locations in the original Org files, and even to
  5609. edit these files remotely.
  5610. @vindex org-agenda-window-setup
  5611. @vindex org-agenda-restore-windows-after-quit
  5612. Two variables control how the agenda buffer is displayed and whether the
  5613. window configuration is restored when the agenda exits:
  5614. @code{org-agenda-window-setup} and
  5615. @code{org-agenda-restore-windows-after-quit}.
  5616. @menu
  5617. * Agenda files:: Files being searched for agenda information
  5618. * Agenda dispatcher:: Keyboard access to agenda views
  5619. * Built-in agenda views:: What is available out of the box?
  5620. * Presentation and sorting:: How agenda items are prepared for display
  5621. * Agenda commands:: Remote editing of Org trees
  5622. * Custom agenda views:: Defining special searches and views
  5623. * Exporting Agenda Views:: Writing a view to a file
  5624. * Agenda column view:: Using column view for collected entries
  5625. @end menu
  5626. @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
  5627. @section Agenda files
  5628. @cindex agenda files
  5629. @cindex files for agenda
  5630. @vindex org-agenda-files
  5631. The information to be shown is normally collected from all @emph{agenda
  5632. files}, the files listed in the variable
  5633. @code{org-agenda-files}@footnote{If the value of that variable is not a
  5634. list, but a single file name, then the list of agenda files will be
  5635. maintained in that external file.}. If a directory is part of this list,
  5636. all files with the extension @file{.org} in this directory will be part
  5637. of the list.
  5638. Thus, even if you only work with a single Org file, that file should
  5639. be put into the list@footnote{When using the dispatcher, pressing
  5640. @kbd{<} before selecting a command will actually limit the command to
  5641. the current file, and ignore @code{org-agenda-files} until the next
  5642. dispatcher command.}. You can customize @code{org-agenda-files}, but
  5643. the easiest way to maintain it is through the following commands
  5644. @cindex files, adding to agenda list
  5645. @table @kbd
  5646. @kindex C-c [
  5647. @item C-c [
  5648. Add current file to the list of agenda files. The file is added to
  5649. the front of the list. If it was already in the list, it is moved to
  5650. the front. With a prefix argument, file is added/moved to the end.
  5651. @kindex C-c ]
  5652. @item C-c ]
  5653. Remove current file from the list of agenda files.
  5654. @kindex C-,
  5655. @kindex C-'
  5656. @item C-,
  5657. @itemx C-'
  5658. Cycle through agenda file list, visiting one file after the other.
  5659. @kindex M-x org-iswitchb
  5660. @item M-x org-iswitchb
  5661. Command to use an @code{iswitchb}-like interface to switch to and between Org
  5662. buffers.
  5663. @end table
  5664. @noindent
  5665. The Org menu contains the current list of files and can be used
  5666. to visit any of them.
  5667. If you would like to focus the agenda temporarily on a file not in
  5668. this list, or on just one file in the list, or even on only a subtree in a
  5669. file, then this can be done in different ways. For a single agenda command,
  5670. you may press @kbd{<} once or several times in the dispatcher
  5671. (@pxref{Agenda dispatcher}). To restrict the agenda scope for an
  5672. extended period, use the following commands:
  5673. @table @kbd
  5674. @kindex C-c C-x <
  5675. @item C-c C-x <
  5676. Permanently restrict the agenda to the current subtree. When with a
  5677. prefix argument, or with the cursor before the first headline in a file,
  5678. the agenda scope is set to the entire file. This restriction remains in
  5679. effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
  5680. or @kbd{>} in the agenda dispatcher. If there is a window displaying an
  5681. agenda view, the new restriction takes effect immediately.
  5682. @kindex C-c C-x >
  5683. @item C-c C-x >
  5684. Remove the permanent restriction created by @kbd{C-c C-x <}.
  5685. @end table
  5686. @noindent
  5687. When working with @file{speedbar.el}, you can use the following commands in
  5688. the Speedbar frame:
  5689. @table @kbd
  5690. @kindex <
  5691. @item < @r{in the speedbar frame}
  5692. Permanently restrict the agenda to the item---either an Org file or a subtree
  5693. in such a file---at the cursor in the Speedbar frame.
  5694. If there is a window displaying an agenda view, the new restriction takes
  5695. effect immediately.
  5696. @kindex >
  5697. @item > @r{in the speedbar frame}
  5698. Lift the restriction.
  5699. @end table
  5700. @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
  5701. @section The agenda dispatcher
  5702. @cindex agenda dispatcher
  5703. @cindex dispatching agenda commands
  5704. The views are created through a dispatcher, which should be bound to a
  5705. global key---for example @kbd{C-c a} (@pxref{Installation}). In the
  5706. following we will assume that @kbd{C-c a} is indeed how the dispatcher
  5707. is accessed and list keyboard access to commands accordingly. After
  5708. pressing @kbd{C-c a}, an additional letter is required to execute a
  5709. command. The dispatcher offers the following default commands:
  5710. @table @kbd
  5711. @item a
  5712. Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
  5713. @item t @r{/} T
  5714. Create a list of all TODO items (@pxref{Global TODO list}).
  5715. @item m @r{/} M
  5716. Create a list of headlines matching a TAGS expression (@pxref{Matching
  5717. tags and properties}).
  5718. @item L
  5719. Create the timeline view for the current buffer (@pxref{Timeline}).
  5720. @item s
  5721. Create a list of entries selected by a boolean expression of keywords
  5722. and/or regular expressions that must or must not occur in the entry.
  5723. @item /
  5724. @vindex org-agenda-text-search-extra-files
  5725. Search for a regular expression in all agenda files and additionally in
  5726. the files listed in @code{org-agenda-text-search-extra-files}. This
  5727. uses the Emacs command @code{multi-occur}. A prefix argument can be
  5728. used to specify the number of context lines for each match, default is
  5729. 1.
  5730. @item # @r{/} !
  5731. Create a list of stuck projects (@pxref{Stuck projects}).
  5732. @item <
  5733. Restrict an agenda command to the current buffer@footnote{For backward
  5734. compatibility, you can also press @kbd{1} to restrict to the current
  5735. buffer.}. After pressing @kbd{<}, you still need to press the character
  5736. selecting the command.
  5737. @item < <
  5738. If there is an active region, restrict the following agenda command to
  5739. the region. Otherwise, restrict it to the current subtree@footnote{For
  5740. backward compatibility, you can also press @kbd{0} to restrict to the
  5741. current region/subtree.}. After pressing @kbd{< <}, you still need to press the
  5742. character selecting the command.
  5743. @end table
  5744. You can also define custom commands that will be accessible through the
  5745. dispatcher, just like the default commands. This includes the
  5746. possibility to create extended agenda buffers that contain several
  5747. blocks together, for example the weekly agenda, the global TODO list and
  5748. a number of special tags matches. @xref{Custom agenda views}.
  5749. @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
  5750. @section The built-in agenda views
  5751. In this section we describe the built-in views.
  5752. @menu
  5753. * Weekly/daily agenda:: The calendar page with current tasks
  5754. * Global TODO list:: All unfinished action items
  5755. * Matching tags and properties:: Structured information with fine-tuned search
  5756. * Timeline:: Time-sorted view for single file
  5757. * Search view:: Find entries by searching for text
  5758. * Stuck projects:: Find projects you need to review
  5759. @end menu
  5760. @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
  5761. @subsection The weekly/daily agenda
  5762. @cindex agenda
  5763. @cindex weekly agenda
  5764. @cindex daily agenda
  5765. The purpose of the weekly/daily @emph{agenda} is to act like a page of a
  5766. paper agenda, showing all the tasks for the current week or day.
  5767. @table @kbd
  5768. @cindex org-agenda, command
  5769. @kindex C-c a a
  5770. @item C-c a a
  5771. @vindex org-agenda-ndays
  5772. Compile an agenda for the current week from a list of Org files. The agenda
  5773. shows the entries for each day. With a numeric prefix@footnote{For backward
  5774. compatibility, the universal prefix @kbd{C-u} causes all TODO entries to be
  5775. listed before the agenda. This feature is deprecated, use the dedicated TODO
  5776. list, or a block agenda instead (@pxref{Block agenda}).} (like @kbd{C-u 2 1
  5777. C-c a a}) you may set the number of days to be displayed (see also the
  5778. variable @code{org-agenda-ndays})
  5779. @end table
  5780. Remote editing from the agenda buffer means, for example, that you can
  5781. change the dates of deadlines and appointments from the agenda buffer.
  5782. The commands available in the Agenda buffer are listed in @ref{Agenda
  5783. commands}.
  5784. @subsubheading Calendar/Diary integration
  5785. @cindex calendar integration
  5786. @cindex diary integration
  5787. Emacs contains the calendar and diary by Edward M. Reingold. The
  5788. calendar displays a three-month calendar with holidays from different
  5789. countries and cultures. The diary allows you to keep track of
  5790. anniversaries, lunar phases, sunrise/set, recurrent appointments
  5791. (weekly, monthly) and more. In this way, it is quite complementary to
  5792. Org. It can be very useful to combine output from Org with
  5793. the diary.
  5794. In order to include entries from the Emacs diary into Org mode's
  5795. agenda, you only need to customize the variable
  5796. @lisp
  5797. (setq org-agenda-include-diary t)
  5798. @end lisp
  5799. @noindent After that, everything will happen automatically. All diary
  5800. entries including holidays, anniversaries, etc., will be included in the
  5801. agenda buffer created by Org mode. @key{SPC}, @key{TAB}, and
  5802. @key{RET} can be used from the agenda buffer to jump to the diary
  5803. file in order to edit existing diary entries. The @kbd{i} command to
  5804. insert new entries for the current date works in the agenda buffer, as
  5805. well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
  5806. Sunrise/Sunset times, show lunar phases and to convert to other
  5807. calendars, respectively. @kbd{c} can be used to switch back and forth
  5808. between calendar and agenda.
  5809. If you are using the diary only for sexp entries and holidays, it is
  5810. faster to not use the above setting, but instead to copy or even move
  5811. the entries into an Org file. Org mode evaluates diary-style sexp
  5812. entries, and does it faster because there is no overhead for first
  5813. creating the diary display. Note that the sexp entries must start at
  5814. the left margin, no whitespace is allowed before them. For example,
  5815. the following segment of an Org file will be processed and entries
  5816. will be made in the agenda:
  5817. @example
  5818. * Birthdays and similar stuff
  5819. #+CATEGORY: Holiday
  5820. %%(org-calendar-holiday) ; special function for holiday names
  5821. #+CATEGORY: Ann
  5822. %%(diary-anniversary 5 14 1956)@footnote{Note that the order of the arguments (month, day, year) depends on the setting of @code{calendar-date-style}.} Arthur Dent is %d years old
  5823. %%(diary-anniversary 10 2 1869) Mahatma Gandhi would be %d years old
  5824. @end example
  5825. @subsubheading Anniversaries from BBDB
  5826. @cindex BBDB, anniversaries
  5827. @cindex anniversaries, from BBDB
  5828. If you are using the Big Brothers Database to store your contacts, you will
  5829. very likely prefer to store anniversaries in BBDB rather than in a
  5830. separate Org or diary file. Org supports this and will show BBDB
  5831. anniversaries as part of the agenda. All you need to do is to add the
  5832. following to one your your agenda files:
  5833. @example
  5834. * Anniversaries
  5835. :PROPERTIES:
  5836. :CATEGORY: Anniv
  5837. :END
  5838. %%(org-bbdb-anniversaries)
  5839. @end example
  5840. You can then go ahead and define anniversaries for a BBDB record. Basically,
  5841. you need to press @kbd{C-o anniversary @key{RET}} with the cursor in a BBDB
  5842. record and then add the date in the format @code{YYYY-MM-DD}, followed by a
  5843. space and the class of the anniversary (@samp{birthday} or @samp{wedding}, or
  5844. a format string). If you omit the class, it will default to @samp{birthday}.
  5845. Here are a few examples, the header for the file @file{org-bbdb.el} contains
  5846. more detailed information.
  5847. @example
  5848. 1973-06-22
  5849. 1955-08-02 wedding
  5850. 2008-04-14 %s released version 6.01 of org-mode, %d years ago
  5851. @end example
  5852. After a change to BBDB, or for the first agenda display during an Emacs
  5853. session, the agenda display will suffer a short delay as Org updates its
  5854. hash with anniversaries. However, from then on things will be very fast---much
  5855. faster in fact than a long list of @samp{%%(diary-anniversary)} entries
  5856. in an Org or Diary file.
  5857. @subsubheading Appointment reminders
  5858. @cindex @file{appt.el}
  5859. @cindex appointment reminders
  5860. Org can interact with Emacs appointments notification facility. To add all
  5861. the appointments of your agenda files, use the command
  5862. @code{org-agenda-to-appt}. This command also lets you filter through the
  5863. list of your appointments and add only those belonging to a specific category
  5864. or matching a regular expression. See the docstring for details.
  5865. @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
  5866. @subsection The global TODO list
  5867. @cindex global TODO list
  5868. @cindex TODO list, global
  5869. The global TODO list contains all unfinished TODO items formatted and
  5870. collected into a single place.
  5871. @table @kbd
  5872. @kindex C-c a t
  5873. @item C-c a t
  5874. Show the global TODO list. This collects the TODO items from all
  5875. agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
  5876. @code{agenda-mode}, so there are commands to examine and manipulate
  5877. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  5878. @kindex C-c a T
  5879. @item C-c a T
  5880. @cindex TODO keyword matching
  5881. @vindex org-todo-keywords
  5882. Like the above, but allows selection of a specific TODO keyword. You
  5883. can also do this by specifying a prefix argument to @kbd{C-c a t}. With
  5884. a @kbd{C-u} prefix you are prompted for a keyword, and you may also
  5885. specify several keywords by separating them with @samp{|} as the boolean OR
  5886. operator. With a numeric prefix, the nth keyword in
  5887. @code{org-todo-keywords} is selected.
  5888. @kindex r
  5889. The @kbd{r} key in the agenda buffer regenerates it, and you can give
  5890. a prefix argument to this command to change the selected TODO keyword,
  5891. for example @kbd{3 r}. If you often need a search for a specific
  5892. keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
  5893. Matching specific TODO keywords can also be done as part of a tags
  5894. search (@pxref{Tag searches}).
  5895. @end table
  5896. Remote editing of TODO items means that you can change the state of a
  5897. TODO entry with a single key press. The commands available in the
  5898. TODO list are described in @ref{Agenda commands}.
  5899. @cindex sublevels, inclusion into TODO list
  5900. Normally the global TODO list simply shows all headlines with TODO
  5901. keywords. This list can become very long. There are two ways to keep
  5902. it more compact:
  5903. @itemize @minus
  5904. @item
  5905. @vindex org-agenda-todo-ignore-scheduled
  5906. @vindex org-agenda-todo-ignore-deadlines
  5907. @vindex org-agenda-todo-ignore-with-date
  5908. Some people view a TODO item that has been @emph{scheduled} for execution or
  5909. have a @emph{deadline} (@pxref{Timestamps}) as no longer @emph{open}.
  5910. Configure the variables @code{org-agenda-todo-ignore-scheduled},
  5911. @code{org-agenda-todo-ignore-deadlines}, and/or
  5912. @code{org-agenda-todo-ignore-with-date} to exclude such items from the
  5913. global TODO list.
  5914. @item
  5915. @vindex org-agenda-todo-list-sublevels
  5916. TODO items may have sublevels to break up the task into subtasks. In
  5917. such cases it may be enough to list only the highest level TODO headline
  5918. and omit the sublevels from the global list. Configure the variable
  5919. @code{org-agenda-todo-list-sublevels} to get this behavior.
  5920. @end itemize
  5921. @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
  5922. @subsection Matching tags and properties
  5923. @cindex matching, of tags
  5924. @cindex matching, of properties
  5925. @cindex tags view
  5926. @cindex match view
  5927. If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}),
  5928. or have properties (@pxref{Properties and Columns}), you can select headlines
  5929. based on this metadata and collect them into an agenda buffer. The match
  5930. syntax described here also applies when creating sparse trees with @kbd{C-c /
  5931. m}.
  5932. @table @kbd
  5933. @kindex C-c a m
  5934. @item C-c a m
  5935. Produce a list of all headlines that match a given set of tags. The
  5936. command prompts for a selection criterion, which is a boolean logic
  5937. expression with tags, like @samp{+work+urgent-withboss} or
  5938. @samp{work|home} (@pxref{Tags}). If you often need a specific search,
  5939. define a custom command for it (@pxref{Agenda dispatcher}).
  5940. @kindex C-c a M
  5941. @item C-c a M
  5942. @vindex org-tags-match-list-sublevels
  5943. @vindex org-agenda-tags-todo-honor-ignore-options
  5944. Like @kbd{C-c a m}, but only select headlines that are also TODO items and
  5945. force checking subitems (see variable @code{org-tags-match-list-sublevels}).
  5946. To exclude scheduled/deadline items, see the variable
  5947. @code{org-agenda-tags-todo-honor-ignore-options}. Matching specific TODO
  5948. keywords together with a tags match is also possible, see @ref{Tag searches}.
  5949. @end table
  5950. The commands available in the tags list are described in @ref{Agenda
  5951. commands}.
  5952. @subsubheading Match syntax
  5953. @cindex Boolean logic, for tag/property searches
  5954. A search string can use Boolean operators @samp{&} for AND and @samp{|} for
  5955. OR. @samp{&} binds more strongly than @samp{|}. Parentheses are currently
  5956. not implemented. Each element in the search is either a tag, a regular
  5957. expression matching tags, or an expression like @code{PROPERTY OPERATOR
  5958. VALUE} with a comparison operator, accessing a property value. Each element
  5959. may be preceded by @samp{-}, to select against it, and @samp{+} is syntactic
  5960. sugar for positive selection. The AND operator @samp{&} is optional when
  5961. @samp{+} or @samp{-} is present. Here are some examples, using only tags.
  5962. @table @samp
  5963. @item +work-boss
  5964. Select headlines tagged @samp{:work:}, but discard those also tagged
  5965. @samp{:boss:}.
  5966. @item work|laptop
  5967. Selects lines tagged @samp{:work:} or @samp{:laptop:}.
  5968. @item work|laptop+night
  5969. Like before, but require the @samp{:laptop:} lines to be tagged also
  5970. @samp{:night:}.
  5971. @end table
  5972. @cindex regular expressions, with tags search
  5973. Instead of a tag, you may also specify a regular expression enclosed in curly
  5974. braces. For example,
  5975. @samp{work+@{^boss.*@}} matches headlines that contain the tag
  5976. @samp{:work:} and any tag @i{starting} with @samp{boss}.
  5977. @cindex TODO keyword matching, with tags search
  5978. @cindex level, require for tags/property match
  5979. @cindex category, require for tags/property match
  5980. @vindex org-odd-levels-only
  5981. You may also test for properties (@pxref{Properties and Columns}) at the same
  5982. time as matching tags. The properties may be real properties, or special
  5983. properties that represent other metadata (@pxref{Special properties}). For
  5984. example, the ``property'' @code{TODO} represents the TODO keyword of the
  5985. entry. Or, the ``property'' @code{LEVEL} represents the level of an entry.
  5986. So a search @samp{+LEVEL=3+boss-TODO="DONE"} lists all level three headlines
  5987. that have the tag @samp{boss} and are @emph{not} marked with the TODO keyword
  5988. DONE. In buffers with @code{org-odd-levels-only} set, @samp{LEVEL} does not
  5989. count the number of stars, but @samp{LEVEL=2} will correspond to 3 stars etc.
  5990. Here are more examples:
  5991. @table @samp
  5992. @item work+TODO="WAITING"
  5993. Select @samp{:work:}-tagged TODO lines with the specific TODO
  5994. keyword @samp{WAITING}.
  5995. @item work+TODO="WAITING"|home+TODO="WAITING"
  5996. Waiting tasks both at work and at home.
  5997. @end table
  5998. When matching properties, a number of different operators can be used to test
  5999. the value of a property. Here is a complex example:
  6000. @example
  6001. +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \
  6002. +With=@{Sarah\|Denny@}+SCHEDULED>="<2008-10-11>"
  6003. @end example
  6004. @noindent
  6005. The type of comparison will depend on how the comparison value is written:
  6006. @itemize @minus
  6007. @item
  6008. If the comparison value is a plain number, a numerical comparison is done,
  6009. and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
  6010. @samp{>=}, and @samp{<>}.
  6011. @item
  6012. If the comparison value is enclosed in double-quotes,
  6013. a string comparison is done, and the same operators are allowed.
  6014. @item
  6015. If the comparison value is enclosed in double-quotes @emph{and} angular
  6016. brackets (like @samp{DEADLINE<="<2008-12-24 18:30>"}), both values are
  6017. assumed to be date/time specifications in the standard Org way, and the
  6018. comparison will be done accordingly. Special values that will be recognized
  6019. are @code{"<now>"} for now (including time), and @code{"<today>"}, and
  6020. @code{"<tomorrow>"} for these days at 0:00 hours, i.e. without a time
  6021. specification. Also strings like @code{"<+5d>"} or @code{"<-2m>"} with units
  6022. @code{d}, @code{w}, @code{m}, and @code{y} for day, week, month, and year,
  6023. respectively, can be used.
  6024. @item
  6025. If the comparison value is enclosed
  6026. in curly braces, a regexp match is performed, with @samp{=} meaning that the
  6027. regexp matches the property value, and @samp{<>} meaning that it does not
  6028. match.
  6029. @end itemize
  6030. So the search string in the example finds entries tagged @samp{:work:} but
  6031. not @samp{:boss:}, which also have a priority value @samp{A}, a
  6032. @samp{:Coffee:} property with the value @samp{unlimited}, an @samp{Effort}
  6033. property that is numerically smaller than 2, a @samp{:With:} property that is
  6034. matched by the regular expression @samp{Sarah\|Denny}, and that are scheduled
  6035. on or after October 11, 2008.
  6036. Accessing TODO, LEVEL, and CATEGORY during a search is fast. Accessing any
  6037. other properties will slow down the search. However, once you have paid the
  6038. price by accessing one property, testing additional properties is cheap
  6039. again.
  6040. You can configure Org mode to use property inheritance during a search, but
  6041. beware that this can slow down searches considerably. See @ref{Property
  6042. inheritance}, for details.
  6043. For backward compatibility, and also for typing speed, there is also a
  6044. different way to test TODO states in a search. For this, terminate the
  6045. tags/property part of the search string (which may include several terms
  6046. connected with @samp{|}) with a @samp{/} and then specify a Boolean
  6047. expression just for TODO keywords. The syntax is then similar to that for
  6048. tags, but should be applied with care: for example, a positive
  6049. selection on several TODO keywords cannot meaningfully be combined with
  6050. boolean AND. However, @emph{negative selection} combined with AND can be
  6051. meaningful. To make sure that only lines are checked that actually have any
  6052. TODO keyword (resulting in a speed-up), use @kbd{C-c a M}, or equivalently
  6053. start the TODO part after the slash with @samp{!}. Examples:
  6054. @table @samp
  6055. @item work/WAITING
  6056. Same as @samp{work+TODO="WAITING"}
  6057. @item work/!-WAITING-NEXT
  6058. Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
  6059. nor @samp{NEXT}
  6060. @item work/!+WAITING|+NEXT
  6061. Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
  6062. @samp{NEXT}.
  6063. @end table
  6064. @node Timeline, Search view, Matching tags and properties, Built-in agenda views
  6065. @subsection Timeline for a single file
  6066. @cindex timeline, single file
  6067. @cindex time-sorted view
  6068. The timeline summarizes all time-stamped items from a single Org mode
  6069. file in a @emph{time-sorted view}. The main purpose of this command is
  6070. to give an overview over events in a project.
  6071. @table @kbd
  6072. @kindex C-c a L
  6073. @item C-c a L
  6074. Show a time-sorted view of the Org file, with all time-stamped items.
  6075. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  6076. (scheduled or not) are also listed under the current date.
  6077. @end table
  6078. @noindent
  6079. The commands available in the timeline buffer are listed in
  6080. @ref{Agenda commands}.
  6081. @node Search view, Stuck projects, Timeline, Built-in agenda views
  6082. @subsection Search view
  6083. @cindex search view
  6084. @cindex text search
  6085. @cindex searching, for text
  6086. This agenda view is a general text search facility for Org mode entries.
  6087. It is particularly useful to find notes.
  6088. @table @kbd
  6089. @kindex C-c a s
  6090. @item C-c a s
  6091. This is a special search that lets you select entries by matching a substring
  6092. or specific words using a boolean logic.
  6093. @end table
  6094. For example, the search string @samp{computer equipment} will find entries
  6095. that contain @samp{computer equipment} as a substring. If the two words are
  6096. separated by more space or a line break, the search will still match.
  6097. Search view can also search for specific keywords in the entry, using Boolean
  6098. logic. The search string @samp{+computer +wifi -ethernet -@{8\.11[bg]@}}
  6099. will search for note entries that contain the keywords @code{computer}
  6100. and @code{wifi}, but not the keyword @code{ethernet}, and which are also
  6101. not matched by the regular expression @code{8\.11[bg]}, meaning to
  6102. exclude both 8.11b and 8.11g. The first @samp{+} is necessary to turn on
  6103. word search, other @samp{+} characters are optional. For more details, see
  6104. the docstring of the command @code{org-search-view}.
  6105. @vindex org-agenda-text-search-extra-files
  6106. Note that in addition to the agenda files, this command will also search
  6107. the files listed in @code{org-agenda-text-search-extra-files}.
  6108. @node Stuck projects, , Search view, Built-in agenda views
  6109. @subsection Stuck projects
  6110. If you are following a system like David Allen's GTD to organize your
  6111. work, one of the ``duties'' you have is a regular review to make sure
  6112. that all projects move along. A @emph{stuck} project is a project that
  6113. has no defined next actions, so it will never show up in the TODO lists
  6114. Org mode produces. During the review, you need to identify such
  6115. projects and define next actions for them.
  6116. @table @kbd
  6117. @kindex C-c a #
  6118. @item C-c a #
  6119. List projects that are stuck.
  6120. @kindex C-c a !
  6121. @item C-c a !
  6122. @vindex org-stuck-projects
  6123. Customize the variable @code{org-stuck-projects} to define what a stuck
  6124. project is and how to find it.
  6125. @end table
  6126. You almost certainly will have to configure this view before it will
  6127. work for you. The built-in default assumes that all your projects are
  6128. level-2 headlines, and that a project is not stuck if it has at least
  6129. one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
  6130. Let's assume that you, in your own way of using Org mode, identify
  6131. projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
  6132. indicate a project that should not be considered yet. Let's further
  6133. assume that the TODO keyword DONE marks finished projects, and that NEXT
  6134. and TODO indicate next actions. The tag @@SHOP indicates shopping and
  6135. is a next action even without the NEXT tag. Finally, if the project
  6136. contains the special word IGNORE anywhere, it should not be listed
  6137. either. In this case you would start by identifying eligible projects
  6138. with a tags/todo match@footnote{@xref{Tag searches}.}
  6139. @samp{+PROJECT/-MAYBE-DONE}, and then check for TODO, NEXT, @@SHOP, and
  6140. IGNORE in the subtree to identify projects that are not stuck. The
  6141. correct customization for this is
  6142. @lisp
  6143. (setq org-stuck-projects
  6144. '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
  6145. "\\<IGNORE\\>"))
  6146. @end lisp
  6147. Note that if a project is identified as non-stuck, the subtree of this entry
  6148. will still be searched for stuck projects.
  6149. @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
  6150. @section Presentation and sorting
  6151. @cindex presentation, of agenda items
  6152. @vindex org-agenda-prefix-format
  6153. Before displaying items in an agenda view, Org mode visually prepares
  6154. the items and sorts them. Each item occupies a single line. The line
  6155. starts with a @emph{prefix} that contains the @emph{category}
  6156. (@pxref{Categories}) of the item and other important information. You can
  6157. customize the prefix using the option @code{org-agenda-prefix-format}.
  6158. The prefix is followed by a cleaned-up version of the outline headline
  6159. associated with the item.
  6160. @menu
  6161. * Categories:: Not all tasks are equal
  6162. * Time-of-day specifications:: How the agenda knows the time
  6163. * Sorting of agenda items:: The order of things
  6164. @end menu
  6165. @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
  6166. @subsection Categories
  6167. @cindex category
  6168. The category is a broad label assigned to each agenda item. By default,
  6169. the category is simply derived from the file name, but you can also
  6170. specify it with a special line in the buffer, like this@footnote{For
  6171. backward compatibility, the following also works: if there are several
  6172. such lines in a file, each specifies the category for the text below it.
  6173. The first category also applies to any text before the first CATEGORY
  6174. line. However, using this method is @emph{strongly} deprecated as it is
  6175. incompatible with the outline structure of the document. The correct
  6176. method for setting multiple categories in a buffer is using a
  6177. property.}:
  6178. @example
  6179. #+CATEGORY: Thesis
  6180. @end example
  6181. @noindent
  6182. @cindex property, CATEGORY
  6183. If you would like to have a special CATEGORY for a single entry or a
  6184. (sub)tree, give the entry a @code{:CATEGORY:} property with the
  6185. special category you want to apply as the value.
  6186. @noindent
  6187. The display in the agenda buffer looks best if the category is not
  6188. longer than 10 characters.
  6189. @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
  6190. @subsection Time-of-day specifications
  6191. @cindex time-of-day specification
  6192. Org mode checks each agenda item for a time-of-day specification. The
  6193. time can be part of the timestamp that triggered inclusion into the
  6194. agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
  6195. ranges can be specified with two timestamps, like
  6196. @c
  6197. @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
  6198. In the headline of the entry itself, a time(range) may also appear as
  6199. plain text (like @samp{12:45} or a @samp{8:30-1pm}). If the agenda
  6200. integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
  6201. specifications in diary entries are recognized as well.
  6202. For agenda display, Org mode extracts the time and displays it in a
  6203. standard 24 hour format as part of the prefix. The example times in
  6204. the previous paragraphs would end up in the agenda like this:
  6205. @example
  6206. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  6207. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  6208. 19:00...... The Vogon reads his poem
  6209. 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
  6210. @end example
  6211. @cindex time grid
  6212. If the agenda is in single-day mode, or for the display of today, the
  6213. timed entries are embedded in a time grid, like
  6214. @example
  6215. 8:00...... ------------------
  6216. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  6217. 10:00...... ------------------
  6218. 12:00...... ------------------
  6219. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  6220. 14:00...... ------------------
  6221. 16:00...... ------------------
  6222. 18:00...... ------------------
  6223. 19:00...... The Vogon reads his poem
  6224. 20:00...... ------------------
  6225. 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
  6226. @end example
  6227. @vindex org-agenda-use-time-grid
  6228. @vindex org-agenda-time-grid
  6229. The time grid can be turned on and off with the variable
  6230. @code{org-agenda-use-time-grid}, and can be configured with
  6231. @code{org-agenda-time-grid}.
  6232. @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
  6233. @subsection Sorting of agenda items
  6234. @cindex sorting, of agenda items
  6235. @cindex priorities, of agenda items
  6236. Before being inserted into a view, the items are sorted. How this is
  6237. done depends on the type of view.
  6238. @itemize @bullet
  6239. @item
  6240. @vindex org-agenda-files
  6241. For the daily/weekly agenda, the items for each day are sorted. The
  6242. default order is to first collect all items containing an explicit
  6243. time-of-day specification. These entries will be shown at the beginning
  6244. of the list, as a @emph{schedule} for the day. After that, items remain
  6245. grouped in categories, in the sequence given by @code{org-agenda-files}.
  6246. Within each category, items are sorted by priority (@pxref{Priorities}),
  6247. which is composed of the base priority (2000 for priority @samp{A}, 1000
  6248. for @samp{B}, and 0 for @samp{C}), plus additional increments for
  6249. overdue scheduled or deadline items.
  6250. @item
  6251. For the TODO list, items remain in the order of categories, but within
  6252. each category, sorting takes place according to priority
  6253. (@pxref{Priorities}). The priority used for sorting derives from the
  6254. priority cookie, with additions depending on how close an item is to its due
  6255. or scheduled date.
  6256. @item
  6257. For tags matches, items are not sorted at all, but just appear in the
  6258. sequence in which they are found in the agenda files.
  6259. @end itemize
  6260. @vindex org-agenda-sorting-strategy
  6261. Sorting can be customized using the variable
  6262. @code{org-agenda-sorting-strategy}, and may also include criteria based on
  6263. the estimated effort of an entry (@pxref{Effort estimates}).
  6264. @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
  6265. @section Commands in the agenda buffer
  6266. @cindex commands, in agenda buffer
  6267. Entries in the agenda buffer are linked back to the Org file or diary
  6268. file where they originate. You are not allowed to edit the agenda
  6269. buffer itself, but commands are provided to show and jump to the
  6270. original entry location, and to edit the Org files ``remotely'' from
  6271. the agenda buffer. In this way, all information is stored only once,
  6272. removing the risk that your agenda and note files may diverge.
  6273. Some commands can be executed with mouse clicks on agenda lines. For
  6274. the other commands, the cursor needs to be in the desired line.
  6275. @table @kbd
  6276. @tsubheading{Motion}
  6277. @cindex motion commands in agenda
  6278. @kindex n
  6279. @item n
  6280. Next line (same as @key{up} and @kbd{C-p}).
  6281. @kindex p
  6282. @item p
  6283. Previous line (same as @key{down} and @kbd{C-n}).
  6284. @tsubheading{View/Go to Org file}
  6285. @kindex mouse-3
  6286. @kindex @key{SPC}
  6287. @item mouse-3
  6288. @itemx @key{SPC}
  6289. Display the original location of the item in another window.
  6290. With prefix arg, make sure that the entire entry is made visible in the
  6291. outline, not only the heading.
  6292. @c
  6293. @kindex L
  6294. @item L
  6295. Display original location and recenter that window.
  6296. @c
  6297. @kindex mouse-2
  6298. @kindex mouse-1
  6299. @kindex @key{TAB}
  6300. @item mouse-2
  6301. @itemx mouse-1
  6302. @itemx @key{TAB}
  6303. Go to the original location of the item in another window. Under Emacs
  6304. 22, @kbd{mouse-1} will also works for this.
  6305. @c
  6306. @kindex @key{RET}
  6307. @itemx @key{RET}
  6308. Go to the original location of the item and delete other windows.
  6309. @c
  6310. @kindex F
  6311. @item F
  6312. @vindex org-agenda-start-with-follow-mode
  6313. Toggle Follow mode. In Follow mode, as you move the cursor through
  6314. the agenda buffer, the other window always shows the corresponding
  6315. location in the Org file. The initial setting for this mode in new
  6316. agenda buffers can be set with the variable
  6317. @code{org-agenda-start-with-follow-mode}.
  6318. @c
  6319. @kindex C-c C-x b
  6320. @item C-c C-x b
  6321. Display the entire subtree of the current item in an indirect buffer. With a
  6322. numeric prefix argument N, go up to level N and then take that tree. If N is
  6323. negative, go up that many levels. With a @kbd{C-u} prefix, do not remove the
  6324. previously used indirect buffer.
  6325. @kindex C-c C-o
  6326. @item C-c C-o
  6327. Follow a link in the entry. This will offer a selection of any links in the
  6328. text belonging to the referenced Org node. If there is only one link, it
  6329. will be followed without a selection prompt.
  6330. @tsubheading{Change display}
  6331. @cindex display changing, in agenda
  6332. @kindex o
  6333. @item o
  6334. Delete other windows.
  6335. @c
  6336. @kindex v d
  6337. @kindex d
  6338. @kindex v w
  6339. @kindex w
  6340. @kindex v m
  6341. @kindex v y
  6342. @item v d @ @r{or short} @ d
  6343. @itemx v w @ @r{or short} @ w
  6344. @itemx v m
  6345. @itemx v y
  6346. Switch to day/week/month/year view. When switching to day or week view,
  6347. this setting becomes the default for subsequent agenda commands. Since
  6348. month and year views are slow to create, they do not become the default.
  6349. A numeric prefix argument may be used to jump directly to a specific day
  6350. of the year, ISO week, month, or year, respectively. For example,
  6351. @kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When
  6352. setting day, week, or month view, a year may be encoded in the prefix
  6353. argument as well. For example, @kbd{200712 w} will jump to week 12 in
  6354. 2007. If such a year specification has only one or two digits, it will
  6355. be mapped to the interval 1938-2037.
  6356. @c
  6357. @kindex f
  6358. @item f
  6359. @vindex org-agenda-ndays
  6360. Go forward in time to display the following @code{org-agenda-ndays} days.
  6361. For example, if the display covers a week, switch to the following week.
  6362. With prefix arg, go forward that many times @code{org-agenda-ndays} days.
  6363. @c
  6364. @kindex b
  6365. @item b
  6366. Go backward in time to display earlier dates.
  6367. @c
  6368. @kindex .
  6369. @item .
  6370. Go to today.
  6371. @c
  6372. @kindex j
  6373. @item j
  6374. Prompt for a date and go there.
  6375. @c
  6376. @kindex D
  6377. @item D
  6378. Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
  6379. @c
  6380. @kindex v l
  6381. @kindex v L
  6382. @kindex l
  6383. @item v l @ @r{or short} @ l
  6384. @vindex org-log-done
  6385. @vindex org-agenda-log-mode-items
  6386. Toggle Logbook mode. In Logbook mode, entries that were marked DONE while
  6387. logging was on (variable @code{org-log-done}) are shown in the agenda, as are
  6388. entries that have been clocked on that day. You can configure the entry
  6389. types that should be included in log mode using the variable
  6390. @code{org-agenda-log-mode-items}. When called with a @kbd{C-u} prefix, show
  6391. all possible logbook entries, including state changes. When called with two
  6392. prefix args @kbd{C-u C-u}, show only logging information, nothing else.
  6393. @kbd{v L} is equivalent to @kbd{C-u v l}.
  6394. @c
  6395. @kindex v [
  6396. @kindex [
  6397. @item v [ @ @r{or short} @ [
  6398. Include inactive timestamps into the current view. Only for weekly/daily
  6399. agenda and timeline views.
  6400. @c
  6401. @kindex v a
  6402. @kindex v A
  6403. @item v a
  6404. @itemx v A
  6405. Toggle Archives mode. In Archives mode, trees that are marked
  6406. @code{ARCHIVED} are also scanned when producing the agenda. When you use the
  6407. capital @kbd{A}, even all archive files are included. To exit archives mode,
  6408. press @kbd{v a} again.
  6409. @c
  6410. @kindex v R
  6411. @kindex R
  6412. @item v R @ @r{or short} @ R
  6413. @vindex org-agenda-start-with-clockreport-mode
  6414. Toggle Clockreport mode. In Clockreport mode, the daily/weekly agenda will
  6415. always show a table with the clocked times for the timespan and file scope
  6416. covered by the current agenda view. The initial setting for this mode in new
  6417. agenda buffers can be set with the variable
  6418. @code{org-agenda-start-with-clockreport-mode}.
  6419. @c
  6420. @kindex v E
  6421. @kindex E
  6422. @item v E @ @r{or short} @ E
  6423. @vindex org-agenda-start-with-entry-text-mode
  6424. @vindex org-agenda-entry-text-maxlines
  6425. Toggle entry text mode. In entry text mode, a number of lines from the Org
  6426. outline node referenced by an agenda line will be displayed below the line.
  6427. The maximum number of lines is given by the variable
  6428. @code{org-agenda-entry-text-maxlines}. Calling this command with a numeric
  6429. prefix argument will temporarily modify that number to the prefix value.
  6430. @c
  6431. @kindex G
  6432. @item G
  6433. @vindex org-agenda-use-time-grid
  6434. @vindex org-agenda-time-grid
  6435. Toggle the time grid on and off. See also the variables
  6436. @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
  6437. @c
  6438. @kindex r
  6439. @item r
  6440. Recreate the agenda buffer, for example to reflect the changes after
  6441. modification of the timestamps of items with @kbd{S-@key{left}} and
  6442. @kbd{S-@key{right}}. When the buffer is the global TODO list, a prefix
  6443. argument is interpreted to create a selective list for a specific TODO
  6444. keyword.
  6445. @kindex g
  6446. @item g
  6447. Same as @kbd{r}.
  6448. @c
  6449. @kindex s
  6450. @kindex C-x C-s
  6451. @item s
  6452. @itemx C-x C-s
  6453. Save all Org buffers in the current Emacs session, and also the locations of
  6454. IDs.
  6455. @c
  6456. @kindex C-c C-x C-c
  6457. @item C-c C-x C-c
  6458. @vindex org-columns-default-format
  6459. Invoke column view (@pxref{Column view}) in the agenda buffer. The column
  6460. view format is taken from the entry at point, or (if there is no entry at
  6461. point), from the first entry in the agenda view. So whatever the format for
  6462. that entry would be in the original buffer (taken from a property, from a
  6463. @code{#+COLUMNS} line, or from the default variable
  6464. @code{org-columns-default-format}), will be used in the agenda.
  6465. @kindex C-c C-x >
  6466. @item C-c C-x >
  6467. Remove the restriction lock on the agenda, if it is currently restricted to a
  6468. file or subtree (@pxref{Agenda files}).
  6469. @tsubheading{Secondary filtering and query editing}
  6470. @cindex filtering, by tag and effort, in agenda
  6471. @cindex tag filtering, in agenda
  6472. @cindex effort filtering, in agenda
  6473. @cindex query editing, in agenda
  6474. @kindex /
  6475. @item /
  6476. @vindex org-agenda-filter-preset
  6477. Filter the current agenda view with respect to a tag and/or effort estimates.
  6478. The difference between this and a custom agenda command is that filtering is
  6479. very fast, so that you can switch quickly between different filters without
  6480. having to recreate the agenda@footnote{Custom commands can preset a filter by
  6481. binding the variable @code{org-agenda-filter-preset} as an option. This
  6482. filter will then be applied to the view and persist as a basic filter through
  6483. refreshes and more secondary filtering.}
  6484. You will be prompted for a tag selection letter, SPC will mean any tag at
  6485. all. Pressing @key{TAB} at that prompt will offer use completion to select a
  6486. tag (including any tags that do not have a selection character). The command
  6487. then hides all entries that do not contain or inherit this tag. When called
  6488. with prefix arg, remove the entries that @emph{do} have the tag. A second
  6489. @kbd{/} at the prompt will turn off the filter and unhide any hidden entries.
  6490. If the first key you press is either @kbd{+} or @kbd{-}, the previous filter
  6491. will be narrowed by requiring or forbidding the selected additional tag.
  6492. Instead of pressing @kbd{+} or @kbd{-} after @kbd{/}, you can also
  6493. immediately use the @kbd{\} command.
  6494. @vindex org-sort-agenda-noeffort-is-high
  6495. In order to filter for effort estimates, you should set-up allowed
  6496. efforts globally, for example
  6497. @lisp
  6498. (setq org-global-properties
  6499. '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
  6500. @end lisp
  6501. You can then filter for an effort by first typing an operator, one of
  6502. @kbd{<}, @kbd{>}, and @kbd{=}, and then the one-digit index of an effort
  6503. estimate in your array of allowed values, where @kbd{0} means the 10th value.
  6504. The filter will then restrict to entries with effort smaller-or-equal, equal,
  6505. or larger-or-equal than the selected value. If the digits 0-9 are not used
  6506. as fast access keys to tags, you can also simply press the index digit
  6507. directly without an operator. In this case, @kbd{<} will be assumed. For
  6508. application of the operator, entries without a defined effort will be treated
  6509. according to the value of @code{org-sort-agenda-noeffort-is-high}. To filter
  6510. for tasks without effort definition, press @kbd{?} as the operator.
  6511. Org also supports automatic, context-aware tag filtering. If the variable
  6512. @code{org-agenda-auto-exclude-function} is set to a user-defined function,
  6513. that function can decide which tags should be excluded from the agenda
  6514. automatically. Once this is set, the @kbd{/} command then accepts @kbd{RET}
  6515. as a sub-option key and runs the auto exclusion logic. For example, let's
  6516. say you use a @code{Net} tag to identify tasks which need network access, an
  6517. @code{Errand} tag for errands in town, and a @code{Call} tag for making phone
  6518. calls. You could auto-exclude these tags based on the availability of the
  6519. Internet, and outside of business hours, with something like this:
  6520. @lisp
  6521. @group
  6522. (defun org-my-auto-exclude-function (tag)
  6523. (and (cond
  6524. ((string= tag "Net")
  6525. (/= 0 (call-process "/sbin/ping" nil nil nil
  6526. "-c1" "-q" "-t1" "mail.gnu.org")))
  6527. ((or (string= tag "Errand") (string= tag "Call"))
  6528. (let ((hour (nth 2 (decode-time))))
  6529. (or (< hour 8) (> hour 21)))))
  6530. (concat "-" tag)))
  6531. (setq org-agenda-auto-exclude-function 'org-my-auto-exclude-function)
  6532. @end group
  6533. @end lisp
  6534. @kindex \
  6535. @item \
  6536. Narrow the current agenda filter by an additional condition. When called with
  6537. prefix arg, remove the entries that @emph{do} have the tag, or that do match
  6538. the effort criterion. You can achieve the same effect by pressing @kbd{+} or
  6539. @kbd{-} as the first key after the @kbd{/} command.
  6540. @kindex [
  6541. @kindex ]
  6542. @kindex @{
  6543. @kindex @}
  6544. @item [ ] @{ @}
  6545. @table @i
  6546. @item @r{in} search view
  6547. add new search words (@kbd{[} and @kbd{]}) or new regular expressions
  6548. (@kbd{@{} and @kbd{@}}) to the query string. The opening bracket/brace will
  6549. add a positive search term prefixed by @samp{+}, indicating that this search
  6550. term @i{must} occur/match in the entry. The closing bracket/brace will add a
  6551. negative search term which @i{must not} occur/match in the entry for it to be
  6552. selected.
  6553. @end table
  6554. @page
  6555. @tsubheading{Remote editing}
  6556. @cindex remote editing, from agenda
  6557. @item 0-9
  6558. Digit argument.
  6559. @c
  6560. @cindex undoing remote-editing events
  6561. @cindex remote editing, undo
  6562. @kindex C-_
  6563. @item C-_
  6564. Undo a change due to a remote editing command. The change is undone
  6565. both in the agenda buffer and in the remote buffer.
  6566. @c
  6567. @kindex t
  6568. @item t
  6569. Change the TODO state of the item, both in the agenda and in the
  6570. original org file.
  6571. @c
  6572. @kindex C-S-@key{right}
  6573. @kindex C-S-@key{left}
  6574. @item C-S-@key{right}@r{/}@key{left}
  6575. Switch to the next/previous set of TODO keywords.
  6576. @c
  6577. @kindex C-k
  6578. @item C-k
  6579. @vindex org-agenda-confirm-kill
  6580. Delete the current agenda item along with the entire subtree belonging
  6581. to it in the original Org file. If the text to be deleted remotely
  6582. is longer than one line, the kill needs to be confirmed by the user. See
  6583. variable @code{org-agenda-confirm-kill}.
  6584. @c
  6585. @kindex C-c C-w
  6586. @item C-c C-w
  6587. Refile the entry at point.
  6588. @c
  6589. @kindex C-c C-x C-a
  6590. @kindex a
  6591. @item C-c C-x C-a @ @r{or short} @ a
  6592. @vindex org-archive-default-command
  6593. Archive the subtree corresponding to the entry at point using the default
  6594. archiving command set in @code{org-archive-default-command}. When using the
  6595. @code{a} key, confirmation will be required.
  6596. @c
  6597. @kindex C-c C-x a
  6598. @item C-c C-x a
  6599. Toggle the ARCHIVE tag for the current headline.
  6600. @c
  6601. @kindex C-c C-x A
  6602. @item C-c C-x A
  6603. Move the subtree corresponding to the current entry to its @emph{archive
  6604. sibling}.
  6605. @c
  6606. @kindex $
  6607. @kindex C-c C-x C-s
  6608. @item C-c C-x C-s @ @r{or short} @ $
  6609. Archive the subtree corresponding to the current headline. This means the
  6610. entry will be moved to the configured archive location, most likely a
  6611. different file.
  6612. @c
  6613. @kindex T
  6614. @item T
  6615. @vindex org-agenda-show-inherited-tags
  6616. Show all tags associated with the current item. This is useful if you have
  6617. turned off @code{org-agenda-show-inherited-tags}, but still want to see all
  6618. tags of a headline occasionally.
  6619. @c
  6620. @kindex :
  6621. @item :
  6622. Set tags for the current headline. If there is an active region in the
  6623. agenda, change a tag for all headings in the region.
  6624. @c
  6625. @kindex ,
  6626. @item ,
  6627. Set the priority for the current item. Org mode prompts for the
  6628. priority character. If you reply with @key{SPC}, the priority cookie
  6629. is removed from the entry.
  6630. @c
  6631. @kindex P
  6632. @item P
  6633. Display weighted priority of current item.
  6634. @c
  6635. @kindex +
  6636. @kindex S-@key{up}
  6637. @item +
  6638. @itemx S-@key{up}
  6639. Increase the priority of the current item. The priority is changed in
  6640. the original buffer, but the agenda is not resorted. Use the @kbd{r}
  6641. key for this.
  6642. @c
  6643. @kindex -
  6644. @kindex S-@key{down}
  6645. @item -
  6646. @itemx S-@key{down}
  6647. Decrease the priority of the current item.
  6648. @c
  6649. @kindex z
  6650. @item z
  6651. @vindex org-log-into-drawer
  6652. Add a note to the entry. This note will be recorded, and then files to the
  6653. same location where state change notes are put. Depending on
  6654. @code{org-log-into-drawer}, this maybe inside a drawer.
  6655. @c
  6656. @kindex C-c C-a
  6657. @item C-c C-a
  6658. Dispatcher for all command related to attachments.
  6659. @c
  6660. @kindex C-c C-s
  6661. @item C-c C-s
  6662. Schedule this item
  6663. @c
  6664. @kindex C-c C-d
  6665. @item C-c C-d
  6666. Set a deadline for this item.
  6667. @c
  6668. @kindex k
  6669. @item k
  6670. Agenda actions, to set dates for selected items to the cursor date.
  6671. This command also works in the calendar! The command prompts for an
  6672. additional key:
  6673. @example
  6674. m @r{Mark the entry at point for action. You can also make entries}
  6675. @r{in Org files with @kbd{C-c C-x C-k}.}
  6676. d @r{Set the deadline of the marked entry to the date at point.}
  6677. s @r{Schedule the marked entry at the date at point.}
  6678. r @r{Call @code{org-remember} with the cursor date as default date.}
  6679. @end example
  6680. @noindent
  6681. Press @kbd{r} afterward to refresh the agenda and see the effect of the
  6682. command.
  6683. @c
  6684. @kindex S-@key{right}
  6685. @item S-@key{right}
  6686. Change the timestamp associated with the current line by one day into the
  6687. future. With a numeric prefix argument, change it by that many days. For
  6688. example, @kbd{3 6 5 S-@key{right}} will change it by a year. With a
  6689. @kbd{C-u} prefix, change the time by one hour. If you immediately repeat the
  6690. command, it will continue to change hours even without the prefix arg. With
  6691. a double @kbd{C-u C-u} prefix, do the same for changing minutes. The stamp
  6692. is changed in the original Org file, but the change is not directly reflected
  6693. in the agenda buffer. Use @kbd{r} or @kbd{g} to update the buffer.
  6694. @c
  6695. @kindex S-@key{left}
  6696. @item S-@key{left}
  6697. Change the timestamp associated with the current line by one day
  6698. into the past.
  6699. @c
  6700. @kindex >
  6701. @item >
  6702. Change the timestamp associated with the current line. The key @kbd{>} has
  6703. been chosen, because it is the same as @kbd{S-.} on my keyboard.
  6704. @c
  6705. @kindex I
  6706. @item I
  6707. Start the clock on the current item. If a clock is running already, it
  6708. is stopped first.
  6709. @c
  6710. @kindex O
  6711. @item O
  6712. Stop the previously started clock.
  6713. @c
  6714. @kindex X
  6715. @item X
  6716. Cancel the currently running clock.
  6717. @kindex J
  6718. @item J
  6719. Jump to the running clock in another window.
  6720. @tsubheading{Bulk remote editing selected entries}
  6721. @cindex remote editing, bulk, from agenda
  6722. @kindex m
  6723. @item s
  6724. Mark the entry at point for bulk action.
  6725. @kindex u
  6726. @item u
  6727. Unmark entry for bulk action.
  6728. @kindex U
  6729. @item U
  6730. Unmark all marked entries for bulk action.
  6731. @kindex B
  6732. @item B
  6733. Bulk action: act on all marked entries in the agenda. This will prompt for
  6734. another key to select the action to be applied:
  6735. @example
  6736. r @r{Prompt for a single refile target and move all entries. The entries}
  6737. @r{will no longer be in the agenda, refresh (@kbd{g}) to bring them back.}
  6738. $ @r{Archive all selected entries.}
  6739. A @r{Archive entries by moving them to their respective archive siblings.}
  6740. t @r{Change TODO state. This prompts for a single TODO keyword and}
  6741. @r{changes the state of all selected entries, bypassing blocking and}
  6742. @r{suppressing logging notes (but not time stamps).}
  6743. + @r{Add a tag to all selected entries.}
  6744. - @r{Remove a tag from all selected entries.}
  6745. s @r{Schedule all items to a new date. To shift existing schedule dates}
  6746. @r{by a fixed number of days, use something starting with double plus}
  6747. @r{at the prompt, for example @samp{++8d} or @samp{++2w}.}
  6748. d @r{Set deadline to a specific date.}
  6749. @end example
  6750. @tsubheading{Calendar commands}
  6751. @cindex calendar commands, from agenda
  6752. @kindex c
  6753. @item c
  6754. Open the Emacs calendar and move to the date at the agenda cursor.
  6755. @c
  6756. @item c
  6757. When in the calendar, compute and show the Org mode agenda for the
  6758. date at the cursor.
  6759. @c
  6760. @cindex diary entries, creating from agenda
  6761. @kindex i
  6762. @item i
  6763. @vindex org-agenda-diary-file
  6764. Insert a new entry into the diary, using the date at the cursor and (for
  6765. block entries) the date at the mark. This will add to the Emacs diary
  6766. file@footnote{This file is parsed for the agenda when
  6767. @code{org-agenda-include-diary} is set.}, in a way similar to the @kbd{i}
  6768. command in the calendar. The diary file will pop up in another window, where
  6769. you can add the entry.
  6770. If you configure @code{org-agenda-diary-file} to point to an Org-mode file,
  6771. Org will create entries (in org-mode syntax) in that file instead. Most
  6772. entries will be stored in a date-based outline tree that will later make it
  6773. easy to archive appointments from previous months/years. The tree will be
  6774. build under an entry with a @code{DATE_TREE} property, or else with years as
  6775. top-level entries. Emacs will prompt you for the entry text - if you specify
  6776. it, the entry will be created in @code{org-agenda-diary-file} without further
  6777. interaction. If you directly press @key{RET} at the prompt without typing
  6778. text, the target file will be shown in another window for you to finish the
  6779. entry there. See also the @kbd{k r} command.
  6780. @c
  6781. @kindex M
  6782. @item M
  6783. Show the phases of the moon for the three months around current date.
  6784. @c
  6785. @kindex S
  6786. @item S
  6787. Show sunrise and sunset times. The geographical location must be set
  6788. with calendar variables, see the documentation for the Emacs calendar.
  6789. @c
  6790. @kindex C
  6791. @item C
  6792. Convert the date at cursor into many other cultural and historic
  6793. calendars.
  6794. @c
  6795. @kindex H
  6796. @item H
  6797. Show holidays for three months around the cursor date.
  6798. @item M-x org-export-icalendar-combine-agenda-files
  6799. Export a single iCalendar file containing entries from all agenda files.
  6800. This is a globally available command, and also available in the agenda menu.
  6801. @tsubheading{Exporting to a file}
  6802. @kindex C-x C-w
  6803. @item C-x C-w
  6804. @cindex exporting agenda views
  6805. @cindex agenda views, exporting
  6806. @vindex org-agenda-exporter-settings
  6807. Write the agenda view to a file. Depending on the extension of the selected
  6808. file name, the view will be exported as HTML (extension @file{.html} or
  6809. @file{.htm}), Postscript (extension @file{.ps}), PDF (extension @file{.pdf}),
  6810. and plain text (any other extension). When called with a @kbd{C-u} prefix
  6811. argument, immediately open the newly created file. Use the variable
  6812. @code{org-agenda-exporter-settings} to set options for @file{ps-print} and
  6813. for @file{htmlize} to be used during export.
  6814. @tsubheading{Quit and Exit}
  6815. @kindex q
  6816. @item q
  6817. Quit agenda, remove the agenda buffer.
  6818. @c
  6819. @kindex x
  6820. @cindex agenda files, removing buffers
  6821. @item x
  6822. Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
  6823. for the compilation of the agenda. Buffers created by the user to
  6824. visit Org files will not be removed.
  6825. @end table
  6826. @node Custom agenda views, Exporting Agenda Views, Agenda commands, Agenda Views
  6827. @section Custom agenda views
  6828. @cindex custom agenda views
  6829. @cindex agenda views, custom
  6830. Custom agenda commands serve two purposes: to store and quickly access
  6831. frequently used TODO and tags searches, and to create special composite
  6832. agenda buffers. Custom agenda commands will be accessible through the
  6833. dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
  6834. @menu
  6835. * Storing searches:: Type once, use often
  6836. * Block agenda:: All the stuff you need in a single buffer
  6837. * Setting Options:: Changing the rules
  6838. @end menu
  6839. @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
  6840. @subsection Storing searches
  6841. The first application of custom searches is the definition of keyboard
  6842. shortcuts for frequently used searches, either creating an agenda
  6843. buffer, or a sparse tree (the latter covering of course only the current
  6844. buffer).
  6845. @kindex C-c a C
  6846. @vindex org-agenda-custom-commands
  6847. Custom commands are configured in the variable
  6848. @code{org-agenda-custom-commands}. You can customize this variable, for
  6849. example by pressing @kbd{C-c a C}. You can also directly set it with
  6850. Emacs Lisp in @file{.emacs}. The following example contains all valid
  6851. search types:
  6852. @lisp
  6853. @group
  6854. (setq org-agenda-custom-commands
  6855. '(("w" todo "WAITING")
  6856. ("W" todo-tree "WAITING")
  6857. ("u" tags "+boss-urgent")
  6858. ("v" tags-todo "+boss-urgent")
  6859. ("U" tags-tree "+boss-urgent")
  6860. ("f" occur-tree "\\<FIXME\\>")
  6861. ("h" . "HOME+Name tags searches") ; description for "h" prefix
  6862. ("hl" tags "+home+Lisa")
  6863. ("hp" tags "+home+Peter")
  6864. ("hk" tags "+home+Kim")))
  6865. @end group
  6866. @end lisp
  6867. @noindent
  6868. The initial string in each entry defines the keys you have to press
  6869. after the dispatcher command @kbd{C-c a} in order to access the command.
  6870. Usually this will be just a single character, but if you have many
  6871. similar commands, you can also define two-letter combinations where the
  6872. first character is the same in several combinations and serves as a
  6873. prefix key@footnote{You can provide a description for a prefix key by
  6874. inserting a cons cell with the prefix and the description.}. The second
  6875. parameter is the search type, followed by the string or regular
  6876. expression to be used for the matching. The example above will
  6877. therefore define:
  6878. @table @kbd
  6879. @item C-c a w
  6880. as a global search for TODO entries with @samp{WAITING} as the TODO
  6881. keyword
  6882. @item C-c a W
  6883. as the same search, but only in the current buffer and displaying the
  6884. results as a sparse tree
  6885. @item C-c a u
  6886. as a global tags search for headlines marked @samp{:boss:} but not
  6887. @samp{:urgent:}
  6888. @item C-c a v
  6889. as the same search as @kbd{C-c a u}, but limiting the search to
  6890. headlines that are also TODO items
  6891. @item C-c a U
  6892. as the same search as @kbd{C-c a u}, but only in the current buffer and
  6893. displaying the result as a sparse tree
  6894. @item C-c a f
  6895. to create a sparse tree (again: current buffer only) with all entries
  6896. containing the word @samp{FIXME}
  6897. @item C-c a h
  6898. as a prefix command for a HOME tags search where you have to press an
  6899. additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
  6900. Peter, or Kim) as additional tag to match.
  6901. @end table
  6902. @node Block agenda, Setting Options, Storing searches, Custom agenda views
  6903. @subsection Block agenda
  6904. @cindex block agenda
  6905. @cindex agenda, with block views
  6906. Another possibility is the construction of agenda views that comprise
  6907. the results of @emph{several} commands, each of which creates a block in
  6908. the agenda buffer. The available commands include @code{agenda} for the
  6909. daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
  6910. for the global TODO list (as constructed with @kbd{C-c a t}), and the
  6911. matching commands discussed above: @code{todo}, @code{tags}, and
  6912. @code{tags-todo}. Here are two examples:
  6913. @lisp
  6914. @group
  6915. (setq org-agenda-custom-commands
  6916. '(("h" "Agenda and Home-related tasks"
  6917. ((agenda "")
  6918. (tags-todo "home")
  6919. (tags "garden")))
  6920. ("o" "Agenda and Office-related tasks"
  6921. ((agenda "")
  6922. (tags-todo "work")
  6923. (tags "office")))))
  6924. @end group
  6925. @end lisp
  6926. @noindent
  6927. This will define @kbd{C-c a h} to create a multi-block view for stuff
  6928. you need to attend to at home. The resulting agenda buffer will contain
  6929. your agenda for the current week, all TODO items that carry the tag
  6930. @samp{home}, and also all lines tagged with @samp{garden}. Finally the
  6931. command @kbd{C-c a o} provides a similar view for office tasks.
  6932. @node Setting Options, , Block agenda, Custom agenda views
  6933. @subsection Setting options for custom commands
  6934. @cindex options, for custom agenda views
  6935. @vindex org-agenda-custom-commands
  6936. Org mode contains a number of variables regulating agenda construction
  6937. and display. The global variables define the behavior for all agenda
  6938. commands, including the custom commands. However, if you want to change
  6939. some settings just for a single custom view, you can do so. Setting
  6940. options requires inserting a list of variable names and values at the
  6941. right spot in @code{org-agenda-custom-commands}. For example:
  6942. @lisp
  6943. @group
  6944. (setq org-agenda-custom-commands
  6945. '(("w" todo "WAITING"
  6946. ((org-agenda-sorting-strategy '(priority-down))
  6947. (org-agenda-prefix-format " Mixed: ")))
  6948. ("U" tags-tree "+boss-urgent"
  6949. ((org-show-following-heading nil)
  6950. (org-show-hierarchy-above nil)))
  6951. ("N" search ""
  6952. ((org-agenda-files '("~org/notes.org"))
  6953. (org-agenda-text-search-extra-files nil)))))
  6954. @end group
  6955. @end lisp
  6956. @noindent
  6957. Now the @kbd{C-c a w} command will sort the collected entries only by
  6958. priority, and the prefix format is modified to just say @samp{ Mixed: }
  6959. instead of giving the category of the entry. The sparse tags tree of
  6960. @kbd{C-c a U} will now turn out ultra-compact, because neither the
  6961. headline hierarchy above the match, nor the headline following the match
  6962. will be shown. The command @kbd{C-c a N} will do a text search limited
  6963. to only a single file.
  6964. @vindex org-agenda-custom-commands
  6965. For command sets creating a block agenda,
  6966. @code{org-agenda-custom-commands} has two separate spots for setting
  6967. options. You can add options that should be valid for just a single
  6968. command in the set, and options that should be valid for all commands in
  6969. the set. The former are just added to the command entry, the latter
  6970. must come after the list of command entries. Going back to the block
  6971. agenda example (@pxref{Block agenda}), let's change the sorting strategy
  6972. for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
  6973. the results for GARDEN tags query in the opposite order,
  6974. @code{priority-up}. This would look like this:
  6975. @lisp
  6976. @group
  6977. (setq org-agenda-custom-commands
  6978. '(("h" "Agenda and Home-related tasks"
  6979. ((agenda)
  6980. (tags-todo "home")
  6981. (tags "garden"
  6982. ((org-agenda-sorting-strategy '(priority-up)))))
  6983. ((org-agenda-sorting-strategy '(priority-down))))
  6984. ("o" "Agenda and Office-related tasks"
  6985. ((agenda)
  6986. (tags-todo "work")
  6987. (tags "office")))))
  6988. @end group
  6989. @end lisp
  6990. As you see, the values and parentheses setting is a little complex.
  6991. When in doubt, use the customize interface to set this variable---it
  6992. fully supports its structure. Just one caveat: when setting options in
  6993. this interface, the @emph{values} are just Lisp expressions. So if the
  6994. value is a string, you need to add the double-quotes around the value
  6995. yourself.
  6996. @node Exporting Agenda Views, Agenda column view, Custom agenda views, Agenda Views
  6997. @section Exporting Agenda Views
  6998. @cindex agenda views, exporting
  6999. If you are away from your computer, it can be very useful to have a printed
  7000. version of some agenda views to carry around. Org mode can export custom
  7001. agenda views as plain text, HTML@footnote{You need to install Hrvoje Niksic's
  7002. @file{htmlize.el}.}, Postscript, PDF@footnote{To create PDF output, the
  7003. ghostscript @file{ps2pdf} utility must be installed on the system. Selecting
  7004. a PDF file with also create the postscript file.}, and iCalendar files. If
  7005. you want to do this only occasionally, use the command
  7006. @table @kbd
  7007. @kindex C-x C-w
  7008. @item C-x C-w
  7009. @cindex exporting agenda views
  7010. @cindex agenda views, exporting
  7011. @vindex org-agenda-exporter-settings
  7012. Write the agenda view to a file. Depending on the extension of the selected
  7013. file name, the view will be exported as HTML (extension @file{.html} or
  7014. @file{.htm}), Postscript (extension @file{.ps}), iCalendar (extension
  7015. @file{.ics}), or plain text (any other extension). Use the variable
  7016. @code{org-agenda-exporter-settings} to set options for @file{ps-print} and
  7017. for @file{htmlize} to be used during export, for example
  7018. @vindex org-agenda-add-entry-text-maxlines
  7019. @vindex htmlize-output-type
  7020. @vindex ps-number-of-columns
  7021. @vindex ps-landscape-mode
  7022. @lisp
  7023. (setq org-agenda-exporter-settings
  7024. '((ps-number-of-columns 2)
  7025. (ps-landscape-mode t)
  7026. (org-agenda-add-entry-text-maxlines 5)
  7027. (htmlize-output-type 'css)))
  7028. @end lisp
  7029. @end table
  7030. If you need to export certain agenda views frequently, you can associate
  7031. any custom agenda command with a list of output file names
  7032. @footnote{If you want to store standard views like the weekly agenda
  7033. or the global TODO list as well, you need to define custom commands for
  7034. them in order to be able to specify file names.}. Here is an example
  7035. that first defines custom commands for the agenda and the global
  7036. TODO list, together with a number of files to which to export them.
  7037. Then we define two block agenda commands and specify file names for them
  7038. as well. File names can be relative to the current working directory,
  7039. or absolute.
  7040. @lisp
  7041. @group
  7042. (setq org-agenda-custom-commands
  7043. '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
  7044. ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
  7045. ("h" "Agenda and Home-related tasks"
  7046. ((agenda "")
  7047. (tags-todo "home")
  7048. (tags "garden"))
  7049. nil
  7050. ("~/views/home.html"))
  7051. ("o" "Agenda and Office-related tasks"
  7052. ((agenda)
  7053. (tags-todo "work")
  7054. (tags "office"))
  7055. nil
  7056. ("~/views/office.ps" "~/calendars/office.ics"))))
  7057. @end group
  7058. @end lisp
  7059. The extension of the file name determines the type of export. If it is
  7060. @file{.html}, Org mode will use the @file{htmlize.el} package to convert
  7061. the buffer to HTML and save it to this file name. If the extension is
  7062. @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
  7063. Postscript output. If the extension is @file{.ics}, iCalendar export is
  7064. run export over all files that were used to construct the agenda, and
  7065. limit the export to entries listed in the agenda. Any other
  7066. extension produces a plain ASCII file.
  7067. The export files are @emph{not} created when you use one of those
  7068. commands interactively because this might use too much overhead.
  7069. Instead, there is a special command to produce @emph{all} specified
  7070. files in one step:
  7071. @table @kbd
  7072. @kindex C-c a e
  7073. @item C-c a e
  7074. Export all agenda views that have export file names associated with
  7075. them.
  7076. @end table
  7077. You can use the options section of the custom agenda commands to also
  7078. set options for the export commands. For example:
  7079. @lisp
  7080. (setq org-agenda-custom-commands
  7081. '(("X" agenda ""
  7082. ((ps-number-of-columns 2)
  7083. (ps-landscape-mode t)
  7084. (org-agenda-prefix-format " [ ] ")
  7085. (org-agenda-with-colors nil)
  7086. (org-agenda-remove-tags t))
  7087. ("theagenda.ps"))))
  7088. @end lisp
  7089. @noindent
  7090. This command sets two options for the Postscript exporter, to make it
  7091. print in two columns in landscape format---the resulting page can be cut
  7092. in two and then used in a paper agenda. The remaining settings modify
  7093. the agenda prefix to omit category and scheduling information, and
  7094. instead include a checkbox to check off items. We also remove the tags
  7095. to make the lines compact, and we don't want to use colors for the
  7096. black-and-white printer. Settings specified in
  7097. @code{org-agenda-exporter-settings} will also apply, but the settings
  7098. in @code{org-agenda-custom-commands} take precedence.
  7099. @noindent
  7100. From the command line you may also use
  7101. @example
  7102. emacs -f org-batch-store-agenda-views -kill
  7103. @end example
  7104. @noindent
  7105. or, if you need to modify some parameters@footnote{Quoting depends on the
  7106. system you use, please check the FAQ for examples.}
  7107. @example
  7108. emacs -eval '(org-batch-store-agenda-views \
  7109. org-agenda-ndays 30 \
  7110. org-agenda-start-day "2007-11-01" \
  7111. org-agenda-include-diary nil \
  7112. org-agenda-files (quote ("~/org/project.org")))' \
  7113. -kill
  7114. @end example
  7115. @noindent
  7116. which will create the agenda views restricted to the file
  7117. @file{~/org/project.org}, without diary entries and with a 30-day
  7118. extent.
  7119. You can also extract agenda information in a way that allows further
  7120. processing by other programs. See @ref{Extracting agenda information}, for
  7121. more information.
  7122. @node Agenda column view, , Exporting Agenda Views, Agenda Views
  7123. @section Using column view in the agenda
  7124. @cindex column view, in agenda
  7125. @cindex agenda, column view
  7126. Column view (@pxref{Column view}) is normally used to view and edit
  7127. properties embedded in the hierarchical structure of an Org file. It can be
  7128. quite useful to use column view also from the agenda, where entries are
  7129. collected by certain criteria.
  7130. @table @kbd
  7131. @kindex C-c C-x C-c
  7132. @item C-c C-x C-c
  7133. Turn on column view in the agenda.
  7134. @end table
  7135. To understand how to use this properly, it is important to realize that the
  7136. entries in the agenda are no longer in their proper outline environment.
  7137. This causes the following issues:
  7138. @enumerate
  7139. @item
  7140. @vindex org-columns-default-format
  7141. @vindex org-overriding-columns-format
  7142. Org needs to make a decision which @code{COLUMNS} format to use. Since the
  7143. entries in the agenda are collected from different files, and different files
  7144. may have different @code{COLUMNS} formats, this is a non-trivial problem.
  7145. Org first checks if the variable @code{org-overriding-columns-format} is
  7146. currently set, and if so, takes the format from there. Otherwise it takes
  7147. the format associated with the first item in the agenda, or, if that item
  7148. does not have a specific format (defined in a property, or in its file), it
  7149. uses @code{org-columns-default-format}.
  7150. @item
  7151. @cindex property, special, CLOCKSUM
  7152. If any of the columns has a summary type defined (@pxref{Column attributes}),
  7153. turning on column view in the agenda will visit all relevant agenda files and
  7154. make sure that the computations of this property are up to date. This is
  7155. also true for the special @code{CLOCKSUM} property. Org will then sum the
  7156. values displayed in the agenda. In the daily/weekly agenda, the sums will
  7157. cover a single day, in all other views they cover the entire block. It is
  7158. vital to realize that the agenda may show the same entry @emph{twice} (for
  7159. example as scheduled and as a deadline), and it may show two entries from the
  7160. same hierarchy (for example a @emph{parent} and its @emph{child}). In these
  7161. cases, the summation in the agenda will lead to incorrect results because
  7162. some values will count double.
  7163. @item
  7164. When the column view in the agenda shows the @code{CLOCKSUM}, that is always
  7165. the entire clocked time for this item. So even in the daily/weekly agenda,
  7166. the clocksum listed in column view may originate from times outside the
  7167. current view. This has the advantage that you can compare these values with
  7168. a column listing the planned total effort for a task---one of the major
  7169. applications for column view in the agenda. If you want information about
  7170. clocked time in the displayed period use clock table mode (press @kbd{R} in
  7171. the agenda).
  7172. @end enumerate
  7173. @node Markup, Exporting, Agenda Views, Top
  7174. @chapter Markup for rich export
  7175. When exporting Org-mode documents, the exporter tries to reflect the
  7176. structure of the document as accurately as possible in the backend. Since
  7177. export targets like HTML, La@TeX{}, or DocBook allow much richer formatting,
  7178. Org mode has rules on how to prepare text for rich export. This section
  7179. summarizes the markup rules used in an Org-mode buffer.
  7180. @menu
  7181. * Structural markup elements:: The basic structure as seen by the exporter
  7182. * Images and tables:: Tables and Images will be included
  7183. * Literal examples:: Source code examples with special formatting
  7184. * Include files:: Include additional files into a document
  7185. * Macro replacement:: Use macros to create complex output
  7186. * Embedded LaTeX:: LaTeX can be freely used inside Org documents
  7187. @end menu
  7188. @node Structural markup elements, Images and tables, Markup, Markup
  7189. @section Structural markup elements
  7190. @menu
  7191. * Document title:: Where the title is taken from
  7192. * Headings and sections:: The document structure as seen by the exporter
  7193. * Table of contents:: The if and where of the table of contents
  7194. * Initial text:: Text before the first heading?
  7195. * Lists:: Lists
  7196. * Paragraphs:: Paragraphs
  7197. * Footnote markup:: Footnotes
  7198. * Emphasis and monospace:: Bold, italic, etc.
  7199. * Horizontal rules:: Make a line
  7200. * Comment lines:: What will *not* be exported
  7201. @end menu
  7202. @node Document title, Headings and sections, Structural markup elements, Structural markup elements
  7203. @subheading Document title
  7204. @cindex document title, markup rules
  7205. @noindent
  7206. The title of the exported document is taken from the special line
  7207. @cindex #+TITLE
  7208. @example
  7209. #+TITLE: This is the title of the document
  7210. @end example
  7211. @noindent
  7212. If this line does not exist, the title is derived from the first non-empty,
  7213. non-comment line in the buffer. If no such line exists, or if you have
  7214. turned off exporting of the text before the first headline (see below), the
  7215. title will be the file name without extension.
  7216. @cindex property, EXPORT_TITLE
  7217. If you are exporting only a subtree by marking is as the region, the heading
  7218. of the subtree will become the title of the document. If the subtree has a
  7219. property @code{EXPORT_TITLE}, that will take precedence.
  7220. @node Headings and sections, Table of contents, Document title, Structural markup elements
  7221. @subheading Headings and sections
  7222. @cindex headings and sections, markup rules
  7223. @vindex org-export-headline-levels
  7224. The outline structure of the document as described in @ref{Document
  7225. Structure}, forms the basis for defining sections of the exported document.
  7226. However, since the outline structure is also used for (for example) lists of
  7227. tasks, only the first three outline levels will be used as headings. Deeper
  7228. levels will become itemized lists. You can change the location of this
  7229. switch globally by setting the variable @code{org-export-headline-levels}, or on a
  7230. per-file basis with a line
  7231. @cindex #+OPTIONS
  7232. @example
  7233. #+OPTIONS: H:4
  7234. @end example
  7235. @node Table of contents, Initial text, Headings and sections, Structural markup elements
  7236. @subheading Table of contents
  7237. @cindex table of contents, markup rules
  7238. @vindex org-export-with-toc
  7239. The table of contents is normally inserted directly before the first headline
  7240. of the file. If you would like to get it to a different location, insert the
  7241. string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
  7242. location. The depth of the table of contents is by default the same as the
  7243. number of headline levels, but you can choose a smaller number, or turn off
  7244. the table of contents entirely, by configuring the variable
  7245. @code{org-export-with-toc}, or on a per-file basis with a line like
  7246. @example
  7247. #+OPTIONS: toc:2 (only to two levels in TOC)
  7248. #+OPTIONS: toc:nil (no TOC at all)
  7249. @end example
  7250. @node Initial text, Lists, Table of contents, Structural markup elements
  7251. @subheading Text before the first headline
  7252. @cindex text before first headline, markup rules
  7253. @cindex #+TEXT
  7254. Org mode normally exports the text before the first headline, and even uses
  7255. the first line as the document title. The text will be fully marked up. If
  7256. you need to include literal HTML, La@TeX{}, or DocBook code, use the special
  7257. constructs described below in the sections for the individual exporters.
  7258. @vindex org-export-skip-text-before-1st-heading
  7259. Some people like to use the space before the first headline for setup and
  7260. internal links and therefore would like to control the exported text before
  7261. the first headline in a different way. You can do so by setting the variable
  7262. @code{org-export-skip-text-before-1st-heading} to @code{t}. On a per-file
  7263. basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
  7264. @noindent
  7265. If you still want to have some text before the first headline, use the
  7266. @code{#+TEXT} construct:
  7267. @example
  7268. #+OPTIONS: skip:t
  7269. #+TEXT: This text will go before the *first* headline.
  7270. #+TEXT: [TABLE-OF-CONTENTS]
  7271. #+TEXT: This goes between the table of contents and the first headline
  7272. @end example
  7273. @node Lists, Paragraphs, Initial text, Structural markup elements
  7274. @subheading Lists
  7275. @cindex lists, markup rules
  7276. Plain lists as described in @ref{Plain lists}, are translated to the backend's
  7277. syntax for such lists. Most backends support unordered, ordered, and
  7278. description lists.
  7279. @node Paragraphs, Footnote markup, Lists, Structural markup elements
  7280. @subheading Paragraphs, line breaks, and quoting
  7281. @cindex paragraphs, markup rules
  7282. Paragraphs are separated by at least one empty line. If you need to enforce
  7283. a line break within a paragraph, use @samp{\\} at the end of a line.
  7284. To keep the line breaks in a region, but otherwise use normal formatting, you
  7285. can use this construct, which can also be used to format poetry.
  7286. @cindex #+BEGIN_VERSE
  7287. @example
  7288. #+BEGIN_VERSE
  7289. Great clouds overhead
  7290. Tiny black birds rise and fall
  7291. Snow covers Emacs
  7292. -- AlexSchroeder
  7293. #+END_VERSE
  7294. @end example
  7295. When quoting a passage from another document, it is customary to format this
  7296. as a paragraph that is indented on both the left and the right margin. You
  7297. can include quotations in Org-mode documents like this:
  7298. @cindex #+BEGIN_QUOTE
  7299. @example
  7300. #+BEGIN_QUOTE
  7301. Everything should be made as simple as possible,
  7302. but not any simpler -- Albert Einstein
  7303. #+END_QUOTE
  7304. @end example
  7305. If you would like to center some text, do it like this:
  7306. @cindex #+BEGIN_CENTER
  7307. @example
  7308. #+BEGIN_CENTER
  7309. Everything should be made as simple as possible, \\
  7310. but not any simpler
  7311. #+END_CENTER
  7312. @end example
  7313. @node Footnote markup, Emphasis and monospace, Paragraphs, Structural markup elements
  7314. @subheading Footnote markup
  7315. @cindex footnotes, markup rules
  7316. @cindex @file{footnote.el}
  7317. Footnotes defined in the way described in @ref{Footnotes}, will be exported by
  7318. all backends. Org allows multiple references to the same note, and
  7319. different backends support this to varying degrees.
  7320. @node Emphasis and monospace, Horizontal rules, Footnote markup, Structural markup elements
  7321. @subheading Emphasis and monospace
  7322. @cindex underlined text, markup rules
  7323. @cindex bold text, markup rules
  7324. @cindex italic text, markup rules
  7325. @cindex verbatim text, markup rules
  7326. @cindex code text, markup rules
  7327. @cindex strike-through text, markup rules
  7328. You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
  7329. and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
  7330. in the code and verbatim string is not processed for Org-mode specific
  7331. syntax, it is exported verbatim.
  7332. @node Horizontal rules, Comment lines, Emphasis and monospace, Structural markup elements
  7333. @subheading Horizontal rules
  7334. @cindex horizontal rules, markup rules
  7335. A line consisting of only dashes, and at least 5 of them, will be
  7336. exported as a horizontal line (@samp{<hr/>} in HTML).
  7337. @node Comment lines, , Horizontal rules, Structural markup elements
  7338. @subheading Comment lines
  7339. @cindex comment lines
  7340. @cindex exporting, not
  7341. @cindex #+BEGIN_COMMENT
  7342. Lines starting with @samp{#} in column zero are treated as comments and will
  7343. never be exported. If you want an indented line to be treated as a comment,
  7344. start it with @samp{#+ }. Also entire subtrees starting with the word
  7345. @samp{COMMENT} will never be exported. Finally, regions surrounded by
  7346. @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
  7347. @table @kbd
  7348. @kindex C-c ;
  7349. @item C-c ;
  7350. Toggle the COMMENT keyword at the beginning of an entry.
  7351. @end table
  7352. @node Images and tables, Literal examples, Structural markup elements, Markup
  7353. @section Images and Tables
  7354. @cindex tables, markup rules
  7355. @cindex #+CAPTION
  7356. @cindex #+LABEL
  7357. Both the native Org mode tables (@pxref{Tables}) and tables formatted with
  7358. the @file{table.el} package will be exported properly. For Org mode tables,
  7359. the lines before the first horizontal separator line will become table header
  7360. lines. You can use the following lines somewhere before the table to assign
  7361. a caption and a label for cross references:
  7362. @example
  7363. #+CAPTION: This is the caption for the next table (or link)
  7364. #+LABEL: tbl:basic-data
  7365. | ... | ...|
  7366. |-----|----|
  7367. @end example
  7368. @cindex inlined images, markup rules
  7369. Some backends (HTML, La@TeX{}, and DocBook) allow you to directly include
  7370. images into the exported document. Org does this, if a link to an image
  7371. files does not have a description part, for example @code{[[./img/a.jpg]]}.
  7372. If you wish to define a caption for the image and maybe a label for internal
  7373. cross references, you sure that the link is on a line by itself precede it
  7374. with:
  7375. @example
  7376. #+CAPTION: This is the caption for the next figure link (or table)
  7377. #+LABEL: fig:SED-HR4049
  7378. [[./img/a.jpg]]
  7379. @end example
  7380. You may also define additional attributes for the figure. As this is
  7381. backend-specific, see the sections about the individual backends for more
  7382. information.
  7383. @node Literal examples, Include files, Images and tables, Markup
  7384. @section Literal examples
  7385. @cindex literal examples, markup rules
  7386. @cindex code line references, markup rules
  7387. You can include literal examples that should not be subjected to
  7388. markup. Such examples will be typeset in monospace, so this is well suited
  7389. for source code and similar examples.
  7390. @cindex #+BEGIN_EXAMPLE
  7391. @example
  7392. #+BEGIN_EXAMPLE
  7393. Some example from a text file.
  7394. #+END_EXAMPLE
  7395. @end example
  7396. Note that such blocks may be @i{indented} in order to align nicely with
  7397. indented text and in particular with plain list structure (@pxref{Plain
  7398. lists}). For simplicity when using small examples, you can also start the
  7399. example lines with a colon followed by a space. There may also be additional
  7400. whitespace before the colon:
  7401. @example
  7402. Here is an example
  7403. : Some example from a text file.
  7404. @end example
  7405. @cindex formatting source code, markup rules
  7406. If the example is source code from a programming language, or any other text
  7407. that can be marked up by font-lock in Emacs, you can ask for the example to
  7408. look like the fontified Emacs buffer@footnote{Currently this works for the
  7409. HTML backend, and requires the @file{htmlize.el} package version 1.34 or
  7410. later. It also works for LaTeX with the listings package, if you turn on the
  7411. option @code{org-export-latex-listings} and make sure that the listings
  7412. package is included by the LaTeX header.}. This is done with the @samp{src}
  7413. block, where you also need to specify the name of the major mode that should
  7414. be used to fontify the example:
  7415. @cindex #+BEGIN_SRC
  7416. @example
  7417. #+BEGIN_SRC emacs-lisp
  7418. (defun org-xor (a b)
  7419. "Exclusive or."
  7420. (if a (not b) b))
  7421. #+END_SRC
  7422. @end example
  7423. Both in @code{example} and in @code{src} snippets, you can add a @code{-n}
  7424. switch to the end of the @code{BEGIN} line, to get the lines of the example
  7425. numbered. If you use a @code{+n} switch, the numbering from the previous
  7426. numbered snippet will be continued in the current one. In literal examples,
  7427. Org will interpret strings like @samp{(ref:name)} as labels, and use them as
  7428. targets for special hyperlinks like @code{[[(name)]]} (i.e. the reference name
  7429. enclosed in single parenthesis). In HTML, hovering the mouse over such a
  7430. link will remote-highlight the corresponding code line, which is kind of
  7431. cool.
  7432. You can also add a @code{-r} switch which @i{removes} the labels from the
  7433. source code@footnote{Adding @code{-k} to @code{-n -r} will @i{keep} the
  7434. labels in the source code while using line numbers for the links, which might
  7435. be useful to explain those in an org-mode example code.}. With the @code{-n}
  7436. switch, links to these references will be labeled by the line numbers from
  7437. the code listing, otherwise links will use the labels with no parentheses.
  7438. Here is an example:
  7439. @example
  7440. #+BEGIN_SRC emacs-lisp -n -r
  7441. (save-excursion (ref:sc)
  7442. (goto-char (point-min)) (ref:jump)
  7443. #+END_SRC
  7444. In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]]
  7445. jumps to point-min.
  7446. @end example
  7447. @vindex org-coderef-label-format
  7448. If the syntax for the label format conflicts with the language syntax, use a
  7449. @code{-l} switch to change the format, for example @samp{#+BEGIN_SRC pascal
  7450. -n -r -l "((%s))"}. See also the variable @code{org-coderef-label-format}.
  7451. HTML export also allows examples to be published as text areas, @xref{Text
  7452. areas in HTML export}.
  7453. @table @kbd
  7454. @kindex C-c '
  7455. @item C-c '
  7456. Edit the source code example at point in its native mode. This works by
  7457. switching to a temporary buffer with the source code. You need to exit by
  7458. pressing @kbd{C-c '} again@footnote{Upon exit, lines starting with @samp{*}
  7459. or @samp{#} will get a comma prepended, to keep them from being interpreted
  7460. by Org as outline nodes or special comments. These commas will be striped
  7461. for editing with @kbd{C-c '}, and also for export.}, the edited version will
  7462. then replace the old version in the Org buffer. Fixed-width regions
  7463. (where each line starts with a colon followed by a space) will be edited
  7464. using @code{artist-mode}@footnote{You may select a different-mode with the
  7465. variable @code{org-edit-fixed-width-region-mode}.} to allow creating ASCII
  7466. drawings easily. Using this command in an empty line will create a new
  7467. fixed-width region.
  7468. @kindex C-c l
  7469. @item C-c l
  7470. Calling @code{org-store-link} while editing a source code example in a
  7471. temporary buffer created with @kbd{C-c '} will prompt for a label, make sure
  7472. that it is unique in the current buffer, and insert it with the proper
  7473. formatting like @samp{(ref:label)} at the end of the current line. Then the
  7474. label is stored as a link @samp{(label)}, for retrieval with @kbd{C-c C-l}.
  7475. @end table
  7476. @node Include files, Macro replacement, Literal examples, Markup
  7477. @section Include files
  7478. @cindex include files, markup rules
  7479. During export, you can include the content of another file. For example, to
  7480. include your @file{.emacs} file, you could use:
  7481. @cindex #+INCLUDE
  7482. @example
  7483. #+INCLUDE: "~/.emacs" src emacs-lisp
  7484. @end example
  7485. @noindent
  7486. The optional second and third parameter are the markup (e.g. @samp{quote},
  7487. @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
  7488. language for formatting the contents. The markup is optional, if it is not
  7489. given, the text will be assumed to be in Org mode format and will be
  7490. processed normally. The include line will also allow additional keyword
  7491. parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
  7492. first line and for each following line, as well as any options accepted by
  7493. the selected markup. For example, to include a file as an item, use
  7494. @example
  7495. #+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
  7496. @end example
  7497. @table @kbd
  7498. @kindex C-c '
  7499. @item C-c '
  7500. Visit the include file at point.
  7501. @end table
  7502. @node Macro replacement, Embedded LaTeX, Include files, Markup
  7503. @section Macro replacement
  7504. @cindex macro replacement, during export
  7505. @cindex #+MACRO
  7506. You can define text snippets with
  7507. @example
  7508. #+MACRO: name replacement text $1, $2 are arguments
  7509. @end example
  7510. @noindent which can be referenced anywhere in the document (even in
  7511. code examples) with @code{@{@{@{name(arg1,arg2)@}@}@}}. In addition to
  7512. defined macros, @code{@{@{@{title@}@}@}}, @code{@{@{@{author@}@}@}}, etc.,
  7513. will reference information set by the @code{#+TITLE:}, @code{#+AUTHOR:}, and
  7514. similar lines. Also, @code{@{@{@{date(@var{FORMAT})@}@}@}} and
  7515. @code{@{@{@{modification-time(@var{FORMAT})@}@}@}} refer to current date time
  7516. and to the modification time of the file being exported, respectively.
  7517. @var{FORMAT} should be a format string understood by
  7518. @code{format-time-string}.
  7519. Macro expansion takes place during export, and some people use it to
  7520. construct complex HTML code.
  7521. @node Embedded LaTeX, , Macro replacement, Markup
  7522. @section Embedded La@TeX{}
  7523. @cindex @TeX{} interpretation
  7524. @cindex La@TeX{} interpretation
  7525. Plain ASCII is normally sufficient for almost all note taking. One
  7526. exception, however, are scientific notes which need to be able to contain
  7527. mathematical symbols and the occasional formula. La@TeX{}@footnote{La@TeX{}
  7528. is a macro system based on Donald E. Knuth's @TeX{} system. Many of the
  7529. features described here as ``La@TeX{}'' are really from @TeX{}, but for
  7530. simplicity I am blurring this distinction.} is widely used to typeset
  7531. scientific documents. Org mode supports embedding La@TeX{} code into its
  7532. files, because many academics are used to reading La@TeX{} source code, and
  7533. because it can be readily processed into images for HTML production.
  7534. It is not necessary to mark La@TeX{} macros and code in any special way.
  7535. If you observe a few conventions, Org mode knows how to find it and what
  7536. to do with it.
  7537. @menu
  7538. * Special symbols:: Greek letters and other symbols
  7539. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  7540. * LaTeX fragments:: Complex formulas made easy
  7541. * Previewing LaTeX fragments:: What will this snippet look like?
  7542. * CDLaTeX mode:: Speed up entering of formulas
  7543. @end menu
  7544. @node Special symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
  7545. @subsection Special symbols
  7546. @cindex math symbols
  7547. @cindex special symbols
  7548. @cindex @TeX{} macros
  7549. @cindex La@TeX{} fragments, markup rules
  7550. @cindex HTML entities
  7551. @cindex La@TeX{} entities
  7552. You can use La@TeX{} macros to insert special symbols like @samp{\alpha} to
  7553. indicate the Greek letter, or @samp{\to} to indicate an arrow. Completion
  7554. for these macros is available, just type @samp{\} and maybe a few letters,
  7555. and press @kbd{M-@key{TAB}} to see possible completions. Unlike La@TeX{}
  7556. code, Org mode allows these macros to be present without surrounding math
  7557. delimiters, for example:
  7558. @example
  7559. Angles are written as Greek letters \alpha, \beta and \gamma.
  7560. @end example
  7561. @vindex org-html-entities
  7562. During export, these symbols will be transformed into the native format of
  7563. the exporter backend. Strings like @code{\alpha} will be exported as
  7564. @code{&alpha;} in the HTML output, and as @code{$\alpha$} in the La@TeX{}
  7565. output. Similarly, @code{\nbsp} will become @code{&nbsp;} in HTML and
  7566. @code{~} in La@TeX{}. If you need such a symbol inside a word, terminate it
  7567. like this: @samp{\Aacute@{@}stor}.
  7568. A large number of entities is provided, with names taken from both HTML and
  7569. La@TeX{}, see the variable @code{org-html-entities} for the complete list.
  7570. @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
  7571. @samp{...} are all converted into special commands creating hyphens of
  7572. different lengths or a compact set of dots.
  7573. @node Subscripts and superscripts, LaTeX fragments, Special symbols, Embedded LaTeX
  7574. @subsection Subscripts and superscripts
  7575. @cindex subscript
  7576. @cindex superscript
  7577. Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
  7578. and subscripts. Again, these can be used without embedding them in
  7579. math-mode delimiters. To increase the readability of ASCII text, it is
  7580. not necessary (but OK) to surround multi-character sub- and superscripts
  7581. with curly braces. For example
  7582. @example
  7583. The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
  7584. the sun is R_@{sun@} = 6.96 x 10^8 m.
  7585. @end example
  7586. @vindex org-export-with-sub-superscripts
  7587. To avoid interpretation as raised or lowered text, you can quote @samp{^} and
  7588. @samp{_} with a backslash: @samp{\^} and @samp{\_}. If you write a text
  7589. where the underscore is often used in a different context, Org's convention
  7590. to always interpret these as subscripts can get in your way. Configure the
  7591. variable @code{org-export-with-sub-superscripts} to globally change this
  7592. convention, or use, on a per-file basis:
  7593. @example
  7594. #+OPTIONS: ^:@{@}
  7595. @end example
  7596. @node LaTeX fragments, Previewing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
  7597. @subsection La@TeX{} fragments
  7598. @cindex La@TeX{} fragments
  7599. @vindex org-format-latex-header
  7600. With symbols, sub- and superscripts, HTML is pretty much at its end when
  7601. it comes to representing mathematical formulas@footnote{Yes, there is
  7602. MathML, but that is not yet fully supported by many browsers, and there
  7603. is no decent converter for turning La@TeX{} or ASCII representations of
  7604. formulas into MathML. So for the time being, converting formulas into
  7605. images seems the way to go.}. More complex expressions need a dedicated
  7606. formula processor. To this end, Org mode can contain arbitrary La@TeX{}
  7607. fragments. It provides commands to preview the typeset result of these
  7608. fragments, and upon export to HTML, all fragments will be converted to
  7609. images and inlined into the HTML document@footnote{The La@TeX{} export
  7610. will not use images for displaying La@TeX{} fragments but include these
  7611. fragments directly into the La@TeX{} code.}. For this to work you
  7612. need to be on a system with a working La@TeX{} installation. You also
  7613. need the @file{dvipng} program, available at
  7614. @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
  7615. will be used when processing a fragment can be configured with the
  7616. variable @code{org-format-latex-header}.
  7617. La@TeX{} fragments don't need any special marking at all. The following
  7618. snippets will be identified as La@TeX{} source code:
  7619. @itemize @bullet
  7620. @item
  7621. Environments of any kind. The only requirement is that the
  7622. @code{\begin} statement appears on a new line, preceded by only
  7623. whitespace.
  7624. @item
  7625. Text within the usual La@TeX{} math delimiters. To avoid conflicts with
  7626. currency specifications, single @samp{$} characters are only recognized as
  7627. math delimiters if the enclosed text contains at most two line breaks, is
  7628. directly attached to the @samp{$} characters with no whitespace in between,
  7629. and if the closing @samp{$} is followed by whitespace, punctuation or a dash.
  7630. For the other delimiters, there is no such restriction, so when in doubt, use
  7631. @samp{\(...\)} as inline math delimiters.
  7632. @end itemize
  7633. @noindent For example:
  7634. @example
  7635. \begin@{equation@} % arbitrary environments,
  7636. x=\sqrt@{b@} % even tables, figures
  7637. \end@{equation@} % etc
  7638. If $a^2=b$ and \( b=2 \), then the solution must be
  7639. either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
  7640. @end example
  7641. @noindent
  7642. @vindex org-format-latex-options
  7643. If you need any of the delimiter ASCII sequences for other purposes, you
  7644. can configure the option @code{org-format-latex-options} to deselect the
  7645. ones you do not wish to have interpreted by the La@TeX{} converter.
  7646. @node Previewing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
  7647. @subsection Previewing LaTeX fragments
  7648. @cindex LaTeX fragments, preview
  7649. La@TeX{} fragments can be processed to produce preview images of the
  7650. typeset expressions:
  7651. @table @kbd
  7652. @kindex C-c C-x C-l
  7653. @item C-c C-x C-l
  7654. Produce a preview image of the La@TeX{} fragment at point and overlay it
  7655. over the source code. If there is no fragment at point, process all
  7656. fragments in the current entry (between two headlines). When called
  7657. with a prefix argument, process the entire subtree. When called with
  7658. two prefix arguments, or when the cursor is before the first headline,
  7659. process the entire buffer.
  7660. @kindex C-c C-c
  7661. @item C-c C-c
  7662. Remove the overlay preview images.
  7663. @end table
  7664. @vindex org-format-latex-options
  7665. You can customize the variable @code{org-format-latex-options} to influence
  7666. some aspects of the preview. In particular, the @code{:scale} (and for HTML
  7667. export, @code{:html-scale}) property can be used to adjust the size of the
  7668. preview images.
  7669. During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
  7670. converted into images and inlined into the document if the following
  7671. setting is active:
  7672. @lisp
  7673. (setq org-export-with-LaTeX-fragments t)
  7674. @end lisp
  7675. @node CDLaTeX mode, , Previewing LaTeX fragments, Embedded LaTeX
  7676. @subsection Using CDLa@TeX{} to enter math
  7677. @cindex CDLa@TeX{}
  7678. CDLa@TeX{} mode is a minor mode that is normally used in combination with a
  7679. major La@TeX{} mode like AUC@TeX{} in order to speed-up insertion of
  7680. environments and math templates. Inside Org mode, you can make use of
  7681. some of the features of CDLa@TeX{} mode. You need to install
  7682. @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
  7683. AUC@TeX{}) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
  7684. Don't use CDLa@TeX{} mode itself under Org mode, but use the light
  7685. version @code{org-cdlatex-mode} that comes as part of Org mode. Turn it
  7686. on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
  7687. Org files with
  7688. @lisp
  7689. (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
  7690. @end lisp
  7691. When this mode is enabled, the following features are present (for more
  7692. details see the documentation of CDLa@TeX{} mode):
  7693. @itemize @bullet
  7694. @kindex C-c @{
  7695. @item
  7696. Environment templates can be inserted with @kbd{C-c @{}.
  7697. @item
  7698. @kindex @key{TAB}
  7699. The @key{TAB} key will do template expansion if the cursor is inside a
  7700. La@TeX{} fragment@footnote{Org mode has a method to test if the cursor is
  7701. inside such a fragment, see the documentation of the function
  7702. @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
  7703. expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
  7704. correctly inside the first brace. Another @key{TAB} will get you into
  7705. the second brace. Even outside fragments, @key{TAB} will expand
  7706. environment abbreviations at the beginning of a line. For example, if
  7707. you write @samp{equ} at the beginning of a line and press @key{TAB},
  7708. this abbreviation will be expanded to an @code{equation} environment.
  7709. To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
  7710. @item
  7711. @kindex _
  7712. @kindex ^
  7713. @vindex cdlatex-simplify-sub-super-scripts
  7714. Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
  7715. characters together with a pair of braces. If you use @key{TAB} to move
  7716. out of the braces, and if the braces surround only a single character or
  7717. macro, they are removed again (depending on the variable
  7718. @code{cdlatex-simplify-sub-super-scripts}).
  7719. @item
  7720. @kindex `
  7721. Pressing the backquote @kbd{`} followed by a character inserts math
  7722. macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
  7723. after the backquote, a help window will pop up.
  7724. @item
  7725. @kindex '
  7726. Pressing the single-quote @kbd{'} followed by another character modifies
  7727. the symbol before point with an accent or a font. If you wait more than
  7728. 1.5 seconds after the backquote, a help window will pop up. Character
  7729. modification will work only inside La@TeX{} fragments, outside the quote
  7730. is normal.
  7731. @end itemize
  7732. @node Exporting, Publishing, Markup, Top
  7733. @chapter Exporting
  7734. @cindex exporting
  7735. Org-mode documents can be exported into a variety of other formats. For
  7736. printing and sharing of notes, ASCII export produces a readable and simple
  7737. version of an Org file. HTML export allows you to publish a notes file on
  7738. the web, while the XOXO format provides a solid base for exchange with a
  7739. broad range of other applications. La@TeX{} export lets you use Org mode and
  7740. its structured editing functions to easily create La@TeX{} files. DocBook
  7741. export makes it possible to convert Org files to many other formats using
  7742. DocBook tools. To incorporate entries with associated times like deadlines
  7743. or appointments into a desktop calendar program like iCal, Org mode can also
  7744. produce extracts in the iCalendar format. Currently Org mode only supports
  7745. export, not import of these different formats.
  7746. Org supports export of selected regions when @code{transient-mark-mode} is
  7747. enabled (default in Emacs 23).
  7748. @menu
  7749. * Selective export:: Using tags to select and exclude trees
  7750. * Export options:: Per-file export settings
  7751. * The export dispatcher:: How to access exporter commands
  7752. * ASCII export:: Exporting to plain ASCII
  7753. * HTML export:: Exporting to HTML
  7754. * LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
  7755. * DocBook export:: Exporting to DocBook
  7756. * Freemind export:: Exporting to Freemind mind maps
  7757. * XOXO export:: Exporting to XOXO
  7758. * iCalendar export:: Exporting in iCalendar format
  7759. @end menu
  7760. @node Selective export, Export options, Exporting, Exporting
  7761. @section Selective export
  7762. @cindex export, selective by tags
  7763. @vindex org-export-select-tags
  7764. @vindex org-export-exclude-tags
  7765. You may use tags to select the parts of a document that should be exported,
  7766. or to exclude parts from export. This behavior is governed by two variables:
  7767. @code{org-export-select-tags} and @code{org-export-exclude-tags}.
  7768. Org first checks if any of the @emph{select} tags is present in the buffer.
  7769. If yes, all trees that do not carry one of these tags will be excluded. If a
  7770. selected tree is a subtree, the heading hierarchy above it will also be
  7771. selected for export, but not the text below those headings.
  7772. @noindent
  7773. If none of the select tags is found, the whole buffer will be selected for
  7774. export.
  7775. @noindent
  7776. Finally, all subtrees that are marked by any of the @emph{exclude} tags will
  7777. be removed from the export buffer.
  7778. @node Export options, The export dispatcher, Selective export, Exporting
  7779. @section Export options
  7780. @cindex options, for export
  7781. @cindex completion, of option keywords
  7782. The exporter recognizes special lines in the buffer which provide
  7783. additional information. These lines may be put anywhere in the file.
  7784. The whole set of lines can be inserted into the buffer with @kbd{C-c
  7785. C-e t}. For individual lines, a good way to make sure the keyword is
  7786. correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
  7787. (@pxref{Completion}). For a summary of other in-buffer settings not
  7788. specifically related to export, see @ref{In-buffer settings}.
  7789. In particular, note that you can place commonly-used (export) options in
  7790. a separate file which can be included using @code{#+SETUPFILE}.
  7791. @table @kbd
  7792. @kindex C-c C-e t
  7793. @item C-c C-e t
  7794. Insert template with export options, see example below.
  7795. @end table
  7796. @cindex #+TITLE
  7797. @cindex #+AUTHOR
  7798. @cindex #+DATE
  7799. @cindex #+EMAIL
  7800. @cindex #+DESCRIPTION
  7801. @cindex #+KEYWORDS
  7802. @cindex #+LANGUAGE
  7803. @cindex #+TEXT
  7804. @cindex #+OPTIONS
  7805. @cindex #+BIND
  7806. @cindex #+LINK_UP
  7807. @cindex #+LINK_HOME
  7808. @cindex #+EXPORT_SELECT_TAGS
  7809. @cindex #+EXPORT_EXCLUDE_TAGS
  7810. @cindex #+LATEX_HEADER
  7811. @vindex user-full-name
  7812. @vindex user-mail-address
  7813. @vindex org-export-default-language
  7814. @example
  7815. #+TITLE: the title to be shown (default is the buffer name)
  7816. #+AUTHOR: the author (default taken from @code{user-full-name})
  7817. #+DATE: a date, fixed, of a format string for @code{format-time-string}
  7818. #+EMAIL: his/her email address (default from @code{user-mail-address})
  7819. #+DESCRIPTION: the page description, e.g. for the XHTML meta tag
  7820. #+KEYWORDS: the page keywords, e.g. for the XHTML meta tag
  7821. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  7822. #+TEXT: Some descriptive text to be inserted at the beginning.
  7823. #+TEXT: Several lines may be given.
  7824. #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
  7825. #+BIND: lisp-var lisp-val, e.g.: org-export-latex-low-levels itemize
  7826. @r{You need to confirm using these, or configure @code{org-export-allow-BIND}}
  7827. #+LINK_UP: the ``up'' link of an exported page
  7828. #+LINK_HOME: the ``home'' link of an exported page
  7829. #+LATEX_HEADER: extra line(s) for the LaTeX header, like \usepackage@{xyz@}
  7830. #+EXPORT_SELECT_TAGS: Tags that select a tree for export
  7831. #+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
  7832. @end example
  7833. @noindent
  7834. The OPTIONS line is a compact@footnote{If you want to configure many options
  7835. this way, you can use several OPTIONS lines.} form to specify export settings. Here
  7836. you can:
  7837. @cindex headline levels
  7838. @cindex section-numbers
  7839. @cindex table of contents
  7840. @cindex line-break preservation
  7841. @cindex quoted HTML tags
  7842. @cindex fixed-width sections
  7843. @cindex tables
  7844. @cindex @TeX{}-like syntax for sub- and superscripts
  7845. @cindex footnotes
  7846. @cindex special strings
  7847. @cindex emphasized text
  7848. @cindex @TeX{} macros
  7849. @cindex La@TeX{} fragments
  7850. @cindex author info, in export
  7851. @cindex time info, in export
  7852. @example
  7853. H: @r{set the number of headline levels for export}
  7854. num: @r{turn on/off section-numbers}
  7855. toc: @r{turn on/off table of contents, or set level limit (integer)}
  7856. \n: @r{turn on/off line-break-preservation (DOES NOT WORK)}
  7857. @@: @r{turn on/off quoted HTML tags}
  7858. :: @r{turn on/off fixed-width sections}
  7859. |: @r{turn on/off tables}
  7860. ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
  7861. @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
  7862. @r{the simple @code{a_b} will be left as it is.}
  7863. -: @r{turn on/off conversion of special strings.}
  7864. f: @r{turn on/off footnotes like this[1].}
  7865. todo: @r{turn on/off inclusion of TODO keywords into exported text}
  7866. pri: @r{turn on/off priority cookies}
  7867. tags: @r{turn on/off inclusion of tags, may also be @code{not-in-toc}}
  7868. <: @r{turn on/off inclusion of any time/date stamps like DEADLINES}
  7869. *: @r{turn on/off emphasized text (bold, italic, underlined)}
  7870. TeX: @r{turn on/off simple @TeX{} macros in plain text}
  7871. LaTeX: @r{turn on/off La@TeX{} fragments}
  7872. skip: @r{turn on/off skipping the text before the first heading}
  7873. author: @r{turn on/off inclusion of author name/email into exported file}
  7874. creator: @r{turn on/off inclusion of creator info into exported file}
  7875. timestamp: @r{turn on/off inclusion creation time into exported file}
  7876. d: @r{turn on/off inclusion of drawers}
  7877. @end example
  7878. @noindent
  7879. These options take effect in both the HTML and La@TeX{} export, except
  7880. for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
  7881. @code{nil} for the La@TeX{} export.
  7882. When exporting only a single subtree by selecting it with @kbd{C-c @@} before
  7883. calling an export command, the subtree can overrule some of the file's export
  7884. settings with properties @code{EXPORT_FILE_NAME}, @code{EXPORT_TITLE},
  7885. @code{EXPORT_TEXT}, @code{EXPORT_AUTHOR}, @code{EXPORT_DATE}, and
  7886. @code{EXPORT_OPTIONS}.
  7887. @node The export dispatcher, ASCII export, Export options, Exporting
  7888. @section The export dispatcher
  7889. @cindex dispatcher, for export commands
  7890. All export commands can be reached using the export dispatcher, which is a
  7891. prefix key that prompts for an additional key specifying the command.
  7892. Normally the entire file is exported, but if there is an active region that
  7893. contains one outline tree, the first heading is used as document title and
  7894. the subtrees are exported.
  7895. @table @kbd
  7896. @kindex C-c C-e
  7897. @item C-c C-e
  7898. @vindex org-export-run-in-background
  7899. Dispatcher for export and publishing commands. Displays a help-window
  7900. listing the additional key(s) needed to launch an export or publishing
  7901. command. The prefix arg is passed through to the exporter. A double prefix
  7902. @kbd{C-u C-u} causes most commands to be executed in the background, in a
  7903. separate Emacs process@footnote{To make this behavior the default, customize
  7904. the variable @code{org-export-run-in-background}.}.
  7905. @kindex C-c C-e v
  7906. @item C-c C-e v
  7907. Like @kbd{C-c C-e}, but only export the text that is currently visible
  7908. (i.e. not hidden by outline visibility).
  7909. @kindex C-u C-u C-c C-e
  7910. @item C-u C-u C-c C-e
  7911. @vindex org-export-run-in-background
  7912. Call an the exporter, but reverse the setting of
  7913. @code{org-export-run-in-background}, i.e. request background processing if
  7914. not set, or force processing in the current Emacs process if set.
  7915. @end table
  7916. @node ASCII export, HTML export, The export dispatcher, Exporting
  7917. @section ASCII export
  7918. @cindex ASCII export
  7919. ASCII export produces a simple and very readable version of an Org-mode
  7920. file.
  7921. @cindex region, active
  7922. @cindex active region
  7923. @cindex transient-mark-mode
  7924. @table @kbd
  7925. @kindex C-c C-e a
  7926. @item C-c C-e a
  7927. @cindex property, EXPORT_FILE_NAME
  7928. Export as ASCII file. For an Org file, @file{myfile.org}, the ASCII file
  7929. will be @file{myfile.txt}. The file will be overwritten without
  7930. warning. If there is an active region@footnote{This requires
  7931. @code{transient-mark-mode} be turned on.}, only the region will be
  7932. exported. If the selected region is a single tree@footnote{To select the
  7933. current subtree, use @kbd{C-c @@}.}, the tree head will
  7934. become the document title. If the tree head entry has or inherits an
  7935. @code{EXPORT_FILE_NAME} property, that name will be used for the
  7936. export.
  7937. @kindex C-c C-e A
  7938. @item C-c C-e A
  7939. Export to a temporary buffer, do not create a file.
  7940. @kindex C-c C-e v a
  7941. @item C-c C-e v a
  7942. Export only the visible part of the document.
  7943. @end table
  7944. @cindex headline levels, for exporting
  7945. In the exported version, the first 3 outline levels will become
  7946. headlines, defining a general document structure. Additional levels
  7947. will be exported as itemized lists. If you want that transition to occur
  7948. at a different level, specify it with a prefix argument. For example,
  7949. @example
  7950. @kbd{C-1 C-c C-e a}
  7951. @end example
  7952. @noindent
  7953. creates only top level headlines and does the rest as items. When
  7954. headlines are converted to items, the indentation of the text following
  7955. the headline is changed to fit nicely under the item. This is done with
  7956. the assumption that the first body line indicates the base indentation of
  7957. the body text. Any indentation larger than this is adjusted to preserve
  7958. the layout relative to the first line. Should there be lines with less
  7959. indentation than the first, these are left alone.
  7960. @vindex org-export-ascii-links-to-notes
  7961. Links will be exported in a footnote-like style, with the descriptive part in
  7962. the text and the link in a note before the next heading. See the variable
  7963. @code{org-export-ascii-links-to-notes} for details and other options.
  7964. @node HTML export, LaTeX and PDF export, ASCII export, Exporting
  7965. @section HTML export
  7966. @cindex HTML export
  7967. Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
  7968. HTML formatting, in ways similar to John Gruber's @emph{markdown}
  7969. language, but with additional support for tables.
  7970. @menu
  7971. * HTML Export commands:: How to invoke HTML export
  7972. * Quoting HTML tags:: Using direct HTML in Org mode
  7973. * Links in HTML export:: How links will be interpreted and formatted
  7974. * Tables in HTML export:: How to modify the formatting of tables
  7975. * Images in HTML export:: How to insert figures into HTML output
  7976. * Text areas in HTML export:: An alternative way to show an example
  7977. * CSS support:: Changing the appearance of the output
  7978. * Javascript support:: Info and Folding in a web browser
  7979. @end menu
  7980. @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
  7981. @subsection HTML export commands
  7982. @cindex region, active
  7983. @cindex active region
  7984. @cindex transient-mark-mode
  7985. @table @kbd
  7986. @kindex C-c C-e h
  7987. @item C-c C-e h
  7988. @cindex property, EXPORT_FILE_NAME
  7989. Export as HTML file @file{myfile.html}. For an Org file @file{myfile.org},
  7990. the ASCII file will be @file{myfile.html}. The file will be overwritten
  7991. without warning. If there is an active region@footnote{This requires
  7992. @code{transient-mark-mode} be turned on.}, only the region will be
  7993. exported. If the selected region is a single tree@footnote{To select the
  7994. current subtree, use @kbd{C-c @@}.}, the tree head will become the document
  7995. title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
  7996. property, that name will be used for the export.
  7997. @kindex C-c C-e b
  7998. @item C-c C-e b
  7999. Export as HTML file and immediately open it with a browser.
  8000. @kindex C-c C-e H
  8001. @item C-c C-e H
  8002. Export to a temporary buffer, do not create a file.
  8003. @kindex C-c C-e R
  8004. @item C-c C-e R
  8005. Export the active region to a temporary buffer. With a prefix argument, do
  8006. not produce the file header and footer, but just the plain HTML section for
  8007. the region. This is good for cut-and-paste operations.
  8008. @kindex C-c C-e v h
  8009. @kindex C-c C-e v b
  8010. @kindex C-c C-e v H
  8011. @kindex C-c C-e v R
  8012. @item C-c C-e v h
  8013. @item C-c C-e v b
  8014. @item C-c C-e v H
  8015. @item C-c C-e v R
  8016. Export only the visible part of the document.
  8017. @item M-x org-export-region-as-html
  8018. Convert the region to HTML under the assumption that it was Org-mode
  8019. syntax before. This is a global command that can be invoked in any
  8020. buffer.
  8021. @item M-x org-replace-region-by-HTML
  8022. Replace the active region (assumed to be in Org-mode syntax) by HTML
  8023. code.
  8024. @end table
  8025. @cindex headline levels, for exporting
  8026. In the exported version, the first 3 outline levels will become headlines,
  8027. defining a general document structure. Additional levels will be exported as
  8028. itemized lists. If you want that transition to occur at a different level,
  8029. specify it with a numeric prefix argument. For example,
  8030. @example
  8031. @kbd{C-2 C-c C-e b}
  8032. @end example
  8033. @noindent
  8034. creates two levels of headings and does the rest as items.
  8035. @node Quoting HTML tags, Links in HTML export, HTML Export commands, HTML export
  8036. @subsection Quoting HTML tags
  8037. Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
  8038. @samp{&gt;} in HTML export. If you want to include simple HTML tags
  8039. which should be interpreted as such, mark them with @samp{@@} as in
  8040. @samp{@@<b>bold text@@</b>}. Note that this really works only for
  8041. simple tags. For more extensive HTML that should be copied verbatim to
  8042. the exported file use either
  8043. @cindex #+HTML
  8044. @cindex #+BEGIN_HTML
  8045. @example
  8046. #+HTML: Literal HTML code for export
  8047. @end example
  8048. @noindent or
  8049. @cindex #+BEGIN_HTML
  8050. @example
  8051. #+BEGIN_HTML
  8052. All lines between these markers are exported literally
  8053. #+END_HTML
  8054. @end example
  8055. @node Links in HTML export, Tables in HTML export, Quoting HTML tags, HTML export
  8056. @subsection Links in HTML export
  8057. @cindex links, in HTML export
  8058. @cindex internal links, in HTML export
  8059. @cindex external links, in HTML export
  8060. Internal links (@pxref{Internal links}) will continue to work in HTML. This
  8061. includes automatic links created by radio targets (@pxref{Radio
  8062. targets}). Links to external files will still work if the target file is on
  8063. the same @i{relative} path as the published Org file. Links to other
  8064. @file{.org} files will be translated into HTML links under the assumption
  8065. that an HTML version also exists of the linked file, at the same relative
  8066. path. @samp{id:} links can then be used to jump to specific entries across
  8067. files. For information related to linking files while publishing them to a
  8068. publishing directory see @ref{Publishing links}.
  8069. If you want to specify attributes for links, you can do so using a special
  8070. @code{#+ATTR_HTML} line to define attributes that will be added to the
  8071. @code{<a>} or @code{<img>} tags. Here is an example that sets @code{title}
  8072. and @code{style} attributes for a link:
  8073. @cindex #+ATTR_HTML
  8074. @example
  8075. #+ATTR_HTML: title="The Org-mode homepage" style="color:red;"
  8076. [[http://orgmode.org]]
  8077. @end example
  8078. @node Tables in HTML export, Images in HTML export, Links in HTML export, HTML export
  8079. @subsection Tables
  8080. @cindex tables, in HTML
  8081. @vindex org-export-html-table-tag
  8082. Org-mode tables are exported to HTML using the table tag defined in
  8083. @code{org-export-html-table-tag}. The default setting makes tables without
  8084. cell borders and frame. If you would like to change this for individual
  8085. tables, place somthing like the following before the table:
  8086. @cindex #+CAPTION
  8087. @cindex #+ATTR_HTML
  8088. @example
  8089. #+CAPTION: This is a table with lines around and between cells
  8090. #+ATTR_HTML: border="2" rules="all" frame="all"
  8091. @end example
  8092. @node Images in HTML export, Text areas in HTML export, Tables in HTML export, HTML export
  8093. @subsection Images in HTML export
  8094. @cindex images, inline in HTML
  8095. @cindex inlining images in HTML
  8096. @vindex org-export-html-inline-images
  8097. HTML export can inline images given as links in the Org file, and
  8098. it can make an image the clickable part of a link. By
  8099. default@footnote{But see the variable
  8100. @code{org-export-html-inline-images}.}, images are inlined if a link does
  8101. not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
  8102. while @samp{[[file:myimg.jpg][the image]]} will just produce a link
  8103. @samp{the image} that points to the image. If the description part
  8104. itself is a @code{file:} link or a @code{http:} URL pointing to an
  8105. image, this image will be inlined and activated so that clicking on the
  8106. image will activate the link. For example, to include a thumbnail that
  8107. will link to a high resolution version of the image, you could use:
  8108. @example
  8109. [[file:highres.jpg][file:thumb.jpg]]
  8110. @end example
  8111. If you need to add attributes to an inlines image, use a @code{#+ATTR_HTML}.
  8112. In the example below we specify the @code{alt} and @code{title} attributes to
  8113. support text viewers and accessibility, and align it to the right.
  8114. @cindex #+CAPTION
  8115. @cindex #+ATTR_HTML
  8116. @example
  8117. #+CAPTION: A black cat stalking a spider
  8118. #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
  8119. [[./img/a.jpg]]
  8120. @end example
  8121. @noindent
  8122. and you could use @code{http} addresses just as well.
  8123. @node Text areas in HTML export, CSS support, Images in HTML export, HTML export
  8124. @subsection Text areas in HTML export
  8125. @cindex text areas, in HTML
  8126. An alternative way to publish literal code examples in HTML is to use text
  8127. areas, where the example can even be edited before pasting it into an
  8128. application. It is triggered by a @code{-t} switch at an @code{example} or
  8129. @code{src} block. Using this switch disables any options for syntax and
  8130. label highlighting, and line numbering, which may be present. You may also
  8131. use @code{-h} and @code{-w} switches to specify the height and width of the
  8132. text area, which default to the number of lines in the example, and 80,
  8133. respectively. For example
  8134. @example
  8135. #+BEGIN_EXAMPLE -t -w 40
  8136. (defun org-xor (a b)
  8137. "Exclusive or."
  8138. (if a (not b) b))
  8139. #+END_EXAMPLE
  8140. @end example
  8141. @node CSS support, Javascript support, Text areas in HTML export, HTML export
  8142. @subsection CSS support
  8143. @cindex CSS, for HTML export
  8144. @cindex HTML export, CSS
  8145. @vindex org-export-html-todo-kwd-class-prefix
  8146. @vindex org-export-html-tag-class-prefix
  8147. You can also give style information for the exported file. The HTML exporter
  8148. assigns the following special CSS classes@footnote{If the classes on TODO
  8149. keywords and tags lead to conflicts, use the variables
  8150. @code{org-export-html-todo-kwd-class-prefix} and
  8151. @code{org-export-html-tag-class-prefix} to make them unique.} to appropriate
  8152. parts of the document---your style specifications may change these, in
  8153. addition to any of the standard classes like for headlines, tables, etc.
  8154. @example
  8155. p.author @r{author information, including email}
  8156. p.date @r{publishing date}
  8157. p.creator @r{creator info, about org-mode version}
  8158. .title @r{document title}
  8159. .todo @r{TODO keywords, all not-done states}
  8160. .done @r{the DONE keywords, all stated the count as done}
  8161. .WAITING @r{each TODO keyword also uses a class named after itself}
  8162. .timestamp @r{timestamp}
  8163. .timestamp-kwd @r{keyword associated with a timestamp, like SCHEDULED}
  8164. .timestamp-wrapper @r{span around keyword plus timestamp}
  8165. .tag @r{tag in a headline}
  8166. ._HOME @r{each tag uses itself as a class, "@@" replaced by "_"}
  8167. .target @r{target for links}
  8168. .linenr @r{the line number in a code example}
  8169. .code-highlighted @r{for highlighting referenced code lines}
  8170. div.outline-N @r{div for outline level N (headline plus text))}
  8171. div.outline-text-N @r{extra div for text at outline level N}
  8172. .section-number-N @r{section number in headlines, different for each level}
  8173. div.figure @r{how to format an inlined image}
  8174. pre.src @r{formatted source code}
  8175. pre.example @r{normal example}
  8176. p.verse @r{verse paragraph}
  8177. div.footnotes @r{footnote section headline}
  8178. p.footnote @r{footnote definition paragraph, containing a footnote}
  8179. .footref @r{a footnote reference number (always a <sup>)}
  8180. .footnum @r{footnote number in footnote definition (always <sup>)}
  8181. @end example
  8182. @vindex org-export-html-style-default
  8183. @vindex org-export-html-style-include-default
  8184. @vindex org-export-html-style
  8185. @vindex org-export-html-extra
  8186. @vindex org-export-html-style-default
  8187. Each exported file contains a compact default style that defines these
  8188. classes in a basic way@footnote{This style is defined in the constant
  8189. @code{org-export-html-style-default}, which you should not modify. To turn
  8190. inclusion of these defaults off, customize
  8191. @code{org-export-html-style-include-default}}. You may overwrite these
  8192. settings, or add to them by using the variables @code{org-export-html-style}
  8193. (for Org-wide settings) and @code{org-export-html-style-extra} (for more
  8194. granular settings, like file-local settings). To set the latter variable
  8195. individually for each file, you can use
  8196. @cindex #+STYLE
  8197. @example
  8198. #+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
  8199. @end example
  8200. @noindent
  8201. For longer style definitions, you can use several such lines. You could also
  8202. directly write a @code{<style>} @code{</style>} section in this way, without
  8203. referring to an external file.
  8204. @c FIXME: More about header and footer styles
  8205. @c FIXME: Talk about links and targets.
  8206. @node Javascript support, , CSS support, HTML export
  8207. @subsection Javascript supported display of web pages
  8208. @cindex Rose, Sebastian
  8209. Sebastian Rose has written a JavaScript program especially designed to
  8210. enhance the web viewing experience of HTML files created with Org. This
  8211. program allows you to view large files in two different ways. The first one
  8212. is an @emph{Info}-like mode where each section is displayed separately and
  8213. navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
  8214. as well, press @kbd{?} for an overview of the available keys). The second
  8215. view type is a @emph{folding} view much like Org provides inside Emacs. The
  8216. script is available at @url{http://orgmode.org/org-info.js} and you can find
  8217. the documentation for it at @url{http://orgmode.org/worg/code/org-info-js/}.
  8218. We host the script at our site, but if you use it a lot, you might
  8219. not want to be dependent on @url{orgmode.org} and prefer to install a local
  8220. copy on your own web server.
  8221. To use the script, you need to make sure that the @file{org-jsinfo.el} module
  8222. gets loaded. It should be loaded by default, but you can try @kbd{M-x
  8223. customize-variable @key{RET} org-modules @key{RET}} to convince yourself that
  8224. this is indeed the case. All it then takes to make use of the program is
  8225. adding a single line to the Org file:
  8226. @cindex #+INFOJS_OPT
  8227. @example
  8228. #+INFOJS_OPT: view:info toc:nil
  8229. @end example
  8230. @noindent
  8231. If this line is found, the HTML header will automatically contain the code
  8232. needed to invoke the script. Using the line above, you can set the following
  8233. viewing options:
  8234. @example
  8235. path: @r{The path to the script. The default is to grab the script from}
  8236. @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
  8237. @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
  8238. view: @r{Initial view when website is first shown. Possible values are:}
  8239. info @r{Info-like interface with one section per page.}
  8240. overview @r{Folding interface, initially showing only top-level.}
  8241. content @r{Folding interface, starting with all headlines visible.}
  8242. showall @r{Folding interface, all headlines and text visible.}
  8243. sdepth: @r{Maximum headline level that will still become an independent}
  8244. @r{section for info and folding modes. The default is taken from}
  8245. @r{@code{org-export-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
  8246. @r{If this is smaller than in @code{org-export-headline-levels}, each}
  8247. @r{info/folding section can still contain child headlines.}
  8248. toc: @r{Should the table of content @emph{initially} be visible?}
  8249. @r{Even when @code{nil}, you can always get to the "toc" with @kbd{i}.}
  8250. tdepth: @r{The depth of the table of contents. The defaults are taken from}
  8251. @r{the variables @code{org-export-headline-levels} and @code{org-export-with-toc}.}
  8252. ftoc: @r{Does the css of the page specify a fixed position for the "toc"?}
  8253. @r{If yes, the toc will never be displayed as a section.}
  8254. ltoc: @r{Should there be short contents (children) in each section?}
  8255. @r{Make this @code{above} if the section should be above initial text.}
  8256. mouse: @r{Headings are highlighted when the mouse is over them. Should be}
  8257. @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
  8258. buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the}
  8259. @r{default), only one such button will be present.}
  8260. @end example
  8261. @noindent
  8262. @vindex org-infojs-options
  8263. @vindex org-export-html-use-infojs
  8264. You can choose default values for these options by customizing the variable
  8265. @code{org-infojs-options}. If you always want to apply the script to your
  8266. pages, configure the variable @code{org-export-html-use-infojs}.
  8267. @node LaTeX and PDF export, DocBook export, HTML export, Exporting
  8268. @section La@TeX{} and PDF export
  8269. @cindex La@TeX{} export
  8270. @cindex PDF export
  8271. @cindex Guerry, Bastien
  8272. Org mode contains a La@TeX{} exporter written by Bastien Guerry. With
  8273. further processing, this backend is also used to produce PDF output. Since
  8274. the La@TeX{} output uses @file{hyperref} to implement links and cross
  8275. references, the PDF output file will be fully linked.
  8276. @menu
  8277. * LaTeX/PDF export commands:: Which key invokes which commands
  8278. * Quoting LaTeX code:: Incorporating literal La@TeX{} code
  8279. * Sectioning structure:: Changing sectioning in La@TeX{} output
  8280. * Tables in LaTeX export:: Options for exporting tables to La@TeX{}
  8281. * Images in LaTeX export:: How to insert figures into La@TeX{} output
  8282. * Beamer class export:: Turning the file into a presentation
  8283. @end menu
  8284. @node LaTeX/PDF export commands, Quoting LaTeX code, LaTeX and PDF export, LaTeX and PDF export
  8285. @subsection La@TeX{} export commands
  8286. @cindex region, active
  8287. @cindex active region
  8288. @cindex transient-mark-mode
  8289. @table @kbd
  8290. @kindex C-c C-e l
  8291. @item C-c C-e l
  8292. @cindex property EXPORT_FILE_NAME
  8293. Export as La@TeX{} file @file{myfile.tex}. For an Org file
  8294. @file{myfile.org}, the ASCII file will be @file{myfile.tex}. The file will
  8295. be overwritten without warning. If there is an active region@footnote{This
  8296. requires @code{transient-mark-mode} be turned on.}, only the region will be
  8297. exported. If the selected region is a single tree@footnote{To select the
  8298. current subtree, use @kbd{C-c @@}.}, the tree head will become the document
  8299. title. If the tree head entry has or inherits an @code{EXPORT_FILE_NAME}
  8300. property, that name will be used for the export.
  8301. @kindex C-c C-e L
  8302. @item C-c C-e L
  8303. Export to a temporary buffer, do not create a file.
  8304. @kindex C-c C-e v l
  8305. @kindex C-c C-e v L
  8306. @item C-c C-e v l
  8307. @item C-c C-e v L
  8308. Export only the visible part of the document.
  8309. @item M-x org-export-region-as-latex
  8310. Convert the region to La@TeX{} under the assumption that it was Org mode
  8311. syntax before. This is a global command that can be invoked in any
  8312. buffer.
  8313. @item M-x org-replace-region-by-latex
  8314. Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
  8315. code.
  8316. @kindex C-c C-e p
  8317. @item C-c C-e p
  8318. Export as La@TeX{} and then process to PDF.
  8319. @kindex C-c C-e d
  8320. @item C-c C-e d
  8321. Export as La@TeX{} and then process to PDF, then open the resulting PDF file.
  8322. @end table
  8323. @cindex headline levels, for exporting
  8324. @vindex org-latex-low-levels
  8325. In the exported version, the first 3 outline levels will become
  8326. headlines, defining a general document structure. Additional levels
  8327. will be exported as description lists. The exporter can ignore them or
  8328. convert them to a custom string depending on
  8329. @code{org-latex-low-levels}.
  8330. If you want that transition to occur at a different level, specify it
  8331. with a numeric prefix argument. For example,
  8332. @example
  8333. @kbd{C-2 C-c C-e l}
  8334. @end example
  8335. @noindent
  8336. creates two levels of headings and does the rest as items.
  8337. @node Quoting LaTeX code, Sectioning structure, LaTeX/PDF export commands, LaTeX and PDF export
  8338. @subsection Quoting La@TeX{} code
  8339. Embedded La@TeX{} as described in @ref{Embedded LaTeX}, will be correctly
  8340. inserted into the La@TeX{} file. This includes simple macros like
  8341. @samp{\ref@{LABEL@}} to create a cross reference to a figure. Furthermore,
  8342. you can add special code that should only be present in La@TeX{} export with
  8343. the following constructs:
  8344. @cindex #+LaTeX
  8345. @cindex #+BEGIN_LaTeX
  8346. @example
  8347. #+LaTeX: Literal LaTeX code for export
  8348. @end example
  8349. @noindent or
  8350. @cindex #+BEGIN_LaTeX
  8351. @example
  8352. #+BEGIN_LaTeX
  8353. All lines between these markers are exported literally
  8354. #+END_LaTeX
  8355. @end example
  8356. @node Sectioning structure, Tables in LaTeX export, Quoting LaTeX code, LaTeX and PDF export
  8357. @subsection Sectioning structure
  8358. @cindex La@TeX{} class
  8359. @cindex La@TeX{} sectioning structure
  8360. By default, the La@TeX{} output uses the class @code{article}.
  8361. @vindex org-export-latex-default-class
  8362. @vindex org-export-latex-classes
  8363. @cindex #+LATEX_HEADER
  8364. @cindex #+LATEX_CLASS
  8365. @cindex #+LATEX_CLASS_OPTIONS
  8366. @cindex property, LATEX_CLASS
  8367. @cindex property, LATEX_CLASS_OPTIONS
  8368. You can change this globally by setting a different value for
  8369. @code{org-export-latex-default-class} or locally by adding an option like
  8370. @code{#+LaTeX_CLASS: myclass} in your file, or with a @code{:LaTeX_CLASS:}
  8371. property that applies when exporting a region containing only this (sub)tree.
  8372. The class should be listed in @code{org-export-latex-classes}, where you can
  8373. also define the sectioning structure for each class, as well as defining
  8374. additional classes. In a similar way, @code{#+LaTeX_CLASS_OPTIONS} or a
  8375. @code{LaTeX_CLASS_OPTIONS} property can specify the options for the
  8376. @code{\documentclass} macro. You can also use @code{#+LATEX_HEADER:
  8377. \usepackage@{xyz@}} to add lines to the header.
  8378. @node Tables in LaTeX export, Images in LaTeX export, Sectioning structure, LaTeX and PDF export
  8379. @subsection Tables in La@TeX{} export
  8380. @cindex tables, in La@TeX{} export
  8381. For La@TeX{} export of a table, you can specify a label and a caption
  8382. (@pxref{Images and tables}). You can also use the @code{ATTR_LaTeX} line to
  8383. request a longtable environment for the table, so that it may span several
  8384. pages. Finally, you can set the alignment string:
  8385. @cindex #+CAPTION
  8386. @cindex #+LABEL
  8387. @cindex #+ATTR_LaTeX
  8388. @example
  8389. #+CAPTION: A long table
  8390. #+LABEL: tbl:long
  8391. #+ATTR_LaTeX: longtable align=l|lp@{3cm@}r|l
  8392. | ..... | ..... |
  8393. | ..... | ..... |
  8394. @end example
  8395. @node Images in LaTeX export, Beamer class export, Tables in LaTeX export, LaTeX and PDF export
  8396. @subsection Images in La@TeX{} export
  8397. @cindex images, inline in La@TeX{}
  8398. @cindex inlining images in La@TeX{}
  8399. Images that are linked to without a description part in the link, like
  8400. @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]} will be inserted into the PDF
  8401. output file resulting from La@TeX{} processing. Org will use an
  8402. @code{\includegraphics} macro to insert the image. If you have specified a
  8403. caption and/or a label as described in @ref{Images and tables}, the figure
  8404. will be wrapped into a @code{figure} environment and thus become a floating
  8405. element. You can use an @code{#+ATTR_LaTeX:} line to specify the various
  8406. options that can be used in the optional argument of the
  8407. @code{\includegraphics} macro. To modify the placement option of the
  8408. @code{figure} environment, add something like @samp{placement=[h!]} to the
  8409. Attributes.
  8410. If you'd like to let text flow around the image, add the word @samp{wrap} to
  8411. the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
  8412. half of the page. To fine-tune, the @code{placement} field will be the
  8413. set of additional arguments needed by the @code{wrapfigure} environment.
  8414. Note that if you change the size of the image, you need to use compatible
  8415. settings for @code{\includegraphics} and @code{wrapfigure}.
  8416. @cindex #+CAPTION
  8417. @cindex #+LABEL
  8418. @cindex #+ATTR_LaTeX
  8419. @example
  8420. #+CAPTION: The black-body emission of the disk around HR 4049
  8421. #+LABEL: fig:SED-HR4049
  8422. #+ATTR_LaTeX: width=5cm,angle=90
  8423. [[./img/sed-hr4049.pdf]]
  8424. #+ATTR_LaTeX: width=0.38\textwidth wrap placement=@{r@}@{0.4\textwidth@}
  8425. [[./img/hst.png]]
  8426. @end example
  8427. If you need references to a label created in this way, write
  8428. @samp{\ref@{fig:SED-HR4049@}} just like in La@TeX{}.
  8429. @node Beamer class export, , Images in LaTeX export, LaTeX and PDF export
  8430. @subsection Beamer class export
  8431. The LaTeX class @file{beamer} allows to produce high quality presentations
  8432. using LaTeX and pdf processing. Org-mode has special support for turning an
  8433. Org-mode file or tree into a @file{beamer} presentation.
  8434. When the LaTeX class for the current buffer (as set with @code{#+LaTeX_CLASS:
  8435. beamer}) or subtree (set with a @code{LaTeX_CLASS} property) is
  8436. @code{beamer}, a special export mode will turn the file or tree into a beamer
  8437. presentation. Any tree with not-to-deep level nesting should in principle be
  8438. exportable as a beamer presentation. By default, the top-level entries (or
  8439. the first level below the selected subtree heading) will be turned into
  8440. frames, and the outline structure below this level will become itemize lists.
  8441. You can also configure the variable @code{org-beamer-frame-level} to a
  8442. different level - then the hierarchy above frames will produce the sectioning
  8443. structure of the presentation.
  8444. A template for useful in-buffer settings or properties can be inserted into
  8445. the buffer with @kbd{M-x org-beamer-settings-template}. Among other things,
  8446. this will install a column view format which is very handy for editing
  8447. special properties used by beamer.
  8448. You can influence the structure of the presentation using the following
  8449. properties:
  8450. @table @code
  8451. @item BEAMER_env
  8452. The environment that should be used to format this entry. Valid environments
  8453. are defined in the constant @code{org-beamer-environments-default}, and you
  8454. can define more in @code{org-beamer-environments-extra}. If this property is
  8455. set, the entry will also get a @code{:B_environment:} tag to make this
  8456. visible. This tag has no semantic meaning, it is only a visual aid.
  8457. @item BEAMER_envargs
  8458. The beamer-special arguments that should be used for the environment, like
  8459. @code{[t]} or @code{[<+->]} of @code{<2-3>}. If the @code{BEAMER_col}
  8460. property is also set, something like @code{C[t]} can be added here as well to
  8461. set an options argument for the implied @code{columns} environment.
  8462. @code{c[t]} will set an option for the implied @code{column} environment.
  8463. @item BEAMER_col
  8464. The width of a column that should start with this entry. If this property is
  8465. set, the entry will also get a @code{:BMCOL:} property to make this visible.
  8466. Also this tag is only a visual aid. When his is a plain number, it will be
  8467. interpreted as a fraction of @code{\textwidth}. Otherwise it will be assumed
  8468. that you have specified the units, like @samp{3cm}. The first such property
  8469. in a frame will start a @code{columns} environment to surround the columns.
  8470. This environment is closed when an entry has a @code{BEAMER_col} property
  8471. with value 0 or 1, or automatically at the end of the frame.
  8472. @item BEAMER_extra
  8473. Additional commands that should be inserted after the environment has been
  8474. opened. For example, when creating a frame, this can be used to specify
  8475. transitions.
  8476. @end table
  8477. Frames will automatically receive a @code{fragile} option if they contain
  8478. source code that uses the verbatim environment. Special @file{beamer}
  8479. specific code can be inserted using @code{#+BEAMER:} and
  8480. @code{#+BEGIN_beamer...#+end_beamer} constructs, similar to other export
  8481. backends, but with the difference that @code{#+LaTeX:} stuff will be included
  8482. in the presentation as well.
  8483. Outline nodes with @code{BEAMER_env} property value @samp{note} or
  8484. @samp{noteNH} will be formatted as beamer notes, i,e, they will be wrapped
  8485. into @code{\note@{...@}}. The former will include the heading as part of the
  8486. note text, the latter will ignore the heading of that node. To simplify note
  8487. generation, it is actually enough to mark the note with a @emph{tag} (either
  8488. @code{:B_note:} or @code{:B_noteNH:}) instead of creating the
  8489. @code{BEAMER_env} property.
  8490. You can turn on a special minor mode @code{org-beamer-mode} for editing
  8491. support with
  8492. @example
  8493. #+STARTUP: beamer
  8494. @end example
  8495. @table @kbd
  8496. @kindex C-c C-b
  8497. @item C-c C-b
  8498. In @code{org-beamer-mode}, this key offers fast selection of a beamer
  8499. environment or the @code{BEAMER_col} property.
  8500. @end table
  8501. Column view provides a great way to set the environment of a node and other
  8502. important parameters. Make sure you are using a COLUMN format that is geared
  8503. toward this special purpose. The command @kbd{M-x
  8504. org-beamer-settings-template} does define such a format.
  8505. Here is a simple example Org document that is intended for beamer export.
  8506. @smallexample
  8507. #+LaTeX_CLASS: beamer
  8508. #+TITLE: Example Presentation
  8509. #+AUTHOR: Carsten Dominik
  8510. #+LaTeX_CLASS_OPTIONS: [presentation]
  8511. #+BEAMER_FRAME_LEVEL: 2
  8512. #+BEAMER_HEADER_EXTRA: \usetheme@{Madrid@}\usecolortheme@{default@}
  8513. #+COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Args) %4BEAMER_col(Col) %8BEAMER_extra(Ex)
  8514. * This is the first structural section
  8515. ** Frame 1 \\ with a subtitle
  8516. *** Thanks to Eric Fraga :BMCOL:B_block:
  8517. :PROPERTIES:
  8518. :BEAMER_env: block
  8519. :BEAMER_envargs: C[t]
  8520. :BEAMER_col: 0.5
  8521. :END:
  8522. for the first viable beamer setup in Org
  8523. *** Thanks to everyone else :BMCOL:B_block:
  8524. :PROPERTIES:
  8525. :BEAMER_col: 0.5
  8526. :BEAMER_env: block
  8527. :BEAMER_envargs: <2->
  8528. :END:
  8529. for contributing to the discussion
  8530. **** This will be formatted as a beamer note :B_note:
  8531. ** Frame 2 \\ where we will not use columns
  8532. *** Request :B_block:
  8533. Please test this stuff!
  8534. @end smallexample
  8535. For more information, see the documentation on Worg.
  8536. @node DocBook export, Freemind export, LaTeX and PDF export, Exporting
  8537. @section DocBook export
  8538. @cindex DocBook export
  8539. @cindex PDF export
  8540. @cindex Cui, Baoqui
  8541. Org contains a DocBook exporter written by Baoqiu Cui. Once an Org file is
  8542. exported to DocBook format, it can be further processed to produce other
  8543. formats, including PDF, HTML, man pages, etc., using many available DocBook
  8544. tools and stylesheets.
  8545. Currently DocBook exporter only supports DocBook V5.0.
  8546. @menu
  8547. * DocBook export commands:: How to invoke DocBook export
  8548. * Quoting DocBook code:: Incorporating DocBook code in Org files
  8549. * Recursive sections:: Recursive sections in DocBook
  8550. * Tables in DocBook export:: Tables are exported as HTML tables
  8551. * Images in DocBook export:: How to insert figures into DocBook output
  8552. * Special characters:: How to handle special characters
  8553. @end menu
  8554. @node DocBook export commands, Quoting DocBook code, DocBook export, DocBook export
  8555. @subsection DocBook export commands
  8556. @cindex region, active
  8557. @cindex active region
  8558. @cindex transient-mark-mode
  8559. @table @kbd
  8560. @kindex C-c C-e D
  8561. @item C-c C-e D
  8562. @cindex property EXPORT_FILE_NAME
  8563. Export as DocBook file. For an Org file, @file{myfile.org}, the DocBook XML
  8564. file will be @file{myfile.xml}. The file will be overwritten without
  8565. warning. If there is an active region@footnote{This requires
  8566. @code{transient-mark-mode} to be turned on}, only the region will be
  8567. exported. If the selected region is a single tree@footnote{To select the
  8568. current subtree, use @kbd{C-c @@}.}, the tree head will become the document
  8569. title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
  8570. property, that name will be used for the export.
  8571. @kindex C-c C-e V
  8572. @item C-c C-e V
  8573. Export as DocBook file, process to PDF, then open the resulting PDF file.
  8574. @vindex org-export-docbook-xslt-proc-command
  8575. @vindex org-export-docbook-xsl-fo-proc-command
  8576. Note that, in order to produce PDF output based on exported DocBook file, you
  8577. need to have XSLT processor and XSL-FO processor software installed on your
  8578. system. Check variables @code{org-export-docbook-xslt-proc-command} and
  8579. @code{org-export-docbook-xsl-fo-proc-command}.
  8580. @kindex C-c C-e v D
  8581. @item C-c C-e v D
  8582. Export only the visible part of the document.
  8583. @end table
  8584. @node Quoting DocBook code, Recursive sections, DocBook export commands, DocBook export
  8585. @subsection Quoting DocBook code
  8586. You can quote DocBook code in Org files and copy it verbatim into exported
  8587. DocBook file with the following constructs:
  8588. @cindex #+DOCBOOK
  8589. @cindex #+BEGIN_DOCBOOK
  8590. @example
  8591. #+DOCBOOK: Literal DocBook code for export
  8592. @end example
  8593. @noindent or
  8594. @cindex #+BEGIN_DOCBOOK
  8595. @example
  8596. #+BEGIN_DOCBOOK
  8597. All lines between these markers are exported by DocBook exporter
  8598. literally.
  8599. #+END_DOCBOOK
  8600. @end example
  8601. For example, you can use the following lines to include a DocBook warning
  8602. admonition. As to what this warning says, you should pay attention to the
  8603. document context when quoting DocBook code in Org files. You may make
  8604. exported DocBook XML files invalid by not quoting DocBook code correctly.
  8605. @example
  8606. #+BEGIN_DOCBOOK
  8607. <warning>
  8608. <para>You should know what you are doing when quoting DocBook XML code
  8609. in your Org file. Invalid DocBook XML file may be generated by
  8610. DocBook exporter if you are not careful!</para>
  8611. </warning>
  8612. #+END_DOCBOOK
  8613. @end example
  8614. @node Recursive sections, Tables in DocBook export, Quoting DocBook code, DocBook export
  8615. @subsection Recursive sections
  8616. @cindex DocBook recursive sections
  8617. DocBook exporter exports Org files as articles using the @code{article}
  8618. element in DocBook. Recursive sections, i.e. @code{section} elements, are
  8619. used in exported articles. Top level headlines in Org files are exported as
  8620. top level sections, and lower level headlines are exported as nested
  8621. sections. The entire structure of Org files will be exported completely, no
  8622. matter how many nested levels of headlines there are.
  8623. Using recursive sections makes it easy to port and reuse exported DocBook
  8624. code in other DocBook document types like @code{book} or @code{set}.
  8625. @node Tables in DocBook export, Images in DocBook export, Recursive sections, DocBook export
  8626. @subsection Tables in DocBook export
  8627. @cindex tables, in DocBook export
  8628. Tables in Org files are exported as HTML tables, which have been supported since
  8629. DocBook V4.3.
  8630. If a table does not have a caption, an informal table is generated using the
  8631. @code{informaltable} element; otherwise, a formal table will be generated
  8632. using the @code{table} element.
  8633. @node Images in DocBook export, Special characters, Tables in DocBook export, DocBook export
  8634. @subsection Images in DocBook export
  8635. @cindex images, inline in DocBook
  8636. @cindex inlining images in DocBook
  8637. Images that are linked to without a description part in the link, like
  8638. @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]}, will be exported to DocBook
  8639. using @code{mediaobject} elements. Each @code{mediaobject} element contains
  8640. an @code{imageobject} that wraps an @code{imagedata} element. If you have
  8641. specified a caption for an image as described in @ref{Images and tables}, a
  8642. @code{caption} element will be added in @code{mediaobject}. If a label is
  8643. also specified, it will be exported as an @code{xml:id} attribute of the
  8644. @code{mediaobject} element.
  8645. @vindex org-export-docbook-default-image-attributes
  8646. Image attributes supported by the @code{imagedata} element, like @code{align}
  8647. or @code{width}, can be specified in two ways: you can either customize
  8648. variable @code{org-export-docbook-default-image-attributes} or use the
  8649. @code{#+ATTR_DOCBOOK:} line. Attributes specified in variable
  8650. @code{org-export-docbook-default-image-attributes} are applied to all inline
  8651. images in the Org file to be exported (unless they are overwritten by image
  8652. attributes specified in @code{#+ATTR_DOCBOOK:} lines).
  8653. The @code{#+ATTR_DOCBOOK:} line can be used to specify additional image
  8654. attributes or overwrite default image attributes for individual images. If
  8655. the same attribute appears in both the @code{#+ATTR_DOCBOOK:} line and
  8656. variable @code{org-export-docbook-default-image-attributes}, the former
  8657. overwrites the latter. Here is an example about how image attributes can be
  8658. set:
  8659. @cindex #+CAPTION
  8660. @cindex #+LABEL
  8661. @cindex #+ATTR_DOCBOOK
  8662. @example
  8663. #+CAPTION: The logo of Org mode
  8664. #+LABEL: unicorn-svg
  8665. #+ATTR_DOCBOOK: scalefit="1" width="100%" depth="100%"
  8666. [[./img/org-mode-unicorn.svg]]
  8667. @end example
  8668. @vindex org-export-docbook-inline-image-extensions
  8669. By default, DocBook exporter recognizes the following image file types:
  8670. @file{jpeg}, @file{jpg}, @file{png}, @file{gif}, and @file{svg}. You can
  8671. customize variable @code{org-export-docbook-inline-image-extensions} to add
  8672. more types to this list as long as DocBook supports them.
  8673. @node Special characters, , Images in DocBook export, DocBook export
  8674. @subsection Special characters in DocBook export
  8675. @cindex Special characters in DocBook export
  8676. @vindex org-export-docbook-doctype
  8677. @vindex org-html-entities
  8678. Special characters that are written in @TeX{}-like syntax, such as @code{\alpha},
  8679. @code{\Gamma}, and @code{\Zeta}, are supported by DocBook exporter. These
  8680. characters are rewritten to XML entities, like @code{&alpha;},
  8681. @code{&Gamma;}, and @code{&Zeta;}, based on the list saved in variable
  8682. @code{org-html-entities}. As long as the generated DocBook file includes the
  8683. corresponding entities, these special characters are recognized.
  8684. You can customize variable @code{org-export-docbook-doctype} to include the
  8685. entities you need. For example, you can set variable
  8686. @code{org-export-docbook-doctype} to the following value to recognize all
  8687. special characters included in XHTML entities:
  8688. @example
  8689. "<!DOCTYPE article [
  8690. <!ENTITY % xhtml1-symbol PUBLIC
  8691. \"-//W3C//ENTITIES Symbol for HTML//EN//XML\"
  8692. \"http://www.w3.org/2003/entities/2007/xhtml1-symbol.ent\"
  8693. >
  8694. %xhtml1-symbol;
  8695. ]>
  8696. "
  8697. @end example
  8698. @node Freemind export, XOXO export, DocBook export, Exporting
  8699. @section Freemind export
  8700. @cindex Freemind export
  8701. @cindex mind map
  8702. The freemind exporter was written by Lennart Borgman.
  8703. @table @kbd
  8704. @kindex C-c C-e m
  8705. @item C-c C-e m
  8706. Export as Freemind mind map @file{myfile.mm}.
  8707. @end table
  8708. @node XOXO export, iCalendar export, Freemind export, Exporting
  8709. @section XOXO export
  8710. @cindex XOXO export
  8711. Org mode contains an exporter that produces XOXO-style output.
  8712. Currently, this exporter only handles the general outline structure and
  8713. does not interpret any additional Org-mode features.
  8714. @table @kbd
  8715. @kindex C-c C-e x
  8716. @item C-c C-e x
  8717. Export as XOXO file @file{myfile.html}.
  8718. @kindex C-c C-e v
  8719. @item C-c C-e v x
  8720. Export only the visible part of the document.
  8721. @end table
  8722. @node iCalendar export, , XOXO export, Exporting
  8723. @section iCalendar export
  8724. @cindex iCalendar export
  8725. @vindex org-icalendar-include-todo
  8726. @vindex org-icalendar-use-deadline
  8727. @vindex org-icalendar-use-scheduled
  8728. @vindex org-icalendar-categories
  8729. Some people use Org mode for keeping track of projects, but still prefer a
  8730. standard calendar application for anniversaries and appointments. In this
  8731. case it can be useful to show deadlines and other time-stamped items in Org
  8732. files in the calendar application. Org mode can export calendar information
  8733. in the standard iCalendar format. If you also want to have TODO entries
  8734. included in the export, configure the variable
  8735. @code{org-icalendar-include-todo}. Plain timestamps are exported as VEVENT,
  8736. and TODO items as VTODO. It will also create events from deadlines that are
  8737. in non-TODO items. Deadlines and scheduling dates in TODO items will be used
  8738. to set the start and due dates for the TODO entry@footnote{See the variables
  8739. @code{org-icalendar-use-deadline} and @code{org-icalendar-use-scheduled}.}.
  8740. As categories, it will use the tags locally defined in the heading, and the
  8741. file/tree category@footnote{To add inherited tags or the TODO state,
  8742. configure the variable @code{org-icalendar-categories}.}.
  8743. @vindex org-icalendar-store-UID
  8744. @cindex property, ID
  8745. The iCalendar standard requires each entry to have a globally unique
  8746. identifier (UID). Org creates these identifiers during export. If you set
  8747. the variable @code{org-icalendar-store-UID}, the UID will be stored in the
  8748. @code{:ID:} property of the entry and re-used next time you report this
  8749. entry. Since a single entry can give rise to multiple iCalendar entries (as
  8750. a timestamp, a deadline, a scheduled item, and as a TODO item), Org adds
  8751. prefixes to the UID, depending on what triggered the inclusion of the entry.
  8752. In this way the UID remains unique, but a synchronization program can still
  8753. figure out from which entry all the different instances originate.
  8754. @table @kbd
  8755. @kindex C-c C-e i
  8756. @item C-c C-e i
  8757. Create iCalendar entries for the current file and store them in the same
  8758. directory, using a file extension @file{.ics}.
  8759. @kindex C-c C-e I
  8760. @item C-c C-e I
  8761. @vindex org-agenda-files
  8762. Like @kbd{C-c C-e i}, but do this for all files in
  8763. @code{org-agenda-files}. For each of these files, a separate iCalendar
  8764. file will be written.
  8765. @kindex C-c C-e c
  8766. @item C-c C-e c
  8767. @vindex org-combined-agenda-icalendar-file
  8768. Create a single large iCalendar file from all files in
  8769. @code{org-agenda-files} and write it to the file given by
  8770. @code{org-combined-agenda-icalendar-file}.
  8771. @end table
  8772. @vindex org-use-property-inheritance
  8773. @vindex org-icalendar-include-body
  8774. @cindex property, SUMMARY
  8775. @cindex property, DESCRIPTION
  8776. @cindex property, LOCATION
  8777. The export will honor SUMMARY, DESCRIPTION and LOCATION@footnote{The LOCATION
  8778. property can be inherited from higher in the hierarchy if you configure
  8779. @code{org-use-property-inheritance} accordingly.} properties if the selected
  8780. entries have them. If not, the summary will be derived from the headline,
  8781. and the description from the body (limited to
  8782. @code{org-icalendar-include-body} characters).
  8783. How this calendar is best read and updated, depends on the application
  8784. you are using. The FAQ covers this issue.
  8785. @node Publishing, Miscellaneous, Exporting, Top
  8786. @chapter Publishing
  8787. @cindex publishing
  8788. @cindex O'Toole, David
  8789. Org includes a publishing management system that allows you to configure
  8790. automatic HTML conversion of @emph{projects} composed of interlinked org
  8791. files. You can also configure Org to automatically upload your exported HTML
  8792. pages and related attachments, such as images and source code files, to a web
  8793. server.
  8794. You can also use Org to convert files into PDF, or even combine HTML and PDF
  8795. conversion so that files are available in both formats on the server.
  8796. Publishing has been contributed to Org by David O'Toole.
  8797. @menu
  8798. * Configuration:: Defining projects
  8799. * Uploading files:: How to get files up on the server
  8800. * Sample configuration:: Example projects
  8801. * Triggering publication:: Publication commands
  8802. @end menu
  8803. @node Configuration, Uploading files, Publishing, Publishing
  8804. @section Configuration
  8805. Publishing needs significant configuration to specify files, destination
  8806. and many other properties of a project.
  8807. @menu
  8808. * Project alist:: The central configuration variable
  8809. * Sources and destinations:: From here to there
  8810. * Selecting files:: What files are part of the project?
  8811. * Publishing action:: Setting the function doing the publishing
  8812. * Publishing options:: Tweaking HTML export
  8813. * Publishing links:: Which links keep working after publishing?
  8814. * Project page index:: Publishing a list of project files
  8815. @end menu
  8816. @node Project alist, Sources and destinations, Configuration, Configuration
  8817. @subsection The variable @code{org-publish-project-alist}
  8818. @cindex org-publish-project-alist
  8819. @cindex projects, for publishing
  8820. @vindex org-publish-project-alist
  8821. Publishing is configured almost entirely through setting the value of one
  8822. variable, called @code{org-publish-project-alist}. Each element of the list
  8823. configures one project, and may be in one of the two following forms:
  8824. @lisp
  8825. ("project-name" :property value :property value ...)
  8826. @r{or}
  8827. ("project-name" :components ("project-name" "project-name" ...))
  8828. @end lisp
  8829. In both cases, projects are configured by specifying property values. A
  8830. project defines the set of files that will be published, as well as the
  8831. publishing configuration to use when publishing those files. When a project
  8832. takes the second form listed above, the individual members of the
  8833. @code{:components} property are taken to be sub-projects, which group
  8834. together files requiring different publishing options. When you publish such
  8835. a ``meta-project'', all the components will also be published, in the
  8836. sequence given.
  8837. @node Sources and destinations, Selecting files, Project alist, Configuration
  8838. @subsection Sources and destinations for files
  8839. @cindex directories, for publishing
  8840. Most properties are optional, but some should always be set. In
  8841. particular, Org needs to know where to look for source files,
  8842. and where to put published files.
  8843. @multitable @columnfractions 0.3 0.7
  8844. @item @code{:base-directory}
  8845. @tab Directory containing publishing source files
  8846. @item @code{:publishing-directory}
  8847. @tab Directory where output files will be published. You can directly
  8848. publish to a webserver using a file name syntax appropriate for
  8849. the Emacs @file{tramp} package. Or you can publish to a local directory and
  8850. use external tools to upload your website (@pxref{Uploading files}).
  8851. @item @code{:preparation-function}
  8852. @tab Function called before starting the publishing process, for example, to
  8853. run @code{make} for updating files to be published.
  8854. @item @code{:completion-function}
  8855. @tab Function called after finishing the publishing process, for example, to
  8856. change permissions of the resulting files.
  8857. @end multitable
  8858. @noindent
  8859. @node Selecting files, Publishing action, Sources and destinations, Configuration
  8860. @subsection Selecting files
  8861. @cindex files, selecting for publishing
  8862. By default, all files with extension @file{.org} in the base directory
  8863. are considered part of the project. This can be modified by setting the
  8864. properties
  8865. @multitable @columnfractions 0.25 0.75
  8866. @item @code{:base-extension}
  8867. @tab Extension (without the dot!) of source files. This actually is a
  8868. regular expression. Set this to the symbol @code{any} if you want to get all
  8869. files in @code{:base-directory}, even without extension.
  8870. @item @code{:exclude}
  8871. @tab Regular expression to match file names that should not be
  8872. published, even though they have been selected on the basis of their
  8873. extension.
  8874. @item @code{:include}
  8875. @tab List of files to be included regardless of @code{:base-extension}
  8876. and @code{:exclude}.
  8877. @end multitable
  8878. @node Publishing action, Publishing options, Selecting files, Configuration
  8879. @subsection Publishing action
  8880. @cindex action, for publishing
  8881. Publishing means that a file is copied to the destination directory and
  8882. possibly transformed in the process. The default transformation is to export
  8883. Org files as HTML files, and this is done by the function
  8884. @code{org-publish-org-to-html} which calls the HTML exporter (@pxref{HTML
  8885. export}). But you also can publish your content as PDF files using
  8886. @code{org-publish-org-to-pdf}. If you want to publish the Org file itself,
  8887. but with @i{archived}, @i{commented}, and @i{tag-excluded} trees removed, use
  8888. @code{org-publish-org-to-org} and set the parameters @code{:plain-source}
  8889. and/or @code{:htmlized-source}. This will produce @file{file.org} and
  8890. @file{file.org.html} in the publishing
  8891. directory@footnote{@file{file-source.org} and @file{file-source.org.html} if
  8892. source and publishing directories are equal. Note that with this kind of
  8893. setup, you need to add @code{:exclude "-source\\.org"} to the project
  8894. definition in @code{org-publish-project-alist} to avoid that the published
  8895. source files will be considered as new org files the next time the project is
  8896. published.}. Other files like images only
  8897. need to be copied to the publishing destination, for this you may use
  8898. @code{org-publish-attachment}. For non-Org files, you always need to
  8899. specify the publishing function:
  8900. @multitable @columnfractions 0.3 0.7
  8901. @item @code{:publishing-function}
  8902. @tab Function executing the publication of a file. This may also be a
  8903. list of functions, which will all be called in turn.
  8904. @item @code{:plain-source}
  8905. @tab Non-nil means, publish plain source.
  8906. @item @code{:htmlized-source}
  8907. @tab Non-nil means, publish htmlized source.
  8908. @end multitable
  8909. The function must accept two arguments: a property list containing at least a
  8910. @code{:publishing-directory} property, and the name of the file to be
  8911. published. It should take the specified file, make the necessary
  8912. transformation (if any) and place the result into the destination folder.
  8913. @node Publishing options, Publishing links, Publishing action, Configuration
  8914. @subsection Options for the HTML/La@TeX{} exporters
  8915. @cindex options, for publishing
  8916. The property list can be used to set many export options for the HTML
  8917. and La@TeX{} exporters. In most cases, these properties correspond to user
  8918. variables in Org. The table below lists these properties along
  8919. with the variable they belong to. See the documentation string for the
  8920. respective variable for details.
  8921. @vindex org-export-html-link-up
  8922. @vindex org-export-html-link-home
  8923. @vindex org-export-default-language
  8924. @vindex org-display-custom-times
  8925. @vindex org-export-headline-levels
  8926. @vindex org-export-with-section-numbers
  8927. @vindex org-export-section-number-format
  8928. @vindex org-export-with-toc
  8929. @vindex org-export-preserve-breaks
  8930. @vindex org-export-with-archived-trees
  8931. @vindex org-export-with-emphasize
  8932. @vindex org-export-with-sub-superscripts
  8933. @vindex org-export-with-special-strings
  8934. @vindex org-export-with-footnotes
  8935. @vindex org-export-with-drawers
  8936. @vindex org-export-with-tags
  8937. @vindex org-export-with-todo-keywords
  8938. @vindex org-export-with-priority
  8939. @vindex org-export-with-TeX-macros
  8940. @vindex org-export-with-LaTeX-fragments
  8941. @vindex org-export-skip-text-before-1st-heading
  8942. @vindex org-export-with-fixed-width
  8943. @vindex org-export-with-timestamps
  8944. @vindex org-export-author-info
  8945. @vindex org-export-creator-info
  8946. @vindex org-export-with-tables
  8947. @vindex org-export-highlight-first-table-line
  8948. @vindex org-export-html-style-include-default
  8949. @vindex org-export-html-style
  8950. @vindex org-export-html-style-extra
  8951. @vindex org-export-html-link-org-files-as-html
  8952. @vindex org-export-html-inline-images
  8953. @vindex org-export-html-extension
  8954. @vindex org-export-html-table-tag
  8955. @vindex org-export-html-expand
  8956. @vindex org-export-html-with-timestamp
  8957. @vindex org-export-publishing-directory
  8958. @vindex org-export-html-preamble
  8959. @vindex org-export-html-postamble
  8960. @vindex org-export-html-auto-preamble
  8961. @vindex org-export-html-auto-postamble
  8962. @vindex user-full-name
  8963. @vindex user-mail-address
  8964. @vindex org-export-select-tags
  8965. @vindex org-export-exclude-tags
  8966. @multitable @columnfractions 0.32 0.68
  8967. @item @code{:link-up} @tab @code{org-export-html-link-up}
  8968. @item @code{:link-home} @tab @code{org-export-html-link-home}
  8969. @item @code{:language} @tab @code{org-export-default-language}
  8970. @item @code{:customtime} @tab @code{org-display-custom-times}
  8971. @item @code{:headline-levels} @tab @code{org-export-headline-levels}
  8972. @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
  8973. @item @code{:section-number-format} @tab @code{org-export-section-number-format}
  8974. @item @code{:table-of-contents} @tab @code{org-export-with-toc}
  8975. @item @code{:preserve-breaks} @tab @code{org-export-preserve-breaks}
  8976. @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
  8977. @item @code{:emphasize} @tab @code{org-export-with-emphasize}
  8978. @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
  8979. @item @code{:special-strings} @tab @code{org-export-with-special-strings}
  8980. @item @code{:footnotes} @tab @code{org-export-with-footnotes}
  8981. @item @code{:drawers} @tab @code{org-export-with-drawers}
  8982. @item @code{:tags} @tab @code{org-export-with-tags}
  8983. @item @code{:todo-keywords} @tab @code{org-export-with-todo-keywords}
  8984. @item @code{:priority} @tab @code{org-export-with-priority}
  8985. @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
  8986. @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
  8987. @item @code{:latex-listings} @tab @code{org-export-latex-listings}
  8988. @item @code{:skip-before-1st-heading} @tab @code{org-export-skip-text-before-1st-heading}
  8989. @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
  8990. @item @code{:timestamps} @tab @code{org-export-with-timestamps}
  8991. @item @code{:author-info} @tab @code{org-export-author-info}
  8992. @item @code{:creator-info} @tab @code{org-export-creator-info}
  8993. @item @code{:tables} @tab @code{org-export-with-tables}
  8994. @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
  8995. @item @code{:style-include-default} @tab @code{org-export-html-style-include-default}
  8996. @item @code{:style} @tab @code{org-export-html-style}
  8997. @item @code{:style-extra} @tab @code{org-export-html-style-extra}
  8998. @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
  8999. @item @code{:inline-images} @tab @code{org-export-html-inline-images}
  9000. @item @code{:html-extension} @tab @code{org-export-html-extension}
  9001. @item @code{:xml-declaration} @tab @code{org-export-html-xml-declaration}
  9002. @item @code{:html-table-tag} @tab @code{org-export-html-table-tag}
  9003. @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
  9004. @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
  9005. @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
  9006. @item @code{:preamble} @tab @code{org-export-html-preamble}
  9007. @item @code{:postamble} @tab @code{org-export-html-postamble}
  9008. @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
  9009. @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
  9010. @item @code{:author} @tab @code{user-full-name}
  9011. @item @code{:email} @tab @code{user-mail-address} : @code{addr;addr;..}
  9012. @item @code{:select-tags} @tab @code{org-export-select-tags}
  9013. @item @code{:exclude-tags} @tab @code{org-export-exclude-tags}
  9014. @item @code{:latex-image-options} @tab @code{org-export-latex-image-default-option}
  9015. @end multitable
  9016. Most of the @code{org-export-with-*} variables have the same effect in
  9017. both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
  9018. @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
  9019. La@TeX{} export.
  9020. @vindex org-publish-project-alist
  9021. When a property is given a value in @code{org-publish-project-alist},
  9022. its setting overrides the value of the corresponding user variable (if
  9023. any) during publishing. Options set within a file (@pxref{Export
  9024. options}), however, override everything.
  9025. @node Publishing links, Project page index, Publishing options, Configuration
  9026. @subsection Links between published files
  9027. @cindex links, publishing
  9028. To create a link from one Org file to another, you would use
  9029. something like @samp{[[file:foo.org][The foo]]} or simply
  9030. @samp{file:foo.org.} (@pxref{Hyperlinks}). When published, this link
  9031. becomes a link to @file{foo.html}. In this way, you can interlink the
  9032. pages of your "org web" project and the links will work as expected when
  9033. you publish them to HTML. If you also publish the Org source file and want
  9034. to link to that, use an @code{http:} link instead of a @code{file:} link,
  9035. because @code{file:} links are converted to link to the corresponding
  9036. @file{html} file.
  9037. You may also link to related files, such as images. Provided you are careful
  9038. with relative file names, and provided you have also configured Org to upload
  9039. the related files, these links will work too. See @ref{Complex example}, for
  9040. an example of this usage.
  9041. Sometimes an Org file to be published may contain links that are
  9042. only valid in your production environment, but not in the publishing
  9043. location. In this case, use the property
  9044. @multitable @columnfractions 0.4 0.6
  9045. @item @code{:link-validation-function}
  9046. @tab Function to validate links
  9047. @end multitable
  9048. @noindent
  9049. to define a function for checking link validity. This function must
  9050. accept two arguments, the file name and a directory relative to which
  9051. the file name is interpreted in the production environment. If this
  9052. function returns @code{nil}, then the HTML generator will only insert a
  9053. description into the HTML file, but no link. One option for this
  9054. function is @code{org-publish-validate-link} which checks if the given
  9055. file is part of any project in @code{org-publish-project-alist}.
  9056. @node Project page index, , Publishing links, Configuration
  9057. @subsection Project page index
  9058. @cindex index, of published pages
  9059. The following properties may be used to control publishing of an
  9060. index of files or a summary page for a given project.
  9061. @multitable @columnfractions 0.25 0.75
  9062. @item @code{:auto-index}
  9063. @tab When non-nil, publish an index during @code{org-publish-current-project}
  9064. or @code{org-publish-all}.
  9065. @item @code{:index-filename}
  9066. @tab Filename for output of index. Defaults to @file{sitemap.org} (which
  9067. becomes @file{sitemap.html}).
  9068. @item @code{:index-title}
  9069. @tab Title of index page. Defaults to name of file.
  9070. @item @code{:index-function}
  9071. @tab Plug-in function to use for generation of index.
  9072. Defaults to @code{org-publish-org-index}, which generates a plain list
  9073. of links to all files in the project.
  9074. @end multitable
  9075. @node Uploading files, Sample configuration, Configuration, Publishing
  9076. @section Uploading files
  9077. @cindex rsync
  9078. @cindex unison
  9079. For those people already utilizing third party sync tools such as
  9080. @command{rsync} or @command{unison}, it might be preferable not to use the built in
  9081. @i{remote} publishing facilities of Org mode which rely heavily on
  9082. Tramp. Tramp, while very useful and powerful, tends not to be
  9083. so efficient for multiple file transfer and has been known to cause problems
  9084. under heavy usage.
  9085. Specialized synchronization utilities offer several advantages. In addition
  9086. to timestamp comparison, they also do content and permissions/attribute
  9087. checks. For this reason you might prefer to publish your web to a local
  9088. directory (possibly even @i{in place} with your Org files) and then use
  9089. @file{unison} or @file{rsync} to do the synchronization with the remote host.
  9090. Since Unison (for example) can be configured as to which files to transfer to
  9091. a certain remote destination, it can greatly simplify the project publishing
  9092. definition. Simply keep all files in the correct location, process your Org
  9093. files with @code{org-publish} and let the synchronization tool do the rest.
  9094. You do not need, in this scenario, to include attachments such as @file{jpg},
  9095. @file{css} or @file{gif} files in the project definition since the 3rd party
  9096. tool syncs them.
  9097. Publishing to a local directory is also much faster than to a remote one, so
  9098. that you can afford more easily to republish entire projects. If you set
  9099. @code{org-publish-use-timestamps-flag} to @code{nil}, you gain the main
  9100. benefit of re-including any changed external files such as source example
  9101. files you might include with @code{#+INCLUDE}. The timestamp mechanism in
  9102. Org is not smart enough to detect if included files have been modified.
  9103. @node Sample configuration, Triggering publication, Uploading files, Publishing
  9104. @section Sample configuration
  9105. Below we provide two example configurations. The first one is a simple
  9106. project publishing only a set of Org files. The second example is
  9107. more complex, with a multi-component project.
  9108. @menu
  9109. * Simple example:: One-component publishing
  9110. * Complex example:: A multi-component publishing example
  9111. @end menu
  9112. @node Simple example, Complex example, Sample configuration, Sample configuration
  9113. @subsection Example: simple publishing configuration
  9114. This example publishes a set of Org files to the @file{public_html}
  9115. directory on the local machine.
  9116. @lisp
  9117. (setq org-publish-project-alist
  9118. '(("org"
  9119. :base-directory "~/org/"
  9120. :publishing-directory "~/public_html"
  9121. :section-numbers nil
  9122. :table-of-contents nil
  9123. :style "<link rel=\"stylesheet\"
  9124. href=\"../other/mystyle.css\"
  9125. type=\"text/css\"/>")))
  9126. @end lisp
  9127. @node Complex example, , Simple example, Sample configuration
  9128. @subsection Example: complex publishing configuration
  9129. This more complicated example publishes an entire website, including
  9130. Org files converted to HTML, image files, Emacs Lisp source code, and
  9131. style sheets. The publishing directory is remote and private files are
  9132. excluded.
  9133. To ensure that links are preserved, care should be taken to replicate
  9134. your directory structure on the web server, and to use relative file
  9135. paths. For example, if your Org files are kept in @file{~/org} and your
  9136. publishable images in @file{~/images}, you'd link to an image with
  9137. @c
  9138. @example
  9139. file:../images/myimage.png
  9140. @end example
  9141. @c
  9142. On the web server, the relative path to the image should be the
  9143. same. You can accomplish this by setting up an "images" folder in the
  9144. right place on the web server, and publishing images to it.
  9145. @lisp
  9146. (setq org-publish-project-alist
  9147. '(("orgfiles"
  9148. :base-directory "~/org/"
  9149. :base-extension "org"
  9150. :publishing-directory "/ssh:user@@host:~/html/notebook/"
  9151. :publishing-function org-publish-org-to-html
  9152. :exclude "PrivatePage.org" ;; regexp
  9153. :headline-levels 3
  9154. :section-numbers nil
  9155. :table-of-contents nil
  9156. :style "<link rel=\"stylesheet\"
  9157. href=\"../other/mystyle.css\" type=\"text/css\"/>"
  9158. :auto-preamble t
  9159. :auto-postamble nil)
  9160. ("images"
  9161. :base-directory "~/images/"
  9162. :base-extension "jpg\\|gif\\|png"
  9163. :publishing-directory "/ssh:user@@host:~/html/images/"
  9164. :publishing-function org-publish-attachment)
  9165. ("other"
  9166. :base-directory "~/other/"
  9167. :base-extension "css\\|el"
  9168. :publishing-directory "/ssh:user@@host:~/html/other/"
  9169. :publishing-function org-publish-attachment)
  9170. ("website" :components ("orgfiles" "images" "other"))))
  9171. @end lisp
  9172. @node Triggering publication, , Sample configuration, Publishing
  9173. @section Triggering publication
  9174. Once properly configured, Org can publish with the following commands:
  9175. @table @kbd
  9176. @kindex C-c C-e C
  9177. @item C-c C-e C
  9178. Prompt for a specific project and publish all files that belong to it.
  9179. @kindex C-c C-e P
  9180. @item C-c C-e P
  9181. Publish the project containing the current file.
  9182. @kindex C-c C-e F
  9183. @item C-c C-e F
  9184. Publish only the current file.
  9185. @kindex C-c C-e E
  9186. @item C-c C-e E
  9187. Publish every project.
  9188. @end table
  9189. @vindex org-publish-use-timestamps-flag
  9190. Org uses timestamps to track when a file has changed. The above functions
  9191. normally only publish changed files. You can override this and force
  9192. publishing of all files by giving a prefix argument to any of the commands
  9193. above, or by customizing the variable @code{org-publish-use-timestamps-flag}.
  9194. This may be necessary in particular if files include other files via
  9195. @code{#+SETUPFILE:} or @code{#+INCLUDE:}.
  9196. @node Miscellaneous, Hacking, Publishing, Top
  9197. @chapter Miscellaneous
  9198. @menu
  9199. * Completion:: M-TAB knows what you need
  9200. * Speed keys:: Electic commands at the beginning of a headline
  9201. * Customization:: Adapting Org to your taste
  9202. * In-buffer settings:: Overview of the #+KEYWORDS
  9203. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  9204. * Clean view:: Getting rid of leading stars in the outline
  9205. * TTY keys:: Using Org on a tty
  9206. * Interaction:: Other Emacs packages
  9207. @end menu
  9208. @node Completion, Speed keys, Miscellaneous, Miscellaneous
  9209. @section Completion
  9210. @cindex completion, of @TeX{} symbols
  9211. @cindex completion, of TODO keywords
  9212. @cindex completion, of dictionary words
  9213. @cindex completion, of option keywords
  9214. @cindex completion, of tags
  9215. @cindex completion, of property keys
  9216. @cindex completion, of link abbreviations
  9217. @cindex @TeX{} symbol completion
  9218. @cindex TODO keywords completion
  9219. @cindex dictionary word completion
  9220. @cindex option keyword completion
  9221. @cindex tag completion
  9222. @cindex link abbreviations, completion of
  9223. Emacs would not be Emacs without completion, and Org-mode uses it whenever it
  9224. makes sense. If you prefer an @i{iswitchb}- or @i{ido}-like interface for
  9225. some of the completion prompts, you can specify your preference by setting at
  9226. most one of the variables @code{org-completion-use-iswitchb}
  9227. @code{org-completion-use-ido}.
  9228. Org supports in-buffer completion. This type of completion does
  9229. not make use of the minibuffer. You simply type a few letters into
  9230. the buffer and use the key to complete text right there.
  9231. @table @kbd
  9232. @kindex M-@key{TAB}
  9233. @item M-@key{TAB}
  9234. Complete word at point
  9235. @itemize @bullet
  9236. @item
  9237. At the beginning of a headline, complete TODO keywords.
  9238. @item
  9239. After @samp{\}, complete @TeX{} symbols supported by the exporter.
  9240. @item
  9241. After @samp{*}, complete headlines in the current buffer so that they
  9242. can be used in search links like @samp{[[*find this headline]]}.
  9243. @item
  9244. After @samp{:} in a headline, complete tags. The list of tags is taken
  9245. from the variable @code{org-tag-alist} (possibly set through the
  9246. @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
  9247. dynamically from all tags used in the current buffer.
  9248. @item
  9249. After @samp{:} and not in a headline, complete property keys. The list
  9250. of keys is constructed dynamically from all keys used in the current
  9251. buffer.
  9252. @item
  9253. After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
  9254. @item
  9255. After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
  9256. @samp{OPTIONS} which set file-specific options for Org mode. When the
  9257. option keyword is already complete, pressing @kbd{M-@key{TAB}} again
  9258. will insert example settings for this keyword.
  9259. @item
  9260. In the line after @samp{#+STARTUP: }, complete startup keywords,
  9261. i.e. valid keys for this line.
  9262. @item
  9263. Elsewhere, complete dictionary words using Ispell.
  9264. @end itemize
  9265. @end table
  9266. @node Speed keys, Customization, Completion, Miscellaneous
  9267. @section Speed keys
  9268. @cindex speed keys
  9269. @vindex org-use-speed-commands
  9270. @vindex org-speed-commands-user
  9271. Single keys can be made to execute commands when the cursor is at the
  9272. beginning of a headline, i.e. before the first star. Configure the variable
  9273. @code{org-use-speed-commands} to activate this feature. There is a
  9274. pre-defined list of commands, and you can add more such commands using the
  9275. variable @code{org-speed-commands-user}. Speed keys do not only speed up
  9276. navigation and other commands, but they also provide an alternative way to
  9277. execute commands bound to keys that are not or not easily available on a tty,
  9278. or on a small mobile device with a limited keyboard.
  9279. To see which commands are available, activate the feature and press @kbd{?}
  9280. with the cursor at the beginning of a headline.
  9281. @node Customization, In-buffer settings, Speed keys, Miscellaneous
  9282. @section Customization
  9283. @cindex customization
  9284. @cindex options, for customization
  9285. @cindex variables, for customization
  9286. There are more than 180 variables that can be used to customize
  9287. Org. For the sake of compactness of the manual, I am not
  9288. describing the variables here. A structured overview of customization
  9289. variables is available with @kbd{M-x org-customize}. Or select
  9290. @code{Browse Org Group} from the @code{Org->Customization} menu. Many
  9291. settings can also be activated on a per-file basis, by putting special
  9292. lines into the buffer (@pxref{In-buffer settings}).
  9293. @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
  9294. @section Summary of in-buffer settings
  9295. @cindex in-buffer settings
  9296. @cindex special keywords
  9297. Org mode uses special lines in the buffer to define settings on a
  9298. per-file basis. These lines start with a @samp{#+} followed by a
  9299. keyword, a colon, and then individual words defining a setting. Several
  9300. setting words can be in the same line, but you can also have multiple
  9301. lines for the keyword. While these settings are described throughout
  9302. the manual, here is a summary. After changing any of those lines in the
  9303. buffer, press @kbd{C-c C-c} with the cursor still in the line to
  9304. activate the changes immediately. Otherwise they become effective only
  9305. when the file is visited again in a new Emacs session.
  9306. @vindex org-archive-location
  9307. @table @kbd
  9308. @item #+ARCHIVE: %s_done::
  9309. This line sets the archive location for the agenda file. It applies for
  9310. all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
  9311. of the file. The first such line also applies to any entries before it.
  9312. The corresponding variable is @code{org-archive-location}.
  9313. @item #+CATEGORY:
  9314. This line sets the category for the agenda file. The category applies
  9315. for all subsequent lines until the next @samp{#+CATEGORY} line, or the
  9316. end of the file. The first such line also applies to any entries before it.
  9317. @item #+COLUMNS: %25ITEM .....
  9318. @cindex property, COLUMNS
  9319. Set the default format for columns view. This format applies when
  9320. columns view is invoked in locations where no @code{COLUMNS} property
  9321. applies.
  9322. @item #+CONSTANTS: name1=value1 ...
  9323. @vindex org-table-formula-constants
  9324. @vindex org-table-formula
  9325. Set file-local values for constants to be used in table formulas. This
  9326. line set the local variable @code{org-table-formula-constants-local}.
  9327. The global version of this variable is
  9328. @code{org-table-formula-constants}.
  9329. @item #+FILETAGS: :tag1:tag2:tag3:
  9330. Set tags that can be inherited by any entry in the file, including the
  9331. top-level entries.
  9332. @item #+DRAWERS: NAME1 .....
  9333. @vindex org-drawers
  9334. Set the file-local set of drawers. The corresponding global variable is
  9335. @code{org-drawers}.
  9336. @item #+LINK: linkword replace
  9337. @vindex org-link-abbrev-alist
  9338. These lines (several are allowed) specify link abbreviations.
  9339. @xref{Link abbreviations}. The corresponding variable is
  9340. @code{org-link-abbrev-alist}.
  9341. @item #+PRIORITIES: highest lowest default
  9342. @vindex org-highest-priority
  9343. @vindex org-lowest-priority
  9344. @vindex org-default-priority
  9345. This line sets the limits and the default for the priorities. All three
  9346. must be either letters A-Z or numbers 0-9. The highest priority must
  9347. have a lower ASCII number that the lowest priority.
  9348. @item #+PROPERTY: Property_Name Value
  9349. This line sets a default inheritance value for entries in the current
  9350. buffer, most useful for specifying the allowed values of a property.
  9351. @cindex #+SETUPFILE
  9352. @item #+SETUPFILE: file
  9353. This line defines a file that holds more in-buffer setup. Normally this is
  9354. entirely ignored. Only when the buffer is parsed for option-setting lines
  9355. (i.e. when starting Org mode for a file, when pressing @kbd{C-c C-c} in a
  9356. settings line, or when exporting), then the contents of this file are parsed
  9357. as if they had been included in the buffer. In particular, the file can be
  9358. any other Org mode file with internal setup. You can visit the file the
  9359. cursor is in the line with @kbd{C-c '}.
  9360. @item #+STARTUP:
  9361. @cindex #+STARTUP:
  9362. This line sets options to be used at startup of Org mode, when an
  9363. Org file is being visited.
  9364. The first set of options deals with the initial visibility of the outline
  9365. tree. The corresponding variable for global default settings is
  9366. @code{org-startup-folded}, with a default value @code{t}, which means
  9367. @code{overview}.
  9368. @vindex org-startup-folded
  9369. @cindex @code{overview}, STARTUP keyword
  9370. @cindex @code{content}, STARTUP keyword
  9371. @cindex @code{showall}, STARTUP keyword
  9372. @cindex @code{showeverything}, STARTUP keyword
  9373. @example
  9374. overview @r{top-level headlines only}
  9375. content @r{all headlines}
  9376. showall @r{no folding of any entries}
  9377. showeverything @r{show even drawer contents}
  9378. @end example
  9379. @vindex org-startup-indented
  9380. @cindex @code{indent}, STARTUP keyword
  9381. @cindex @code{noindent}, STARTUP keyword
  9382. Dynamic virtual indentation is controlled by the variable
  9383. @code{org-startup-indented}@footnote{Emacs 23 and Org-mode 6.29 are required}
  9384. @example
  9385. indent @r{start with @code{org-indent-mode} turned on}
  9386. noindent @r{start with @code{org-indent-mode} turned off}
  9387. @end example
  9388. @vindex org-startup-align-all-tables
  9389. Then there are options for aligning tables upon visiting a file. This
  9390. is useful in files containing narrowed table columns. The corresponding
  9391. variable is @code{org-startup-align-all-tables}, with a default value
  9392. @code{nil}.
  9393. @cindex @code{align}, STARTUP keyword
  9394. @cindex @code{noalign}, STARTUP keyword
  9395. @example
  9396. align @r{align all tables}
  9397. noalign @r{don't align tables on startup}
  9398. @end example
  9399. @vindex org-log-done
  9400. @vindex org-log-note-clock-out
  9401. @vindex org-log-repeat
  9402. Logging the closing and reopening of TODO items and clock intervals can be
  9403. configured using these options (see variables @code{org-log-done},
  9404. @code{org-log-note-clock-out} and @code{org-log-repeat})
  9405. @cindex @code{logdone}, STARTUP keyword
  9406. @cindex @code{lognotedone}, STARTUP keyword
  9407. @cindex @code{nologdone}, STARTUP keyword
  9408. @cindex @code{lognoteclock-out}, STARTUP keyword
  9409. @cindex @code{nolognoteclock-out}, STARTUP keyword
  9410. @cindex @code{logrepeat}, STARTUP keyword
  9411. @cindex @code{lognoterepeat}, STARTUP keyword
  9412. @cindex @code{nologrepeat}, STARTUP keyword
  9413. @cindex @code{logreschedule}, STARTUP keyword
  9414. @cindex @code{lognotereschedule}, STARTUP keyword
  9415. @cindex @code{nologreschedule}, STARTUP keyword
  9416. @cindex @code{logredeadline}, STARTUP keyword
  9417. @cindex @code{lognoteredeadline}, STARTUP keyword
  9418. @cindex @code{nologredeadline}, STARTUP keyword
  9419. @example
  9420. logdone @r{record a timestamp when an item is marked DONE}
  9421. lognotedone @r{record timestamp and a note when DONE}
  9422. nologdone @r{don't record when items are marked DONE}
  9423. logrepeat @r{record a time when reinstating a repeating item}
  9424. lognoterepeat @r{record a note when reinstating a repeating item}
  9425. nologrepeat @r{do not record when reinstating repeating item}
  9426. lognoteclock-out @r{record a note when clocking out}
  9427. nolognoteclock-out @r{don't record a note when clocking out}
  9428. logreschedule @r{record a timestamp when scheduling time changes}
  9429. lognotereschedule @r{record a note when scheduling time changes}
  9430. nologreschedule @r{do not record when a scheduling date changes}
  9431. logredeadline @r{record a timestamp when deadline changes}
  9432. lognoteredeadline @r{record a note when deadline changes}
  9433. nologredeadline @r{do not record when a deadline date changes}
  9434. @end example
  9435. @vindex org-hide-leading-stars
  9436. @vindex org-odd-levels-only
  9437. Here are the options for hiding leading stars in outline headings, and for
  9438. indenting outlines. The corresponding variables are
  9439. @code{org-hide-leading-stars} and @code{org-odd-levels-only}, both with a
  9440. default setting @code{nil} (meaning @code{showstars} and @code{oddeven}).
  9441. @cindex @code{hidestars}, STARTUP keyword
  9442. @cindex @code{showstars}, STARTUP keyword
  9443. @cindex @code{odd}, STARTUP keyword
  9444. @cindex @code{even}, STARTUP keyword
  9445. @example
  9446. hidestars @r{make all but one of the stars starting a headline invisible.}
  9447. showstars @r{show all stars starting a headline}
  9448. indent @r{virtual indentation according to outline level}
  9449. noindent @r{no virtual indentation according to outline level}
  9450. odd @r{allow only odd outline levels (1,3,...)}
  9451. oddeven @r{allow all outline levels}
  9452. @end example
  9453. @vindex org-put-time-stamp-overlays
  9454. @vindex org-time-stamp-overlay-formats
  9455. To turn on custom format overlays over timestamps (variables
  9456. @code{org-put-time-stamp-overlays} and
  9457. @code{org-time-stamp-overlay-formats}), use
  9458. @cindex @code{customtime}, STARTUP keyword
  9459. @example
  9460. customtime @r{overlay custom time format}
  9461. @end example
  9462. @vindex constants-unit-system
  9463. The following options influence the table spreadsheet (variable
  9464. @code{constants-unit-system}).
  9465. @cindex @code{constcgs}, STARTUP keyword
  9466. @cindex @code{constSI}, STARTUP keyword
  9467. @example
  9468. constcgs @r{@file{constants.el} should use the c-g-s unit system}
  9469. constSI @r{@file{constants.el} should use the SI unit system}
  9470. @end example
  9471. @vindex org-footnote-define-inline
  9472. @vindex org-footnote-auto-label
  9473. @vindex org-footnote-auto-adjust
  9474. To influence footnote settings, use the following keywords. The
  9475. corresponding variables are @code{org-footnote-define-inline},
  9476. @code{org-footnote-auto-label}, and @code{org-footnote-auto-adjust}.
  9477. @cindex @code{fninline}, STARTUP keyword
  9478. @cindex @code{nofninline}, STARTUP keyword
  9479. @cindex @code{fnlocal}, STARTUP keyword
  9480. @cindex @code{fnprompt}, STARTUP keyword
  9481. @cindex @code{fnauto}, STARTUP keyword
  9482. @cindex @code{fnconfirm}, STARTUP keyword
  9483. @cindex @code{fnplain}, STARTUP keyword
  9484. @cindex @code{fnadjust}, STARTUP keyword
  9485. @cindex @code{nofnadjust}, STARTUP keyword
  9486. @example
  9487. fninline @r{define footnotes inline}
  9488. fnnoinline @r{define footnotes in separate section}
  9489. fnlocal @r{define footnotes near first reference, but not inline}
  9490. fnprompt @r{prompt for footnote labels}
  9491. fnauto @r{create [fn:1]-like labels automatically (default)}
  9492. fnconfirm @r{offer automatic label for editing or confirmation}
  9493. fnplain @r{create [1]-like labels automatically}
  9494. fnadjust @r{automatically renumber and sort footnotes}
  9495. nofnadjust @r{do not renumber and sort automatically}
  9496. @end example
  9497. @cindex org-hide-block-startup
  9498. To hide blocks on startup, use these keywords. The corresponding variable is
  9499. @code{org-hide-block-startup}.
  9500. @cindex @code{hideblocks}, STARTUP keyword
  9501. @cindex @code{nohideblocks}, STARTUP keyword
  9502. @example
  9503. hideblocks @r{Hide all begin/end blocks on startup}
  9504. nohideblocks @r{Do not hide blocks on startup}
  9505. @end example
  9506. @item #+TAGS: TAG1(c1) TAG2(c2)
  9507. @vindex org-tag-alist
  9508. These lines (several such lines are allowed) specify the valid tags in
  9509. this file, and (potentially) the corresponding @emph{fast tag selection}
  9510. keys. The corresponding variable is @code{org-tag-alist}.
  9511. @item #+TBLFM:
  9512. This line contains the formulas for the table directly above the line.
  9513. @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+DATE:,
  9514. @itemx #+OPTIONS:, #+BIND:
  9515. @itemx #+DESCRIPTION:, #+KEYWORDS:
  9516. @itemx #+LATEX_HEADER:, #+STYLE:, #+LINK_UP:, #+LINK_HOME:,
  9517. @itemx #+EXPORT_SELECT_TAGS:, #+EXPORT_EXCLUDE_TAGS:
  9518. These lines provide settings for exporting files. For more details see
  9519. @ref{Export options}.
  9520. @item #+TODO: #+SEQ_TODO: #+TYP_TODO:
  9521. @vindex org-todo-keywords
  9522. These lines set the TODO keywords and their interpretation in the
  9523. current file. The corresponding variable is @code{org-todo-keywords}.
  9524. @end table
  9525. @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
  9526. @section The very busy C-c C-c key
  9527. @kindex C-c C-c
  9528. @cindex C-c C-c, overview
  9529. The key @kbd{C-c C-c} has many purposes in Org, which are all
  9530. mentioned scattered throughout this manual. One specific function of
  9531. this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
  9532. other circumstances it means something like @emph{``Hey Org, look
  9533. here and update according to what you see here''}. Here is a summary of
  9534. what this means in different contexts.
  9535. @itemize @minus
  9536. @item
  9537. If there are highlights in the buffer from the creation of a sparse
  9538. tree, or from clock display, remove these highlights.
  9539. @item
  9540. If the cursor is in one of the special @code{#+KEYWORD} lines, this
  9541. triggers scanning the buffer for these lines and updating the
  9542. information.
  9543. @item
  9544. If the cursor is inside a table, realign the table. This command
  9545. works even if the automatic table editor has been turned off.
  9546. @item
  9547. If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
  9548. the entire table.
  9549. @item
  9550. If the cursor is inside a table created by the @file{table.el} package,
  9551. activate that table.
  9552. @item
  9553. If the current buffer is a Remember buffer, close the note and file it.
  9554. With a prefix argument, file it, without further interaction, to the
  9555. default location.
  9556. @item
  9557. If the cursor is on a @code{<<<target>>>}, update radio targets and
  9558. corresponding links in this buffer.
  9559. @item
  9560. If the cursor is in a property line or at the start or end of a property
  9561. drawer, offer property commands.
  9562. @item
  9563. If the cursor is at a footnote reference, go to the corresponding
  9564. definition, and vice versa.
  9565. @item
  9566. If the cursor is on a statistics cookie, update it.
  9567. @item
  9568. If the cursor is in a plain list item with a checkbox, toggle the status
  9569. of the checkbox.
  9570. @item
  9571. If the cursor is on a numbered item in a plain list, renumber the
  9572. ordered list.
  9573. @item
  9574. If the cursor is on the @code{#+BEGIN} line of a dynamic block, the
  9575. block is updated.
  9576. @end itemize
  9577. @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
  9578. @section A cleaner outline view
  9579. @cindex hiding leading stars
  9580. @cindex dynamic indentation
  9581. @cindex odd-levels-only outlines
  9582. @cindex clean outline view
  9583. Some people find it noisy and distracting that the Org headlines start with a
  9584. potentially large number of stars, and that text below the headlines is not
  9585. indented. While this is no problem when writing a @emph{book-like} document
  9586. where the outline headings are really section headings, in a more
  9587. @emph{list-oriented} outline, indented structure is a lot cleaner:
  9588. @example
  9589. @group
  9590. * Top level headline | * Top level headline
  9591. ** Second level | * Second level
  9592. *** 3rd level | * 3rd level
  9593. some text | some text
  9594. *** 3rd level | * 3rd level
  9595. more text | more text
  9596. * Another top level headline | * Another top level headline
  9597. @end group
  9598. @end example
  9599. @noindent
  9600. If you are using at least Emacs 23.1.50.3 and version 6.29 of Org, this kind
  9601. of view can be achieved dynamically at display time using
  9602. @code{org-indent-mode}. In this minor mode, all lines are prefixed for
  9603. display with the necessary amount of space. Also headlines are prefixed with
  9604. additional stars, so that the amount of indentation shifts by
  9605. two@footnote{See the variable @code{org-indent-indentation-per-level}.}
  9606. spaces per level. All headline stars but the last one are made invisible
  9607. using the @code{org-hide} face@footnote{Turning on @code{org-indent-mode}
  9608. sets @code{org-hide-leading-stars} to @code{t} and
  9609. @code{org-adapt-indentation} to @code{nil}.} - see below under @samp{2.} for
  9610. more information on how this works. You can turn on @code{org-indent-mode}
  9611. for all files by customizing the variable @code{org-startup-indented}, or you
  9612. can turn it on for individual files using
  9613. @example
  9614. #+STARTUP: indent
  9615. @end example
  9616. If you want a similar effect in earlier version of Emacs and/or Org, or if
  9617. you want the indentation to be hard space characters so that the plain text
  9618. file looks as similar as possible to the Emacs display, Org supports you in
  9619. the following way:
  9620. @enumerate
  9621. @item
  9622. @emph{Indentation of text below headlines}@*
  9623. You may indent text below each headline to make the left boundary line up
  9624. with the headline, like
  9625. @example
  9626. *** 3rd level
  9627. more text, now indented
  9628. @end example
  9629. @vindex org-adapt-indentation
  9630. Org supports this with paragraph filling, line wrapping, and structure
  9631. editing@footnote{See also the variable @code{org-adapt-indentation}.},
  9632. preserving or adapting the indentation as appropriate.
  9633. @item
  9634. @vindex org-hide-leading-stars
  9635. @emph{Hiding leading stars}@* You can modify the display in such a way that
  9636. all leading stars become invisible. To do this in a global way, configure
  9637. the variable @code{org-hide-leading-stars} or change this on a per-file basis
  9638. with
  9639. @example
  9640. #+STARTUP: hidestars
  9641. #+STARTUP: showstars
  9642. @end example
  9643. With hidden stars, the tree becomes:
  9644. @example
  9645. @group
  9646. * Top level headline
  9647. * Second level
  9648. * 3rd level
  9649. ...
  9650. @end group
  9651. @end example
  9652. @noindent
  9653. @vindex org-hide @r{(face)}
  9654. The leading stars are not truly replaced by whitespace, they are only
  9655. fontified with the face @code{org-hide} that uses the background color as
  9656. font color. If you are not using either white or black background, you may
  9657. have to customize this face to get the wanted effect. Another possibility is
  9658. to set this font such that the extra stars are @i{almost} invisible, for
  9659. example using the color @code{grey90} on a white background.
  9660. @item
  9661. @vindex org-odd-levels-only
  9662. Things become cleaner still if you skip all the even levels and use only odd
  9663. levels 1, 3, 5..., effectively adding two stars to go from one outline level
  9664. to the next@footnote{When you need to specify a level for a property search
  9665. or refile targets, @samp{LEVEL=2} will correspond to 3 stars, etc@.}. In this
  9666. way we get the outline view shown at the beginning of this section. In order
  9667. to make the structure editing and export commands handle this convention
  9668. correctly, configure the variable @code{org-odd-levels-only}, or set this on
  9669. a per-file basis with one of the following lines:
  9670. @example
  9671. #+STARTUP: odd
  9672. #+STARTUP: oddeven
  9673. @end example
  9674. You can convert an Org file from single-star-per-level to the
  9675. double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
  9676. RET} in that file. The reverse operation is @kbd{M-x
  9677. org-convert-to-oddeven-levels}.
  9678. @end enumerate
  9679. @node TTY keys, Interaction, Clean view, Miscellaneous
  9680. @section Using Org on a tty
  9681. @cindex tty key bindings
  9682. Because Org contains a large number of commands, by default many of
  9683. Org's core commands are bound to keys that are generally not
  9684. accessible on a tty, such as the cursor keys (@key{left}, @key{right},
  9685. @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
  9686. together with modifiers like @key{Meta} and/or @key{Shift}. To access
  9687. these commands on a tty when special keys are unavailable, the following
  9688. alternative bindings can be used. The tty bindings below will likely be
  9689. more cumbersome; you may find for some of the bindings below that a
  9690. customized workaround suits you better. For example, changing a timestamp
  9691. is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
  9692. tty you would rather use @kbd{C-c .} to re-insert the timestamp.
  9693. @multitable @columnfractions 0.15 0.2 0.1 0.2
  9694. @item @b{Default} @tab @b{Alternative 1} @tab @b{Speed key} @tab @b{Alternative 2}
  9695. @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab @kbd{C} @tab
  9696. @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{l} @tab @kbd{@key{Esc} @key{left}}
  9697. @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab @kbd{L} @tab
  9698. @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{r} @tab @kbd{@key{Esc} @key{right}}
  9699. @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab @kbd{R} @tab
  9700. @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{ } @tab @kbd{@key{Esc} @key{up}}
  9701. @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab @kbd{U} @tab
  9702. @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{ } @tab @kbd{@key{Esc} @key{down}}
  9703. @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab @kbd{D} @tab
  9704. @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab @kbd{ } @tab
  9705. @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{ } @tab @kbd{@key{Esc} @key{RET}}
  9706. @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab @kbd{ } @tab
  9707. @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab @kbd{ } @tab
  9708. @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab @kbd{ } @tab
  9709. @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab @kbd{ } @tab
  9710. @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab @kbd{ } @tab
  9711. @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab @kbd{ } @tab
  9712. @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab @kbd{ } @tab
  9713. @end multitable
  9714. @node Interaction, , TTY keys, Miscellaneous
  9715. @section Interaction with other packages
  9716. @cindex packages, interaction with other
  9717. Org lives in the world of GNU Emacs and interacts in various ways
  9718. with other code out there.
  9719. @menu
  9720. * Cooperation:: Packages Org cooperates with
  9721. * Conflicts:: Packages that lead to conflicts
  9722. @end menu
  9723. @node Cooperation, Conflicts, Interaction, Interaction
  9724. @subsection Packages that Org cooperates with
  9725. @table @asis
  9726. @cindex @file{calc.el}
  9727. @cindex Gillespie, Dave
  9728. @item @file{calc.el} by Dave Gillespie
  9729. Org uses the Calc package for implementing spreadsheet
  9730. functionality in its tables (@pxref{The spreadsheet}). Org
  9731. checks for the availability of Calc by looking for the function
  9732. @code{calc-eval} which will have been autoloaded during setup if Calc has
  9733. been installed properly. As of Emacs 22, Calc is part of the Emacs
  9734. distribution. Another possibility for interaction between the two
  9735. packages is using Calc for embedded calculations. @xref{Embedded Mode,
  9736. , Embedded Mode, Calc, GNU Emacs Calc Manual}.
  9737. @item @file{constants.el} by Carsten Dominik
  9738. @cindex @file{constants.el}
  9739. @cindex Dominik, Carsten
  9740. @vindex org-table-formula-constants
  9741. In a table formula (@pxref{The spreadsheet}), it is possible to use
  9742. names for natural constants or units. Instead of defining your own
  9743. constants in the variable @code{org-table-formula-constants}, install
  9744. the @file{constants} package which defines a large number of constants
  9745. and units, and lets you use unit prefixes like @samp{M} for
  9746. @samp{Mega}, etc@. You will need version 2.0 of this package, available
  9747. at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
  9748. the function @code{constants-get}, which has to be autoloaded in your
  9749. setup. See the installation instructions in the file
  9750. @file{constants.el}.
  9751. @item @file{cdlatex.el} by Carsten Dominik
  9752. @cindex @file{cdlatex.el}
  9753. @cindex Dominik, Carsten
  9754. Org mode can make use of the CDLa@TeX{} package to efficiently enter
  9755. La@TeX{} fragments into Org files. See @ref{CDLaTeX mode}.
  9756. @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
  9757. @cindex @file{imenu.el}
  9758. Imenu allows menu access to an index of items in a file. Org mode
  9759. supports Imenu---all you need to do to get the index is the following:
  9760. @lisp
  9761. (add-hook 'org-mode-hook
  9762. (lambda () (imenu-add-to-menubar "Imenu")))
  9763. @end lisp
  9764. @vindex org-imenu-depth
  9765. By default the index is two levels deep---you can modify the depth using
  9766. the option @code{org-imenu-depth}.
  9767. @item @file{remember.el} by John Wiegley
  9768. @cindex @file{remember.el}
  9769. @cindex Wiegley, John
  9770. Org cooperates with remember, see @ref{Remember}.
  9771. @file{Remember.el} is not part of Emacs, find it on the web.
  9772. @item @file{speedbar.el} by Eric M. Ludlam
  9773. @cindex @file{speedbar.el}
  9774. @cindex Ludlam, Eric M.
  9775. Speedbar is a package that creates a special frame displaying files and
  9776. index items in files. Org mode supports Speedbar and allows you to
  9777. drill into Org files directly from the Speedbar. It also allows you to
  9778. restrict the scope of agenda commands to a file or a subtree by using
  9779. the command @kbd{<} in the Speedbar frame.
  9780. @cindex @file{table.el}
  9781. @item @file{table.el} by Takaaki Ota
  9782. @kindex C-c C-c
  9783. @cindex table editor, @file{table.el}
  9784. @cindex @file{table.el}
  9785. @cindex Ota, Takaaki
  9786. Complex ASCII tables with automatic line wrapping, column- and
  9787. row-spanning, and alignment can be created using the Emacs table
  9788. package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
  9789. and also part of Emacs 22).
  9790. When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org mode
  9791. will call @command{table-recognize-table} and move the cursor into the
  9792. table. Inside a table, the keymap of Org mode is inactive. In order
  9793. to execute Org mode-related commands, leave the table.
  9794. @table @kbd
  9795. @kindex C-c C-c
  9796. @item C-c C-c
  9797. Recognize @file{table.el} table. Works when the cursor is in a
  9798. table.el table.
  9799. @c
  9800. @kindex C-c ~
  9801. @item C-c ~
  9802. Insert a @file{table.el} table. If there is already a table at point, this
  9803. command converts it between the @file{table.el} format and the Org-mode
  9804. format. See the documentation string of the command
  9805. @code{org-convert-table} for the restrictions under which this is
  9806. possible.
  9807. @end table
  9808. @file{table.el} is part of Emacs 22.
  9809. @item @file{footnote.el} by Steven L. Baur
  9810. @cindex @file{footnote.el}
  9811. @cindex Baur, Steven L.
  9812. Org mode recognizes numerical footnotes as provided by this package.
  9813. However, Org mode also has its own footnote support (@pxref{Footnotes}),
  9814. which makes using @file{footnote.el} unnecessary.
  9815. @end table
  9816. @node Conflicts, , Cooperation, Interaction
  9817. @subsection Packages that lead to conflicts with Org mode
  9818. @table @asis
  9819. @cindex @code{shift-selection-mode}
  9820. @vindex org-support-shift-select
  9821. In Emacs 23, @code{shift-selection-mode} is on by default, meaning that
  9822. cursor motions combined with the shift key should start or enlarge regions.
  9823. This conflicts with the use of @kbd{S-@key{cursor}} commands in Org to change
  9824. timestamps, TODO keywords, priorities, and item bullet types if the cursor is
  9825. at such a location. By default, @kbd{S-@key{cursor}} commands outside
  9826. special contexts don't do anything, but you can customize the variable
  9827. @code{org-support-shift-select}. Org mode then tries to accommodate shift
  9828. selection by (i) using it outside of the special contexts where special
  9829. commands apply, and by (ii) extending an existing active region even if the
  9830. cursor moves across a special context.
  9831. @item @file{CUA.el} by Kim. F. Storm
  9832. @cindex @file{CUA.el}
  9833. @cindex Storm, Kim. F.
  9834. @vindex org-replace-disputed-keys
  9835. Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by CUA mode
  9836. (as well as @code{pc-select-mode} and @code{s-region-mode}) to select and extend the
  9837. region. In fact, Emacs 23 has this built-in in the form of
  9838. @code{shift-selection-mode}, see previous paragraph. If you are using Emacs
  9839. 23, you probably don't want to use another package for this purpose. However,
  9840. if you prefer to leave these keys to a different package while working in
  9841. Org mode, configure the variable @code{org-replace-disputed-keys}. When set,
  9842. Org will move the following key bindings in Org files, and in the agenda
  9843. buffer (but not during date selection).
  9844. @example
  9845. S-UP -> M-p S-DOWN -> M-n
  9846. S-LEFT -> M-- S-RIGHT -> M-+
  9847. C-S-LEFT -> M-S-- C-S-RIGHT -> M-S-+
  9848. @end example
  9849. @vindex org-disputed-keys
  9850. Yes, these are unfortunately more difficult to remember. If you want
  9851. to have other replacement keys, look at the variable
  9852. @code{org-disputed-keys}.
  9853. @item @file{yasnippet.el}
  9854. @cindex @file{yasnippet.el}
  9855. The way Org-mode binds the TAB key (binding to @code{[tab]} instead of
  9856. @code{"\t"}) overrules yasnippets' access to this key. The following code
  9857. fixed this problem:
  9858. @lisp
  9859. (add-hook 'org-mode-hook
  9860. (lambda ()
  9861. (org-set-local 'yas/trigger-key [tab])
  9862. (define-key yas/keymap [tab] 'yas/next-field-group)))
  9863. @end lisp
  9864. @item @file{windmove.el} by Hovav Shacham
  9865. @cindex @file{windmove.el}
  9866. This package also uses the @kbd{S-<cursor>} keys, so everything written
  9867. in the paragraph above about CUA mode also applies here.
  9868. @item @file{viper.el} by Michael Kifer
  9869. @cindex @file{viper.el}
  9870. @kindex C-c /
  9871. Viper uses @kbd{C-c /} and therefore makes this key not access the
  9872. corresponding Org-mode command @code{org-sparse-tree}. You need to find
  9873. another key for this command, or override the key in
  9874. @code{viper-vi-global-user-map} with
  9875. @lisp
  9876. (define-key viper-vi-global-user-map "C-c /" 'org-sparse-tree)
  9877. @end lisp
  9878. @end table
  9879. @node Hacking, MobileOrg, Miscellaneous, Top
  9880. @appendix Hacking
  9881. @cindex hacking
  9882. This appendix covers some aspects where users can extend the functionality of
  9883. Org.
  9884. @menu
  9885. * Hooks:: Who to reach into Org's internals
  9886. * Add-on packages:: Available extensions
  9887. * Adding hyperlink types:: New custom link types
  9888. * Context-sensitive commands:: How to add functionality to such commands
  9889. * Tables in arbitrary syntax:: Orgtbl for La@TeX{} and other programs
  9890. * Dynamic blocks:: Automatically filled blocks
  9891. * Special agenda views:: Customized views
  9892. * Extracting agenda information:: Postprocessing of agenda information
  9893. * Using the property API:: Writing programs that use entry properties
  9894. * Using the mapping API:: Mapping over all or selected entries
  9895. @end menu
  9896. @node Hooks, Add-on packages, Hacking, Hacking
  9897. @section Hooks
  9898. @cindex hooks
  9899. Org has a large number of hook variables that can be used to add
  9900. functionality. This appendix about hacking is going to illustrate the
  9901. use of some of them. A complete list of all hooks with documentation is
  9902. maintained by the Worg project and can be found at
  9903. @uref{http://orgmode.org/worg/org-configs/org-hooks.php}.
  9904. @node Add-on packages, Adding hyperlink types, Hooks, Hacking
  9905. @section Add-on packages
  9906. @cindex add-on packages
  9907. A large number of add-on packages have been written by various authors.
  9908. These packages are not part of Emacs, but they are distributed as contributed
  9909. packages with the separate release available at the Org mode home page at
  9910. @uref{http://orgmode.org}. The list of contributed packages, along with
  9911. documentation about each package, is maintained by the Worg project at
  9912. @uref{http://orgmode.org/worg/org-contrib/}.
  9913. @node Adding hyperlink types, Context-sensitive commands, Add-on packages, Hacking
  9914. @section Adding hyperlink types
  9915. @cindex hyperlinks, adding new types
  9916. Org has a large number of hyperlink types built-in
  9917. (@pxref{Hyperlinks}). If you would like to add new link types, Org
  9918. provides an interface for doing so. Let's look at an example file,
  9919. @file{org-man.el}, that will add support for creating links like
  9920. @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
  9921. Emacs:
  9922. @lisp
  9923. ;;; org-man.el - Support for links to manpages in Org
  9924. (require 'org)
  9925. (org-add-link-type "man" 'org-man-open)
  9926. (add-hook 'org-store-link-functions 'org-man-store-link)
  9927. (defcustom org-man-command 'man
  9928. "The Emacs command to be used to display a man page."
  9929. :group 'org-link
  9930. :type '(choice (const man) (const woman)))
  9931. (defun org-man-open (path)
  9932. "Visit the manpage on PATH.
  9933. PATH should be a topic that can be thrown at the man command."
  9934. (funcall org-man-command path))
  9935. (defun org-man-store-link ()
  9936. "Store a link to a manpage."
  9937. (when (memq major-mode '(Man-mode woman-mode))
  9938. ;; This is a man page, we do make this link
  9939. (let* ((page (org-man-get-page-name))
  9940. (link (concat "man:" page))
  9941. (description (format "Manpage for %s" page)))
  9942. (org-store-link-props
  9943. :type "man"
  9944. :link link
  9945. :description description))))
  9946. (defun org-man-get-page-name ()
  9947. "Extract the page name from the buffer name."
  9948. ;; This works for both `Man-mode' and `woman-mode'.
  9949. (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
  9950. (match-string 1 (buffer-name))
  9951. (error "Cannot create link to this man page")))
  9952. (provide 'org-man)
  9953. ;;; org-man.el ends here
  9954. @end lisp
  9955. @noindent
  9956. You would activate this new link type in @file{.emacs} with
  9957. @lisp
  9958. (require 'org-man)
  9959. @end lisp
  9960. @noindent
  9961. Let's go through the file and see what it does.
  9962. @enumerate
  9963. @item
  9964. It does @code{(require 'org)} to make sure that @file{org.el} has been
  9965. loaded.
  9966. @item
  9967. The next line calls @code{org-add-link-type} to define a new link type
  9968. with prefix @samp{man}. The call also contains the name of a function
  9969. that will be called to follow such a link.
  9970. @item
  9971. @vindex org-store-link-functions
  9972. The next line adds a function to @code{org-store-link-functions}, in
  9973. order to allow the command @kbd{C-c l} to record a useful link in a
  9974. buffer displaying a man page.
  9975. @end enumerate
  9976. The rest of the file defines the necessary variables and functions.
  9977. First there is a customization variable that determines which Emacs
  9978. command should be used to display man pages. There are two options,
  9979. @code{man} and @code{woman}. Then the function to follow a link is
  9980. defined. It gets the link path as an argument---in this case the link
  9981. path is just a topic for the manual command. The function calls the
  9982. value of @code{org-man-command} to display the man page.
  9983. Finally the function @code{org-man-store-link} is defined. When you try
  9984. to store a link with @kbd{C-c l}, this function will be called to
  9985. try to make a link. The function must first decide if it is supposed to
  9986. create the link for this buffer type; we do this by checking the value
  9987. of the variable @code{major-mode}. If not, the function must exit and
  9988. return the value @code{nil}. If yes, the link is created by getting the
  9989. manual topic from the buffer name and prefixing it with the string
  9990. @samp{man:}. Then it must call the command @code{org-store-link-props}
  9991. and set the @code{:type} and @code{:link} properties. Optionally you
  9992. can also set the @code{:description} property to provide a default for
  9993. the link description when the link is later inserted into an Org
  9994. buffer with @kbd{C-c C-l}.
  9995. When is makes sense for your new link type, you may also define a function
  9996. @code{org-PREFIX-complete-link} that implements special (e.g. completion)
  9997. support for inserting such a link with @kbd{C-c C-l}. Such a function should
  9998. not accept any arguments, and return the full link with prefix.
  9999. @node Context-sensitive commands, Tables in arbitrary syntax, Adding hyperlink types, Hacking
  10000. @section Context-sensitive commands
  10001. @cindex context-sensitive commands, hooks
  10002. @cindex add-ons, context-sensitive commands
  10003. @vindex org-ctrl-c-ctrl-c-hook
  10004. Org has several commands that act differently depending on context. The most
  10005. important example it the @kbd{C-c C-c} (@pxref{The very busy C-c C-c key}).
  10006. Also the @kbd{M-cursor} and @kbd{M-S-cursor} keys have this property.
  10007. Add-ons can tap into this functionality by providing a function that detects
  10008. special context for that add-on and executes functionality appropriate for
  10009. the context. Here is an example from Dan Davison's @file{org-R.el} which
  10010. allows you to evaluate commands based on the @file{R} programming language. For
  10011. this package, special contexts are lines that start with @code{#+R:} or
  10012. @code{#+RR:}.
  10013. @lisp
  10014. (defun org-R-apply-maybe ()
  10015. "Detect if this is context for org-R and execute R commands."
  10016. (if (save-excursion
  10017. (beginning-of-line 1)
  10018. (looking-at "#\\+RR?:"))
  10019. (progn (call-interactively 'org-R-apply)
  10020. t) ;; to signal that we took action
  10021. nil)) ;; to signal that we did not
  10022. (add-hook 'org-ctrl-c-ctrl-c-hook 'org-R-apply-maybe)
  10023. @end lisp
  10024. The function first checks if the cursor is in such a line. If that is the
  10025. case, @code{org-R-apply} is called and the function returns @code{t} to
  10026. signal that action was taken, and @kbd{C-c C-c} will stop looking for other
  10027. contexts. If the function finds it should do nothing locally, it returns @code{nil} so that other, similar functions can have a try.
  10028. @node Tables in arbitrary syntax, Dynamic blocks, Context-sensitive commands, Hacking
  10029. @section Tables and lists in arbitrary syntax
  10030. @cindex tables, in other modes
  10031. @cindex lists, in other modes
  10032. @cindex Orgtbl mode
  10033. Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
  10034. frequent feature request has been to make it work with native tables in
  10035. specific languages, for example La@TeX{}. However, this is extremely
  10036. hard to do in a general way, would lead to a customization nightmare,
  10037. and would take away much of the simplicity of the Orgtbl-mode table
  10038. editor.
  10039. This appendix describes a different approach. We keep the Orgtbl mode
  10040. table in its native format (the @i{source table}), and use a custom
  10041. function to @i{translate} the table to the correct syntax, and to
  10042. @i{install} it in the right location (the @i{target table}). This puts
  10043. the burden of writing conversion functions on the user, but it allows
  10044. for a very flexible system.
  10045. Bastien added the ability to do the same with lists. You can use Org's
  10046. facilities to edit and structure lists by turning @code{orgstruct-mode}
  10047. on, then locally exporting such lists in another format (HTML, La@TeX{}
  10048. or Texinfo.)
  10049. @menu
  10050. * Radio tables:: Sending and receiving radio tables
  10051. * A LaTeX example:: Step by step, almost a tutorial
  10052. * Translator functions:: Copy and modify
  10053. * Radio lists:: Doing the same for lists
  10054. @end menu
  10055. @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
  10056. @subsection Radio tables
  10057. @cindex radio tables
  10058. To define the location of the target table, you first need to create two
  10059. lines that are comments in the current mode, but contain magic words for
  10060. Orgtbl mode to find. Orgtbl mode will insert the translated table
  10061. between these lines, replacing whatever was there before. For example:
  10062. @example
  10063. /* BEGIN RECEIVE ORGTBL table_name */
  10064. /* END RECEIVE ORGTBL table_name */
  10065. @end example
  10066. @noindent
  10067. Just above the source table, we put a special line that tells
  10068. Orgtbl mode how to translate this table and where to install it. For
  10069. example:
  10070. @cindex #+ORGTBL
  10071. @example
  10072. #+ORGTBL: SEND table_name translation_function arguments....
  10073. @end example
  10074. @noindent
  10075. @code{table_name} is the reference name for the table that is also used
  10076. in the receiver lines. @code{translation_function} is the Lisp function
  10077. that does the translation. Furthermore, the line can contain a list of
  10078. arguments (alternating key and value) at the end. The arguments will be
  10079. passed as a property list to the translation function for
  10080. interpretation. A few standard parameters are already recognized and
  10081. acted upon before the translation function is called:
  10082. @table @code
  10083. @item :skip N
  10084. Skip the first N lines of the table. Hlines do count as separate lines for
  10085. this parameter!
  10086. @item :skipcols (n1 n2 ...)
  10087. List of columns that should be skipped. If the table has a column with
  10088. calculation marks, that column is automatically discarded as well.
  10089. Please note that the translator function sees the table @emph{after} the
  10090. removal of these columns, the function never knows that there have been
  10091. additional columns.
  10092. @end table
  10093. @noindent
  10094. The one problem remaining is how to keep the source table in the buffer
  10095. without disturbing the normal workings of the file, for example during
  10096. compilation of a C file or processing of a La@TeX{} file. There are a
  10097. number of different solutions:
  10098. @itemize @bullet
  10099. @item
  10100. The table could be placed in a block comment if that is supported by the
  10101. language. For example, in C mode you could wrap the table between
  10102. @samp{/*} and @samp{*/} lines.
  10103. @item
  10104. Sometimes it is possible to put the table after some kind of @i{END}
  10105. statement, for example @samp{\bye} in @TeX{} and @samp{\end@{document@}}
  10106. in La@TeX{}.
  10107. @item
  10108. You can just comment the table line-by-line whenever you want to process
  10109. the file, and uncomment it whenever you need to edit the table. This
  10110. only sounds tedious---the command @kbd{M-x orgtbl-toggle-comment}
  10111. makes this comment-toggling very easy, in particular if you bind it to a
  10112. key.
  10113. @end itemize
  10114. @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
  10115. @subsection A La@TeX{} example of radio tables
  10116. @cindex La@TeX{}, and Orgtbl mode
  10117. The best way to wrap the source table in La@TeX{} is to use the
  10118. @code{comment} environment provided by @file{comment.sty}. It has to be
  10119. activated by placing @code{\usepackage@{comment@}} into the document
  10120. header. Orgtbl mode can insert a radio table skeleton@footnote{By
  10121. default this works only for La@TeX{}, HTML, and Texinfo. Configure the
  10122. variable @code{orgtbl-radio-tables} to install templates for other
  10123. modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
  10124. be prompted for a table name, let's say we use @samp{salesfigures}. You
  10125. will then get the following template:
  10126. @cindex #+ORGTBL, SEND
  10127. @example
  10128. % BEGIN RECEIVE ORGTBL salesfigures
  10129. % END RECEIVE ORGTBL salesfigures
  10130. \begin@{comment@}
  10131. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  10132. | | |
  10133. \end@{comment@}
  10134. @end example
  10135. @noindent
  10136. @vindex La@TeX{}-verbatim-environments
  10137. The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
  10138. @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
  10139. into the receiver location with name @code{salesfigures}. You may now
  10140. fill in the table, feel free to use the spreadsheet features@footnote{If
  10141. the @samp{#+TBLFM} line contains an odd number of dollar characters,
  10142. this may cause problems with font-lock in La@TeX{} mode. As shown in the
  10143. example you can fix this by adding an extra line inside the
  10144. @code{comment} environment that is used to balance the dollar
  10145. expressions. If you are using AUC@TeX{} with the font-latex library, a
  10146. much better solution is to add the @code{comment} environment to the
  10147. variable @code{LaTeX-verbatim-environments}.}:
  10148. @example
  10149. % BEGIN RECEIVE ORGTBL salesfigures
  10150. % END RECEIVE ORGTBL salesfigures
  10151. \begin@{comment@}
  10152. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  10153. | Month | Days | Nr sold | per day |
  10154. |-------+------+---------+---------|
  10155. | Jan | 23 | 55 | 2.4 |
  10156. | Feb | 21 | 16 | 0.8 |
  10157. | March | 22 | 278 | 12.6 |
  10158. #+TBLFM: $4=$3/$2;%.1f
  10159. % $ (optional extra dollar to keep font-lock happy, see footnote)
  10160. \end@{comment@}
  10161. @end example
  10162. @noindent
  10163. When you are done, press @kbd{C-c C-c} in the table to get the converted
  10164. table inserted between the two marker lines.
  10165. Now let's assume you want to make the table header by hand, because you
  10166. want to control how columns are aligned, etc@. In this case we make sure
  10167. that the table translator skips the first 2 lines of the source
  10168. table, and tell the command to work as a @i{splice}, i.e. to not produce
  10169. header and footer commands of the target table:
  10170. @example
  10171. \begin@{tabular@}@{lrrr@}
  10172. Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
  10173. % BEGIN RECEIVE ORGTBL salesfigures
  10174. % END RECEIVE ORGTBL salesfigures
  10175. \end@{tabular@}
  10176. %
  10177. \begin@{comment@}
  10178. #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
  10179. | Month | Days | Nr sold | per day |
  10180. |-------+------+---------+---------|
  10181. | Jan | 23 | 55 | 2.4 |
  10182. | Feb | 21 | 16 | 0.8 |
  10183. | March | 22 | 278 | 12.6 |
  10184. #+TBLFM: $4=$3/$2;%.1f
  10185. \end@{comment@}
  10186. @end example
  10187. The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
  10188. Orgtbl mode. It uses a @code{tabular} environment to typeset the table
  10189. and marks horizontal lines with @code{\hline}. Furthermore, it
  10190. interprets the following parameters (see also @pxref{Translator functions}):
  10191. @table @code
  10192. @item :splice nil/t
  10193. When set to t, return only table body lines, don't wrap them into a
  10194. tabular environment. Default is nil.
  10195. @item :fmt fmt
  10196. A format to be used to wrap each field, it should contain @code{%s} for the
  10197. original field value. For example, to wrap each field value in dollars,
  10198. you could use @code{:fmt "$%s$"}. This may also be a property list with
  10199. column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
  10200. A function of one argument can be used in place of the strings; the
  10201. function must return a formatted string.
  10202. @item :efmt efmt
  10203. Use this format to print numbers with exponentials. The format should
  10204. have @code{%s} twice for inserting mantissa and exponent, for example
  10205. @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
  10206. may also be a property list with column numbers and formats, for example
  10207. @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
  10208. @code{efmt} has been applied to a value, @code{fmt} will also be
  10209. applied. Similar to @code{fmt}, functions of two arguments can be
  10210. supplied instead of strings.
  10211. @end table
  10212. @node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
  10213. @subsection Translator functions
  10214. @cindex HTML, and Orgtbl mode
  10215. @cindex translator function
  10216. Orgtbl mode has several translator functions built-in: @code{orgtbl-to-csv}
  10217. (comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values)
  10218. @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and @code{orgtbl-to-texinfo}.
  10219. Except for @code{orgtbl-to-html}@footnote{The HTML translator uses the same
  10220. code that produces tables during HTML export.}, these all use a generic
  10221. translator, @code{orgtbl-to-generic}. For example, @code{orgtbl-to-latex}
  10222. itself is a very short function that computes the column definitions for the
  10223. @code{tabular} environment, defines a few field and line separators and then
  10224. hands processing over to the generic translator. Here is the entire code:
  10225. @lisp
  10226. @group
  10227. (defun orgtbl-to-latex (table params)
  10228. "Convert the Orgtbl mode TABLE to LaTeX."
  10229. (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
  10230. org-table-last-alignment ""))
  10231. (params2
  10232. (list
  10233. :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
  10234. :tend "\\end@{tabular@}"
  10235. :lstart "" :lend " \\\\" :sep " & "
  10236. :efmt "%s\\,(%s)" :hline "\\hline")))
  10237. (orgtbl-to-generic table (org-combine-plists params2 params))))
  10238. @end group
  10239. @end lisp
  10240. As you can see, the properties passed into the function (variable
  10241. @var{PARAMS}) are combined with the ones newly defined in the function
  10242. (variable @var{PARAMS2}). The ones passed into the function (i.e. the
  10243. ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
  10244. would like to use the La@TeX{} translator, but wanted the line endings to
  10245. be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
  10246. overrule the default with
  10247. @example
  10248. #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
  10249. @end example
  10250. For a new language, you can either write your own converter function in
  10251. analogy with the La@TeX{} translator, or you can use the generic function
  10252. directly. For example, if you have a language where a table is started
  10253. with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
  10254. started with @samp{!BL!}, ended with @samp{!EL!}, and where the field
  10255. separator is a TAB, you could call the generic translator like this (on
  10256. a single line!):
  10257. @example
  10258. #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
  10259. :lstart "!BL! " :lend " !EL!" :sep "\t"
  10260. @end example
  10261. @noindent
  10262. Please check the documentation string of the function
  10263. @code{orgtbl-to-generic} for a full list of parameters understood by
  10264. that function, and remember that you can pass each of them into
  10265. @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
  10266. using the generic function.
  10267. Of course you can also write a completely new function doing complicated
  10268. things the generic translator cannot do. A translator function takes
  10269. two arguments. The first argument is the table, a list of lines, each
  10270. line either the symbol @code{hline} or a list of fields. The second
  10271. argument is the property list containing all parameters specified in the
  10272. @samp{#+ORGTBL: SEND} line. The function must return a single string
  10273. containing the formatted table. If you write a generally useful
  10274. translator, please post it on @email{emacs-orgmode@@gnu.org} so that
  10275. others can benefit from your work.
  10276. @node Radio lists, , Translator functions, Tables in arbitrary syntax
  10277. @subsection Radio lists
  10278. @cindex radio lists
  10279. @cindex org-list-insert-radio-list
  10280. Sending and receiving radio lists works exactly the same way than sending and
  10281. receiving radio tables (@pxref{Radio tables}). As for radio tables, you can
  10282. insert radio lists templates in HTML, La@TeX{} and Texinfo modes by calling
  10283. @code{org-list-insert-radio-list}.
  10284. Here are the differences with radio tables:
  10285. @itemize @minus
  10286. @item
  10287. Use @code{ORGLST} instead of @code{ORGTBL}.
  10288. @item
  10289. The available translation functions for radio lists don't take
  10290. parameters.
  10291. @item
  10292. @kbd{C-c C-c} will work when pressed on the first item of the list.
  10293. @end itemize
  10294. Here is a La@TeX{} example. Let's say that you have this in your
  10295. La@TeX{} file:
  10296. @cindex #+ORGLIST
  10297. @example
  10298. % BEGIN RECEIVE ORGLST to-buy
  10299. % END RECEIVE ORGLST to-buy
  10300. \begin@{comment@}
  10301. #+ORGLIST: SEND to-buy orgtbl-to-latex
  10302. - a new house
  10303. - a new computer
  10304. + a new keyboard
  10305. + a new mouse
  10306. - a new life
  10307. \end@{comment@}
  10308. @end example
  10309. Pressing `C-c C-c' on @code{a new house} and will insert the converted
  10310. La@TeX{} list between the two marker lines.
  10311. @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
  10312. @section Dynamic blocks
  10313. @cindex dynamic blocks
  10314. Org documents can contain @emph{dynamic blocks}. These are
  10315. specially marked regions that are updated by some user-written function.
  10316. A good example for such a block is the clock table inserted by the
  10317. command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
  10318. Dynamic block are enclosed by a BEGIN-END structure that assigns a name
  10319. to the block and can also specify parameters for the function producing
  10320. the content of the block.
  10321. #+BEGIN:dynamic block
  10322. @example
  10323. #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
  10324. #+END:
  10325. @end example
  10326. Dynamic blocks are updated with the following commands
  10327. @table @kbd
  10328. @kindex C-c C-x C-u
  10329. @item C-c C-x C-u
  10330. Update dynamic block at point.
  10331. @kindex C-u C-c C-x C-u
  10332. @item C-u C-c C-x C-u
  10333. Update all dynamic blocks in the current file.
  10334. @end table
  10335. Updating a dynamic block means to remove all the text between BEGIN and
  10336. END, parse the BEGIN line for parameters and then call the specific
  10337. writer function for this block to insert the new content. If you want
  10338. to use the original content in the writer function, you can use the
  10339. extra parameter @code{:content}.
  10340. For a block with name @code{myblock}, the writer function is
  10341. @code{org-dblock-write:myblock} with as only parameter a property list
  10342. with the parameters given in the begin line. Here is a trivial example
  10343. of a block that keeps track of when the block update function was last
  10344. run:
  10345. @example
  10346. #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
  10347. #+END:
  10348. @end example
  10349. @noindent
  10350. The corresponding block writer function could look like this:
  10351. @lisp
  10352. (defun org-dblock-write:block-update-time (params)
  10353. (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
  10354. (insert "Last block update at: "
  10355. (format-time-string fmt (current-time)))))
  10356. @end lisp
  10357. If you want to make sure that all dynamic blocks are always up-to-date,
  10358. you could add the function @code{org-update-all-dblocks} to a hook, for
  10359. example @code{before-save-hook}. @code{org-update-all-dblocks} is
  10360. written in a way such that it does nothing in buffers that are not in
  10361. @code{org-mode}.
  10362. @node Special agenda views, Extracting agenda information, Dynamic blocks, Hacking
  10363. @section Special agenda views
  10364. @cindex agenda views, user-defined
  10365. Org provides a special hook that can be used to narrow down the
  10366. selection made by any of the agenda views. You may specify a function
  10367. that is used at each match to verify if the match should indeed be part
  10368. of the agenda view, and if not, how much should be skipped.
  10369. Let's say you want to produce a list of projects that contain a WAITING
  10370. tag anywhere in the project tree. Let's further assume that you have
  10371. marked all tree headings that define a project with the TODO keyword
  10372. PROJECT. In this case you would run a TODO search for the keyword
  10373. PROJECT, but skip the match unless there is a WAITING tag anywhere in
  10374. the subtree belonging to the project line.
  10375. To achieve this, you must write a function that searches the subtree for
  10376. the tag. If the tag is found, the function must return @code{nil} to
  10377. indicate that this match should not be skipped. If there is no such
  10378. tag, return the location of the end of the subtree, to indicate that
  10379. search should continue from there.
  10380. @lisp
  10381. (defun my-skip-unless-waiting ()
  10382. "Skip trees that are not waiting"
  10383. (let ((subtree-end (save-excursion (org-end-of-subtree t))))
  10384. (if (re-search-forward ":waiting:" subtree-end t)
  10385. nil ; tag found, do not skip
  10386. subtree-end))) ; tag not found, continue after end of subtree
  10387. @end lisp
  10388. Now you may use this function in an agenda custom command, for example
  10389. like this:
  10390. @lisp
  10391. (org-add-agenda-custom-command
  10392. '("b" todo "PROJECT"
  10393. ((org-agenda-skip-function 'my-skip-unless-waiting)
  10394. (org-agenda-overriding-header "Projects waiting for something: "))))
  10395. @end lisp
  10396. @vindex org-agenda-overriding-header
  10397. Note that this also binds @code{org-agenda-overriding-header} to get a
  10398. meaningful header in the agenda view.
  10399. @vindex org-odd-levels-only
  10400. @vindex org-agenda-skip-function
  10401. A general way to create custom searches is to base them on a search for
  10402. entries with a certain level limit. If you want to study all entries with
  10403. your custom search function, simply do a search for
  10404. @samp{LEVEL>0}@footnote{Note that, when using @code{org-odd-levels-only}, a
  10405. level number corresponds to order in the hierarchy, not to the number of
  10406. stars.}, and then use @code{org-agenda-skip-function} to select the entries
  10407. you really want to have.
  10408. You may also put a Lisp form into @code{org-agenda-skip-function}. In
  10409. particular, you may use the functions @code{org-agenda-skip-entry-if}
  10410. and @code{org-agenda-skip-subtree-if} in this form, for example:
  10411. @table @code
  10412. @item '(org-agenda-skip-entry-if 'scheduled)
  10413. Skip current entry if it has been scheduled.
  10414. @item '(org-agenda-skip-entry-if 'notscheduled)
  10415. Skip current entry if it has not been scheduled.
  10416. @item '(org-agenda-skip-entry-if 'deadline)
  10417. Skip current entry if it has a deadline.
  10418. @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
  10419. Skip current entry if it has a deadline, or if it is scheduled.
  10420. @item '(org-agenda-skip-entry-if 'timestamp)
  10421. Skip current entry if it has any timestamp, may also be deadline or scheduled.
  10422. @item '(org-agenda-skip-entry 'regexp "regular expression")
  10423. Skip current entry if the regular expression matches in the entry.
  10424. @item '(org-agenda-skip-entry 'notregexp "regular expression")
  10425. Skip current entry unless the regular expression matches.
  10426. @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
  10427. Same as above, but check and skip the entire subtree.
  10428. @end table
  10429. Therefore we could also have written the search for WAITING projects
  10430. like this, even without defining a special function:
  10431. @lisp
  10432. (org-add-agenda-custom-command
  10433. '("b" todo "PROJECT"
  10434. ((org-agenda-skip-function '(org-agenda-skip-subtree-if
  10435. 'regexp ":waiting:"))
  10436. (org-agenda-overriding-header "Projects waiting for something: "))))
  10437. @end lisp
  10438. @node Extracting agenda information, Using the property API, Special agenda views, Hacking
  10439. @section Extracting agenda information
  10440. @cindex agenda, pipe
  10441. @cindex Scripts, for agenda processing
  10442. @vindex org-agenda-custom-commands
  10443. Org provides commands to access agenda information for the command
  10444. line in Emacs batch mode. This extracted information can be sent
  10445. directly to a printer, or it can be read by a program that does further
  10446. processing of the data. The first of these commands is the function
  10447. @code{org-batch-agenda}, that produces an agenda view and sends it as
  10448. ASCII text to STDOUT. The command takes a single string as parameter.
  10449. If the string has length 1, it is used as a key to one of the commands
  10450. you have configured in @code{org-agenda-custom-commands}, basically any
  10451. key you can use after @kbd{C-c a}. For example, to directly print the
  10452. current TODO list, you could use
  10453. @example
  10454. emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
  10455. @end example
  10456. If the parameter is a string with 2 or more characters, it is used as a
  10457. tags/TODO match string. For example, to print your local shopping list
  10458. (all items with the tag @samp{shop}, but excluding the tag
  10459. @samp{NewYork}), you could use
  10460. @example
  10461. emacs -batch -l ~/.emacs \
  10462. -eval '(org-batch-agenda "+shop-NewYork")' | lpr
  10463. @end example
  10464. @noindent
  10465. You may also modify parameters on the fly like this:
  10466. @example
  10467. emacs -batch -l ~/.emacs \
  10468. -eval '(org-batch-agenda "a" \
  10469. org-agenda-ndays 30 \
  10470. org-agenda-include-diary nil \
  10471. org-agenda-files (quote ("~/org/project.org")))' \
  10472. | lpr
  10473. @end example
  10474. @noindent
  10475. which will produce a 30-day agenda, fully restricted to the Org file
  10476. @file{~/org/projects.org}, not even including the diary.
  10477. If you want to process the agenda data in more sophisticated ways, you
  10478. can use the command @code{org-batch-agenda-csv} to get a comma-separated
  10479. list of values for each agenda item. Each line in the output will
  10480. contain a number of fields separated by commas. The fields in a line
  10481. are:
  10482. @example
  10483. category @r{The category of the item}
  10484. head @r{The headline, without TODO keyword, TAGS and PRIORITY}
  10485. type @r{The type of the agenda entry, can be}
  10486. todo @r{selected in TODO match}
  10487. tagsmatch @r{selected in tags match}
  10488. diary @r{imported from diary}
  10489. deadline @r{a deadline}
  10490. scheduled @r{scheduled}
  10491. timestamp @r{appointment, selected by timestamp}
  10492. closed @r{entry was closed on date}
  10493. upcoming-deadline @r{warning about nearing deadline}
  10494. past-scheduled @r{forwarded scheduled item}
  10495. block @r{entry has date block including date}
  10496. todo @r{The TODO keyword, if any}
  10497. tags @r{All tags including inherited ones, separated by colons}
  10498. date @r{The relevant date, like 2007-2-14}
  10499. time @r{The time, like 15:00-16:50}
  10500. extra @r{String with extra planning info}
  10501. priority-l @r{The priority letter if any was given}
  10502. priority-n @r{The computed numerical priority}
  10503. @end example
  10504. @noindent
  10505. Time and date will only be given if a timestamp (or deadline/scheduled)
  10506. led to the selection of the item.
  10507. A CSV list like this is very easy to use in a post-processing script.
  10508. For example, here is a Perl program that gets the TODO list from
  10509. Emacs/Org and prints all the items, preceded by a checkbox:
  10510. @example
  10511. #!/usr/bin/perl
  10512. # define the Emacs command to run
  10513. $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
  10514. # run it and capture the output
  10515. $agenda = qx@{$cmd 2>/dev/null@};
  10516. # loop over all lines
  10517. foreach $line (split(/\n/,$agenda)) @{
  10518. # get the individual values
  10519. ($category,$head,$type,$todo,$tags,$date,$time,$extra,
  10520. $priority_l,$priority_n) = split(/,/,$line);
  10521. # process and print
  10522. print "[ ] $head\n";
  10523. @}
  10524. @end example
  10525. @node Using the property API, Using the mapping API, Extracting agenda information, Hacking
  10526. @section Using the property API
  10527. @cindex API, for properties
  10528. @cindex properties, API
  10529. Here is a description of the functions that can be used to work with
  10530. properties.
  10531. @defun org-entry-properties &optional pom which
  10532. Get all properties of the entry at point-or-marker POM.@*
  10533. This includes the TODO keyword, the tags, time strings for deadline,
  10534. scheduled, and clocking, and any additional properties defined in the
  10535. entry. The return value is an alist, keys may occur multiple times
  10536. if the property key was used several times.@*
  10537. POM may also be nil, in which case the current entry is used.
  10538. If WHICH is nil or `all', get all properties. If WHICH is
  10539. `special' or `standard', only get that subclass.
  10540. @end defun
  10541. @vindex org-use-property-inheritance
  10542. @defun org-entry-get pom property &optional inherit
  10543. Get value of PROPERTY for entry at point-or-marker POM. By default,
  10544. this only looks at properties defined locally in the entry. If INHERIT
  10545. is non-nil and the entry does not have the property, then also check
  10546. higher levels of the hierarchy. If INHERIT is the symbol
  10547. @code{selective}, use inheritance if and only if the setting of
  10548. @code{org-use-property-inheritance} selects PROPERTY for inheritance.
  10549. @end defun
  10550. @defun org-entry-delete pom property
  10551. Delete the property PROPERTY from entry at point-or-marker POM.
  10552. @end defun
  10553. @defun org-entry-put pom property value
  10554. Set PROPERTY to VALUE for entry at point-or-marker POM.
  10555. @end defun
  10556. @defun org-buffer-property-keys &optional include-specials
  10557. Get all property keys in the current buffer.
  10558. @end defun
  10559. @defun org-insert-property-drawer
  10560. Insert a property drawer at point.
  10561. @end defun
  10562. @defun org-entry-put-multivalued-property pom property &rest values
  10563. Set PROPERTY at point-or-marker POM to VALUES. VALUES should be a list of
  10564. strings. They will be concatenated, with spaces as separators.
  10565. @end defun
  10566. @defun org-entry-get-multivalued-property pom property
  10567. Treat the value of the property PROPERTY as a whitespace-separated list of
  10568. values and return the values as a list of strings.
  10569. @end defun
  10570. @defun org-entry-add-to-multivalued-property pom property value
  10571. Treat the value of the property PROPERTY as a whitespace-separated list of
  10572. values and make sure that VALUE is in this list.
  10573. @end defun
  10574. @defun org-entry-remove-from-multivalued-property pom property value
  10575. Treat the value of the property PROPERTY as a whitespace-separated list of
  10576. values and make sure that VALUE is @emph{not} in this list.
  10577. @end defun
  10578. @defun org-entry-member-in-multivalued-property pom property value
  10579. Treat the value of the property PROPERTY as a whitespace-separated list of
  10580. values and check if VALUE is in this list.
  10581. @end defun
  10582. @defopt org-property-allowed-value-functions
  10583. Hook for functions supplying allowed values for specific.
  10584. The functions must take a single argument, the name of the property, and
  10585. return a flat list of allowed values. If @samp{:ETC} is one of
  10586. the values, use the values as completion help, but allow also other values
  10587. to be entered. The functions must return @code{nil} if they are not
  10588. responsible for this property.
  10589. @end defopt
  10590. @node Using the mapping API, , Using the property API, Hacking
  10591. @section Using the mapping API
  10592. @cindex API, for mapping
  10593. @cindex mapping entries, API
  10594. Org has sophisticated mapping capabilities to find all entries satisfying
  10595. certain criteria. Internally, this functionality is used to produce agenda
  10596. views, but there is also an API that can be used to execute arbitrary
  10597. functions for each or selected entries. The main entry point for this API
  10598. is:
  10599. @defun org-map-entries func &optional match scope &rest skip
  10600. Call FUNC at each headline selected by MATCH in SCOPE.
  10601. FUNC is a function or a Lisp form. The function will be called without
  10602. arguments, with the cursor positioned at the beginning of the headline.
  10603. The return values of all calls to the function will be collected and
  10604. returned as a list.
  10605. The call to FUNC will be wrapped into a save-excursion form, so FUNC
  10606. does not need to preserve point. After evaluation, the cursor will be
  10607. moved to the end of the line (presumably of the headline of the
  10608. processed entry) and search continues from there. Under some
  10609. circumstances, this may not produce the wanted results. For example,
  10610. if you have removed (e.g. archived) the current (sub)tree it could
  10611. mean that the next entry will be skipped entirely. In such cases, you
  10612. can specify the position from where search should continue by making
  10613. FUNC set the variable `org-map-continue-from' to the desired buffer
  10614. position.
  10615. MATCH is a tags/property/todo match as it is used in the agenda match view.
  10616. Only headlines that are matched by this query will be considered during
  10617. the iteration. When MATCH is nil or t, all headlines will be
  10618. visited by the iteration.
  10619. SCOPE determines the scope of this command. It can be any of:
  10620. @example
  10621. nil @r{the current buffer, respecting the restriction if any}
  10622. tree @r{the subtree started with the entry at point}
  10623. file @r{the current buffer, without restriction}
  10624. file-with-archives
  10625. @r{the current buffer, and any archives associated with it}
  10626. agenda @r{all agenda files}
  10627. agenda-with-archives
  10628. @r{all agenda files with any archive files associated with them}
  10629. (file1 file2 ...)
  10630. @r{if this is a list, all files in the list will be scanned}
  10631. @end example
  10632. @noindent
  10633. The remaining args are treated as settings for the skipping facilities of
  10634. the scanner. The following items can be given here:
  10635. @vindex org-agenda-skip-function
  10636. @example
  10637. archive @r{skip trees with the archive tag}
  10638. comment @r{skip trees with the COMMENT keyword}
  10639. function or Lisp form
  10640. @r{will be used as value for @code{org-agenda-skip-function},}
  10641. @r{so whenever the function returns t, FUNC}
  10642. @r{will not be called for that entry and search will}
  10643. @r{continue from the point where the function leaves it}
  10644. @end example
  10645. @end defun
  10646. The function given to that mapping routine can really do anything you like.
  10647. It can use the property API (@pxref{Using the property API}) to gather more
  10648. information about the entry, or in order to change metadata in the entry.
  10649. Here are a couple of functions that might be handy:
  10650. @defun org-todo &optional arg
  10651. Change the TODO state of the entry, see the docstring of the functions for
  10652. the many possible values for the argument ARG.
  10653. @end defun
  10654. @defun org-priority &optional action
  10655. Change the priority of the entry, see the docstring of this function for the
  10656. possible values for ACTION.
  10657. @end defun
  10658. @defun org-toggle-tag tag &optional onoff
  10659. Toggle the tag TAG in the current entry. Setting ONOFF to either @code{on}
  10660. or @code{off} will not toggle tag, but ensure that it is either on or off.
  10661. @end defun
  10662. @defun org-promote
  10663. Promote the current entry.
  10664. @end defun
  10665. @defun org-demote
  10666. Demote the current entry.
  10667. @end defun
  10668. Here is a simple example that will turn all entries in the current file with
  10669. a tag @code{TOMORROW} into TODO entries with the keyword @code{UPCOMING}.
  10670. Entries in comment trees and in archive trees will be ignored.
  10671. @lisp
  10672. (org-map-entries
  10673. '(org-todo "UPCOMING")
  10674. "+TOMORROW" 'file 'archive 'comment)
  10675. @end lisp
  10676. The following example counts the number of entries with TODO keyword
  10677. @code{WAITING}, in all agenda files.
  10678. @lisp
  10679. (length (org-map-entries t "/+WAITING" 'agenda))
  10680. @end lisp
  10681. @node MobileOrg, History and Acknowledgments, Hacking, Top
  10682. @appendix MobileOrg
  10683. @cindex iPhone
  10684. @cindex MobileOrg
  10685. @i{MobileOrg} is an application for the @i{iPhone/iPod Touch} series of
  10686. devices, developed by Richard Moreland. @i{MobileOrg} offers offline viewing
  10687. and capture support for an Org-mode system rooted on a ``real'' computer. It
  10688. does also allow you to record changes to existing entries. For information
  10689. about @i{MobileOrg}, see @uref{http://mobileorg.ncogni.to/}).
  10690. This appendix describes the support Org has for creating agenda views in a
  10691. format that can be displayed by @i{MobileOrg}, and for integrating notes
  10692. captured and changes made by @i{MobileOrg} into the main system.
  10693. For changing tags and TODO states in MobileOrg, you should have set up the
  10694. customization variables @code{org-todo-keywords} and @code{org-tags-alist} to
  10695. cover all important tags and todo keywords, even if individual files use only
  10696. part of these. MobileOrg will also offer you states and tags set up with
  10697. in-buffer settings, but it will understand the logistics of todo state
  10698. @i{sets} (@pxref{Per-file keywords}) and @i{mutually exclusive} tags
  10699. (@pxref{Setting tags}) only for those set in these variables.
  10700. @menu
  10701. * Setting up the staging area:: Where to interact with the mobile device
  10702. * Pushing to MobileOrg:: Uploading Org files and agendas
  10703. * Pulling from MobileOrg:: Integrating captured and flagged items
  10704. @end menu
  10705. @node Setting up the staging area, Pushing to MobileOrg, MobileOrg, MobileOrg
  10706. @section Setting up the staging area
  10707. Org-mode has commands to prepare a directory with files for @i{MobileOrg},
  10708. and to read captured notes from there. If Emacs can directly write to the
  10709. WebDAV directory accessed by @i{MobileOrg}, just point to this directory
  10710. using the variable @code{org-mobile-directory}. Using the @file{tramp}
  10711. method, @code{org-mobile-directory} may point to a remote directory
  10712. accessible through, for example,
  10713. @file{ssh/scp}:
  10714. @smallexample
  10715. (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
  10716. @end smallexample
  10717. If Emacs cannot access the WebDAV directory directly using a @file{tramp}
  10718. method, or you prefer to maintain a local copy, you can use a local directory
  10719. for staging. Other means must then be used to keep this directory in sync
  10720. with the WebDAV directory. In the following example, files are staged in
  10721. @file{~/stage}, and Org-mode hooks take care of moving files to and from the
  10722. WebDAV directory using @file{scp}.
  10723. @smallexample
  10724. (setq org-mobile-directory "~/stage/")
  10725. (add-hook 'org-mobile-post-push-hook
  10726. (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
  10727. (add-hook 'org-mobile-pre-pull-hook
  10728. (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
  10729. (add-hook 'org-mobile-post-pull-hook
  10730. (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
  10731. @end smallexample
  10732. @node Pushing to MobileOrg, Pulling from MobileOrg, Setting up the staging area, MobileOrg
  10733. @section Pushing to MobileOrg
  10734. This operation copies all files currently listed in @code{org-mobile-files}
  10735. to the directory @code{org-mobile-directory}. By default this list contains
  10736. all agenda files (as listed in @code{org-agenda-files}), but additional files
  10737. can be included by customizing @code{org-mobiles-files}. File names will be
  10738. staged with path relative to @code{org-directory}, so all files should be
  10739. inside this directory. The push operation also creates (in the same
  10740. directory) a special Org file @file{agendas.org}. This file is an Org-mode
  10741. style outline, containing every custom agenda view defined by the user.
  10742. While creating the agendas, Org-mode will force@footnote{See the variable
  10743. @code{org-mobile-force-id-on-agenda-items}.} an ID property on all entries
  10744. referenced by the agendas, so that these entries can be uniquely identified
  10745. if @i{MobileOrg} flags them for further action. Finally, Org writes the file
  10746. @file{index.org}, containing links to all other files. If @i{MobileOrg} is
  10747. configured to request this file from the WebDAV server, all agendas and Org
  10748. files will be downloaded to the device. To speed up the download, MobileOrg
  10749. will only read files whose checksums@footnote{stored automatically in the
  10750. file @file{checksums.dat}} have changed.
  10751. @node Pulling from MobileOrg, , Pushing to MobileOrg, MobileOrg
  10752. @section Pulling from MobileOrg
  10753. When @i{MobileOrg} synchronizes with the WebDAV server, it not only pulls the
  10754. Org files for viewing. It also appends captured entries and pointers to
  10755. flagged and changed entries to the file @file{mobileorg.org} on the server.
  10756. Org has a @emph{pull} operation that integrates this information into an
  10757. inbox file and operates on the pointers to flagged entries. Here is how it
  10758. works:
  10759. @enumerate
  10760. @item
  10761. Org moves all entries found in
  10762. @file{mobileorg.org}@footnote{@file{mobileorg.org} will be empty after this
  10763. operation.} and appends them to the file pointed to by the variable
  10764. @code{org-mobile-inbox-for-pull}. Each captured entry and each editing event
  10765. will be a top-level entry in the inbox file.
  10766. @item
  10767. After moving the entries, Org will attempt to implement the changes made in
  10768. @i{MobileOrg}. Some changes are applied directly and without user
  10769. interaction. Examples are all changes to tags, TODO state, headline and body
  10770. text that can be cleanly applied. Entries that have been flagged for further
  10771. action will receive a tag @code{:FLAGGED:}, so that they can be easily found
  10772. again. When there is a problem finding an entry or applying the change, the
  10773. pointer entry will remain in the inbox and will be marked with an error
  10774. message. You need to later resolve these issues by hand.
  10775. @item
  10776. Org will then generate an agenda view with all flagged entries. The user
  10777. should then go through these entries and do whatever actions are necessary.
  10778. If a note has been stored while flagging an entry in @i{MobileOrg}, that note
  10779. will be displayed in the echo area when the cursor is on the corresponding
  10780. agenda line.
  10781. @table @kbd
  10782. @kindex ?
  10783. @item ?
  10784. Pressing @kbd{?} in that special agenda will display the full flagging note in
  10785. another window and also push it onto the kill ring. So you could use @kbd{?
  10786. z C-y C-c C-c} to store that flagging note as a normal note in the entry.
  10787. Pressing @kbd{?} twice in succession will offer to remove the
  10788. @code{:FLAGGED:} tag along with the recorded flagging note (which is stored
  10789. in a property). In this way you indicate, that the intended processing for
  10790. this flagged entry is finished.
  10791. @end table
  10792. @end enumerate
  10793. @kindex C-c a ?
  10794. If you are not able to process all flagged entries directly, you can always
  10795. return to this agenda view using @kbd{C-c a ?}. Note, however, that there is
  10796. a subtle difference. The view created automatically by @kbd{M-x
  10797. org-mobile-pull RET} is guaranteed to search all files that have been
  10798. addressed by the last pull. This might include a file that is not currently
  10799. in your list of agenda files. If you later use @kbd{C-c a ?} to regenerate
  10800. the view, only the current agenda files will be searched.
  10801. @node History and Acknowledgments, Main Index, MobileOrg, Top
  10802. @appendix History and Acknowledgments
  10803. @cindex acknowledgements
  10804. @cindex history
  10805. @cindex thanks
  10806. Org was born in 2003, out of frustration over the user interface
  10807. of the Emacs Outline mode. I was trying to organize my notes and
  10808. projects, and using Emacs seemed to be the natural way to go. However,
  10809. having to remember eleven different commands with two or three keys per
  10810. command, only to hide and show parts of the outline tree, that seemed
  10811. entirely unacceptable to me. Also, when using outlines to take notes, I
  10812. constantly wanted to restructure the tree, organizing it parallel to my
  10813. thoughts and plans. @emph{Visibility cycling} and @emph{structure
  10814. editing} were originally implemented in the package
  10815. @file{outline-magic.el}, but quickly moved to the more general
  10816. @file{org.el}. As this environment became comfortable for project
  10817. planning, the next step was adding @emph{TODO entries}, basic
  10818. @emph{timestamps}, and @emph{table support}. These areas highlighted the two main
  10819. goals that Org still has today: to be a new, outline-based,
  10820. plain text mode with innovative and intuitive editing features, and to
  10821. incorporate project planning functionality directly into a notes file.
  10822. A special thanks goes to @i{Bastien Guerry} who has not only written a large
  10823. number of extensions to Org (most of them integrated into the core by now),
  10824. but who has also helped in the development and maintenance of Org so much that he
  10825. should be considered the main co-contributor to this package.
  10826. Since the first release, literally thousands of emails to me or to
  10827. @email{emacs-orgmode@@gnu.org} have provided a constant stream of bug
  10828. reports, feedback, new ideas, and sometimes patches and add-on code.
  10829. Many thanks to everyone who has helped to improve this package. I am
  10830. trying to keep here a list of the people who had significant influence
  10831. in shaping one or more aspects of Org. The list may not be
  10832. complete, if I have forgotten someone, please accept my apologies and
  10833. let me know.
  10834. @itemize @bullet
  10835. @item
  10836. @i{Russel Adams} came up with the idea for drawers.
  10837. @item
  10838. @i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
  10839. @item
  10840. @i{Christophe Bataillon} created the great unicorn logo that we use on the
  10841. Org-mode website.
  10842. @item
  10843. @i{Alex Bochannek} provided a patch for rounding timestamps.
  10844. @item
  10845. @i{Jan Böcker} wrote @file{org-docview.el}.
  10846. @item
  10847. @i{Brad Bozarth} showed how to pull RSS feed data into Org-mode files.
  10848. @item
  10849. @i{Tom Breton} wrote @file{org-choose.el}.
  10850. @item
  10851. @i{Charles Cave}'s suggestion sparked the implementation of templates
  10852. for Remember.
  10853. @item
  10854. @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
  10855. specified time.
  10856. @item
  10857. @i{Gregory Chernov} patched support for Lisp forms into table
  10858. calculations and improved XEmacs compatibility, in particular by porting
  10859. @file{nouline.el} to XEmacs.
  10860. @item
  10861. @i{Sacha Chua} suggested copying some linking code from Planner.
  10862. @item
  10863. @i{Baoqiu Cui} contributed the DocBook exporter.
  10864. @item
  10865. @i{Dan Davison} wrote (together with @i{Eric Schulte}) Org Babel.
  10866. @item
  10867. @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
  10868. came up with the idea of properties, and that there should be an API for
  10869. them.
  10870. @item
  10871. @i{Nick Dokos} tracked down several nasty bugs.
  10872. @item
  10873. @i{Kees Dullemond} used to edit projects lists directly in HTML and so
  10874. inspired some of the early development, including HTML export. He also
  10875. asked for a way to narrow wide table columns.
  10876. @item
  10877. @i{Christian Egli} converted the documentation into Texinfo format,
  10878. patched CSS formatting into the HTML exporter, and inspired the agenda.
  10879. @item
  10880. @i{David Emery} provided a patch for custom CSS support in exported
  10881. HTML agendas.
  10882. @item
  10883. @i{Nic Ferrier} contributed mailcap and XOXO support.
  10884. @item
  10885. @i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
  10886. @item
  10887. @i{John Foerch} figured out how to make incremental search show context
  10888. around a match in a hidden outline tree.
  10889. @item
  10890. @i{Raimar Finken} wrote @file{org-git-line.el}.
  10891. @item
  10892. @i{Mikael Fornius} works as a mailing list moderator.
  10893. @item
  10894. @i{Austin Frank} works as a mailing list moderator.
  10895. @item
  10896. @i{Niels Giesen} had the idea to automatically archive DONE trees.
  10897. @item
  10898. @i{Bastien Guerry} wrote the La@TeX{} exporter and @file{org-bibtex.el}, and
  10899. has been prolific with patches, ideas, and bug reports.
  10900. @item
  10901. @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
  10902. @item
  10903. @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
  10904. task state change logging, and the clocktable. His clear explanations have
  10905. been critical when we started to adopt the Git version control system.
  10906. @item
  10907. @i{Manuel Hermenegildo} has contributed various ideas, small fixes and
  10908. patches.
  10909. @item
  10910. @i{Phil Jackson} wrote @file{org-irc.el}.
  10911. @item
  10912. @i{Scott Jaderholm} proposed footnotes, control over whitespace between
  10913. folded entries, and column view for properties.
  10914. @item
  10915. @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
  10916. @item
  10917. @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
  10918. provided frequent feedback and some patches.
  10919. @item
  10920. @i{Matt Lundin} has proposed last-row references for table formulas and named
  10921. invisible anchors. He has also worked a lot on the FAQ.
  10922. @item
  10923. @i{Jason F. McBrayer} suggested agenda export to CSV format.
  10924. @item
  10925. @i{Max Mikhanosha} came up with the idea of refiling.
  10926. @item
  10927. @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
  10928. basis.
  10929. @item
  10930. @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
  10931. happy.
  10932. @item
  10933. @i{Richard Moreland} wrote @i{MobileOrg} for the iPhone.
  10934. @item
  10935. @i{Rick Moynihan} proposed allowing multiple TODO sequences in a file
  10936. and being able to quickly restrict the agenda to a subtree.
  10937. @item
  10938. @i{Todd Neal} provided patches for links to Info files and Elisp forms.
  10939. @item
  10940. @i{Greg Newman} refreshed the unicorn logo into its current form.
  10941. @item
  10942. @i{Tim O'Callaghan} suggested in-file links, search options for general
  10943. file links, and TAGS.
  10944. @item
  10945. @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
  10946. into Japanese.
  10947. @item
  10948. @i{Oliver Oppitz} suggested multi-state TODO items.
  10949. @item
  10950. @i{Scott Otterson} sparked the introduction of descriptive text for
  10951. links, among other things.
  10952. @item
  10953. @i{Pete Phillips} helped during the development of the TAGS feature, and
  10954. provided frequent feedback.
  10955. @item
  10956. @i{Martin Pohlack} provided the code snippet to bundle character insertion
  10957. into bundles of 20 for undo.
  10958. @item
  10959. @i{T.V. Raman} reported bugs and suggested improvements.
  10960. @item
  10961. @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
  10962. control.
  10963. @item
  10964. @i{Paul Rivier} provided the basic implementation of named footnotes. He
  10965. also acted as mailing list moderator for some time.
  10966. @item
  10967. @i{Kevin Rogers} contributed code to access VM files on remote hosts.
  10968. @item
  10969. @i{Sebastian Rose} wrote @file{org-info.js}, a Java script for displaying
  10970. webpages derived from Org using an Info-like or a folding interface with
  10971. single-key navigation.
  10972. @item
  10973. @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
  10974. conflict with @file{allout.el}.
  10975. @item
  10976. @i{Jason Riedy} generalized the send-receive mechanism for Orgtbl tables with
  10977. extensive patches.
  10978. @item
  10979. @i{Philip Rooke} created the Org reference card, provided lots
  10980. of feedback, developed and applied standards to the Org documentation.
  10981. @item
  10982. @i{Christian Schlauer} proposed angular brackets around links, among
  10983. other things.
  10984. @item
  10985. @i{Eric Schulte} wrote @file{org-plot.el} and (together with @i{Dan Davison})
  10986. Org Babel, and contributed various patches, small features and modules.
  10987. @item
  10988. @i{Paul Sexton} wrote @file{org-ctags.el}.
  10989. @item
  10990. Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
  10991. @file{organizer-mode.el}.
  10992. @item
  10993. @i{Ilya Shlyakhter} proposed the Archive Sibling, line numbering in literal
  10994. examples, and remote highlighting for referenced code lines.
  10995. @item
  10996. @i{Stathis Sideris} wrote the @file{ditaa.jar} ASCII to PNG converter that is
  10997. now packaged into Org's @file{contrib} directory.
  10998. @item
  10999. @i{Daniel Sinder} came up with the idea of internal archiving by locking
  11000. subtrees.
  11001. @item
  11002. @i{Dale Smith} proposed link abbreviations.
  11003. @item
  11004. @i{James TD Smith} has contributed a large number of patches for useful
  11005. tweaks and features.
  11006. @item
  11007. @i{Adam Spiers} asked for global linking commands, inspired the link
  11008. extension system, added support for mairix, and proposed the mapping API.
  11009. @item
  11010. @i{Andy Stewart} contributed code to @file{org-w3m.el}, to copy HTML content
  11011. with links transformation to Org syntax.
  11012. @item
  11013. @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
  11014. chapter about publishing.
  11015. @item
  11016. @i{J@"urgen Vollmer} contributed code generating the table of contents
  11017. in HTML output.
  11018. @item
  11019. @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
  11020. keyword.
  11021. @item
  11022. @i{David Wainberg} suggested archiving, and improvements to the linking
  11023. system.
  11024. @item
  11025. @i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
  11026. @file{muse.el}, which have some overlap with Org. Initially the development
  11027. of Org was fully independent because I was not aware of the existence of
  11028. these packages. But with time I have occasionally looked at John's code and
  11029. learned a lot from it. John has also contributed a number of great ideas and
  11030. patches directly to Org, including the attachment system
  11031. (@file{org-attach.el}), integration with Apple Mail
  11032. (@file{org-mac-message.el}), hierarchical dependencies of TODO items, habit
  11033. tracking (@file{org-habits.el}).
  11034. @item
  11035. @i{Carsten Wimmer} suggested some changes and helped fix a bug in
  11036. linking to Gnus.
  11037. @item
  11038. @i{Roland Winkler} requested additional key bindings to make Org
  11039. work on a tty.
  11040. @item
  11041. @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
  11042. and contributed various ideas and code snippets.
  11043. @end itemize
  11044. @node Main Index, Key Index, History and Acknowledgments, Top
  11045. @unnumbered Concept Index
  11046. @printindex cp
  11047. @node Key Index, Variable Index, Main Index, Top
  11048. @unnumbered Key Index
  11049. @printindex ky
  11050. @node Variable Index, , Key Index, Top
  11051. @unnumbered Variable Index
  11052. This is not a complete index of variables and faces, only the ones that are
  11053. mentioned in the manual. For a more complete list, use @kbd{M-x
  11054. org-customize @key{RET}} and then click yourself through the tree.
  11055. @printindex vr
  11056. @bye
  11057. @ignore
  11058. arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
  11059. @end ignore
  11060. @c Local variables:
  11061. @c ispell-local-dictionary: "en_US-w_accents"
  11062. @c ispell-local-pdict: "./.aspell.org.pws"
  11063. @c fill-column: 77
  11064. @c End:
  11065. @c LocalWords: webdavhost pre