org.texi 312 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103
  1. \input texinfo
  2. @c %**start of header
  3. @setfilename ../info/org
  4. @settitle Org Mode Manual
  5. @set VERSION 5.11
  6. @set DATE October 2007
  7. @dircategory Emacs
  8. @direntry
  9. * Org Mode: (org). Outline-based notes management and organizer
  10. @end direntry
  11. @c Version and Contact Info
  12. @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
  13. @set AUTHOR Carsten Dominik
  14. @set MAINTAINER Carsten Dominik
  15. @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
  16. @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
  17. @c %**end of header
  18. @finalout
  19. @c Macro definitions
  20. @c Subheadings inside a table.
  21. @macro tsubheading{text}
  22. @ifinfo
  23. @subsubheading \text\
  24. @end ifinfo
  25. @ifnotinfo
  26. @item @b{\text\}
  27. @end ifnotinfo
  28. @end macro
  29. @copying
  30. This manual is for Org-mode (version @value{VERSION}).
  31. Copyright @copyright{} 2004, 2005, 2006, 2007 Free Software Foundation
  32. @quotation
  33. Permission is granted to copy, distribute and/or modify this document
  34. under the terms of the GNU Free Documentation License, Version 1.1 or
  35. any later version published by the Free Software Foundation; with no
  36. Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
  37. and with the Back-Cover Texts as in (a) below. A copy of the
  38. license is included in the section entitled ``GNU Free Documentation
  39. License.''
  40. (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
  41. this GNU Manual, like GNU software. Copies published by the Free
  42. Software Foundation raise funds for GNU development.''
  43. @end quotation
  44. @end copying
  45. @titlepage
  46. @title Org Mode Manual
  47. @subtitle Release @value{VERSION}
  48. @author by Carsten Dominik
  49. @c The following two commands start the copyright page.
  50. @page
  51. @vskip 0pt plus 1filll
  52. @insertcopying
  53. @end titlepage
  54. @c Output the table of contents at the beginning.
  55. @contents
  56. @ifnottex
  57. @node Top, Introduction, (dir), (dir)
  58. @top Org Mode Manual
  59. @insertcopying
  60. @end ifnottex
  61. @menu
  62. * Introduction:: Getting started
  63. * Document structure:: A tree works like your brain
  64. * Tables:: Pure magic for quick formatting
  65. * Hyperlinks:: Notes in context
  66. * TODO items:: Every tree branch can be a TODO item
  67. * Tags:: Tagging headlines and matching sets of tags
  68. * Properties and columns:: Storing information about an entry
  69. * Timestamps:: Assign date and time to items
  70. * Remember:: Quickly adding nodes to the outline tree
  71. * Agenda views:: Collecting information into views
  72. * Embedded LaTeX:: LaTeX fragments and formulas
  73. * Exporting:: Sharing and publishing of notes
  74. * Publishing:: Create a web site of linked Org-mode files
  75. * Miscellaneous:: All the rest which did not fit elsewhere
  76. * Extensions and Hacking:: It is possible to write add-on code
  77. * History and Acknowledgments:: How Org-mode came into being
  78. * Index:: The fast road to specific information
  79. * Key Index:: Key bindings and where they are described
  80. @detailmenu
  81. --- The Detailed Node Listing ---
  82. Introduction
  83. * Summary:: Brief summary of what Org-mode does
  84. * Installation:: How to install a downloaded version of Org-mode
  85. * Activation:: How to activate Org-mode for certain buffers.
  86. * Feedback:: Bug reports, ideas, patches etc.
  87. Document Structure
  88. * Outlines:: Org-mode is based on outline-mode
  89. * Headlines:: How to typeset org-tree headlines
  90. * Visibility cycling:: Show and hide, much simplified
  91. * Motion:: Jumping to other headlines
  92. * Structure editing:: Changing sequence and level of headlines
  93. * Archiving:: Move done task trees to a different place
  94. * Sparse trees:: Matches embedded in context
  95. * Plain lists:: Additional structure within an entry
  96. * Drawers:: Tucking stuff away
  97. * orgstruct-mode:: Structure editing outside Org-mode
  98. Archiving
  99. * ARCHIVE tag:: Marking a tree as inactive
  100. * Moving subtrees:: Moving a tree to an archive file
  101. Tables
  102. * Built-in table editor:: Simple tables
  103. * Narrow columns:: Stop wasting space in tables
  104. * Column groups:: Grouping to trigger vertical lines
  105. * orgtbl-mode:: The table editor as minor mode
  106. * The spreadsheet:: The table editor has spreadsheet capabilities.
  107. The spreadsheet
  108. * References:: How to refer to another field or range
  109. * Formula syntax for Calc:: Using Calc to compute stuff
  110. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  111. * Field formulas:: Formulas valid for a single field
  112. * Column formulas:: Formulas valid for an entire column
  113. * Editing and debugging formulas:: Fixing formulas
  114. * Updating the table:: Recomputing all dependent fields
  115. * Advanced features:: Field names, parameters and automatic recalc
  116. Hyperlinks
  117. * Link format:: How links in Org-mode are formatted
  118. * Internal links:: Links to other places in the current file
  119. * External links:: URL-like links to the world
  120. * Handling links:: Creating, inserting and following
  121. * Using links outside Org-mode:: Linking from my C source code?
  122. * Link abbreviations:: Shortcuts for writing complex links
  123. * Search options:: Linking to a specific location
  124. * Custom searches:: When the default search is not enough
  125. Internal links
  126. * Radio targets:: Make targets trigger links in plain text.
  127. TODO items
  128. * TODO basics:: Marking and displaying TODO entries
  129. * TODO extensions:: Workflow and assignments
  130. * Progress logging:: Dates and notes for progress
  131. * Priorities:: Some things are more important than others
  132. * Breaking down tasks:: Splitting a task into manageable pieces
  133. * Checkboxes:: Tick-off lists
  134. Extended use of TODO keywords
  135. * Workflow states:: From TODO to DONE in steps
  136. * TODO types:: I do this, Fred the rest
  137. * Multiple sets in one file:: Mixing it all, and still finding your way
  138. * Fast access to TODO states:: Single letter selection of a state
  139. * Per file keywords:: Different files, different requirements
  140. * Faces for TODO keywords:: Highlighting states
  141. Progress Logging
  142. * Closing items:: When was this entry marked DONE?
  143. * Tracking TODO state changes:: When did the status change?
  144. Tags
  145. * Tag inheritance:: Tags use the tree structure of the outline
  146. * Setting tags:: How to assign tags to a headline
  147. * Tag searches:: Searching for combinations of tags
  148. Properties and Columns
  149. * Property syntax:: How properties are spelled out
  150. * Special properties:: Access to other Org-mode features
  151. * Property searches:: Matching property values
  152. * Column view:: Tabular viewing and editing
  153. * Property API:: Properties for Lisp programmers
  154. Column View
  155. * Defining columns:: The COLUMNS format property
  156. * Using column view:: How to create and use column view
  157. Defining Columns
  158. * Scope of column definitions:: Where defined, where valid?
  159. * Column attributes:: Appearance and content of a column
  160. Timestamps
  161. * Time stamps:: Assigning a time to a tree entry
  162. * Creating timestamps:: Commands which insert timestamps
  163. * Deadlines and scheduling:: Planning your work
  164. * Clocking work time::
  165. Creating timestamps
  166. * The date/time prompt:: How org-mode helps you entering date and time
  167. * Custom time format:: Making dates look differently
  168. Deadlines and Scheduling
  169. * Inserting deadline/schedule:: Planning items
  170. * Repeated tasks:: Items that show up again and again
  171. Remember
  172. * Setting up remember:: Some code for .emacs to get things going
  173. * Remember templates:: Define the outline of different note types
  174. * Storing notes:: Directly get the note to where it belongs
  175. Agenda Views
  176. * Agenda files:: Files being searched for agenda information
  177. * Agenda dispatcher:: Keyboard access to agenda views
  178. * Built-in agenda views:: What is available out of the box?
  179. * Presentation and sorting:: How agenda items are prepared for display
  180. * Agenda commands:: Remote editing of org trees
  181. * Custom agenda views:: Defining special searches and views
  182. The built-in agenda views
  183. * Weekly/Daily agenda:: The calendar page with current tasks
  184. * Global TODO list:: All unfinished action items
  185. * Matching tags and properties:: Structured information with fine-tuned search
  186. * Timeline:: Time-sorted view for single file
  187. * Stuck projects:: Find projects you need to review
  188. Presentation and sorting
  189. * Categories:: Not all tasks are equal
  190. * Time-of-day specifications:: How the agenda knows the time
  191. * Sorting of agenda items:: The order of things
  192. Custom agenda views
  193. * Storing searches:: Type once, use often
  194. * Block agenda:: All the stuff you need in a single buffer
  195. * Setting Options:: Changing the rules
  196. * Exporting Agenda Views:: Writing agendas to files.
  197. * Extracting Agenda Information for other programs::
  198. Embedded LaTeX
  199. * Math symbols:: TeX macros for symbols and Greek letters
  200. * Subscripts and Superscripts:: Simple syntax for raising/lowering text
  201. * LaTeX fragments:: Complex formulas made easy
  202. * Processing LaTeX fragments:: Previewing LaTeX processing
  203. * CDLaTeX mode:: Speed up entering of formulas
  204. Exporting
  205. * ASCII export:: Exporting to plain ASCII
  206. * HTML export:: Exporting to HTML
  207. * LaTeX export:: Exporting to LaTeX
  208. * XOXO export:: Exporting to XOXO
  209. * iCalendar export:: Exporting in iCalendar format
  210. * Text interpretation:: How the exporter looks at the file
  211. HTML export
  212. * HTML Export commands:: How to invoke LaTeX export
  213. * Quoting HTML tags:: Using direct HTML in Org-mode
  214. * Links:: Transformation of links for HTML
  215. * Images:: How to include images
  216. * CSS support:: Changing the appearence of the output
  217. LaTeX export
  218. * LaTeX export commands:: How to invoke LaTeX export
  219. * Quoting LaTeX code:: Incorporating literal LaTeX code
  220. Text interpretation by the exporter
  221. * Comment lines:: Some lines will not be exported
  222. * Initial text:: Text before the first headline
  223. * Footnotes:: Numbers like [1]
  224. * Enhancing text:: Subscripts, symbols and more
  225. * Export options:: How to influence the export settings
  226. Publishing
  227. * Configuration:: Defining projects
  228. * Sample configuration:: Example projects
  229. * Triggering publication:: Publication commands
  230. Configuration
  231. * Project alist:: The central configuration variable
  232. * Sources and destinations:: From here to there
  233. * Selecting files:: What files are part of the project?
  234. * Publishing action:: Setting the function doing the publishing
  235. * Publishing options:: Tweaking HTML export
  236. * Publishing links:: Which links keep working after publishing?
  237. * Project page index:: Publishing a list of project files
  238. Sample configuration
  239. * Simple example:: One-component publishing
  240. * Complex example:: A multi-component publishing example
  241. Miscellaneous
  242. * Completion:: M-TAB knows what you need
  243. * Customization:: Adapting Org-mode to your taste
  244. * In-buffer settings:: Overview of the #+KEYWORDS
  245. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  246. * Clean view:: Getting rid of leading stars in the outline
  247. * TTY keys:: Using Org-mode on a tty
  248. * Interaction:: Other Emacs packages
  249. * Bugs:: Things which do not work perfectly
  250. Interaction with other packages
  251. * Cooperation:: Packages Org-mode cooperates with
  252. * Conflicts:: Packages that lead to conflicts
  253. Extensions, Hooks and Hacking
  254. * Extensions:: Existing 3rd-part extensions
  255. * Adding hyperlink types:: New custom link types
  256. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  257. * Dynamic blocks:: Automatically filled blocks
  258. * Special agenda views:: Customized views
  259. * Using the property API:: Writing programs that use entry properties
  260. Tables in arbitrary syntax
  261. * Radio tables:: Sending and receiving
  262. * A LaTeX example:: Step by step, almost a tutorial
  263. * Translator functions:: Copy and modify
  264. @end detailmenu
  265. @end menu
  266. @node Introduction, Document structure, Top, Top
  267. @chapter Introduction
  268. @cindex introduction
  269. @menu
  270. * Summary:: Brief summary of what Org-mode does
  271. * Installation:: How to install a downloaded version of Org-mode
  272. * Activation:: How to activate Org-mode for certain buffers.
  273. * Feedback:: Bug reports, ideas, patches etc.
  274. @end menu
  275. @node Summary, Installation, Introduction, Introduction
  276. @section Summary
  277. @cindex summary
  278. Org-mode is a mode for keeping notes, maintaining TODO lists, and doing
  279. project planning with a fast and effective plain-text system.
  280. Org-mode develops organizational tasks around NOTES files that contain
  281. lists or information about projects as plain text. Org-mode is
  282. implemented on top of outline-mode, which makes it possible to keep the
  283. content of large files well structured. Visibility cycling and
  284. structure editing help to work with the tree. Tables are easily created
  285. with a built-in table editor. Org-mode supports TODO items, deadlines,
  286. time stamps, and scheduling. It dynamically compiles entries into an
  287. agenda that utilizes and smoothly integrates much of the Emacs calendar
  288. and diary. Plain text URL-like links connect to websites, emails,
  289. Usenet messages, BBDB entries, and any files related to the projects.
  290. For printing and sharing of notes, an Org-mode file can be exported as a
  291. structured ASCII file, as HTML, or (todo and agenda items only) as an
  292. iCalendar file. It can also serve as a publishing tool for a set of
  293. linked webpages.
  294. An important design aspect that distinguishes Org-mode from for example
  295. Planner/Muse is that it encourages to store every piece of information
  296. only once. In Planner, you have project pages, day pages and possibly
  297. other files, duplicating some information such as tasks. In Org-mode,
  298. you only have notes files. In your notes you mark entries as tasks,
  299. label them with tags and timestamps. All necessary lists like a
  300. schedule for the day, the agenda for a meeting, tasks lists selected by
  301. tags etc are created dynamically when you need them.
  302. Org-mode keeps simple things simple. When first fired up, it should
  303. feel like a straightforward, easy to use outliner. Complexity is not
  304. imposed, but a large amount of functionality is available when you need
  305. it. Org-mode is a toolbox and can be used in different ways, for
  306. example as:
  307. @example
  308. @r{@bullet{} outline extension with visibility cycling and structure editing}
  309. @r{@bullet{} ASCII system and table editor for taking structured notes}
  310. @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
  311. @r{@bullet{} TODO list editor}
  312. @r{@bullet{} full agenda and planner with deadlines and work scheduling}
  313. @r{@bullet{} environment to implement David Allen's GTD system}
  314. @r{@bullet{} a basic database application}
  315. @r{@bullet{} simple hypertext system, with HTML export}
  316. @r{@bullet{} publishing tool to create a set of interlinked webpages}
  317. @end example
  318. Org-mode's automatic, context sensitive table editor with spreadsheet
  319. capabilities can be integrated into any major mode by activating the
  320. minor Orgtbl-mode. Using a translation step, it can be used to maintain
  321. tables in arbitrary file types, for example in La@TeX{}. The structure
  322. editing and list creation capabilities can be used outside Org-mode with
  323. the minor Orgstruct-mode.
  324. @cindex FAQ
  325. There is a website for Org-mode which provides links to the newest
  326. version of Org-mode, as well as additional information, frequently asked
  327. questions (FAQ), links to tutorials etc. This page is located at
  328. @uref{http://orgmode.org}.
  329. @page
  330. @node Installation, Activation, Summary, Introduction
  331. @section Installation
  332. @cindex installation
  333. @cindex XEmacs
  334. @b{Important:} @i{If Org-mode is part of the Emacs distribution or an
  335. XEmacs package, please skip this section and go directly to
  336. @ref{Activation}.}
  337. If you have downloaded Org-mode from the Web, you must take the
  338. following steps to install it: Go into the Org-mode distribution
  339. directory and edit the top section of the file @file{Makefile}. You
  340. must set the name of the Emacs binary (likely either @file{emacs} or
  341. @file{xemacs}), and the paths to the directories where local Lisp and
  342. Info files are kept. If you don't have access to the system-wide
  343. directories, create your own two directories for these files, enter them
  344. into the Makefile, and make sure Emacs finds the Lisp files by adding
  345. the following line to @file{.emacs}:
  346. @example
  347. (setq load-path (cons "~/path/to/lispdir" load-path))
  348. @end example
  349. @b{XEmacs users now need to install the file @file{noutline.el} from
  350. the @file{xemacs} subdirectory of the Org-mode distribution. Use the
  351. command:}
  352. @example
  353. @b{make install-noutline}
  354. @end example
  355. @noindent Now byte-compile and install the Lisp files with the shell
  356. commands:
  357. @example
  358. make
  359. make install
  360. @end example
  361. @noindent If you want to install the info documentation, use this command:
  362. @example
  363. make install-info
  364. @end example
  365. @noindent Then add to @file{.emacs}:
  366. @lisp
  367. ;; This line only if org-mode is not part of the X/Emacs distribution.
  368. (require 'org-install)
  369. @end lisp
  370. @node Activation, Feedback, Installation, Introduction
  371. @section Activation
  372. @cindex activation
  373. @cindex autoload
  374. @cindex global keybindings
  375. @cindex keybindings, global
  376. @iftex
  377. @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
  378. PDF documentation as viewed by Acrobat reader to your .emacs file, the
  379. single quote character comes out incorrectly and the code will not work.
  380. You need to fix the single quotes by hand, or copy from Info
  381. documentation.}
  382. @end iftex
  383. Add the following lines to your @file{.emacs} file. The last two lines
  384. define @emph{global} keys for the commands @command{org-store-link} and
  385. @command{org-agenda} - please choose suitable keys yourself.
  386. @lisp
  387. ;; The following lines are always needed. Choose your own keys.
  388. (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  389. (global-set-key "\C-cl" 'org-store-link)
  390. (global-set-key "\C-ca" 'org-agenda)
  391. @end lisp
  392. Furthermore, you must activate @code{font-lock-mode} in org-mode
  393. buffers, because significant functionality depends on font-locking being
  394. active. You can do this with either one of the following two lines
  395. (XEmacs user must use the second option):
  396. @lisp
  397. (global-font-lock-mode 1) ; for all buffers
  398. (add-hook 'org-mode-hook 'turn-on-font-lock) ; org-mode buffers only
  399. @end lisp
  400. @cindex org-mode, turning on
  401. With this setup, all files with extension @samp{.org} will be put
  402. into Org-mode. As an alternative, make the first line of a file look
  403. like this:
  404. @example
  405. MY PROJECTS -*- mode: org; -*-
  406. @end example
  407. @noindent which will select Org-mode for this buffer no matter what
  408. the file's name is. See also the variable
  409. @code{org-insert-mode-line-in-empty-file}.
  410. @node Feedback, , Activation, Introduction
  411. @section Feedback
  412. @cindex feedback
  413. @cindex bug reports
  414. @cindex maintainer
  415. @cindex author
  416. If you find problems with Org-mode, or if you have questions, remarks,
  417. or ideas about it, please contact the maintainer @value{MAINTAINER} at
  418. @value{MAINTAINEREMAIL}.
  419. For bug reports, please provide as much information as possible,
  420. including the version information of Emacs (@kbd{C-h v emacs-version
  421. @key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
  422. the Org-mode related setup in @file{.emacs}. If an error occurs, a
  423. backtrace can be very useful (see below on how to create one). Often a
  424. small example file helps, along with clear information about:
  425. @enumerate
  426. @item What exactly did you do?
  427. @item What did you expect to happen?
  428. @item What happened instead?
  429. @end enumerate
  430. @noindent Thank you for helping to improve this mode.
  431. @subsubheading How to create a useful backtrace
  432. @cindex backtrace of an error
  433. If working with Org-mode produces an error with a message you don't
  434. understand, you may have hit a bug. The best way to report this is by
  435. providing, in addition to what was mentioned above, a @emph{Backtrace}.
  436. This is information from the built-in debugger about where and how the
  437. error occurred. Here is how to produce a useful backtrace:
  438. @enumerate
  439. @item
  440. Start a fresh Emacs or XEmacs, and make sure that it will load the
  441. original Lisp code in @file{org.el} instead of the compiled version in
  442. @file{org.elc}. The backtrace contains much more information if it is
  443. produced with uncompiled code. To do this, either rename @file{org.elc}
  444. to something else before starting Emacs, or ask Emacs explicitly to load
  445. @file{org.el} by using the command line
  446. @example
  447. emacs -l /path/to/org.el
  448. @end example
  449. @item
  450. Go to the @code{Options} menu and select @code{Enter Debugger on Error}
  451. (XEmacs has this option in the @code{Troubleshooting} sub-menu).
  452. @item
  453. Do whatever you have to do to hit the error. Don't forget to
  454. document the steps you take.
  455. @item
  456. When you hit the error, a @file{*Backtrace*} buffer will appear on the
  457. screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
  458. attach it to your bug report.
  459. @end enumerate
  460. @node Document structure, Tables, Introduction, Top
  461. @chapter Document Structure
  462. @cindex document structure
  463. @cindex structure of document
  464. Org-mode is based on outline mode and provides flexible commands to
  465. edit the structure of the document.
  466. @menu
  467. * Outlines:: Org-mode is based on outline-mode
  468. * Headlines:: How to typeset org-tree headlines
  469. * Visibility cycling:: Show and hide, much simplified
  470. * Motion:: Jumping to other headlines
  471. * Structure editing:: Changing sequence and level of headlines
  472. * Archiving:: Move done task trees to a different place
  473. * Sparse trees:: Matches embedded in context
  474. * Plain lists:: Additional structure within an entry
  475. * Drawers:: Tucking stuff away
  476. * orgstruct-mode:: Structure editing outside Org-mode
  477. @end menu
  478. @node Outlines, Headlines, Document structure, Document structure
  479. @section Outlines
  480. @cindex outlines
  481. @cindex outline-mode
  482. Org-mode is implemented on top of outline-mode. Outlines allow a
  483. document to be organized in a hierarchical structure, which (at least
  484. for me) is the best representation of notes and thoughts. An overview
  485. of this structure is achieved by folding (hiding) large parts of the
  486. document to show only the general document structure and the parts
  487. currently being worked on. Org-mode greatly simplifies the use of
  488. outlines by compressing the entire show/hide functionality into a single
  489. command @command{org-cycle}, which is bound to the @key{TAB} key.
  490. @node Headlines, Visibility cycling, Outlines, Document structure
  491. @section Headlines
  492. @cindex headlines
  493. @cindex outline tree
  494. Headlines define the structure of an outline tree. The headlines in
  495. Org-mode start with one or more stars, on the left margin@footnote{See
  496. the variable @code{org-special-ctrl-a/e} to configure special behavior
  497. of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
  498. @example
  499. * Top level headline
  500. ** Second level
  501. *** 3rd level
  502. some text
  503. *** 3rd level
  504. more text
  505. * Another top level headline
  506. @end example
  507. @noindent Some people find the many stars too noisy and would prefer an
  508. outline that has whitespace followed by a single star as headline
  509. starters. @ref{Clean view} describes a setup to realize this.
  510. An empty line after the end of a subtree is considered part of it and
  511. will be hidden when the subtree is folded. However, if you leave at
  512. least two empty lines, one empty line will remain visible after folding
  513. the subtree, in order to structure the collapsed view. See the
  514. variable @code{org-cycle-separator-lines} to modify this behavior.
  515. @node Visibility cycling, Motion, Headlines, Document structure
  516. @section Visibility cycling
  517. @cindex cycling, visibility
  518. @cindex visibility cycling
  519. @cindex trees, visibility
  520. @cindex show hidden text
  521. @cindex hide text
  522. Outlines make it possible to hide parts of the text in the buffer.
  523. Org-mode uses just two commands, bound to @key{TAB} and
  524. @kbd{S-@key{TAB}} to change the visibility in the buffer.
  525. @cindex subtree visibility states
  526. @cindex subtree cycling
  527. @cindex folded, subtree visibility state
  528. @cindex children, subtree visibility state
  529. @cindex subtree, subtree visibility state
  530. @table @kbd
  531. @kindex @key{TAB}
  532. @item @key{TAB}
  533. @emph{Subtree cycling}: Rotate current subtree among the states
  534. @example
  535. ,-> FOLDED -> CHILDREN -> SUBTREE --.
  536. '-----------------------------------'
  537. @end example
  538. The cursor must be on a headline for this to work@footnote{see, however,
  539. the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
  540. beginning of the buffer and the first line is not a headline, then
  541. @key{TAB} actually runs global cycling (see below)@footnote{see the
  542. option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
  543. argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
  544. @cindex global visibility states
  545. @cindex global cycling
  546. @cindex overview, global visibility state
  547. @cindex contents, global visibility state
  548. @cindex show all, global visibility state
  549. @kindex S-@key{TAB}
  550. @item S-@key{TAB}
  551. @itemx C-u @key{TAB}
  552. @emph{Global cycling}: Rotate the entire buffer among the states
  553. @example
  554. ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
  555. '--------------------------------------'
  556. @end example
  557. When @kbd{S-@key{TAB}} is called with a numerical prefix N, the CONTENTS
  558. view up to headlines of level N will be shown.
  559. Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
  560. @cindex show all, command
  561. @kindex C-c C-a
  562. @item C-c C-a
  563. Show all.
  564. @kindex C-c C-r
  565. @item C-c C-r
  566. Reveal context around point, showing the current entry, the following
  567. heading and the hierarchy above. Useful for working near a location
  568. exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda
  569. command (@pxref{Agenda commands}). With prefix arg show, on each
  570. level, all sibling headings.
  571. @kindex C-c C-x b
  572. @item C-c C-x b
  573. Show the current subtree in an indirect buffer@footnote{The indirect
  574. buffer
  575. @ifinfo
  576. (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
  577. @end ifinfo
  578. @ifnotinfo
  579. (see the Emacs manual for more information about indirect buffers)
  580. @end ifnotinfo
  581. will contain the entire buffer, but will be narrowed to the current
  582. tree. Editing the indirect buffer will also change the original buffer,
  583. but without affecting visibility in that buffer.}. With numerical
  584. prefix ARG, go up to this level and then take that tree. If ARG is
  585. negative, go up that many levels. With @kbd{C-u} prefix, do not remove
  586. the previously used indirect buffer.
  587. @end table
  588. When Emacs first visits an Org-mode file, the global state is set to
  589. OVERVIEW, i.e. only the top level headlines are visible. This can be
  590. configured through the variable @code{org-startup-folded}, or on a
  591. per-file basis by adding one of the following lines anywhere in the
  592. buffer:
  593. @example
  594. #+STARTUP: overview
  595. #+STARTUP: content
  596. #+STARTUP: showall
  597. @end example
  598. @node Motion, Structure editing, Visibility cycling, Document structure
  599. @section Motion
  600. @cindex motion, between headlines
  601. @cindex jumping, to headlines
  602. @cindex headline navigation
  603. The following commands jump to other headlines in the buffer.
  604. @table @kbd
  605. @kindex C-c C-n
  606. @item C-c C-n
  607. Next heading.
  608. @kindex C-c C-p
  609. @item C-c C-p
  610. Previous heading.
  611. @kindex C-c C-f
  612. @item C-c C-f
  613. Next heading same level.
  614. @kindex C-c C-b
  615. @item C-c C-b
  616. Previous heading same level.
  617. @kindex C-c C-u
  618. @item C-c C-u
  619. Backward to higher level heading.
  620. @kindex C-c C-j
  621. @item C-c C-j
  622. Jump to a different place without changing the current outline
  623. visibility. Shows the document structure in a temporary buffer, where
  624. you can use the following keys to find your destination:
  625. @example
  626. @key{TAB} @r{Cycle visibility.}
  627. @key{down} / @key{up} @r{Next/previous visible headline.}
  628. n / p @r{Next/previous visible headline.}
  629. f / b @r{Next/previous headline same level.}
  630. u @r{One level up.}
  631. 0-9 @r{Digit argument.}
  632. @key{RET} @r{Select this location.}
  633. @end example
  634. @end table
  635. @node Structure editing, Archiving, Motion, Document structure
  636. @section Structure editing
  637. @cindex structure editing
  638. @cindex headline, promotion and demotion
  639. @cindex promotion, of subtrees
  640. @cindex demotion, of subtrees
  641. @cindex subtree, cut and paste
  642. @cindex pasting, of subtrees
  643. @cindex cutting, of subtrees
  644. @cindex copying, of subtrees
  645. @cindex subtrees, cut and paste
  646. @table @kbd
  647. @kindex M-@key{RET}
  648. @item M-@key{RET}
  649. Insert new heading with same level as current. If the cursor is in a
  650. plain list item, a new item is created (@pxref{Plain lists}). To force
  651. creation of a new headline, use a prefix arg, or first press @key{RET}
  652. to get to the beginning of the next line. When this command is used in
  653. the middle of a line, the line is split and the rest of the line becomes
  654. the new headline. If the command is used at the beginning of a
  655. headline, the new headline is created before the current line. If at
  656. the beginning of any other line, the content of that line is made the
  657. new heading. If the command is used at the end of a folded subtree
  658. (i.e. behind the ellipses at the end of a headline), then a headline
  659. like the current one will be inserted after the end of the subtree.
  660. @kindex C-@key{RET}
  661. @item C-@key{RET}
  662. Insert a new heading after the current subtree, same level as the
  663. current headline. This command works from anywhere in the entry.
  664. @kindex M-S-@key{RET}
  665. @item M-S-@key{RET}
  666. Insert new TODO entry with same level as current heading.
  667. @kindex M-@key{left}
  668. @item M-@key{left}
  669. Promote current heading by one level.
  670. @kindex M-@key{right}
  671. @item M-@key{right}
  672. Demote current heading by one level.
  673. @kindex M-S-@key{left}
  674. @item M-S-@key{left}
  675. Promote the current subtree by one level.
  676. @kindex M-S-@key{right}
  677. @item M-S-@key{right}
  678. Demote the current subtree by one level.
  679. @kindex M-S-@key{up}
  680. @item M-S-@key{up}
  681. Move subtree up (swap with previous subtree of same
  682. level).
  683. @kindex M-S-@key{down}
  684. @item M-S-@key{down}
  685. Move subtree down (swap with next subtree of same level).
  686. @kindex C-c C-x C-w
  687. @kindex C-c C-x C-k
  688. @item C-c C-x C-w
  689. @itemx C-c C-x C-k
  690. Kill subtree, i.e. remove it from buffer but save in kill ring.
  691. @kindex C-c C-x M-w
  692. @item C-c C-x M-w
  693. Copy subtree to kill ring.
  694. @kindex C-c C-x C-y
  695. @item C-c C-x C-y
  696. Yank subtree from kill ring. This does modify the level of the subtree to
  697. make sure the tree fits in nicely at the yank position. The yank
  698. level can also be specified with a prefix arg, or by yanking after a
  699. headline marker like @samp{****}.
  700. @kindex C-c ^
  701. @item C-c ^
  702. Sort same-level entries. When there is an active region, all entries in
  703. the region will be sorted. Otherwise the children of the current
  704. headline are sorted. The command prompts for the sorting method, which
  705. can be alphabetically, numerically, by time (using the first time stamp
  706. in each entry), by priority, and each of these in reverse order. With a
  707. @kbd{C-u} prefix, sorting will be case-sensitive. With two @kbd{C-u
  708. C-u} prefixes, duplicate entries will also be removed.
  709. @end table
  710. @cindex region, active
  711. @cindex active region
  712. @cindex transient-mark-mode
  713. When there is an active region (transient-mark-mode), promotion and
  714. demotion work on all headlines in the region. To select a region of
  715. headlines, it is best to place both point and mark at the beginning of a
  716. line, mark at the beginning of the first headline, and point at the line
  717. just after the last headline to change. Note that when the cursor is
  718. inside a table (@pxref{Tables}), the Meta-Cursor keys have different
  719. functionality.
  720. @node Archiving, Sparse trees, Structure editing, Document structure
  721. @section Archiving
  722. @cindex archiving
  723. When a project represented by a (sub)tree is finished, you may want
  724. to move the tree out of the way and to stop it from contributing to the
  725. agenda. Org-mode knows two ways of archiving. You can mark a tree with
  726. the ARCHIVE tag, or you can move an entire (sub)tree to a different
  727. location.
  728. @menu
  729. * ARCHIVE tag:: Marking a tree as inactive
  730. * Moving subtrees:: Moving a tree to an archive file
  731. @end menu
  732. @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
  733. @subsection The ARCHIVE tag
  734. @cindex internal archiving
  735. A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
  736. its location in the outline tree, but behaves in the following way:
  737. @itemize @minus
  738. @item
  739. It does not open when you attempt to do so with a visibility cycling
  740. command (@pxref{Visibility cycling}). You can force cycling archived
  741. subtrees with @kbd{C-@key{TAB}}, or by setting the option
  742. @code{org-cycle-open-archived-trees}. Also normal outline commands like
  743. @code{show-all} will open archived subtrees.
  744. @item
  745. During sparse tree construction (@pxref{Sparse trees}), matches in
  746. archived subtrees are not exposed, unless you configure the option
  747. @code{org-sparse-tree-open-archived-trees}.
  748. @item
  749. During agenda view construction (@pxref{Agenda views}), the content of
  750. archived trees is ignored unless you configure the option
  751. @code{org-agenda-skip-archived-trees}.
  752. @item
  753. Archived trees are not exported (@pxref{Exporting}), only the headline
  754. is. Configure the details using the variable
  755. @code{org-export-with-archived-trees}.
  756. @end itemize
  757. The following commands help managing the ARCHIVE tag:
  758. @table @kbd
  759. @kindex C-c C-x C-a
  760. @item C-c C-x C-a
  761. Toggle the ARCHIVE tag for the current headline. When the tag is set,
  762. the headline changes to a shadowish face, and the subtree below it is
  763. hidden.
  764. @kindex C-u C-c C-x C-a
  765. @item C-u C-c C-x C-a
  766. Check if any direct children of the current headline should be archived.
  767. To do this, each subtree is checked for open TODO entries. If none are
  768. found, the command offers to set the ARCHIVE tag for the child. If the
  769. cursor is @emph{not} on a headline when this command is invoked, the
  770. level 1 trees will be checked.
  771. @kindex C-@kbd{TAB}
  772. @item C-@kbd{TAB}
  773. Cycle a tree even if it is tagged with ARCHIVE.
  774. @end table
  775. @node Moving subtrees, , ARCHIVE tag, Archiving
  776. @subsection Moving subtrees
  777. @cindex external archiving
  778. Once an entire project is finished, you may want to move it to a
  779. different location, either in the current file, or even in a different
  780. file, the archive file.
  781. @table @kbd
  782. @kindex C-c C-x C-s
  783. @item C-c C-x C-s
  784. Archive the subtree starting at the cursor position to the location
  785. given by @code{org-archive-location}. Context information that could be
  786. lost like the file name, the category, inherited tags, and the todo
  787. state will be store as properties in the entry.
  788. @kindex C-u C-c C-x C-s
  789. @item C-u C-c C-x C-s
  790. Check if any direct children of the current headline could be moved to
  791. the archive. To do this, each subtree is checked for open TODO entries.
  792. If none are found, the command offers to move it to the archive
  793. location. If the cursor is @emph{not} on a headline when this command
  794. is invoked, the level 1 trees will be checked.
  795. @end table
  796. @cindex archive locations
  797. The default archive location is a file in the same directory as the
  798. current file, with the name derived by appending @file{_archive} to the
  799. current file name. For information and examples on how to change this,
  800. see the documentation string of the variable
  801. @code{org-archive-location}. There is also an in-buffer option for
  802. setting this variable, for example@footnote{If there are several such
  803. lines in the buffer, each will be valid for the entries below it. The
  804. first will also apply to any text before it. This method is only kept
  805. for backward compatibility. The preferred methods for setting multiple
  806. archive locations is using a property.}:
  807. @example
  808. #+ARCHIVE: %s_done::
  809. @end example
  810. @noindent
  811. If you would like to have a special ARCHIVE location for a single entry
  812. or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
  813. location as the value (@pxref{Properties and columns}).
  814. @node Sparse trees, Plain lists, Archiving, Document structure
  815. @section Sparse trees
  816. @cindex sparse trees
  817. @cindex trees, sparse
  818. @cindex folding, sparse trees
  819. @cindex occur, command
  820. An important feature of Org-mode is the ability to construct
  821. @emph{sparse trees} for selected information in an outline tree. A
  822. sparse tree means that the entire document is folded as much as
  823. possible, but the selected information is made visible along with the
  824. headline structure above it@footnote{See also the variables
  825. @code{org-show-hierarchy-above}, @code{org-show-following-heading}, and
  826. @code{org-show-siblings} for detailed control on how much context is
  827. shown around each match.}. Just try it out and you will see immediately
  828. how it works.
  829. Org-mode contains several commands creating such trees. The most
  830. basic one is @command{org-occur}:
  831. @table @kbd
  832. @kindex C-c /
  833. @item C-c /
  834. Occur. Prompts for a regexp and shows a sparse tree with all matches.
  835. If the match is in a headline, the headline is made visible. If the
  836. match is in the body of an entry, headline and body are made visible.
  837. In order to provide minimal context, also the full hierarchy of
  838. headlines above the match is shown, as well as the headline following
  839. the match. Each match is also highlighted; the highlights disappear
  840. when the buffer is changed by an editing command, or by pressing
  841. @kbd{C-c C-c}. When called with a @kbd{C-u} prefix argument, previous
  842. highlights are kept, so several calls to this command can be stacked.
  843. @end table
  844. @noindent
  845. For frequently used sparse trees of specific search strings, you can
  846. use the variable @code{org-agenda-custom-commands} to define fast
  847. keyboard access to specific sparse trees. These commands will then be
  848. accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
  849. For example:
  850. @lisp
  851. (setq org-agenda-custom-commands
  852. '(("f" occur-tree "FIXME")))
  853. @end lisp
  854. @noindent will define the key @kbd{C-c a f} as a shortcut for creating
  855. a sparse tree matching the string @samp{FIXME}.
  856. Other commands use sparse trees as well. For example @kbd{C-c
  857. C-v} creates a sparse TODO tree (@pxref{TODO basics}).
  858. @kindex C-c C-e v
  859. @cindex printing sparse trees
  860. @cindex visible text, printing
  861. To print a sparse tree, you can use the Emacs command
  862. @code{ps-print-buffer-with-faces} which does not print invisible parts
  863. of the document @footnote{This does not work under XEmacs, because
  864. XEmacs uses selective display for outlining, not text properties.}.
  865. Or you can use the command @kbd{C-c C-e v} to export only the visible
  866. part of the document and print the resulting file.
  867. @node Plain lists, Drawers, Sparse trees, Document structure
  868. @section Plain lists
  869. @cindex plain lists
  870. @cindex lists, plain
  871. @cindex lists, ordered
  872. @cindex ordered lists
  873. Within an entry of the outline tree, hand-formatted lists can provide
  874. additional structure. They also provide a way to create lists of
  875. checkboxes (@pxref{Checkboxes}). Org-mode supports editing such lists,
  876. and the HTML exporter (@pxref{Exporting}) does parse and format them.
  877. Org-mode knows ordered and unordered lists. Unordered list items start
  878. with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
  879. bullet, lines must be indented or they will be seen as top-level
  880. headlines. Also, when you are hiding leading stars to get a clean
  881. outline view, plain list items starting with a star are visually
  882. indistinguishable from true headlines. In short: even though @samp{*}
  883. is supported, it may be better not to use it for plain list items.} as
  884. bullets. Ordered list items start with @samp{1.} or @samp{1)}. Items
  885. belonging to the same list must have the same indentation on the first
  886. line. In particular, if an ordered list reaches number @samp{10.}, then
  887. the 2--digit numbers must be written left-aligned with the other numbers
  888. in the list. Indentation also determines the end of a list item. It
  889. ends before the next line that is indented like the bullet/number, or
  890. less. Empty lines are part of the previous item, so you can have
  891. several paragraphs in one item. If you would like an empty line to
  892. terminate all currently open plain lists, configure the variable
  893. @code{org-empty-line-terminates-plain-lists}. Here is an example:
  894. @example
  895. @group
  896. ** Lord of the Rings
  897. My favorite scenes are (in this order)
  898. 1. The attack of the Rohirrim
  899. 2. Eowyns fight with the witch king
  900. + this was already my favorite scene in the book
  901. + I really like Miranda Otto.
  902. 3. Peter Jackson being shot by Legolas
  903. - on DVD only
  904. He makes a really funny face when it happens.
  905. But in the end, not individual scenes matter but the film as a whole.
  906. @end group
  907. @end example
  908. Org-mode supports these lists by tuning filling and wrapping commands to
  909. deal with them correctly@footnote{Org-mode only changes the filling
  910. settings for Emacs. For XEmacs, you should use Kyle E. Jones'
  911. @file{filladapt.el}. To turn this on, put into @file{.emacs}:
  912. @code{(require 'filladapt)}}.
  913. The following commands act on items when the cursor is in the first line
  914. of an item (the line with the bullet or number).
  915. @table @kbd
  916. @kindex @key{TAB}
  917. @item @key{TAB}
  918. Items can be folded just like headline levels if you set the variable
  919. @code{org-cycle-include-plain-lists}. The level of an item is then
  920. given by the indentation of the bullet/number. Items are always
  921. subordinate to real headlines, however; the hierarchies remain
  922. completely separated.
  923. If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
  924. fixes the indentation of the curent line in a heuristic way.
  925. @kindex M-@key{RET}
  926. @item M-@key{RET}
  927. Insert new item at current level. With prefix arg, force a new heading
  928. (@pxref{Structure editing}). If this command is used in the middle of a
  929. line, the line is @emph{split} and the rest of the line becomes the new
  930. item. If this command is executed in the @emph{whitespace before a bullet or
  931. number}, the new item is created @emph{before} the current item. If the
  932. command is executed in the white space before the text that is part of
  933. an item but does not contain the bullet, a bullet is added to the
  934. current line.
  935. @kindex M-S-@key{RET}
  936. @item M-S-@key{RET}
  937. Insert a new item with a checkbox (@pxref{Checkboxes}).
  938. @kindex S-@key{up}
  939. @kindex S-@key{down}
  940. @item S-@key{up}
  941. @itemx S-@key{down}
  942. Jump to the previous/next item in the current list.
  943. @kindex M-S-@key{up}
  944. @kindex M-S-@key{down}
  945. @item M-S-@key{up}
  946. @itemx M-S-@key{down}
  947. Move the item including subitems up/down (swap with previous/next item
  948. of same indentation). If the list is ordered, renumbering is
  949. automatic.
  950. @kindex M-S-@key{left}
  951. @kindex M-S-@key{right}
  952. @item M-S-@key{left}
  953. @itemx M-S-@key{right}
  954. Decrease/increase the indentation of the item, including subitems.
  955. Initially, the item tree is selected based on current indentation.
  956. When these commands are executed several times in direct succession,
  957. the initially selected region is used, even if the new indentation
  958. would imply a different hierarchy. To use the new hierarchy, break
  959. the command chain with a cursor motion or so.
  960. @kindex C-c C-c
  961. @item C-c C-c
  962. If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
  963. state of the checkbox. If not, make this command makes sure that all
  964. the items on this list level use the same bullet. Furthermore, if this
  965. is an ordered list, make sure the numbering is ok.
  966. @kindex C-c -
  967. @item C-c -
  968. Cycle the entire list level through the different itemize/enumerate
  969. bullets (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).
  970. With prefix arg, select the nth bullet from this list.
  971. @end table
  972. @node Drawers, orgstruct-mode, Plain lists, Document structure
  973. @section Drawers
  974. @cindex drawers
  975. @cindex visibility cycling, drawers
  976. Sometimes you want to keep information associated with an entry, but you
  977. normally don't want to see it. For this, Org-mode has @emph{drawers}.
  978. Drawers need to be configured with the variable @code{org-drawers}, and
  979. look like this:
  980. @example
  981. ** This is a headline
  982. Still outside the drawer
  983. :DRAWERNAME:
  984. This is inside the drawer.
  985. :END:
  986. After the drawer.
  987. @end example
  988. Visibility cycling (@pxref{Visibility cycling}) on the headline will
  989. hide and show the entry, but keep the drawer collapsed to a single line.
  990. In order to look inside the drawer, you need to move the cursor to the
  991. drawer line and press @key{TAB} there. Org-mode uses a drawer for
  992. storing properties (@pxref{Properties and columns}).
  993. @node orgstruct-mode, , Drawers, Document structure
  994. @section The Orgstruct minor mode
  995. @cindex orgstruct-mode
  996. @cindex minor mode for structure editing
  997. If you like the intuitive way the Org-mode structure editing and list
  998. formatting works, you might want to use these commands in other modes
  999. like text-mode or mail-mode as well. The minor mode Orgstruct-mode
  1000. makes this possible. You can always toggle the mode with @kbd{M-x
  1001. orgstruct-mode}. To turn it on by default, for example in mail mode,
  1002. use
  1003. @lisp
  1004. (add-hook 'mail-mode-hook 'turn-on-orgstruct)
  1005. @end lisp
  1006. When this mode is active and the cursor is on a line that looks to
  1007. Org-mode like a headline of the first line of a list item, most
  1008. structure editing commands will work, even if the same keys normally
  1009. have different functionality in the major mode you are using. If the
  1010. cursor is not in one of those special lines, Orgstruct-mode lurks
  1011. silently in the shadow.
  1012. @node Tables, Hyperlinks, Document structure, Top
  1013. @chapter Tables
  1014. @cindex tables
  1015. @cindex editing tables
  1016. Org-mode has a very fast and intuitive table editor built-in.
  1017. Spreadsheet-like calculations are supported in connection with the
  1018. Emacs @file{calc} package.
  1019. @menu
  1020. * Built-in table editor:: Simple tables
  1021. * Narrow columns:: Stop wasting space in tables
  1022. * Column groups:: Grouping to trigger vertical lines
  1023. * orgtbl-mode:: The table editor as minor mode
  1024. * The spreadsheet:: The table editor has spreadsheet capabilities.
  1025. @end menu
  1026. @node Built-in table editor, Narrow columns, Tables, Tables
  1027. @section The built-in table editor
  1028. @cindex table editor, built-in
  1029. Org-mode makes it easy to format tables in plain ASCII. Any line with
  1030. @samp{|} as the first non-whitespace character is considered part of a
  1031. table. @samp{|} is also the column separator. A table might look like
  1032. this:
  1033. @example
  1034. | Name | Phone | Age |
  1035. |-------+-------+-----|
  1036. | Peter | 1234 | 17 |
  1037. | Anna | 4321 | 25 |
  1038. @end example
  1039. A table is re-aligned automatically each time you press @key{TAB} or
  1040. @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
  1041. the next field (@key{RET} to the next row) and creates new table rows
  1042. at the end of the table or before horizontal lines. The indentation
  1043. of the table is set by the first line. Any line starting with
  1044. @samp{|-} is considered as a horizontal separator line and will be
  1045. expanded on the next re-align to span the whole table width. So, to
  1046. create the above table, you would only type
  1047. @example
  1048. |Name|Phone|Age|
  1049. |-
  1050. @end example
  1051. @noindent and then press @key{TAB} to align the table and start filling in
  1052. fields.
  1053. When typing text into a field, Org-mode treats @key{DEL},
  1054. @key{Backspace}, and all character keys in a special way, so that
  1055. inserting and deleting avoids shifting other fields. Also, when
  1056. typing @emph{immediately after the cursor was moved into a new field
  1057. with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
  1058. field is automatically made blank. If this behavior is too
  1059. unpredictable for you, configure the variables
  1060. @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
  1061. @table @kbd
  1062. @tsubheading{Creation and conversion}
  1063. @kindex C-c |
  1064. @item C-c |
  1065. Convert the active region to table. If every line contains at least one
  1066. TAB character, the function assumes that the material is tab separated.
  1067. If every line contains a comma, comma-separated values (CSV) are assumed.
  1068. If not, lines are split at whitespace into fields. You can use a prefix
  1069. argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
  1070. C-u} forces TAB, and a numeric argument N indicates that at least N
  1071. consequtive spaces, or alternatively a TAB will be the separator.
  1072. @*
  1073. If there is no active region, this command creates an empty Org-mode
  1074. table. But it's easier just to start typing, like
  1075. @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
  1076. @tsubheading{Re-aligning and field motion}
  1077. @kindex C-c C-c
  1078. @item C-c C-c
  1079. Re-align the table without moving the cursor.
  1080. @c
  1081. @kindex @key{TAB}
  1082. @item @key{TAB}
  1083. Re-align the table, move to the next field. Creates a new row if
  1084. necessary.
  1085. @c
  1086. @kindex S-@key{TAB}
  1087. @item S-@key{TAB}
  1088. Re-align, move to previous field.
  1089. @c
  1090. @kindex @key{RET}
  1091. @item @key{RET}
  1092. Re-align the table and move down to next row. Creates a new row if
  1093. necessary. At the beginning or end of a line, @key{RET} still does
  1094. NEWLINE, so it can be used to split a table.
  1095. @tsubheading{Column and row editing}
  1096. @kindex M-@key{left}
  1097. @kindex M-@key{right}
  1098. @item M-@key{left}
  1099. @itemx M-@key{right}
  1100. Move the current column left/right.
  1101. @c
  1102. @kindex M-S-@key{left}
  1103. @item M-S-@key{left}
  1104. Kill the current column.
  1105. @c
  1106. @kindex M-S-@key{right}
  1107. @item M-S-@key{right}
  1108. Insert a new column to the left of the cursor position.
  1109. @c
  1110. @kindex M-@key{up}
  1111. @kindex M-@key{down}
  1112. @item M-@key{up}
  1113. @itemx M-@key{down}
  1114. Move the current row up/down.
  1115. @c
  1116. @kindex M-S-@key{up}
  1117. @item M-S-@key{up}
  1118. Kill the current row or horizontal line.
  1119. @c
  1120. @kindex M-S-@key{down}
  1121. @item M-S-@key{down}
  1122. Insert a new row above (with arg: below) the current row.
  1123. @c
  1124. @kindex C-c -
  1125. @item C-c -
  1126. Insert a horizontal line below current row. With prefix arg, the line
  1127. is created above the current line.
  1128. @c
  1129. @kindex C-c ^
  1130. @item C-c ^
  1131. Sort the table lines in the region. The position of point indicates the
  1132. column to be used for sorting, and the range of lines is the range
  1133. between the nearest horizontal separator lines, or the entire table. If
  1134. point is before the first column, you will be prompted for the sorting
  1135. column. If there is an active region, the mark specifies the first line
  1136. and the sorting column, while point should be in the last line to be
  1137. included into the sorting. The command prompts for the sorting type
  1138. (alphabetically, numerically, or by time). When called with a prefix
  1139. argument, alphabetic sorting will be case-sensitive.
  1140. @tsubheading{Regions}
  1141. @kindex C-c C-x M-w
  1142. @item C-c C-x M-w
  1143. Copy a rectangular region from a table to a special clipboard. Point
  1144. and mark determine edge fields of the rectangle. The process ignores
  1145. horizontal separator lines.
  1146. @c
  1147. @kindex C-c C-x C-w
  1148. @item C-c C-x C-w
  1149. Copy a rectangular region from a table to a special clipboard, and
  1150. blank all fields in the rectangle. So this is the ``cut'' operation.
  1151. @c
  1152. @kindex C-c C-x C-y
  1153. @item C-c C-x C-y
  1154. Paste a rectangular region into a table.
  1155. The upper right corner ends up in the current field. All involved fields
  1156. will be overwritten. If the rectangle does not fit into the present table,
  1157. the table is enlarged as needed. The process ignores horizontal separator
  1158. lines.
  1159. @c
  1160. @kindex C-c C-q
  1161. @item C-c C-q
  1162. Wrap several fields in a column like a paragraph. If there is an active
  1163. region, and both point and mark are in the same column, the text in the
  1164. column is wrapped to minimum width for the given number of lines. A
  1165. prefix ARG may be used to change the number of desired lines. If there
  1166. is no region, the current field is split at the cursor position and the
  1167. text fragment to the right of the cursor is prepended to the field one
  1168. line down. If there is no region, but you specify a prefix ARG, the
  1169. current field is made blank, and the content is appended to the field
  1170. above.
  1171. @tsubheading{Calculations}
  1172. @cindex formula, in tables
  1173. @cindex calculations, in tables
  1174. @cindex region, active
  1175. @cindex active region
  1176. @cindex transient-mark-mode
  1177. @kindex C-c +
  1178. @item C-c +
  1179. Sum the numbers in the current column, or in the rectangle defined by
  1180. the active region. The result is shown in the echo area and can
  1181. be inserted with @kbd{C-y}.
  1182. @c
  1183. @kindex S-@key{RET}
  1184. @item S-@key{RET}
  1185. When current field is empty, copy from first non-empty field above.
  1186. When not empty, copy current field down to next row and move cursor
  1187. along with it. Depending on the variable
  1188. @code{org-table-copy-increment}, integer field values will be
  1189. incremented during copy. This key is also used by CUA-mode
  1190. (@pxref{Cooperation}).
  1191. @tsubheading{Miscellaneous}
  1192. @kindex C-c `
  1193. @item C-c `
  1194. Edit the current field in a separate window. This is useful for fields
  1195. that are not fully visible (@pxref{Narrow columns}). When called with a
  1196. @kbd{C-u} prefix, just make the full field visible, so that it can be
  1197. edited in place.
  1198. @c
  1199. @kindex C-c @key{TAB}
  1200. @item C-c @key{TAB}
  1201. This is an alias for @kbd{C-u C-c `} to make the current field fully
  1202. visible.
  1203. @c
  1204. @item M-x org-table-import
  1205. Import a file as a table. The table should be TAB- or whitespace
  1206. separated. Useful, for example, to import an Excel table or data from a
  1207. database, because these programs generally can write TAB-separated text
  1208. files. This command works by inserting the file into the buffer and
  1209. then converting the region to a table. Any prefix argument is passed on
  1210. to the converter, which uses it to determine the separator.
  1211. @item C-c |
  1212. Tables can also be imported by pasting tabular text into the org-mode
  1213. buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
  1214. @kbd{C-c |} command (see above under @i{Creation and conversion}.
  1215. @c
  1216. @item M-x org-table-export
  1217. Export the table as a TAB-separated file. Useful for data exchange with,
  1218. for example, Excel or database programs.
  1219. @end table
  1220. If you don't like the automatic table editor because it gets in your
  1221. way on lines which you would like to start with @samp{|}, you can turn
  1222. it off with
  1223. @lisp
  1224. (setq org-enable-table-editor nil)
  1225. @end lisp
  1226. @noindent Then the only table command that still works is
  1227. @kbd{C-c C-c} to do a manual re-align.
  1228. @node Narrow columns, Column groups, Built-in table editor, Tables
  1229. @section Narrow columns
  1230. @cindex narrow columns in tables
  1231. The width of columns is automatically determined by the table editor.
  1232. Sometimes a single field or a few fields need to carry more text,
  1233. leading to inconveniently wide columns. To limit@footnote{This feature
  1234. does not work on XEmacs.} the width of a column, one field anywhere in
  1235. the column may contain just the string @samp{<N>} where @samp{N} is an
  1236. integer specifying the width of the column in characters. The next
  1237. re-align will then set the width of this column to no more than this
  1238. value.
  1239. @example
  1240. @group
  1241. |---+------------------------------| |---+--------|
  1242. | | | | | <6> |
  1243. | 1 | one | | 1 | one |
  1244. | 2 | two | ----\ | 2 | two |
  1245. | 3 | This is a long chunk of text | ----/ | 3 | This=> |
  1246. | 4 | four | | 4 | four |
  1247. |---+------------------------------| |---+--------|
  1248. @end group
  1249. @end example
  1250. @noindent
  1251. Fields that are wider become clipped and end in the string @samp{=>}.
  1252. Note that the full text is still in the buffer, it is only invisible.
  1253. To see the full text, hold the mouse over the field - a tool-tip window
  1254. will show the full content. To edit such a field, use the command
  1255. @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
  1256. open a new window with the full field. Edit it and finish with @kbd{C-c
  1257. C-c}.
  1258. When visiting a file containing a table with narrowed columns, the
  1259. necessary character hiding has not yet happened, and the table needs to
  1260. be aligned before it looks nice. Setting the option
  1261. @code{org-startup-align-all-tables} will realign all tables in a file
  1262. upon visiting, but also slow down startup. You can also set this option
  1263. on a per-file basis with:
  1264. @example
  1265. #+STARTUP: align
  1266. #+STARTUP: noalign
  1267. @end example
  1268. @node Column groups, orgtbl-mode, Narrow columns, Tables
  1269. @section Column groups
  1270. @cindex grouping columns in tables
  1271. When Org-mode exports tables, it does so by default without vertical
  1272. lines because that is visually more satisfying in general. Occasionally
  1273. however, vertical lines can be useful to structure a table into groups
  1274. of columns, much like horizontal lines can do for groups of rows. In
  1275. order to specify column groups, you can use a special row where the
  1276. first field contains only @samp{/}. The further fields can either
  1277. contain @samp{<} to indicate that this column should start a group,
  1278. @samp{>} to indicate the end of a column, or @samp{<>} to make a column
  1279. a group of its own. Boundaries between colum groups will upon export be
  1280. marked with vertical lines. Here is an example:
  1281. @example
  1282. | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1283. |---+----+-----+-----+-----+---------+------------|
  1284. | / | <> | < | | > | < | > |
  1285. | # | 1 | 1 | 1 | 1 | 1 | 1 |
  1286. | # | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
  1287. | # | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
  1288. |---+----+-----+-----+-----+---------+------------|
  1289. #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2))
  1290. @end example
  1291. It is also sufficient to just insert the colum group starters after
  1292. every vertical line you'd like to have:
  1293. @example
  1294. | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1295. |----+-----+-----+-----+---------+------------|
  1296. | / | < | | | < | |
  1297. @end example
  1298. @node orgtbl-mode, The spreadsheet, Column groups, Tables
  1299. @section The Orgtbl minor mode
  1300. @cindex orgtbl-mode
  1301. @cindex minor mode for tables
  1302. If you like the intuitive way the Org-mode table editor works, you
  1303. might also want to use it in other modes like text-mode or mail-mode.
  1304. The minor mode Orgtbl-mode makes this possible. You can always toggle
  1305. the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
  1306. example in mail mode, use
  1307. @lisp
  1308. (add-hook 'mail-mode-hook 'turn-on-orgtbl)
  1309. @end lisp
  1310. Furthermore, with some special setup, it is possible to maintain tables
  1311. in arbitrary syntax with Orgtbl-mode. For example, it is possible to
  1312. construct La@TeX{} tables with the underlying ease and power of
  1313. Orgtbl-mode, including spreadsheet capabilities. For details, see
  1314. @ref{Tables in arbitrary syntax}.
  1315. @node The spreadsheet, , orgtbl-mode, Tables
  1316. @section The spreadsheet
  1317. @cindex calculations, in tables
  1318. @cindex spreadsheet capabilities
  1319. @cindex @file{calc} package
  1320. The table editor makes use of the Emacs @file{calc} package to implement
  1321. spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
  1322. derive fields from other fields. While fully featured, Org-mode's
  1323. implementation is not identical to other spreadsheets. For example,
  1324. Org-mode knows the concept of a @emph{column formula} that will be
  1325. applied to all non-header fields in a column without having to copy the
  1326. formula to each relevant field.
  1327. @menu
  1328. * References:: How to refer to another field or range
  1329. * Formula syntax for Calc:: Using Calc to compute stuff
  1330. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  1331. * Field formulas:: Formulas valid for a single field
  1332. * Column formulas:: Formulas valid for an entire column
  1333. * Editing and debugging formulas:: Fixing formulas
  1334. * Updating the table:: Recomputing all dependent fields
  1335. * Advanced features:: Field names, parameters and automatic recalc
  1336. @end menu
  1337. @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
  1338. @subsection References
  1339. @cindex references
  1340. To compute fields in the table from other fields, formulas must
  1341. reference other fields or ranges. In Org-mode, fields can be referenced
  1342. by name, by absolute coordinates, and by relative coordinates. To find
  1343. out what the coordinates of a field are, press @kbd{C-c ?} in that
  1344. field, or press @kbd{C-c @}} to toggle the display of a grid.
  1345. @subsubheading Field references
  1346. @cindex field references
  1347. @cindex references, to fields
  1348. Formulas can reference the value of another field in two ways. Like in
  1349. any other spreadsheet, you may reference fields with a letter/number
  1350. combination like @code{B3}, meaning the 2nd field in the 3rd row.
  1351. @c Such references are always fixed to that field, they don't change
  1352. @c when you copy and paste a formula to a different field. So
  1353. @c Org-mode's @code{B3} behaves like @code{$B$3} in other spreadsheets.
  1354. @noindent
  1355. Org-mode also uses another, more general operator that looks like this:
  1356. @example
  1357. @@row$column
  1358. @end example
  1359. @noindent
  1360. Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
  1361. or relative to the current column like @samp{+1} or @samp{-2}.
  1362. The row specification only counts data lines and ignores horizontal
  1363. separator lines (hlines). You can use absolute row numbers
  1364. @samp{1}...@samp{N}, and row numbers relative to the current row like
  1365. @samp{+3} or @samp{-1}. Or specify the row relative to one of the
  1366. hlines: @samp{I} refers to the first hline, @samp{II} to the second etc.
  1367. @samp{-I} refers to the first such line above the current line,
  1368. @samp{+I} to the first such line below the current line. You can also
  1369. write @samp{III+2} which is the second data line after the third hline
  1370. in the table. Relative row numbers like @samp{-3} will not cross hlines
  1371. if the current line is too close to the hline. Instead, the value
  1372. directly at the hline is used.
  1373. @samp{0} refers to the current row and column. Also, if you omit
  1374. either the column or the row part of the reference, the current
  1375. row/column is implied.
  1376. Org-mode's references with @emph{unsigned} numbers are fixed references
  1377. in the sense that if you use the same reference in the formula for two
  1378. different fields, the same field will be referenced each time.
  1379. Org-mode's references with @emph{signed} numbers are floating
  1380. references because the same reference operator can reference different
  1381. fields depending on the field being calculated by the formula.
  1382. Here are a few examples:
  1383. @example
  1384. @@2$3 @r{2nd row, 3rd column}
  1385. C2 @r{same as previous}
  1386. $5 @r{column 5 in the current row}
  1387. E& @r{same as previous}
  1388. @@2 @r{current column, row 2}
  1389. @@-1$-3 @r{the field one row up, three columns to the left}
  1390. @@-I$2 @r{field just under hline above current row, column 2}
  1391. @end example
  1392. @subsubheading Range references
  1393. @cindex range references
  1394. @cindex references, to ranges
  1395. You may reference a rectangular range of fields by specifying two field
  1396. references connected by two dots @samp{..}. If both fields are in the
  1397. current row, you may simply use @samp{$2..$7}, but if at least one field
  1398. is in a different row, you need to use the general @code{@@row$column}
  1399. format at least for the first field (i.e the reference must start with
  1400. @samp{@@} in order to be interpreted correctly). Examples:
  1401. @example
  1402. $1..$3 @r{First three fields in the current row.}
  1403. $P..$Q @r{Range, using column names (see under Advanced)}
  1404. @@2$1..@@4$3 @r{6 fields between these two fields.}
  1405. A2..C4 @r{Same as above.}
  1406. @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
  1407. @end example
  1408. @noindent Range references return a vector of values that can be fed
  1409. into Calc vector functions. Empty fields in ranges are normally
  1410. suppressed, so that the vector contains only the non-empty fields (but
  1411. see the @samp{E} mode switch below). If there are no non-empty fields,
  1412. @samp{[0]} is returned to avoid syntax errors in formulas.
  1413. @subsubheading Named references
  1414. @cindex named references
  1415. @cindex references, named
  1416. @cindex name, of column or field
  1417. @cindex constants, in calculations
  1418. @samp{$name} is interpreted as the name of a column, parameter or
  1419. constant. Constants are defined globally through the variable
  1420. @code{org-table-formula-constants}, and locally (for the file) through a
  1421. line like
  1422. @example
  1423. #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
  1424. @end example
  1425. @noindent
  1426. Also properties (@pxref{Properties and columns}) can be used as
  1427. constants in table formulas: For a property @samp{:XYZ:} use the name
  1428. @samp{$PROP_XYZ}, and the property will be searched in the current
  1429. outline entry and in the hierarchy above it. If you have the
  1430. @file{constants.el} package, it will also be used to resolve constants,
  1431. including natural constants like @samp{$h} for Planck's constant, and
  1432. units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
  1433. supply the values of constants in two different unit systems, @code{SI}
  1434. and @code{cgs}. Which one is used depends on the value of the variable
  1435. @code{constants-unit-system}. You can use the @code{#+STARTUP} options
  1436. @code{constSI} and @code{constcgs} to set this value for the current
  1437. buffer.}. Column names and parameters can be specified in special table
  1438. lines. These are described below, see @ref{Advanced features}. All
  1439. names must start with a letter, and further consist of letters and
  1440. numbers.
  1441. @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
  1442. @subsection Formula syntax for Calc
  1443. @cindex formula syntax, Calc
  1444. @cindex syntax, of formulas
  1445. A formula can be any algebraic expression understood by the Emacs
  1446. @file{Calc} package. @b{Note that @file{calc} has the
  1447. non-standard convention that @samp{/} has lower precedence than
  1448. @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
  1449. evaluation by @code{calc-eval} (@pxref{Calling Calc from
  1450. Your Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU
  1451. Emacs Calc Manual}),
  1452. @c FIXME: The link to the calc manual in HTML does not work.
  1453. variable substitution takes place according to the rules described above.
  1454. @cindex vectors, in table calculations
  1455. The range vectors can be directly fed into the calc vector functions
  1456. like @samp{vmean} and @samp{vsum}.
  1457. @cindex format specifier
  1458. @cindex mode, for @file{calc}
  1459. A formula can contain an optional mode string after a semicolon. This
  1460. string consists of flags to influence Calc and other modes during
  1461. execution. By default, Org-mode uses the standard calc modes (precision
  1462. 12, angular units degrees, fraction and symbolic modes off. The display
  1463. format, however, has been changed to @code{(float 5)} to keep tables
  1464. compact. The default settings can be configured using the variable
  1465. @code{org-calc-default-modes}.
  1466. @example
  1467. p20 @r{switch the internal precision to 20 digits}
  1468. n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
  1469. D R @r{angle modes: degrees, radians}
  1470. F S @r{fraction and symbolic modes}
  1471. N @r{interpret all fields as numbers, use 0 for non-numbers}
  1472. T @r{force text interpretation}
  1473. E @r{keep empty fields in ranges}
  1474. @end example
  1475. @noindent
  1476. In addition, you may provide a @code{printf} format specifier to
  1477. reformat the final result. A few examples:
  1478. @example
  1479. $1+$2 @r{Sum of first and second field}
  1480. $1+$2;%.2f @r{Same, format result to two decimals}
  1481. exp($2)+exp($1) @r{Math functions can be used}
  1482. $0;%.1f @r{Reformat current cell to 1 decimal}
  1483. ($3-32)*5/9 @r{Degrees F -> C conversion}
  1484. $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
  1485. tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
  1486. sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
  1487. vmean($2..$7) @r{Compute column range mean, using vector function}
  1488. vmean($2..$7);EN @r{Same, but treat empty fields as 0}
  1489. taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
  1490. @end example
  1491. Calc also contains a complete set of logical operations. For example
  1492. @example
  1493. if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
  1494. @end example
  1495. @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
  1496. @subsection Emacs Lisp forms as formulas
  1497. @cindex Lisp forms, as table formulas
  1498. It is also possible to write a formula in Emacs Lisp; this can be useful
  1499. for string manipulation and control structures, if the Calc's
  1500. functionality is not enough. If a formula starts with a single quote
  1501. followed by an opening parenthesis, then it is evaluated as a lisp form.
  1502. The evaluation should return either a string or a number. Just as with
  1503. @file{calc} formulas, you can specify modes and a printf format after a
  1504. semicolon. With Emacs Lisp forms, you need to be concious about the way
  1505. field references are interpolated into the form. By default, a
  1506. reference will be interpolated as a Lisp string (in double quotes)
  1507. containing the field. If you provide the @samp{N} mode switch, all
  1508. referenced elements will be numbers (non-number fields will be zero) and
  1509. interpolated as Lisp numbers, without quotes. If you provide the
  1510. @samp{L} flag, all fields will be interpolated literally, without quotes.
  1511. I.e., if you want a reference to be interpreted as a string by the Lisp
  1512. form, enclode the reference operator itself in double quotes, like
  1513. @code{"$3"}. Ranges are inserted as space-separated fields, so you can
  1514. embed them in list or vector syntax. A few examples, note how the
  1515. @samp{N} mode is used when we do computations in lisp.
  1516. @example
  1517. @r{Swap the first two characters of the content of column 1}
  1518. '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
  1519. @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
  1520. '(+ $1 $2);N
  1521. @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
  1522. '(apply '+ '($1..$4));N
  1523. @end example
  1524. @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
  1525. @subsection Field formulas
  1526. @cindex field formula
  1527. @cindex formula, for individual table field
  1528. To assign a formula to a particular field, type it directly into the
  1529. field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
  1530. press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
  1531. the field, the formula will be stored as the formula for this field,
  1532. evaluated, and the current field replaced with the result.
  1533. Formulas are stored in a special line starting with @samp{#+TBLFM:}
  1534. directly below the table. If you typed the equation in the 4th field of
  1535. the 3rd data line in the table, the formula will look like
  1536. @samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
  1537. with the appropriate commands, @i{absolute references} (but not relative
  1538. ones) in stored formulas are modified in order to still reference the
  1539. same field. Of cause this is not true if you edit the table structure
  1540. with normal editing commands - then you must fix the equations yourself.
  1541. Instead of typing an equation into the field, you may also use the
  1542. following command
  1543. @table @kbd
  1544. @kindex C-u C-c =
  1545. @item C-u C-c =
  1546. Install a new formula for the current field. The command prompts for a
  1547. formula, with default taken from the @samp{#+TBLFM:} line, applies
  1548. it to the current field and stores it.
  1549. @end table
  1550. @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
  1551. @subsection Column formulas
  1552. @cindex column formula
  1553. @cindex formula, for table column
  1554. Often in a table, the same formula should be used for all fields in a
  1555. particular column. Instead of having to copy the formula to all fields
  1556. in that column, org-mode allows to assign a single formula to an entire
  1557. column. If the table contains horizontal separator hlines, everything
  1558. before the first such line is considered part of the table @emph{header}
  1559. and will not be modified by column formulas.
  1560. To assign a formula to a column, type it directly into any field in the
  1561. column, preceded by an equal sign, like @samp{=$1+$2}. When you press
  1562. @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
  1563. field, the formula will be stored as the formula for the current column,
  1564. evaluated and the current field replaced with the result. If the field
  1565. contains only @samp{=}, the previously stored formula for this column is
  1566. used. For each column, Org-mode will only remember the most recently
  1567. used formula. In the @samp{TBLFM:} line, column formulas will look like
  1568. @samp{$4=$1+$2}.
  1569. Instead of typing an equation into the field, you may also use the
  1570. following command:
  1571. @table @kbd
  1572. @kindex C-c =
  1573. @item C-c =
  1574. Install a new formula for the current column and replace current field
  1575. with the result of the formula. The command prompts for a formula, with
  1576. default taken from the @samp{#+TBLFM} line, applies it to the current
  1577. field and stores it. With a numerical prefix (e.g. @kbd{C-5 C-c =})
  1578. will apply it to that many consecutive fields in the current column.
  1579. @end table
  1580. @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
  1581. @subsection Editing and Debugging formulas
  1582. @cindex formula editing
  1583. @cindex editing, of table formulas
  1584. You can edit individual formulas in the minibuffer or directly in the
  1585. field. Org-mode can also prepare a special buffer with all active
  1586. formulas of a table. When offering a formula for editing, Org-mode
  1587. converts references to the standard format (like @code{B3} or @code{D&})
  1588. if possible. If you prefer to only work with the internal format (like
  1589. @code{@@3$2} or @code{$4}), configure the variable
  1590. @code{org-table-use-standard-references}.
  1591. @table @kbd
  1592. @kindex C-c =
  1593. @kindex C-u C-c =
  1594. @item C-c =
  1595. @itemx C-u C-c =
  1596. Edit the formula associated with the current column/field in the
  1597. minibuffer. See @ref{Column formulas} and @ref{Field formulas}.
  1598. @kindex C-u C-u C-c =
  1599. @item C-u C-u C-c =
  1600. Re-insert the active formula (either a
  1601. field formula, or a column formula) into the current field, so that you
  1602. can edit it directly in the field. The advantage over editing in the
  1603. minibuffer is that you can use the command @kbd{C-c ?}.
  1604. @kindex C-c ?
  1605. @item C-c ?
  1606. While editing a formula in a table field, highlight the field(s)
  1607. referenced by the reference at the cursor position in the formula.
  1608. @kindex C-c @}
  1609. @item C-c @}
  1610. Toggle the display of row and column numbers for a table, using
  1611. overlays. These are updated each time the table is aligned, you can
  1612. force it with @kbd{C-c C-c}.
  1613. @kindex C-c @{
  1614. @item C-c @{
  1615. Toggle the formula debugger on and off. See below.
  1616. @kindex C-c '
  1617. @item C-c '
  1618. Edit all formulas for the current table in a special buffer, where the
  1619. formulas will be displayed one per line. If the current field has an
  1620. active formula, the cursor in the formula editor will mark it.
  1621. While inside the special buffer, Org-mode will automatically highlight
  1622. any field or range reference at the cursor position. You may edit,
  1623. remove and add formulas, and use the following commands:
  1624. @table @kbd
  1625. @kindex C-c C-c
  1626. @kindex C-x C-s
  1627. @item C-c C-c
  1628. @itemx C-x C-s
  1629. Exit the formula editor and store the modified formulas. With @kbd{C-u}
  1630. prefix, also apply the new formulas to the entire table.
  1631. @kindex C-c C-q
  1632. @item C-c C-q
  1633. Exit the formula editor without installing changes.
  1634. @kindex C-c C-r
  1635. @item C-c C-r
  1636. Toggle all references in the formula editor between standard (like
  1637. @code{B3}) and internal (like @code{@@3$2}).
  1638. @kindex @key{TAB}
  1639. @item @key{TAB}
  1640. Pretty-print or indent lisp formula at point. When in a line containing
  1641. a lisp formula, format the formula according to Emacs Lisp rules.
  1642. Another @key{TAB} collapses the formula back again. In the open
  1643. formula, @key{TAB} re-indents just like in Emacs-lisp-mode.
  1644. @kindex M-@key{TAB}
  1645. @item M-@key{TAB}
  1646. Complete Lisp symbols, just like in Emacs-lisp-mode.
  1647. @kindex S-@key{up}
  1648. @kindex S-@key{down}
  1649. @kindex S-@key{left}
  1650. @kindex S-@key{right}
  1651. @item S-@key{up}/@key{down}/@key{left}/@key{right}
  1652. Shift the reference at point. For example, if the reference is
  1653. @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
  1654. This also works for relative references, and for hline references.
  1655. @kindex M-S-@key{up}
  1656. @kindex M-S-@key{down}
  1657. @item M-S-@key{up}/@key{down}
  1658. Move the test line for column formulas in the Org-mode buffer up and
  1659. down.
  1660. @kindex M-@key{up}
  1661. @kindex M-@key{down}
  1662. @item M-@key{up}/@key{down}
  1663. Scroll the window displaying the table.
  1664. @kindex C-c @}
  1665. @item C-c @}
  1666. Turn the coordinate grid in the table on and off.
  1667. @end table
  1668. @end table
  1669. Making a table field blank does not remove the formula associated with
  1670. the field, because that is stored in a different line (the @samp{TBLFM}
  1671. line) - during the next recalculation the field will be filled again.
  1672. To remove a formula from a field, you have to give an empty reply when
  1673. prompted for the formula, or to edit the @samp{#+TBLFM} line.
  1674. @kindex C-c C-c
  1675. You may edit the @samp{#+TBLFM} directly and re-apply the changed
  1676. equations with @kbd{C-c C-c} in that line, or with the normal
  1677. recalculation commands in the table.
  1678. @subsubheading Debugging formulas
  1679. @cindex formula debugging
  1680. @cindex debugging, of table formulas
  1681. When the evaluation of a formula leads to an error, the field content
  1682. becomes the string @samp{#ERROR}. If you would like see what is going
  1683. on during variable substitution and calculation in order to find a bug,
  1684. turn on formula debugging in the @code{Tbl} menu and repeat the
  1685. calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
  1686. field. Detailed information will be displayed.
  1687. @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
  1688. @subsection Updating the Table
  1689. @cindex recomputing table fields
  1690. @cindex updating, table
  1691. Recalculation of a table is normally not automatic, but needs to be
  1692. triggered by a command. See @ref{Advanced features} for a way to make
  1693. recalculation at least semi-automatically.
  1694. In order to recalculate a line of a table or the entire table, use the
  1695. following commands:
  1696. @table @kbd
  1697. @kindex C-c *
  1698. @item C-c *
  1699. Recalculate the current row by first applying the stored column formulas
  1700. from left to right, and all field formulas in the current row.
  1701. @c
  1702. @kindex C-u C-c *
  1703. @item C-u C-c *
  1704. @kindex C-u C-c C-c
  1705. @itemx C-u C-c C-c
  1706. Recompute the entire table, line by line. Any lines before the first
  1707. hline are left alone, assuming that these are part of the table header.
  1708. @c
  1709. @kindex C-u C-u C-c *
  1710. @kindex C-u C-u C-c C-c
  1711. @item C-u C-u C-c *
  1712. @itemx C-u C-u C-c C-c
  1713. Iterate the table by recomputing it until no further changes occur.
  1714. This may be necessary if some computed fields use the value of other
  1715. fields that are computed @i{later} in the calculation sequence.
  1716. @end table
  1717. @node Advanced features, , Updating the table, The spreadsheet
  1718. @subsection Advanced features
  1719. If you want the recalculation of fields to happen automatically, or if
  1720. you want to be able to assign @i{names} to fields and columns, you need
  1721. to reserve the first column of the table for special marking characters.
  1722. @table @kbd
  1723. @kindex C-#
  1724. @item C-#
  1725. Rotate the calculation mark in first column through the states @samp{},
  1726. @samp{#}, @samp{*}, @samp{!}, @samp{$}. The meaning of these characters
  1727. is discussed below. When there is an active region, change all marks in
  1728. the region.
  1729. @end table
  1730. Here is an example of a table that collects exam results of students and
  1731. makes use of these features:
  1732. @example
  1733. @group
  1734. |---+---------+--------+--------+--------+-------+------|
  1735. | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
  1736. |---+---------+--------+--------+--------+-------+------|
  1737. | ! | | P1 | P2 | P3 | Tot | |
  1738. | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
  1739. | ^ | | m1 | m2 | m3 | mt | |
  1740. |---+---------+--------+--------+--------+-------+------|
  1741. | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
  1742. | # | Sara | 6 | 14 | 19 | 39 | 7.8 |
  1743. | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
  1744. |---+---------+--------+--------+--------+-------+------|
  1745. | | Average | | | | 29.7 | |
  1746. | ^ | | | | | at | |
  1747. | $ | max=50 | | | | | |
  1748. |---+---------+--------+--------+--------+-------+------|
  1749. #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
  1750. @end group
  1751. @end example
  1752. @noindent @b{Important}: Please note that for these special tables,
  1753. recalculating the table with @kbd{C-u C-c *} will only affect rows that
  1754. are marked @samp{#} or @samp{*}, and fields that have a formula assigned
  1755. to the field itself. The column formulas are not applied in rows with
  1756. empty first field.
  1757. @cindex marking characters, tables
  1758. The marking characters have the following meaning:
  1759. @table @samp
  1760. @item !
  1761. The fields in this line define names for the columns, so that you may
  1762. refer to a column as @samp{$Tot} instead of @samp{$6}.
  1763. @item ^
  1764. This row defines names for the fields @emph{above} the row. With such
  1765. a definition, any formula in the table may use @samp{$m1} to refer to
  1766. the value @samp{10}. Also, if you assign a formula to a names field, it
  1767. will be stored as @samp{$name=...}.
  1768. @item _
  1769. Similar to @samp{^}, but defines names for the fields in the row
  1770. @emph{below}.
  1771. @item $
  1772. Fields in this row can define @emph{parameters} for formulas. For
  1773. example, if a field in a @samp{$} row contains @samp{max=50}, then
  1774. formulas in this table can refer to the value 50 using @samp{$max}.
  1775. Parameters work exactly like constants, only that they can be defined on
  1776. a per-table basis.
  1777. @item #
  1778. Fields in this row are automatically recalculated when pressing
  1779. @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
  1780. is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
  1781. lines will be left alone by this command.
  1782. @item *
  1783. Selects this line for global recalculation with @kbd{C-u C-c *}, but
  1784. not for automatic recalculation. Use this when automatic
  1785. recalculation slows down editing too much.
  1786. @item
  1787. Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
  1788. All lines that should be recalculated should be marked with @samp{#}
  1789. or @samp{*}.
  1790. @item /
  1791. Do not export this line. Useful for lines that contain the narrowing
  1792. @samp{<N>} markers.
  1793. @end table
  1794. Finally, just to whet your appetite on what can be done with the
  1795. fantastic @file{calc} package, here is a table that computes the Taylor
  1796. series of degree @code{n} at location @code{x} for a couple of functions
  1797. (homework: try that with Excel :-)
  1798. @example
  1799. @group
  1800. |---+-------------+---+-----+--------------------------------------|
  1801. | | Func | n | x | Result |
  1802. |---+-------------+---+-----+--------------------------------------|
  1803. | # | exp(x) | 1 | x | 1 + x |
  1804. | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
  1805. | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
  1806. | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
  1807. | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
  1808. | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
  1809. |---+-------------+---+-----+--------------------------------------|
  1810. #+TBLFM: $5=taylor($2,$4,$3);n3
  1811. @end group
  1812. @end example
  1813. @node Hyperlinks, TODO items, Tables, Top
  1814. @chapter Hyperlinks
  1815. @cindex hyperlinks
  1816. Just like HTML, Org-mode provides links inside a file, and external
  1817. links to other files, Usenet articles, emails, and much more.
  1818. @menu
  1819. * Link format:: How links in Org-mode are formatted
  1820. * Internal links:: Links to other places in the current file
  1821. * External links:: URL-like links to the world
  1822. * Handling links:: Creating, inserting and following
  1823. * Using links outside Org-mode:: Linking from my C source code?
  1824. * Link abbreviations:: Shortcuts for writing complex links
  1825. * Search options:: Linking to a specific location
  1826. * Custom searches:: When the default search is not enough
  1827. @end menu
  1828. @node Link format, Internal links, Hyperlinks, Hyperlinks
  1829. @section Link format
  1830. @cindex link format
  1831. @cindex format, of links
  1832. Org-mode will recognize plain URL-like links and activate them as
  1833. clickable links. The general link format, however, looks like this:
  1834. @example
  1835. [[link][description]] @r{or alternatively} [[link]]
  1836. @end example
  1837. Once a link in the buffer is complete (all brackets present), Org-mode
  1838. will change the display so that @samp{description} is displayed instead
  1839. of @samp{[[link][description]]} and @samp{link} is displayed instead of
  1840. @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
  1841. which by default is an underlined face. You can directly edit the
  1842. visible part of a link. Note that this can be either the @samp{link}
  1843. part (if there is no description) or the @samp{description} part. To
  1844. edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
  1845. cursor on the link.
  1846. If you place the cursor at the beginning or just behind the end of the
  1847. displayed text and press @key{BACKSPACE}, you will remove the
  1848. (invisible) bracket at that location. This makes the link incomplete
  1849. and the internals are again displayed as plain text. Inserting the
  1850. missing bracket hides the link internals again. To show the
  1851. internal structure of all links, use the menu entry
  1852. @code{Org->Hyperlinks->Literal links}.
  1853. @node Internal links, External links, Link format, Hyperlinks
  1854. @section Internal links
  1855. @cindex internal links
  1856. @cindex links, internal
  1857. @cindex targets, for links
  1858. If the link does not look like a URL, it is considered to be internal in
  1859. the current file. Links such as @samp{[[My Target]]} or @samp{[[My
  1860. Target][Find my target]]} lead to a text search in the current file.
  1861. The link can be followed with @kbd{C-c C-o} when the cursor is on the
  1862. link, or with a mouse click (@pxref{Handling links}). The preferred
  1863. match for such a link is a dedicated target: the same string in double
  1864. angular brackets. Targets may be located anywhere; sometimes it is
  1865. convenient to put them into a comment line. For example
  1866. @example
  1867. # <<My Target>>
  1868. @end example
  1869. @noindent In HTML export (@pxref{HTML export}), such targets will become
  1870. named anchors for direct access through @samp{http} links@footnote{Note
  1871. that text before the first headline is usually not exported, so the
  1872. first such target should be after the first headline.}.
  1873. If no dedicated target exists, Org-mode will search for the words in the
  1874. link. In the above example the search would be for @samp{my target}.
  1875. Links starting with a star like @samp{*My Target} restrict the search to
  1876. headlines. When searching, Org-mode will first try an exact match, but
  1877. then move on to more and more lenient searches. For example, the link
  1878. @samp{[[*My Targets]]} will find any of the following:
  1879. @example
  1880. ** My targets
  1881. ** TODO my targets are bright
  1882. ** my 20 targets are
  1883. @end example
  1884. To insert a link targeting a headline, in-buffer completion can be used.
  1885. Just type a star followed by a few optional letters into the buffer and
  1886. press @kbd{M-@key{TAB}}. All headlines in the current buffer will be
  1887. offered as completions. @xref{Handling links}, for more commands
  1888. creating links.
  1889. Following a link pushes a mark onto Org-mode's own mark ring. You can
  1890. return to the previous position with @kbd{C-c &}. Using this command
  1891. several times in direct succession goes back to positions recorded
  1892. earlier.
  1893. @menu
  1894. * Radio targets:: Make targets trigger links in plain text.
  1895. @end menu
  1896. @node Radio targets, , Internal links, Internal links
  1897. @subsection Radio targets
  1898. @cindex radio targets
  1899. @cindex targets, radio
  1900. @cindex links, radio targets
  1901. Org-mode can automatically turn any occurrences of certain target names
  1902. in normal text into a link. So without explicitly creating a link, the
  1903. text connects to the target radioing its position. Radio targets are
  1904. enclosed by triple angular brackets. For example, a target @samp{<<<My
  1905. Target>>>} causes each occurrence of @samp{my target} in normal text to
  1906. become activated as a link. The Org-mode file is scanned automatically
  1907. for radio targets only when the file is first loaded into Emacs. To
  1908. update the target list during editing, press @kbd{C-c C-c} with the
  1909. cursor on or at a target.
  1910. @node External links, Handling links, Internal links, Hyperlinks
  1911. @section External links
  1912. @cindex links, external
  1913. @cindex external links
  1914. @cindex links, external
  1915. @cindex GNUS links
  1916. @cindex BBDB links
  1917. @cindex URL links
  1918. @cindex file links
  1919. @cindex VM links
  1920. @cindex RMAIL links
  1921. @cindex WANDERLUST links
  1922. @cindex MH-E links
  1923. @cindex USENET links
  1924. @cindex SHELL links
  1925. @cindex Info links
  1926. @cindex elisp links
  1927. Org-mode supports links to files, websites, Usenet and email messages,
  1928. and BBDB database entries. External links are URL-like locators. They
  1929. start with a short identifying string followed by a colon. There can be
  1930. no space after the colon. The following list shows examples for each
  1931. link type.
  1932. @example
  1933. http://www.astro.uva.nl/~dominik @r{on the web}
  1934. file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
  1935. file:papers/last.pdf @r{file, relative path}
  1936. news:comp.emacs @r{Usenet link}
  1937. mailto:adent@@galaxy.net @r{Mail link}
  1938. vm:folder @r{VM folder link}
  1939. vm:folder#id @r{VM message link}
  1940. vm://myself@@some.where.org/folder#id @r{VM on remote machine}
  1941. wl:folder @r{WANDERLUST folder link}
  1942. wl:folder#id @r{WANDERLUST message link}
  1943. mhe:folder @r{MH-E folder link}
  1944. mhe:folder#id @r{MH-E message link}
  1945. rmail:folder @r{RMAIL folder link}
  1946. rmail:folder#id @r{RMAIL message link}
  1947. gnus:group @r{GNUS group link}
  1948. gnus:group#id @r{GNUS article link}
  1949. bbdb:Richard Stallman @r{BBDB link}
  1950. shell:ls *.org @r{A shell command}
  1951. elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
  1952. @end example
  1953. A link should be enclosed in double brackets and may contain a
  1954. descriptive text to be displayed instead of the url (@pxref{Link
  1955. format}), for example:
  1956. @example
  1957. [[http://www.gnu.org/software/emacs/][GNU Emacs]]
  1958. @end example
  1959. @noindent
  1960. If the description is a file name or URL that points to an image, HTML
  1961. export (@pxref{HTML export}) will inline the image as a clickable
  1962. button. If there is no description at all and the link points to an
  1963. image,
  1964. that image will be inlined into the exported HTML file.
  1965. @cindex angular brackets, around links
  1966. @cindex plain text external links
  1967. Org-mode also finds external links in the normal text and activates them
  1968. as links. If spaces must be part of the link (for example in
  1969. @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
  1970. about the end of the link, enclose them in angular brackets.
  1971. @node Handling links, Using links outside Org-mode, External links, Hyperlinks
  1972. @section Handling links
  1973. @cindex links, handling
  1974. Org-mode provides methods to create a link in the correct syntax, to
  1975. insert it into an org-mode file, and to follow the link.
  1976. @table @kbd
  1977. @kindex C-c l
  1978. @cindex storing links
  1979. @item C-c l
  1980. Store a link to the current location. This is a @emph{global} command
  1981. which can be used in any buffer to create a link. The link will be
  1982. stored for later insertion into an Org-mode buffer (see below). For
  1983. Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
  1984. points to the target. Otherwise it points to the current headline. For
  1985. VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
  1986. indicate the current article/entry. For W3 and W3M buffers, the link
  1987. goes to the current URL. For any other files, the link will point to
  1988. the file, with a search string (@pxref{Search options}) pointing to the
  1989. contents of the current line. If there is an active region, the
  1990. selected words will form the basis of the search string. If the
  1991. automatically created link is not working correctly or accurately
  1992. enough, you can write custom functions to select the search string and
  1993. to do the search for particular file types - see @ref{Custom searches}.
  1994. The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
  1995. @c
  1996. @kindex C-c C-l
  1997. @cindex link completion
  1998. @cindex completion, of links
  1999. @cindex inserting links
  2000. @item C-c C-l
  2001. Insert a link. This prompts for a link to be inserted into the buffer.
  2002. You can just type a link, using text for an internal link, or one of the
  2003. link type prefixes mentioned in the examples above. All links stored
  2004. during the current session are part of the history for this prompt, so
  2005. you can access them with @key{up} and @key{down} (or @kbd{M-p/n}).
  2006. Completion, on the other hand, will help you to insert valid link
  2007. prefixes like @samp{http:} or @samp{ftp:}, including the prefixes
  2008. defined through link abbreviations (@pxref{Link abbreviations}). The
  2009. link will be inserted into the buffer@footnote{After insertion of a
  2010. stored link, the link will be removed from the list of stored links. To
  2011. keep it in the list later use, use a triple @kbd{C-u} prefix to @kbd{C-c
  2012. C-l}, or configure the option
  2013. @code{org-keep-stored-link-after-insertion}.}, along with a descriptive
  2014. text. If some text was selected when this command is called, the
  2015. selected text becomes the default description.@* Note that you don't
  2016. have to use this command to insert a link. Links in Org-mode are plain
  2017. text, and you can type or paste them straight into the buffer. By using
  2018. this command, the links are automatically enclosed in double brackets,
  2019. and you will be asked for the optional descriptive text.
  2020. @c
  2021. @c If the link is a @samp{file:} link and
  2022. @c the linked file is located in the same directory as the current file or
  2023. @c a subdirectory of it, the path of the file will be inserted relative to
  2024. @c the current directory.
  2025. @c
  2026. @kindex C-u C-c C-l
  2027. @cindex file name completion
  2028. @cindex completion, of file names
  2029. @item C-u C-c C-l
  2030. When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
  2031. a file will be inserted and you may use file name completion to select
  2032. the name of the file. The path to the file is inserted relative to the
  2033. directory of the current org file, if the linked file is in the current
  2034. directory or in a subdirectory of it, or if the path is written relative
  2035. to the current directory using @samp{../}. Otherwise an absolute path
  2036. is used, if possible with @samp{~/} for your home directory. You can
  2037. force an absolute path with two @kbd{C-u} prefixes.
  2038. @c
  2039. @item C-c C-l @r{(with cursor on existing link)}
  2040. When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
  2041. link and description parts of the link.
  2042. @c
  2043. @cindex following links
  2044. @kindex C-c C-o
  2045. @item C-c C-o
  2046. Open link at point. This will launch a web browser for URLs (using
  2047. @command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb
  2048. for the corresponding links, and execute the command in a shell link.
  2049. When the cursor is on an internal link, this commands runs the
  2050. corresponding search. When the cursor is on a TAG list in a headline,
  2051. it creates the corresponding TAGS view. If the cursor is on a time
  2052. stamp, it compiles the agenda for that date. Furthermore, it will visit
  2053. text and remote files in @samp{file:} links with Emacs and select a
  2054. suitable application for local non-text files. Classification of files
  2055. is based on file extension only. See option @code{org-file-apps}. If
  2056. you want to override the default application and visit the file with
  2057. Emacs, use a @kbd{C-u} prefix.
  2058. @c
  2059. @kindex mouse-2
  2060. @kindex mouse-1
  2061. @item mouse-2
  2062. @itemx mouse-1
  2063. On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
  2064. would. Under Emacs 22, also @kbd{mouse-1} will follow a link.
  2065. @c
  2066. @kindex mouse-3
  2067. @item mouse-3
  2068. Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
  2069. internal links to be displayed in another window@footnote{See the
  2070. variable @code{org-display-internal-link-with-indirect-buffer}}.
  2071. @c
  2072. @cindex mark ring
  2073. @kindex C-c %
  2074. @item C-c %
  2075. Push the current position onto the mark ring, to be able to return
  2076. easily. Commands following an internal link do this automatically.
  2077. @c
  2078. @cindex links, returning to
  2079. @kindex C-c &
  2080. @item C-c &
  2081. Jump back to a recorded position. A position is recorded by the
  2082. commands following internal links, and by @kbd{C-c %}. Using this
  2083. command several times in direct succession moves through a ring of
  2084. previously recorded positions.
  2085. @c
  2086. @kindex C-c C-x C-n
  2087. @kindex C-c C-x C-p
  2088. @cindex links, finding next/previous
  2089. @item C-c C-x C-n
  2090. @itemx C-c C-x C-p
  2091. Move forward/backward to the next link in the buffer. At the limit of
  2092. the buffer, the search fails once, and then wraps around. The key
  2093. bindings for this are really too long, you might want to bind this also
  2094. to @kbd{C-n} and @kbd{C-p}
  2095. @lisp
  2096. (add-hook 'org-load-hook
  2097. (lambda ()
  2098. (define-key 'org-mode-map "\C-n" 'org-next-link)
  2099. (define-key 'org-mode-map "\C-p" 'org-previous-link)))
  2100. @end lisp
  2101. @end table
  2102. @node Using links outside Org-mode, Link abbreviations, Handling links, Hyperlinks
  2103. @section Using links outside Org-mode
  2104. You can insert and follow links that have Org-mode syntax not only in
  2105. Org-mode, but in any Emacs buffer. For this, you should create two
  2106. global commands, like this (please select suitable global keys
  2107. yourself):
  2108. @lisp
  2109. (global-set-key "\C-c L" 'org-insert-link-global)
  2110. (global-set-key "\C-c o" 'org-open-at-point-global)
  2111. @end lisp
  2112. @node Link abbreviations, Search options, Using links outside Org-mode, Hyperlinks
  2113. @section Link abbreviations
  2114. @cindex link abbreviations
  2115. @cindex abbreviation, links
  2116. Long URLs can be cumbersome to type, and often many similar links are
  2117. needed in a document. For this you can use link abbreviations. An
  2118. abbreviated link looks like this
  2119. @example
  2120. [[linkword:tag][description]]
  2121. @end example
  2122. @noindent
  2123. where the tag is optional. Such abbreviations are resolved according to
  2124. the information in the variable @code{org-link-abbrev-alist} that
  2125. relates the linkwords to replacement text. Here is an example:
  2126. @lisp
  2127. @group
  2128. (setq org-link-abbrev-alist
  2129. '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
  2130. ("google" . "http://www.google.com/search?q=")
  2131. ("ads" . "http://adsabs.harvard.edu/cgi-bin/
  2132. nph-abs_connect?author=%s&db_key=AST")))
  2133. @end group
  2134. @end lisp
  2135. If the replacement text contains the string @samp{%s}, it will be
  2136. replaced with the tag. Otherwise the tag will be appended to the string
  2137. in order to create the link. You may also specify a function that will
  2138. be called with the tag as the only argument to create the link.
  2139. With the above setting, you could link to a specific bug with
  2140. @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
  2141. @code{[[google:OrgMode]]} and find out what the Org-mode author is
  2142. doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
  2143. If you need special abbreviations just for a single Org-mode buffer, you
  2144. can define them in the file with
  2145. @example
  2146. #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
  2147. #+LINK: google http://www.google.com/search?q=%s
  2148. @end example
  2149. @noindent
  2150. In-buffer completion @pxref{Completion} can be used after @samp{[} to
  2151. complete link abbreviations.
  2152. @node Search options, Custom searches, Link abbreviations, Hyperlinks
  2153. @section Search options in file links
  2154. @cindex search option in file links
  2155. @cindex file links, searching
  2156. File links can contain additional information to make Emacs jump to a
  2157. particular location in the file when following a link. This can be a
  2158. line number or a search option after a double@footnote{For backward
  2159. compatibility, line numbers can also follow a single colon.} colon. For
  2160. example, when the command @kbd{C-c l} creates a link (@pxref{Handling
  2161. links}) to a file, it encodes the words in the current line as a search
  2162. string that can be used to find this line back later when following the
  2163. link with @kbd{C-c C-o}.
  2164. Here is the syntax of the different ways to attach a search to a file
  2165. link, together with an explanation:
  2166. @example
  2167. [[file:~/code/main.c::255]]
  2168. [[file:~/xx.org::My Target]]
  2169. [[file:~/xx.org::*My Target]]
  2170. [[file:~/xx.org::/regexp/]]
  2171. @end example
  2172. @table @code
  2173. @item 255
  2174. Jump to line 255.
  2175. @item My Target
  2176. Search for a link target @samp{<<My Target>>}, or do a text search for
  2177. @samp{my target}, similar to the search in internal links, see
  2178. @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
  2179. link will become an HTML reference to the corresponding named anchor in
  2180. the linked file.
  2181. @item *My Target
  2182. In an Org-mode file, restrict search to headlines.
  2183. @item /regexp/
  2184. Do a regular expression search for @code{regexp}. This uses the Emacs
  2185. command @code{occur} to list all matches in a separate window. If the
  2186. target file is in Org-mode, @code{org-occur} is used to create a
  2187. sparse tree with the matches.
  2188. @c If the target file is a directory,
  2189. @c @code{grep} will be used to search all files in the directory.
  2190. @end table
  2191. As a degenerate case, a file link with an empty file name can be used
  2192. to search the current file. For example, @code{[[file:::find me]]} does
  2193. a search for @samp{find me} in the current file, just as
  2194. @samp{[[find me]]} would.
  2195. @node Custom searches, , Search options, Hyperlinks
  2196. @section Custom Searches
  2197. @cindex custom search strings
  2198. @cindex search strings, custom
  2199. The default mechanism for creating search strings and for doing the
  2200. actual search related to a file link may not work correctly in all
  2201. cases. For example, BibTeX database files have many entries like
  2202. @samp{year="1993"} which would not result in good search strings,
  2203. because the only unique identification for a BibTeX entry is the
  2204. citation key.
  2205. If you come across such a problem, you can write custom functions to set
  2206. the right search string for a particular file type, and to do the search
  2207. for the string in the file. Using @code{add-hook}, these functions need
  2208. to be added to the hook variables
  2209. @code{org-create-file-search-functions} and
  2210. @code{org-execute-file-search-functions}. See the docstring for these
  2211. variables for more information. Org-mode actually uses this mechanism
  2212. for Bib@TeX{} database files, and you can use the corresponding code as
  2213. an implementation example. Search for @samp{BibTeX links} in the source
  2214. file.
  2215. @node TODO items, Tags, Hyperlinks, Top
  2216. @chapter TODO items
  2217. @cindex TODO items
  2218. Org-mode does not maintain TODO lists as a separate document. TODO
  2219. items are an integral part of the notes file, because TODO items
  2220. usually come up while taking notes! With Org-mode, you simply mark
  2221. any entry in a tree as being a TODO item. In this way, the
  2222. information is not duplicated, and the entire context from which the
  2223. item emerged is always present when you check.
  2224. Of course, this technique causes TODO items to be scattered throughout
  2225. your file. Org-mode provides methods to give you an overview over all
  2226. things you have to do.
  2227. @menu
  2228. * TODO basics:: Marking and displaying TODO entries
  2229. * TODO extensions:: Workflow and assignments
  2230. * Progress logging:: Dates and notes for progress
  2231. * Priorities:: Some things are more important than others
  2232. * Breaking down tasks:: Splitting a task into manageable pieces
  2233. * Checkboxes:: Tick-off lists
  2234. @end menu
  2235. @node TODO basics, TODO extensions, TODO items, TODO items
  2236. @section Basic TODO functionality
  2237. Any headline can become a TODO item by starting it with the word TODO,
  2238. for example:
  2239. @example
  2240. *** TODO Write letter to Sam Fortune
  2241. @end example
  2242. @noindent
  2243. The most important commands to work with TODO entries are:
  2244. @table @kbd
  2245. @kindex C-c C-t
  2246. @cindex cycling, of TODO states
  2247. @item C-c C-t
  2248. Rotate the TODO state of the current item among
  2249. @example
  2250. ,-> (unmarked) -> TODO -> DONE --.
  2251. '--------------------------------'
  2252. @end example
  2253. The same rotation can also be done ``remotely'' from the timeline and
  2254. agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
  2255. @kindex C-u C-c C-t
  2256. @item C-u C-c C-t
  2257. Select a specific keyword using completion of (if it has been set up)
  2258. the fast selection interface.
  2259. @kindex S-@key{right}
  2260. @kindex S-@key{left}
  2261. @item S-@key{right}
  2262. @itemx S-@key{left}
  2263. Select the following/preceding TODO state, similar to cycling. Mostly
  2264. useful if more than two TODO states are possible (@pxref{TODO
  2265. extensions}).
  2266. @kindex C-c C-c
  2267. @item C-c C-c
  2268. Use the fast tag interface to quickly and directly select a specific
  2269. TODO state. For this you need to assign keys to TODO state, like this:
  2270. @example
  2271. #+SEQ_TODO: TODO(t) STARTED(s) WAITING(w) | DONE(d)
  2272. @end example
  2273. @noindent See @ref{Per file keywords} and @ref{Setting tags} for more
  2274. information.
  2275. @kindex C-c C-v
  2276. @cindex sparse tree, for TODO
  2277. @item C-c C-v
  2278. View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
  2279. the entire buffer, but shows all TODO items and the headings hierarchy
  2280. above them. With prefix arg, search for a specific TODO. You will be
  2281. prompted for the keyword, and you can also give a list of keywords like
  2282. @code{kwd1|kwd2|...}. With numerical prefix N, show the tree for the
  2283. Nth keyword in the variable @code{org-todo-keywords}. With two prefix
  2284. args, find all TODO and DONE entries.
  2285. @kindex C-c a t
  2286. @item C-c a t
  2287. Show the global TODO list. This collects the TODO items from all
  2288. agenda files (@pxref{Agenda views}) into a single buffer. The buffer is in
  2289. @code{agenda-mode}, so there are commands to examine and manipulate
  2290. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  2291. @xref{Global TODO list}, for more information.
  2292. @kindex S-M-@key{RET}
  2293. @item S-M-@key{RET}
  2294. Insert a new TODO entry below the current one.
  2295. @end table
  2296. @node TODO extensions, Progress logging, TODO basics, TODO items
  2297. @section Extended use of TODO keywords
  2298. @cindex extended TODO keywords
  2299. The default implementation of TODO entries is just two states: TODO and
  2300. DONE. You can use the TODO feature for more complicated things by
  2301. configuring the variable @code{org-todo-keywords}. With special setup,
  2302. the TODO keyword system can work differently in different files.
  2303. Note that @i{tags} are another way to classify headlines in general and
  2304. TODO items in particular (@pxref{Tags}).
  2305. @menu
  2306. * Workflow states:: From TODO to DONE in steps
  2307. * TODO types:: I do this, Fred the rest
  2308. * Multiple sets in one file:: Mixing it all, and still finding your way
  2309. * Fast access to TODO states:: Single letter selection of a state
  2310. * Per file keywords:: Different files, different requirements
  2311. * Faces for TODO keywords:: Highlighting states
  2312. @end menu
  2313. @node Workflow states, TODO types, TODO extensions, TODO extensions
  2314. @subsection TODO keywords as workflow states
  2315. @cindex TODO workflow
  2316. @cindex workflow states as TODO keywords
  2317. You can use TODO keywords to indicate different @emph{sequential} states
  2318. in the process of working on an item, for example@footnote{Changing
  2319. this variable only becomes effective after restarting Org-mode in a
  2320. buffer.}:
  2321. @lisp
  2322. (setq org-todo-keywords
  2323. '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
  2324. @end lisp
  2325. The vertical bar separates the TODO keywords (states that @emph{need
  2326. action}) from the DONE states (which need @emph{no further action}. If
  2327. you don't provide the separator bar, the last state is used as the DONE
  2328. state.
  2329. @cindex completion, of TODO keywords
  2330. With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
  2331. to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
  2332. also use a prefix argument to quickly select a specific state. For
  2333. example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
  2334. If you define many keywords, you can use in-buffer completion (see
  2335. @ref{Completion}) to insert these words into the buffer. Changing a
  2336. todo state can be logged with a timestamp, see @ref{Tracking TODO state
  2337. changes} for more information.
  2338. @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
  2339. @subsection TODO keywords as types
  2340. @cindex TODO types
  2341. @cindex names as TODO keywords
  2342. @cindex types as TODO keywords
  2343. The second possibility is to use TODO keywords to indicate different
  2344. @emph{types} of action items. For example, you might want to indicate
  2345. that items are for ``work'' or ``home''. Or, when you work with several
  2346. people on a single project, you might want to assign action items
  2347. directly to persons, by using their names as TODO keywords. This would
  2348. be set up like this:
  2349. @lisp
  2350. (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
  2351. @end lisp
  2352. In this case, different keywords do not indicate a sequence, but rather
  2353. different types. So the normal work flow would be to assign a task to a
  2354. person, and later to mark it DONE. Org-mode supports this style by
  2355. adapting the workings of the command @kbd{C-c C-t}@footnote{This is also
  2356. true for the @kbd{t} command in the timeline and agenda buffers.}. When
  2357. used several times in succession, it will still cycle through all names,
  2358. in order to first select the right type for a task. But when you return
  2359. to the item after some time and execute @kbd{C-c C-t} again, it will
  2360. switch from any name directly to DONE. Use prefix arguments or
  2361. completion to quickly select a specific name. You can also review the
  2362. items of a specific TODO type in a sparse tree by using a numeric prefix
  2363. to @kbd{C-c C-v}. For example, to see all things Lucy has to do, you
  2364. would use @kbd{C-3 C-c C-v}. To collect Lucy's items from all agenda
  2365. files into a single buffer, you would use the prefix arg as well when
  2366. creating the global todo list: @kbd{C-3 C-c t}.
  2367. @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
  2368. @subsection Multiple keyword sets in one file
  2369. @cindex todo keyword sets
  2370. Sometimes you may want to use different sets of TODO keywords in
  2371. parallel. For example, you may want to have the basic
  2372. @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
  2373. separate state indicating that an item has been canceled (so it is not
  2374. DONE, but also does not require action). Your setup would then look
  2375. like this:
  2376. @lisp
  2377. (setq org-todo-keywords
  2378. '((sequence "TODO" "|" "DONE")
  2379. (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
  2380. (sequence "|" "CANCELED")))
  2381. @end lisp
  2382. The keywords should all be different, this helps Org-mode to keep track
  2383. of which subsequence should be used for a given entry. In this setup,
  2384. @kbd{C-c C-t} only operates within a subsequence, so it switches from
  2385. @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
  2386. (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
  2387. select the correct sequence. Besides the obvious ways like typing a
  2388. keyword or using completion, you may also apply the following commands:
  2389. @table @kbd
  2390. @kindex C-S-@key{right}
  2391. @kindex C-S-@key{left}
  2392. @item C-S-@key{right}
  2393. @itemx C-S-@key{left}
  2394. These keys jump from one TODO subset to the next. In the above example,
  2395. @kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
  2396. @code{REPORT}, and any of the words in the second row to @code{CANCELED}.
  2397. @kindex S-@key{right}
  2398. @kindex S-@key{left}
  2399. @item S-@key{right}
  2400. @itemx S-@key{left}
  2401. @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
  2402. @emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
  2403. would switch from @code{DONE} to @code{REPORT} in the example above.
  2404. @end table
  2405. @node Fast access to TODO states, Per file keywords, Multiple sets in one file, TODO extensions
  2406. @subsection Fast access to TODO states
  2407. If you would like to quickly change an entry to an arbitrary TODO state
  2408. instead of cycling through the states, you can set up keys for
  2409. single-letter access to the states. This is done by adding the section
  2410. key after each keyword, in parenthesis. For example:
  2411. @lisp
  2412. (setq org-todo-keywords
  2413. '((sequence "TODO(t)" "|" "DONE(d)")
  2414. (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
  2415. (sequence "|" "CANCELED(c)")))
  2416. @end lisp
  2417. If you then press @code{C-u C-c C-t} followed by the selection key, the
  2418. entry will be switched to this state. @key{SPC} can be used to remove
  2419. any TODO keyword from an entry. Should you like this way of selecting
  2420. TODO states a lot, you might want to set the variable
  2421. @code{org-use-fast-todo-selection} to @code{t} and make this behavior
  2422. the default. Check also the variable
  2423. @code{org-fast-tag-selection-include-todo}, it allows to change the TODO
  2424. state through the tags interface (@pxref{Setting tags}).
  2425. @node Per file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
  2426. @subsection Setting up keywords for individual files
  2427. @cindex keyword options
  2428. @cindex per file keywords
  2429. It can be very useful to use different aspects of the TODO mechanism in
  2430. different files. For file-local settings, you need to add special lines
  2431. to the file which set the keywords and interpretation for that file
  2432. only. For example, to set one of the two examples discussed above, you
  2433. need one of the following lines, starting in column zero anywhere in the
  2434. file:
  2435. @example
  2436. #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
  2437. @end example
  2438. or
  2439. @example
  2440. #+TYP_TODO: Fred Sara Lucy Mike | DONE
  2441. @end example
  2442. A setup for using several sets in parallel would be:
  2443. @example
  2444. #+SEQ_TODO: TODO | DONE
  2445. #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
  2446. #+SEQ_TODO: | CANCELED
  2447. @end example
  2448. @cindex completion, of option keywords
  2449. @kindex M-@key{TAB}
  2450. @noindent To make sure you are using the correct keyword, type
  2451. @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
  2452. @cindex DONE, final TODO keyword
  2453. Remember that the keywords after the vertical bar (or the last keyword
  2454. if no bar is there) must always mean that the item is DONE (although you
  2455. may use a different word). After changing one of these lines, use
  2456. @kbd{C-c C-c} with the cursor still in the line to make the changes
  2457. known to Org-mode@footnote{Org-mode parses these lines only when
  2458. Org-mode is activated after visiting a file. @kbd{C-c C-c} with the
  2459. cursor in a line starting with @samp{#+} is simply restarting Org-mode
  2460. for the current buffer.}.
  2461. @node Faces for TODO keywords, , Per file keywords, TODO extensions
  2462. @subsection Faces for TODO keywords
  2463. @cindex faces, for TODO keywords
  2464. Org-mode highlights TODO keywords with special faces: @code{org-todo}
  2465. for keywords indicating that an item still has to be acted upon, and
  2466. @code{org-done} for keywords indicating that an item is finished. If
  2467. you are using more than 2 different states, you might want to use
  2468. special faces for some of them. This can be done using the variable
  2469. @code{org-todo-keyword-faces}. For example:
  2470. @lisp
  2471. (setq org-todo-keyword-faces
  2472. '(("TODO" . org-warning)
  2473. ("DEFERRED" . shadow)
  2474. ("CANCELED" . (:foreground "blue" :weight bold))))
  2475. @end lisp
  2476. @page
  2477. @node Progress logging, Priorities, TODO extensions, TODO items
  2478. @section Progress Logging
  2479. @cindex progress logging
  2480. @cindex logging, of progress
  2481. Org-mode can automatically record a time stamp and even a note when you
  2482. mark a TODO item as DONE, or even each time you change the state of
  2483. a TODO item.
  2484. @menu
  2485. * Closing items:: When was this entry marked DONE?
  2486. * Tracking TODO state changes:: When did the status change?
  2487. @end menu
  2488. @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
  2489. @subsection Closing items
  2490. If you want to keep track of @emph{when} a certain TODO item was
  2491. finished, turn on logging with@footnote{The corresponding in-buffer
  2492. setting is: @code{#+STARTUP: logdone}. You may also set this for the
  2493. scope of a subtree by adding a @code{LOGGING} property with one or more
  2494. of the logging keywords in the value.}
  2495. @lisp
  2496. (setq org-log-done t)
  2497. @end lisp
  2498. @noindent
  2499. Then each time you turn a TODO entry into DONE using either @kbd{C-c
  2500. C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
  2501. @samp{CLOSED: [timestamp]} will be inserted just after the headline. If
  2502. you turn the entry back into a TODO item through further state cycling,
  2503. that line will be removed again. In the timeline (@pxref{Timeline}) and
  2504. in the agenda (@pxref{Weekly/Daily agenda}), you can then use the
  2505. @kbd{l} key to display the TODO items closed on each day, giving you an
  2506. overview of what has been done on a day. If you want to record a note
  2507. along with the timestamp, use@footnote{The corresponding in-buffer
  2508. setting is: @code{#+STARTUP: lognotedone}}
  2509. @lisp
  2510. (setq org-log-done '(done))
  2511. @end lisp
  2512. @node Tracking TODO state changes, , Closing items, Progress logging
  2513. @subsection Tracking TODO state changes
  2514. When TODO keywords are used as workflow states (@pxref{Workflow
  2515. states}), you might want to keep track of when a state change occurred
  2516. and record a note about this change. With the setting@footnote{The
  2517. corresponding in-buffer setting is: @code{#+STARTUP: lognotestate}.}
  2518. @lisp
  2519. (setq org-log-done '(state))
  2520. @end lisp
  2521. @noindent
  2522. each state change will prompt you for a note that will be attached to
  2523. the current headline. If you press @kbd{C-c C-c} without typing
  2524. anything into the note buffer, only the time of the state change will be
  2525. noted. Very likely you do not want this verbose tracking all the time,
  2526. so it is probably better to configure this behavior with in-buffer
  2527. options. For example, if you are tracking purchases, put these into a
  2528. separate file that contains:
  2529. @example
  2530. #+SEQ_TODO: TODO(t) ORDERED(o) INVOICE(i) PAYED(p) | RECEIVED(r)
  2531. #+STARTUP: lognotestate
  2532. @end example
  2533. If you only need to take a note for some of the states, mark those
  2534. states with an additional @samp{@@}, like this:
  2535. @example
  2536. #+SEQ_TODO: TODO(t) ORDERED(o@@) INVOICE(i@@) PAYED(p) | RECEIVED(r)
  2537. #+STARTUP: lognotestate
  2538. @end example
  2539. @node Priorities, Breaking down tasks, Progress logging, TODO items
  2540. @section Priorities
  2541. @cindex priorities
  2542. If you use Org-mode extensively to organize your work, you may end up
  2543. with a number of TODO entries so large that you'd like to prioritize
  2544. them. This can be done by placing a @emph{priority cookie} into the
  2545. headline, like this
  2546. @example
  2547. *** TODO [#A] Write letter to Sam Fortune
  2548. @end example
  2549. @noindent
  2550. With its standard setup, Org-mode supports priorities @samp{A},
  2551. @samp{B}, and @samp{C}. @samp{A} is the highest priority. An entry
  2552. without a cookie is treated as priority @samp{B}. Priorities make a
  2553. difference only in the agenda (@pxref{Weekly/Daily agenda}).
  2554. @table @kbd
  2555. @kindex @kbd{C-c ,}
  2556. @item @kbd{C-c ,}
  2557. Set the priority of the current headline. The command prompts for a
  2558. priority character @samp{A}, @samp{B} or @samp{C}. When you press
  2559. @key{SPC} instead, the priority cookie is removed from the headline.
  2560. The priorities can also be changed ``remotely'' from the timeline and
  2561. agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
  2562. @c
  2563. @kindex S-@key{up}
  2564. @kindex S-@key{down}
  2565. @item S-@key{up}
  2566. @itemx S-@key{down}
  2567. Increase/decrease priority of current headline@footnote{See also the
  2568. option @code{org-priority-start-cycle-with-default'}.}. Note that these
  2569. keys are also used to modify time stamps (@pxref{Creating timestamps}).
  2570. Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}).
  2571. @end table
  2572. You can change the range of allowed priorities by setting the variables
  2573. @code{org-highest-priority}, @code{org-lowest-priority}, and
  2574. @code{org-default-priority}. For an individual buffer, you may set
  2575. these values (highest, lowest, default) like this (please make sure that
  2576. the highest priority is earlier in the alphabet than the lowest
  2577. priority):
  2578. @example
  2579. #+PRIORITIES: A C B
  2580. @end example
  2581. @node Breaking down tasks, Checkboxes, Priorities, TODO items
  2582. @section Breaking tasks down into subtasks
  2583. @cindex tasks, breaking down
  2584. It is often advisable to break down large tasks into smaller, manageable
  2585. subtasks. You can do this by creating an outline tree below a TODO
  2586. item, with detailed subtasks on the tree@footnote{To keep subtasks out
  2587. of the global TODO list, see the
  2588. @code{org-agenda-todo-list-sublevels}.}. Another possibility is the use
  2589. of checkboxes to identify (a hierarchy of) a large number of subtasks
  2590. (@pxref{Checkboxes}).
  2591. @node Checkboxes, , Breaking down tasks, TODO items
  2592. @section Checkboxes
  2593. @cindex checkboxes
  2594. Every item in a plain list (@pxref{Plain lists}) can be made a checkbox
  2595. by starting it with the string @samp{[ ]}. This feature is similar to
  2596. TODO items (@pxref{TODO items}), but more lightweight. Checkboxes are
  2597. not included into the global TODO list, so they are often great to split
  2598. a task into a number of simple steps. Or you can use them in a shopping
  2599. list. To toggle a checkbox, use @kbd{C-c C-c}, or try Piotr Zielinski's
  2600. @file{org-mouse.el}. Here is an example of a checkbox list.
  2601. @example
  2602. * TODO Organize party [3/6]
  2603. - call people [1/3]
  2604. - [ ] Peter
  2605. - [X] Sarah
  2606. - [ ] Sam
  2607. - [X] order food
  2608. - [ ] think about what music to play
  2609. - [X] talk to the neighbors
  2610. @end example
  2611. @cindex statistics, for checkboxes
  2612. @cindex checkbox statistics
  2613. The @samp{[3/6]} and @samp{[1/3]} in the first and second line are
  2614. cookies indicating how many checkboxes are present in this entry, and
  2615. how many of them have been checked off. This can give you an idea on
  2616. how many checkboxes remain, even without opening a folded entry. The
  2617. cookies can be placed into a headline or into (the first line of) a
  2618. plain list item. Each cookie covers all checkboxes structurally below
  2619. that headline/item. You have to insert the cookie yourself by typing
  2620. either @samp{[/]} or @samp{[%]}. In the first case you get an @samp{n
  2621. out of m} result, in the second case you get information about the
  2622. percentage of checkboxes checked (in the above example, this would be
  2623. @samp{[50%]} and @samp{[33%], respectively}).
  2624. @noindent The following commands work with checkboxes:
  2625. @table @kbd
  2626. @kindex C-c C-c
  2627. @item C-c C-c
  2628. Toggle checkbox at point. With prefix argument, set it to @samp{[-]},
  2629. which is considered to be an intermediate state.
  2630. @kindex C-c C-x C-b
  2631. @item C-c C-x C-b
  2632. Toggle checkbox at point.
  2633. @itemize @minus
  2634. @item
  2635. If there is an active region, toggle the first checkbox in the region
  2636. and set all remaining boxes to the same status as the first. If you
  2637. want to toggle all boxes in the region independently, use a prefix
  2638. argument.
  2639. @item
  2640. If the cursor is in a headline, toggle checkboxes in the region between
  2641. this headline and the next (so @emph{not} the entire subtree).
  2642. @item
  2643. If there is no active region, just toggle the checkbox at point.
  2644. @end itemize
  2645. @kindex M-S-@key{RET}
  2646. @item M-S-@key{RET}
  2647. Insert a new item with a checkbox.
  2648. This works only if the cursor is already in a plain list item
  2649. (@pxref{Plain lists}).
  2650. @kindex C-c #
  2651. @item C-c #
  2652. Update the checkbox statistics in the current outline entry. When
  2653. called with a @kbd{C-u} prefix, update the entire file. Checkbox
  2654. statistic cookies are updated automatically if you toggle checkboxes
  2655. with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}. If you
  2656. delete boxes or add/change them by hand, use this command to get things
  2657. back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
  2658. @end table
  2659. @node Tags, Properties and columns, TODO items, Top
  2660. @chapter Tags
  2661. @cindex tags
  2662. @cindex headline tagging
  2663. @cindex matching, tags
  2664. @cindex sparse tree, tag based
  2665. If you wish to implement a system of labels and contexts for
  2666. cross-correlating information, an excellent way is to assign @i{tags} to
  2667. headlines. Org-mode has extensive support for using tags.
  2668. Every headline can contain a list of tags, at the end of the headline.
  2669. Tags are normal words containing letters, numbers, @samp{_}, and
  2670. @samp{@@}. Tags must be preceded and followed by a single colon; like
  2671. @samp{:WORK:}. Several tags can be specified like @samp{:WORK:URGENT:}.
  2672. @menu
  2673. * Tag inheritance:: Tags use the tree structure of the outline
  2674. * Setting tags:: How to assign tags to a headline
  2675. * Tag searches:: Searching for combinations of tags
  2676. @end menu
  2677. @node Tag inheritance, Setting tags, Tags, Tags
  2678. @section Tag inheritance
  2679. @cindex inheritance, of tags
  2680. @cindex sublevels, inclusion into tags match
  2681. @i{Tags} make use of the hierarchical structure of outline trees. If a
  2682. heading has a certain tag, all subheadings will inherit the tag as
  2683. well. For example, in the list
  2684. @example
  2685. * Meeting with the French group :WORK:
  2686. ** Summary by Frank :BOSS:NOTES:
  2687. *** TODO Prepare slides for him :ACTION:
  2688. @end example
  2689. @noindent
  2690. the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
  2691. @samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and
  2692. Org-mode finds that a certain headline matches the search criterion, it
  2693. will not check any sublevel headline, assuming that these likely also
  2694. match, and that the list of matches can become very long. This may
  2695. not be what you want, however, and you can influence inheritance and
  2696. searching using the variables @code{org-use-tag-inheritance} and
  2697. @code{org-tags-match-list-sublevels}.
  2698. @node Setting tags, Tag searches, Tag inheritance, Tags
  2699. @section Setting tags
  2700. @cindex setting tags
  2701. @cindex tags, setting
  2702. @kindex M-@key{TAB}
  2703. Tags can simply be typed into the buffer at the end of a headline.
  2704. After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
  2705. also a special command for inserting tags:
  2706. @table @kbd
  2707. @kindex C-c C-c
  2708. @item C-c C-c
  2709. @cindex completion, of tags
  2710. Enter new tags for the current headline. Org-mode will either offer
  2711. completion or a special single-key interface for setting tags, see
  2712. below. After pressing @key{RET}, the tags will be inserted and aligned
  2713. to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
  2714. tags in the current buffer will be aligned to that column, just to make
  2715. things look nice. TAGS are automatically realigned after promotion,
  2716. demotion, and TODO state changes (@pxref{TODO basics}).
  2717. @end table
  2718. Org will support tag insertion based on a @emph{list of tags}. By
  2719. default this list is constructed dynamically, containing all tags
  2720. currently used in the buffer. You may also globally specify a hard list
  2721. of tags with the variable @code{org-tag-alist}. Finally you can set
  2722. the default tags for a given file with lines like
  2723. @example
  2724. #+TAGS: @@WORK @@HOME @@TENNISCLUB
  2725. #+TAGS: Laptop Car PC Sailboat
  2726. @end example
  2727. If you have globally defined your preferred set of tags using the
  2728. variable @code{org-tag-alist}, but would like to use a dynamic tag list
  2729. in a specific file: Just add an empty TAGS option line to that file:
  2730. @example
  2731. #+TAGS:
  2732. @end example
  2733. The default support method for entering tags is minibuffer completion.
  2734. However, Org-mode also implements a much better method: @emph{fast tag
  2735. selection}. This method allows to select and deselect tags with a
  2736. single key per tag. To function efficiently, you should assign unique
  2737. keys to most tags. This can be done globally with
  2738. @lisp
  2739. (setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
  2740. @end lisp
  2741. @noindent or on a per-file basis with
  2742. @example
  2743. #+TAGS: @@WORK(w) @@HOME(h) @@TENNISCLUB(t) Laptop(l) PC(p)
  2744. @end example
  2745. @noindent
  2746. You can also group together tags that are mutually exclusive. With
  2747. curly braces@footnote{In @code{org-mode-alist} use
  2748. @code{'(:startgroup)} and @code{'(:endgroup)}, respectively. Several
  2749. groups are allowed.}
  2750. @example
  2751. #+TAGS: @{ @@WORK(w) @@HOME(h) @@TENNISCLUB(t) @} Laptop(l) PC(p)
  2752. @end example
  2753. @noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
  2754. and @samp{@@TENNISCLUB} should be selected.
  2755. @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
  2756. these lines to activate any changes.
  2757. If at least one tag has a selection key, pressing @kbd{C-c C-c} will
  2758. automatically present you with a special interface, listing inherited
  2759. tags, the tags of the current headline, and a list of all legal tags
  2760. with corresponding keys@footnote{Keys will automatically be assigned to
  2761. tags which have no configured keys.}. In this interface, you can use
  2762. the following keys:
  2763. @table @kbd
  2764. @item a-z...
  2765. Pressing keys assigned to tags will add or remove them from the list of
  2766. tags in the current line. Selecting a tag in a group of mutually
  2767. exclusive tags will turn off any other tags from that group.
  2768. @kindex @key{TAB}
  2769. @item @key{TAB}
  2770. Enter a tag in the minibuffer, even if the tag is not in the predefined
  2771. list. You will be able to complete on all tags present in the buffer.
  2772. @kindex @key{SPC}
  2773. @item @key{SPC}
  2774. Clear all tags for this line.
  2775. @kindex @key{RET}
  2776. @item @key{RET}
  2777. Accept the modified set.
  2778. @item C-g
  2779. Abort without installing changes.
  2780. @item q
  2781. If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
  2782. @item !
  2783. Turn off groups of mutually exclusive tags. Use this to (as an
  2784. exception) assign several tags from such a group.
  2785. @item C-c
  2786. Toggle auto-exit after the next change (see below).
  2787. If you are using expert mode, the first @kbd{C-c} will display the
  2788. selection window.
  2789. @end table
  2790. @noindent
  2791. This method lets you assign tags to a headline with very few keys. With
  2792. the above setup, you could clear the current tags and set @samp{@@HOME},
  2793. @samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
  2794. C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@HOME} to
  2795. @samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
  2796. alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
  2797. @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
  2798. @key{RET} @key{RET}}.
  2799. If you find that most of the time, you need only a single keypress to
  2800. modify your list of tags, set the variable
  2801. @code{org-fast-tag-selection-single-key}. Then you no longer have to
  2802. press @key{RET} to exit fast tag selection - it will immediately exit
  2803. after the first change. If you then occasionally need more keys, press
  2804. @kbd{C-c} to turn off auto-exit for the current tag selection process
  2805. (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
  2806. C-c}). If you set the variable to the value @code{expert}, the special
  2807. window is not even shown for single-key tag selection, it comes up only
  2808. when you press an extra @kbd{C-c}.
  2809. @node Tag searches, , Setting tags, Tags
  2810. @section Tag searches
  2811. @cindex tag searches
  2812. @cindex searching for tags
  2813. Once a tags system has been set up, it can be used to collect related
  2814. information into special lists.
  2815. @table @kbd
  2816. @kindex C-c \
  2817. @item C-c \
  2818. Create a sparse tree with all headlines matching a tags search. With a
  2819. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  2820. @kindex C-c a m
  2821. @item C-c a m
  2822. Create a global list of tag matches from all agenda files.
  2823. @xref{Matching tags and properties}.
  2824. @kindex C-c a M
  2825. @item C-c a M
  2826. Create a global list of tag matches from all agenda files, but check
  2827. only TODO items and force checking subitems (see variable
  2828. @code{org-tags-match-list-sublevels}).
  2829. @end table
  2830. @cindex Boolean logic, for tag searches
  2831. A @i{tags} search string can use Boolean operators @samp{&} for AND and
  2832. @samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
  2833. Parenthesis are currently not implemented. A tag may also be preceded
  2834. by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
  2835. positive selection. The AND operator @samp{&} is optional when @samp{+}
  2836. or @samp{-} is present. Examples:
  2837. @table @samp
  2838. @item +WORK-BOSS
  2839. Select headlines tagged @samp{:WORK:}, but discard those also tagged
  2840. @samp{:BOSS:}.
  2841. @item WORK|LAPTOP
  2842. Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
  2843. @item WORK|LAPTOP&NIGHT
  2844. Like before, but require the @samp{:LAPTOP:} lines to be tagged also
  2845. @samp{NIGHT}.
  2846. @end table
  2847. @cindex TODO keyword matching, with tags search
  2848. If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
  2849. can be useful to also match on the TODO keyword. This can be done by
  2850. adding a condition after a slash to a tags match. The syntax is similar
  2851. to the tag matches, but should be applied with consideration: For
  2852. example, a positive selection on several TODO keywords can not
  2853. meaningfully be combined with boolean AND. However, @emph{negative
  2854. selection} combined with AND can be meaningful. To make sure that only
  2855. lines are checked that actually have any TODO keyword, use @kbd{C-c a
  2856. M}, or equivalently start the todo part after the slash with @samp{!}.
  2857. Examples:
  2858. @table @samp
  2859. @item WORK/WAITING
  2860. Select @samp{:WORK:}-tagged TODO lines with the specific TODO
  2861. keyword @samp{WAITING}.
  2862. @item WORK/!-WAITING-NEXT
  2863. Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
  2864. nor @samp{NEXT}
  2865. @item WORK/+WAITING|+NEXT
  2866. Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
  2867. @samp{NEXT}.
  2868. @end table
  2869. @cindex regular expressions, with tags search
  2870. Any element of the tag/todo match can be a regular expression - in this
  2871. case it must be enclosed in curly braces. For example,
  2872. @samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
  2873. @samp{WORK} and any tag @i{starting} with @samp{BOSS}.
  2874. @cindex level, require for tags match
  2875. You can also require a headline to be of a certain level, by writing
  2876. instead of any TAG an expression like @samp{LEVEL=3}. For example, a
  2877. search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
  2878. have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
  2879. @node Properties and columns, Timestamps, Tags, Top
  2880. @chapter Properties and Columns
  2881. @cindex properties
  2882. Properties are a set of key-value pairs associated with an entry. There
  2883. are two main applications for properties in Org-mode. First, properties
  2884. are like tags, but with a value. For example, in a file where you
  2885. document bugs and plan releases of a piece of software, instead of using
  2886. tags like @code{:release_1:}, @code{:release_2:}, it can be more
  2887. efficient to use a property @code{RELEASE} with a value @code{1.0} or
  2888. @code{2.0}. Second, you can use properties to implement (very basic)
  2889. database capabilities in an Org-mode buffer, for example to create a
  2890. list of Music CD's you own. You can edit and view properties
  2891. conveniently in column view (@pxref{Column view}).
  2892. @menu
  2893. * Property syntax:: How properties are spelled out
  2894. * Special properties:: Access to other Org-mode features
  2895. * Property searches:: Matching property values
  2896. * Column view:: Tabular viewing and editing
  2897. * Property API:: Properties for Lisp programmers
  2898. @end menu
  2899. @node Property syntax, Special properties, Properties and columns, Properties and columns
  2900. @section Property Syntax
  2901. @cindex property syntax
  2902. @cindex drawer, for properties
  2903. Properties are key-value pairs. They need to be inserted into a special
  2904. drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
  2905. is specified on a single line, with the key (surrounded by colons)
  2906. first, and the value after it. Here is an example:
  2907. @example
  2908. * CD collection
  2909. ** Classic
  2910. *** Goldberg Variations
  2911. :PROPERTIES:
  2912. :Title: Goldberg Variations
  2913. :Composer: J.S. Bach
  2914. :Artist: Glen Gould
  2915. :Publisher: Deutsche Grammphon
  2916. :NDisks: 1
  2917. :END:
  2918. @end example
  2919. You may define the allowed values for a particular property @samp{XYZ}
  2920. by setting a property @samp{XYZ_ALL}. This special property is
  2921. @emph{inherited}, so if you set it in a level 1 entry, it will apply to
  2922. the entire tree. When allowed values are defined, setting the
  2923. corresponding property becomes easier and is less prone to typing
  2924. errors. For the example with the CD collection, we can predefine
  2925. publishers and the number of disks in a box like this:
  2926. @example
  2927. * CD collection
  2928. :PROPERTIES:
  2929. :NDisks_ALL: 1 2 3 4
  2930. :Publisher_ALL: "Deutsche Grammophon" Phillips EMI
  2931. :END:
  2932. @end example
  2933. If you want to set properties that can be inherited by any entry in a
  2934. file, use a line like
  2935. @example
  2936. #+PROPERTY: NDisks_ALL 1 2 3 4
  2937. @end example
  2938. Property values set with the global variable
  2939. @code{org-global-properties} can be inherited by all entries in all
  2940. Org-mode files.
  2941. @noindent
  2942. The following commands help to work with properties:
  2943. @table @kbd
  2944. @kindex M-@key{TAB}
  2945. @item M-@key{TAB}
  2946. After an initial colon in a line, complete property keys. All keys used
  2947. in the current file will be offered as possible completions.
  2948. @item M-x org-insert-property-drawer
  2949. Insert a property drawer into the current entry. The drawer will be
  2950. inserted early in the entry, but after the lines with planning
  2951. information like deadlines.
  2952. @kindex C-c C-c
  2953. @item C-c C-c
  2954. With the cursor in a property drawer, this executes property commands.
  2955. @item C-c C-c s
  2956. Set a property in the current entry. Both the property and the value
  2957. can be inserted using completion.
  2958. @kindex S-@key{right}
  2959. @kindex S-@key{left}
  2960. @item S-@key{left}/@key{right}
  2961. Switch property at point to the next/previous allowed value.
  2962. @item C-c C-c d
  2963. Remove a property from the current entry.
  2964. @item C-c C-c D
  2965. Globally remove a property, from all entries in the current file.
  2966. @item C-c C-c c
  2967. Compute the property at point, using the operator and scope from the
  2968. nearest column format definition.
  2969. @end table
  2970. @node Special properties, Property searches, Property syntax, Properties and columns
  2971. @section Special Properties
  2972. @cindex properties, special
  2973. Special properties provide alternative access method to Org-mode
  2974. features discussed in the previous chapters, like the TODO state or the
  2975. priority of an entry. This interface exists so that you can include
  2976. these states into columns view (@pxref{Column view}). The following
  2977. property names are special and should not be used as keys in the
  2978. properties drawer:
  2979. @example
  2980. TODO @r{The TODO keyword of the entry.}
  2981. TAGS @r{The tags defined directly in the headline.}
  2982. ALLTAGS @r{All tags, including inherited ones.}
  2983. PRIORITY @r{The priority of the entry, a string with a single letter.}
  2984. DEADLINE @r{The deadline time string, without the angular brackets.}
  2985. SCHEDULED @r{The scheduling time stamp, without the angular brackets.}
  2986. @end example
  2987. @node Property searches, Column view, Special properties, Properties and columns
  2988. @section Property searches
  2989. @cindex properties, searching
  2990. To create sparse trees and special lists with selection based on
  2991. properties, the same commands are used as for tag searches (@pxref{Tag
  2992. searches}), and the same logic applies. For example, a search string
  2993. @example
  2994. +WORK-BOSS+PRIORITY="A"+coffee="unlimited"+with=@{Sarah\|Denny@}
  2995. @end example
  2996. @noindent
  2997. finds entries tagged @samp{:WORK:} but not @samp{:BOSS:}, which
  2998. also have a priority value @samp{A}, a @samp{:coffee:} property with the
  2999. value @samp{unlimited}, and a @samp{:with:} property that is matched by
  3000. the regular expression @samp{Sarah\|Denny}.
  3001. @node Column view, Property API, Property searches, Properties and columns
  3002. @section Column View
  3003. A great way to view and edit properties in an outline tree is
  3004. @emph{column view}. In column view, each outline item is turned into a
  3005. table row. Columns in this table provide access to properties of the
  3006. entries. Org-mode implements columns by overlaying a tabular structure
  3007. over the headline of each item. While the headlines have been turned
  3008. into a table row, you can still change the visibility of the outline
  3009. tree. For example, you get a compact table by switching to CONTENTS
  3010. view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
  3011. is active), but you can still open, read, and edit the entry below each
  3012. headline. Or, you can switch to column view after executing a sparse
  3013. tree command and in this way get a table only for the selected items.
  3014. Column view also works in agenda buffers (@pxref{Agenda views}) where
  3015. queries have collected selected items, possibly from a number of files.
  3016. @menu
  3017. * Defining columns:: The COLUMNS format property
  3018. * Using column view:: How to create and use column view
  3019. @end menu
  3020. @node Defining columns, Using column view, Column view, Column view
  3021. @subsection Defining Columns
  3022. @cindex column view, for properties
  3023. @cindex properties, column view
  3024. Setting up a column view first requires defining the columns. This is
  3025. done by defining a column format line.
  3026. @menu
  3027. * Scope of column definitions:: Where defined, where valid?
  3028. * Column attributes:: Appearance and content of a column
  3029. @end menu
  3030. @node Scope of column definitions, Column attributes, Defining columns, Defining columns
  3031. @subsubsection Scope of column definitions
  3032. To define a column format for an entire file, use a line like
  3033. @example
  3034. #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3035. @end example
  3036. To specify a format that only applies to a specific tree, add a COLUMNS
  3037. property to the top node of that tree, for example
  3038. @example
  3039. ** Top node for columns view
  3040. :PROPERTIES:
  3041. :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3042. :END:
  3043. @end example
  3044. If a @code{COLUMNS} property is present in an entry, it defines columns
  3045. for the entry itself, and for the entire subtree below it. Since the
  3046. column definition is part of the hierarchical structure of the document,
  3047. you can define columns on level 1 that are general enough for all
  3048. sublevels, and more specific columns further down, when you edit a
  3049. deeper part of the tree.
  3050. @node Column attributes, , Scope of column definitions, Defining columns
  3051. @subsubsection Column attributes
  3052. A column definition sets the attributes of a column. The general
  3053. definition looks like this:
  3054. @example
  3055. %[width]property[(title)][@{summary-type@}]
  3056. @end example
  3057. @noindent
  3058. Except for the percent sign and the property name, all items are
  3059. optional. The individual parts have the following meaning:
  3060. @example
  3061. width @r{An integer specifying the width of the column in characters.}
  3062. @r{If omitted, the width will be determined automatically.}
  3063. property @r{The property that should be edited in this column.}
  3064. (title) @r{The header text for the column. If omitted, the}
  3065. @r{property name is used.}
  3066. @{summary-type@} @r{The summary type. If specified, the column values for}
  3067. @r{parent nodes are computed from the children.}
  3068. @r{Supported summary types are:}
  3069. @{+@} @r{Sum numbers in this column.}
  3070. @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
  3071. @{X@} @r{Checkbox status, [X] if all children are [X].}
  3072. @end example
  3073. @noindent
  3074. Here is an example for a complete columns definition, along with allowed
  3075. values.
  3076. @example
  3077. :COLUMNS: %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status %10Time_Spent@{:@}
  3078. :Owner_ALL: Tammy Mark Karl Lisa Don
  3079. :Status_ALL: "In progress" "Not started yet" "Finished" ""
  3080. :Approved_ALL: "[ ]" "[X]"
  3081. @end example
  3082. The first column, @samp{%25ITEM}, means the first 25 characters of the
  3083. item itself, i.e. of the headline. You probably always should start the
  3084. column definition with the ITEM specifier. The other specifiers create
  3085. columns @samp{Owner} with a list of names as allowed values, for
  3086. @samp{Status} with four different possible values, and for a checkbox
  3087. field @samp{Approved}. When no width is given after the @samp{%}
  3088. character, the column will be exactly as wide as it needs to be in order
  3089. to fully display all values. The @samp{Approved} column does have a
  3090. modified title (@samp{Approved?}, with a question mark). Summaries will
  3091. be created for the @samp{Time_Spent} column by adding time duration
  3092. expressions like HH:MM, and for the @samp{Approved} column, by providing
  3093. an @samp{[X]} status if all children have been checked.
  3094. @node Using column view, , Defining columns, Column view
  3095. @subsection Using Column View
  3096. @table @kbd
  3097. @tsubheading{Turning column view on and off}
  3098. @kindex C-c C-x C-c
  3099. @item C-c C-x C-c
  3100. Create the column view for the local environment. This command searches
  3101. the hierarchy, up from point, for a @code{COLUMNS} property that defines
  3102. a format. When one is found, the column view table is established for
  3103. the entire tree, starting from the entry that contains the @code{COLUMNS}
  3104. property. If none is found, the format is taken from the @code{#+COLUMNS}
  3105. line or from the variable @code{org-columns-default-format}, and column
  3106. view is established for the current entry and its subtree.
  3107. @kindex q
  3108. @item q
  3109. Exit column view.
  3110. @tsubheading{Editing values}
  3111. @item @key{left} @key{right} @key{up} @key{down}
  3112. Move through the column view from field to field.
  3113. @kindex S-@key{left}
  3114. @kindex S-@key{right}
  3115. @item S-@key{left}/@key{right}
  3116. Switch to the next/previous allowed value of the field. For this, you
  3117. have to have specified allowed values for a property.
  3118. @kindex n
  3119. @kindex p
  3120. @itemx n / p
  3121. Same as @kbd{S-@key{left}/@key{right}}
  3122. @kindex e
  3123. @item e
  3124. Edit the property at point. For the special properties, this will
  3125. invoke the same interface that you normally use to change that
  3126. property. For example, when editing a TAGS property, the tag completion
  3127. or fast selection interface will pop up.
  3128. @kindex v
  3129. @item v
  3130. View the full value of this property. This is useful if the width of
  3131. the column is smaller than that of the value.
  3132. @kindex a
  3133. @item a
  3134. Edit the list of allowed values for this property. If the list is found
  3135. in the hierarchy, the modified values is stored there. If no list is
  3136. found, the new value is stored in the first entry that is part of the
  3137. current column view.
  3138. @tsubheading{Modifying the table structure}
  3139. @kindex <
  3140. @kindex >
  3141. @item < / >
  3142. Make the column narrower/wider by one character.
  3143. @kindex S-M-@key{right}
  3144. @item S-M-@key{right}
  3145. Insert a new column, to the right of the current column.
  3146. @kindex S-M-@key{left}
  3147. @item S-M-@key{left}
  3148. Delete the current column.
  3149. @end table
  3150. @node Property API, , Column view, Properties and columns
  3151. @section The Property API
  3152. @cindex properties, API
  3153. @cindex API, for properties
  3154. There is a full API for accessing and changing properties. This API can
  3155. be used by Emacs Lisp programs to work with properties and to implement
  3156. features based on them. For more information see @ref{Using the
  3157. property API}.
  3158. @node Timestamps, Remember, Properties and columns, Top
  3159. @chapter Timestamps
  3160. @cindex time stamps
  3161. @cindex date stamps
  3162. Items can be labeled with timestamps to make them useful for project
  3163. planning.
  3164. @menu
  3165. * Time stamps:: Assigning a time to a tree entry
  3166. * Creating timestamps:: Commands which insert timestamps
  3167. * Deadlines and scheduling:: Planning your work
  3168. * Clocking work time::
  3169. @end menu
  3170. @node Time stamps, Creating timestamps, Timestamps, Timestamps
  3171. @section Time stamps, deadlines and scheduling
  3172. @cindex time stamps
  3173. @cindex ranges, time
  3174. @cindex date stamps
  3175. @cindex deadlines
  3176. @cindex scheduling
  3177. A time stamp is a specification of a date (possibly with time or a range
  3178. of times) in a special format, either @samp{<2003-09-16 Tue>} or
  3179. @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
  3180. 12:00-12:30>}@footnote{This is the standard ISO date/time format. If
  3181. you cannot get used to these, see @ref{Custom time format}}. A time
  3182. stamp can appear anywhere in the headline or body of an org-tree entry.
  3183. Its presence causes entries to be shown on specific dates in the agenda
  3184. (@pxref{Weekly/Daily agenda}). We distinguish:
  3185. @table @var
  3186. @item Plain time stamp, Event, Appointment
  3187. @cindex timestamp
  3188. A simple time stamp just assigns a date/time to an item. This is just
  3189. like writing down an appointment or event in a paper agenda. In the
  3190. timeline and agenda displays, the headline of an entry associated with a
  3191. plain time stamp will be shown exactly on that date.
  3192. @example
  3193. * Meet Peter at the movies <2006-11-01 Wed 19:15>
  3194. * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
  3195. @end example
  3196. @item Time stamp with repeater interval
  3197. @cindex timestamp, with repeater interval
  3198. A time stamp may contain a @emph{repeater interval}, indicating that it
  3199. applies not only on the given date, but again and again after a certain
  3200. interval of N days (d), weeks (w), months(m), or years(y). The
  3201. following will show up in the agenda every Wednesday:
  3202. @example
  3203. * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
  3204. @end example
  3205. @item Diary-style sexp entries
  3206. For more complex date specifications, Org-mode supports using the
  3207. special sexp diary entries implemented in the Emacs calendar/diary
  3208. package. For example
  3209. @example
  3210. * The nerd meeting on every 2nd Thursday of the month
  3211. <%%(diary-float t 4 2)>
  3212. @end example
  3213. @item Time/Date range
  3214. @cindex timerange
  3215. @cindex date range
  3216. Two time stamps connected by @samp{--} denote a range. The headline
  3217. will be shown on the first and last day of the range, and on any dates
  3218. that are displayed and fall in the range. Here is an example:
  3219. @example
  3220. ** Meeting in Amsterdam
  3221. <2004-08-23 Mon>--<2004-08-26 Thu>
  3222. @end example
  3223. @item Inactive time stamp
  3224. @cindex timestamp, inactive
  3225. @cindex inactive timestamp
  3226. Just like a plain time stamp, but with square brackets instead of
  3227. angular ones. These time stamps are inactive in the sense that they do
  3228. @emph{not} trigger an entry to show up in the agenda.
  3229. @example
  3230. * Gillian comes late for the fifth time [2006-11-01 Wed]
  3231. @end example
  3232. @end table
  3233. @node Creating timestamps, Deadlines and scheduling, Time stamps, Timestamps
  3234. @section Creating timestamps
  3235. @cindex creating timestamps
  3236. @cindex timestamps, creating
  3237. For Org-mode to recognize time stamps, they need to be in the specific
  3238. format. All commands listed below produce time stamps in the correct
  3239. format.
  3240. @table @kbd
  3241. @kindex C-c .
  3242. @item C-c .
  3243. Prompt for a date and insert a corresponding time stamp. When the
  3244. cursor is at a previously used time stamp, it is updated to NOW. When
  3245. this command is used twice in succession, a time range is inserted.
  3246. @c
  3247. @kindex C-u C-c .
  3248. @item C-u C-c .
  3249. Like @kbd{C-c .}, but use the alternative format which contains date
  3250. and time. The default time can be rounded to multiples of 5 minutes,
  3251. see the option @code{org-time-stamp-rounding-minutes}.
  3252. @c
  3253. @kindex C-c !
  3254. @item C-c !
  3255. Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
  3256. an agenda entry.
  3257. @c
  3258. @kindex C-c <
  3259. @item C-c <
  3260. Insert a time stamp corresponding to the cursor date in the Calendar.
  3261. @c
  3262. @kindex C-c >
  3263. @item C-c >
  3264. Access the Emacs calendar for the current date. If there is a
  3265. timestamp in the current line, goto the corresponding date
  3266. instead.
  3267. @c
  3268. @kindex C-c C-o
  3269. @item C-c C-o
  3270. Access the agenda for the date given by the time stamp or -range at
  3271. point (@pxref{Weekly/Daily agenda}).
  3272. @c
  3273. @kindex S-@key{left}
  3274. @kindex S-@key{right}
  3275. @item S-@key{left}
  3276. @itemx S-@key{right}
  3277. Change date at cursor by one day. These key bindings conflict with
  3278. CUA-mode (@pxref{Conflicts}).
  3279. @c
  3280. @kindex S-@key{up}
  3281. @kindex S-@key{down}
  3282. @item S-@key{up}
  3283. @itemx S-@key{down}
  3284. Change the item under the cursor in a timestamp. The cursor can be on a
  3285. year, month, day, hour or minute. Note that if the cursor is in a
  3286. headline and not at a time stamp, these same keys modify the priority of
  3287. an item. (@pxref{Priorities}). The key bindings also conflict with
  3288. CUA-mode (@pxref{Conflicts}).
  3289. @c
  3290. @kindex C-c C-y
  3291. @cindex evaluate time range
  3292. @item C-c C-y
  3293. Evaluate a time range by computing the difference between start and
  3294. end. With prefix arg, insert result after the time range (in a table:
  3295. into the following column).
  3296. @end table
  3297. @menu
  3298. * The date/time prompt:: How org-mode helps you entering date and time
  3299. * Custom time format:: Making dates look differently
  3300. @end menu
  3301. @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
  3302. @subsection The date/time prompt
  3303. @cindex date, reading in minibuffer
  3304. @cindex time, reading in minibuffer
  3305. When Org-mode prompts for a date/time, the prompt suggests to enter an
  3306. ISO date. But it will in fact accept any string containing some date
  3307. and/or time information. You can, for example, use @kbd{C-y} to paste a
  3308. (possibly multi-line) string copied from an email message. Org-mode
  3309. will find whatever information is in there and will replace anything not
  3310. specified with the current date and time. For example:
  3311. @example
  3312. 3-2-5 --> 2003-02-05
  3313. feb 15 --> currentyear-02-15
  3314. sep 12 9 --> 2009-09-12
  3315. 12:45 --> today 12:45
  3316. 22 sept 0:34 --> currentyear-09-22 0:34
  3317. 12 --> currentyear-currentmonth-12
  3318. Fri --> nearest Friday (today or later)
  3319. +4 --> 4 days from now (if +N is the only thing given)
  3320. @end example
  3321. The function understands English month and weekday abbreviations. If
  3322. you want to use unabbreviated names and/or other languages, configure
  3323. the variables @code{parse-time-months} and @code{parse-time-weekdays}.
  3324. @cindex calendar, for selecting date
  3325. Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
  3326. you don't need/want the calendar, configure the variable
  3327. @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
  3328. prompt, either by clicking on a date in the calendar, or by pressing
  3329. @key{RET}, the date selected in the calendar will be combined with the
  3330. information entered at the prompt. You can control the calendar fully
  3331. from the minibuffer:
  3332. @table @kbd
  3333. @kindex <
  3334. @item <
  3335. Scroll calendar backwards by one month.
  3336. @kindex >
  3337. @item >
  3338. Scroll calendar forwards by one month.
  3339. @kindex mouse-1
  3340. @item mouse-1
  3341. Select date by clicking on it.
  3342. @kindex S-@key{right}
  3343. @item S-@key{right}
  3344. One day forward.
  3345. @kindex S-@key{left}
  3346. @item S-@key{left}
  3347. One day back.
  3348. @kindex S-@key{down}
  3349. @item S-@key{down}
  3350. One week forward.
  3351. @kindex S-@key{up}
  3352. @item S-@key{up}
  3353. One week back.
  3354. @kindex M-S-@key{right}
  3355. @item M-S-@key{right}
  3356. One month forward.
  3357. @kindex M-S-@key{left}
  3358. @item M-S-@key{left}
  3359. One month back.
  3360. @kindex @key{RET}
  3361. @item @key{RET}
  3362. Choose date in calendar (only if nothing was typed into minibuffer).
  3363. @end table
  3364. @node Custom time format, , The date/time prompt, Creating timestamps
  3365. @subsection Custom time format
  3366. @cindex custom date/time format
  3367. @cindex time format, custom
  3368. @cindex date format, custom
  3369. Org-mode uses the standard ISO notation for dates and times as it is
  3370. defined in ISO 8601. If you cannot get used to this and require another
  3371. representation of date and time to keep you happy, you can get it by
  3372. customizing the variables @code{org-display-custom-times} and
  3373. @code{org-time-stamp-custom-formats}.
  3374. @table @kbd
  3375. @kindex C-c C-x C-t
  3376. @item C-c C-x C-t
  3377. Toggle the display of custom formats for dates and times.
  3378. @end table
  3379. @noindent
  3380. Org-mode needs the default format for scanning, so the custom date/time
  3381. format does not @emph{replace} the default format - instead it is put
  3382. @emph{over} the default format using text properties. This has the
  3383. following consequences:
  3384. @itemize @bullet
  3385. @item
  3386. You cannot place the cursor onto a time stamp anymore, only before or
  3387. after.
  3388. @item
  3389. The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
  3390. each component of a time stamp. If the cursor is at the beginning of
  3391. the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
  3392. just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
  3393. time will be changed by one minute.
  3394. @item
  3395. If the time stamp contains a range of clock times or a repeater, these
  3396. will not be overlayed, but remain in the buffer as they were.
  3397. @item
  3398. When you delete a time stamp character-by-character, it will only
  3399. disappear from the buffer after @emph{all} (invisible) characters
  3400. belonging to the ISO timestamp have been removed.
  3401. @item
  3402. If the custom time stamp format is longer than the default and you are
  3403. using dates in tables, table alignment will be messed up. If the custom
  3404. format is shorter, things do work as expected.
  3405. @end itemize
  3406. @node Deadlines and scheduling, Clocking work time, Creating timestamps, Timestamps
  3407. @section Deadlines and Scheduling
  3408. A time stamp may be preceded by special keywords to facilitate planning
  3409. of work:
  3410. @table @var
  3411. @item DEADLINE
  3412. @cindex DEADLINE keyword
  3413. The task (most likely a TODO item) is supposed to be finished on that
  3414. date, and it will be listed then. In addition, the compilation for
  3415. @emph{today} will carry a warning about the approaching or missed
  3416. deadline, starting @code{org-deadline-warning-days} before the due date,
  3417. and continuing until the entry is marked DONE. An example:
  3418. @example
  3419. *** TODO write article about the Earth for the Guide
  3420. The editor in charge is [[bbdb:Ford Prefect]]
  3421. DEADLINE: <2004-02-29 Sun>
  3422. @end example
  3423. You can specify a different lead time for warnings for a specific
  3424. deadlines using the following syntax. Here is an example with a warning
  3425. period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
  3426. @item SCHEDULED
  3427. @cindex SCHEDULED keyword
  3428. You are planning to start working on that task on the given date. The
  3429. headline will be listed under the given date@footnote{It will still be
  3430. listed on that date after it has been marked DONE. If you don't like
  3431. this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
  3432. addition, a reminder that the scheduled date has passed will be present
  3433. in the compilation for @emph{today}, until the entry is marked DONE.
  3434. I.e., the task will automatically be forwarded until completed.
  3435. @example
  3436. *** TODO Call Trillian for a date on New Years Eve.
  3437. SCHEDULED: <2004-12-25 Sat>
  3438. @end example
  3439. @noindent
  3440. @b{Important:} Scheduling an item in Org-mode should @i{not} be
  3441. understood like @i{Scheduling a meeting}. Setting a date for a meeting
  3442. is just a simple appointment, you should mark this entry with a simple
  3443. plain time stamp, to get this item shown on the date where it applies.
  3444. This is a frequent mis-understanding from Org-users. In Org-mode,
  3445. @i{Scheduling} means setting a date when you want to start working on an
  3446. action item.
  3447. @end table
  3448. @menu
  3449. * Inserting deadline/schedule:: Planning items
  3450. * Repeated tasks:: Items that show up again and again
  3451. @end menu
  3452. @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
  3453. @subsection Inserting deadline/schedule
  3454. The following commands allow to quickly insert a deadline or to schedule
  3455. an item:
  3456. @table @kbd
  3457. @c
  3458. @kindex C-c C-d
  3459. @item C-c C-d
  3460. Insert @samp{DEADLINE} keyword along with a stamp. The insertion will
  3461. happen in the line directly following the headline. When called with a
  3462. prefix arg, an existing deadline will be removed from the entry.
  3463. @c FIXME Any CLOSED timestamp will be removed.????????
  3464. @c
  3465. @kindex C-c C-w
  3466. @cindex sparse tree, for deadlines
  3467. @item C-c C-w
  3468. Create a sparse tree with all deadlines that are either past-due, or
  3469. which will become due within @code{org-deadline-warning-days}.
  3470. With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
  3471. prefix, check that many days. For example, @kbd{C-1 C-c C-w} shows
  3472. all deadlines due tomorrow.
  3473. @c
  3474. @kindex C-c C-s
  3475. @item C-c C-s
  3476. Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
  3477. happen in the line directly following the headline. Any CLOSED
  3478. timestamp will be removed. When called with a prefix argument, remove
  3479. the scheduling date from the entry.
  3480. @end table
  3481. @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
  3482. @subsection Repeated Tasks
  3483. Some tasks need to be repeated again and again, and Org-mode therefore
  3484. allows to use a repeater in a DEADLINE or SCHEDULED time stamp, for
  3485. example:
  3486. @example
  3487. ** TODO Pay the rent
  3488. DEADLINE: <2005-10-01 Sat +1m>
  3489. @end example
  3490. Deadlines and scheduled items produce entries in the agenda when they
  3491. are over-due, so it is important to be able to mark such an entry as
  3492. completed once you have done so. When you mark a DEADLINE or a SCHEDULE
  3493. with the todo keyword DONE, it will no longer produce entries in the
  3494. agenda. The problem with this is, however, that then also the
  3495. @emph{next} instance of the repeated entry will not be active. Org-mode
  3496. deals with this in the following way: When you try to mark such an entry
  3497. DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
  3498. time stamp by the repeater interval, and immediately set the entry state
  3499. back to TODO. In the example above, setting the state to DONE would
  3500. actually switch the date like this:
  3501. @example
  3502. ** TODO Pay the rent
  3503. DEADLINE: <2005-11-01 Tue +1m>
  3504. @end example
  3505. You will also be prompted for a note@footnote{You can change this using
  3506. the option @code{org-log-repeat}, or the @code{#+STARTUP} options
  3507. @code{logrepeat} and @code{nologrepeat}.} that will be put under the
  3508. DEADLINE line to keep a record that you actually acted on the previous
  3509. instance of this deadline.
  3510. As a consequence of shifting the base date, this entry will no longer be
  3511. visible in the agenda when checking past dates, but all future instances
  3512. will be visible.
  3513. You may have both scheduling and deadline information for a specific
  3514. task - just make sure that the repeater intervals on both are the same.
  3515. @node Clocking work time, , Deadlines and scheduling, Timestamps
  3516. @section Clocking work time
  3517. Org-mode allows you to clock the time you spent on specific tasks in a
  3518. project. When you start working on an item, you can start the clock.
  3519. When you stop working on that task, or when you mark the task done, the
  3520. clock is stopped and the corresponding time interval is recorded. It
  3521. also computes the total time spent on each subtree of a project.
  3522. @table @kbd
  3523. @kindex C-c C-x C-i
  3524. @item C-c C-x C-i
  3525. Start the clock on the current item (clock-in). This inserts the CLOCK
  3526. keyword together with a timestamp. If this is not the first clocking of
  3527. this item, the multiple CLOCK lines will be wrapped into a
  3528. @code{:CLOCK:} drawer (see also the variable
  3529. @code{org-clock-into-drawer}.
  3530. @kindex C-c C-x C-o
  3531. @item C-c C-x C-o
  3532. Stop the clock (clock-out). The inserts another timestamp at the same
  3533. location where the clock was last started. It also directly computes
  3534. the resulting time in inserts it after the time range as @samp{=>
  3535. HH:MM}. See the variable @code{org-log-done} for the possibility to
  3536. record an additional note together with the clock-out time
  3537. stamp@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:
  3538. lognoteclock-out}}.
  3539. @kindex C-c C-y
  3540. @item C-c C-y
  3541. Recompute the time interval after changing one of the time stamps. This
  3542. is only necessary if you edit the time stamps directly. If you change
  3543. them with @kbd{S-@key{cursor}} keys, the update is automatic.
  3544. @kindex C-c C-t
  3545. @item C-c C-t
  3546. Changing the TODO state of an item to DONE automatically stops the clock
  3547. if it is running in this same item.
  3548. @kindex C-c C-x C-x
  3549. @item C-c C-x C-x
  3550. Cancel the current clock. This is useful if a clock was started by
  3551. mistake, or if you ended up working on something else.
  3552. @kindex C-c C-x C-j
  3553. @item C-c C-x C-j
  3554. Jump to the entry that contains the currently running clock, an another
  3555. window.
  3556. @kindex C-c C-x C-d
  3557. @item C-c C-x C-d
  3558. Display time summaries for each subtree in the current buffer. This
  3559. puts overlays at the end of each headline, showing the total time
  3560. recorded under that heading, including the time of any subheadings. You
  3561. can use visibility cycling to study the tree, but the overlays disappear
  3562. when you change the buffer (see variable
  3563. @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
  3564. @kindex C-c C-x C-r
  3565. @item C-c C-x C-r
  3566. Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
  3567. report as an org-mode table into the current file.
  3568. @example
  3569. #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
  3570. #+END: clocktable
  3571. @end example
  3572. @noindent
  3573. If such a block already exists at point, its content is replaced by the
  3574. new table. The @samp{BEGIN} line can specify options:
  3575. @example
  3576. :maxlevel @r{Maximum level depth to which times are listed in the table.}
  3577. :emphasize @r{When @code{t}, emphasize level one and level two items}
  3578. :scope @r{The scope to consider. This can be any of the following:}
  3579. nil @r{the current buffer or narrowed region}
  3580. file @r{the full current buffer}
  3581. subtree @r{the subtree where the clocktable is located}
  3582. treeN @r{the surrounding level N tree, for example @code{tree3}}
  3583. tree @r{the surrounding level 1 tree}
  3584. agenda @r{all agenda files}
  3585. ("file"..) @r{scan these files}
  3586. :block @r{The time block to consider. This block is specified relative}
  3587. @r{to the current time and may be any of these keywords:}
  3588. @r{@code{today}, @code{yesterday}, @code{thisweek}, @code{lastweek},}
  3589. @r{@code{thismonth}, @code{lastmonth}, @code{thisyear}, or @code{lastyear}}.
  3590. :tstart @r{A time string specifying when to start considering times}
  3591. :tend @r{A time string specifying when to stop considering times}
  3592. @end example
  3593. So to get a clock summary of the current level 1 tree, for the current
  3594. day, you could write
  3595. @example
  3596. #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1
  3597. #+END: clocktable
  3598. @end example
  3599. and to use a specific time range you could write@footnote{Note that all
  3600. parameters must be specified in a single line - the line is broken here
  3601. only to fit it onto the manual.}
  3602. @example
  3603. #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
  3604. :tend "<2006-08-10 Thu 12:00>"
  3605. #+END: clocktable
  3606. @end example
  3607. @kindex C-c C-c
  3608. @item C-c C-c
  3609. @kindex C-c C-x C-u
  3610. @itemx C-c C-x C-u
  3611. Update dynamical block at point. The cursor needs to be in the
  3612. @code{#+BEGIN} line of the dynamic block.
  3613. @kindex C-u C-c C-x C-u
  3614. @item C-u C-c C-x C-u
  3615. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  3616. you have several clocktable blocks in a buffer.
  3617. @end table
  3618. The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
  3619. the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
  3620. worked on or closed during a day.
  3621. @node Remember, Agenda views, Timestamps, Top
  3622. @chapter Remember
  3623. @cindex @file{remember.el}
  3624. The @i{Remember} package by John Wiegley lets you store quick notes with
  3625. little interruption of your work flow. See
  3626. @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
  3627. information. It is an excellent way to add new notes and TODO items to
  3628. Org-mode files. Org-mode significantly expands the possibilities of
  3629. @i{remember}: You may define templates for different note types, and to
  3630. associate target files and headlines with specific templates. It also
  3631. allows you to select the location where a note should be stored
  3632. interactively, on the fly.
  3633. @menu
  3634. * Setting up remember:: Some code for .emacs to get things going
  3635. * Remember templates:: Define the outline of different note types
  3636. * Storing notes:: Directly get the note to where it belongs
  3637. @end menu
  3638. @node Setting up remember, Remember templates, Remember, Remember
  3639. @section Setting up remember
  3640. The following customization will tell @i{remember} to use org files as
  3641. target, and to create annotations compatible with Org-mode links.
  3642. @example
  3643. (setq org-directory "~/path/to/my/orgfiles/")
  3644. (setq org-default-notes-file (concat org-directory "/notes.org"))
  3645. (setq remember-annotation-functions '(org-remember-annotation))
  3646. (setq remember-handler-functions '(org-remember-handler))
  3647. (add-hook 'remember-mode-hook 'org-remember-apply-template)
  3648. @end example
  3649. @node Remember templates, Storing notes, Setting up remember, Remember
  3650. @section Remember templates
  3651. @cindex templates, for remember
  3652. In combination with Org-mode, you can use templates to generate
  3653. different types of @i{remember} notes. For example, if you would like
  3654. to use one template to create general TODO entries, another one for
  3655. journal entries, and a third one for collecting random ideas, you could
  3656. use:
  3657. @example
  3658. (setq org-remember-templates
  3659. '((?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
  3660. (?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
  3661. (?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  3662. @end example
  3663. @noindent In these entries, the character specifies how to select the
  3664. template. The first string specifies the template. Two more (optional)
  3665. strings give the file in which, and the headline under which the new
  3666. note should be stored. The file defaults (if not present or @code{nil})
  3667. to @code{org-default-notes-file}, the heading to
  3668. @code{org-remember-default-headline}. Both defaults help to get to the
  3669. storing location quickly, but you can change the location interactively
  3670. while storing the note.
  3671. When you call @kbd{M-x remember} (or @kbd{M-x org-remember}) to remember
  3672. something, org will prompt for a key to select the template (if you have
  3673. more than one template) and then prepare the buffer like
  3674. @example
  3675. * TODO
  3676. [[file:link to where you called remember]]
  3677. @end example
  3678. @noindent or
  3679. @example
  3680. * [2006-03-21 Tue 15:37]
  3681. [[file:link to where you called remember]]
  3682. @end example
  3683. @noindent
  3684. During expansion of the template, special @kbd{%}-escapes allow dynamic
  3685. insertion of content:
  3686. @example
  3687. %^@{prompt@} @r{prompt the user for a string and replace this sequence with it.}
  3688. %t @r{time stamp, date only}
  3689. %T @r{time stamp with date and time}
  3690. %u, %U @r{like the above, but inactive time stamps}
  3691. %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
  3692. @r{You may define a prompt like @code{%^@{Birthday@}t}}
  3693. %n @r{user name (taken from @code{user-full-name})}
  3694. %a @r{annotation, normally the link created with @code{org-store-link}}
  3695. %A @r{like @code{%a}, but prompt for the description part}
  3696. %i @r{initial content, the region when remember is called with C-u.}
  3697. @r{The entire text will be indented like @code{%i} itself.}
  3698. %^g @r{prompt for tags, with completion on tags in target file.}
  3699. %^G @r{prompt for tags, with completion all tags in all agenda files.}
  3700. %:keyword @r{specific information for certain link types, see below}
  3701. @end example
  3702. @noindent
  3703. For specific link types, the following keywords will be
  3704. defined@footnote{If you define your own link types (@pxref{Adding
  3705. hyperlink types}), any property you store with
  3706. @code{org-store-link-props} can be accessed in remember templates in a
  3707. similar way.}:
  3708. @example
  3709. Link type | Available keywords
  3710. -------------------+----------------------------------------------
  3711. bbdb | %:name %:company
  3712. vm, wl, mh, rmail | %:type %:subject %:message-id
  3713. | %:from %:fromname %:fromaddress
  3714. | %:to %:toname %:toaddress
  3715. | %: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}.}}
  3716. gnus | %:group, @r{for messages also all email fields}
  3717. w3, w3m | %:url
  3718. info | %:file %:node
  3719. calendar | %:date"
  3720. @end example
  3721. @noindent
  3722. To place the cursor after template expansion use:
  3723. @example
  3724. %? @r{After completing the template, position cursor here.}
  3725. @end example
  3726. @noindent
  3727. If you change you mind about which template to use, call
  3728. @code{org-remember} in the remember buffer. You may then select a new
  3729. template that will be filled with the previous context information.
  3730. @node Storing notes, , Remember templates, Remember
  3731. @section Storing notes
  3732. When you are finished preparing a note with @i{remember}, you have to press
  3733. @kbd{C-c C-c} to file the note away. The handler will store the note in
  3734. the file and under the headline specified in the template, or it will
  3735. use the default file and headlines. The window configuration will be
  3736. restored, and you are back in the working context before the call to
  3737. @code{remember}. To re-use the location found during the last call to
  3738. @code{remember}, exit the remember buffer with @kbd{C-u C-u C-c C-c},
  3739. i.e. specify a double prefix argument to @kbd{C-c C-c}.
  3740. If you want to store the note to a different place, use @kbd{C-u C-c
  3741. C-c} instead to exit remember@footnote{Configure the variable
  3742. @code{org-remember-store-without-prompt} to make this behavior the
  3743. default.}. The handler will then first prompt for a target file - if you
  3744. press @key{RET}, the value specified for the template is used. Then the
  3745. command offers the headings tree of the selected file, with the cursor
  3746. position at the default headline (if you had specified one in the
  3747. template). You can either immediately press @key{RET} to get the note
  3748. placed there. Or you can use the following keys to find a different
  3749. location:
  3750. @example
  3751. @key{TAB} @r{Cycle visibility.}
  3752. @key{down} / @key{up} @r{Next/previous visible headline.}
  3753. n / p @r{Next/previous visible headline.}
  3754. f / b @r{Next/previous headline same level.}
  3755. u @r{One level up.}
  3756. @c 0-9 @r{Digit argument.}
  3757. @end example
  3758. @noindent
  3759. Pressing @key{RET} or @key{left} or @key{right}
  3760. then leads to the following result.
  3761. @multitable @columnfractions 0.2 0.15 0.65
  3762. @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
  3763. @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
  3764. @item @tab @tab depending on @code{org-reverse-note-order}.
  3765. @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
  3766. @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
  3767. @item @tab @tab depending on @code{org-reverse-note-order}.
  3768. @item not on headline @tab @key{RET}
  3769. @tab at cursor position, level taken from context.
  3770. @end multitable
  3771. Before inserting the text into a tree, the function ensures that the
  3772. text has a headline, i.e. a first line that starts with a @samp{*}. If
  3773. not, a headline is constructed from the current date and some additional
  3774. data. If you have indented the text of the note below the headline, the
  3775. indentation will be adapted if inserting the note into the tree requires
  3776. demotion from level 1.
  3777. @node Agenda views, Embedded LaTeX, Remember, Top
  3778. @chapter Agenda Views
  3779. @cindex agenda views
  3780. Due to the way Org-mode works, TODO items, time-stamped items, and
  3781. tagged headlines can be scattered throughout a file or even a number of
  3782. files. To get an overview over open action items, or over events that
  3783. are important for a particular date, this information must be collected,
  3784. sorted and displayed in an organized way.
  3785. Org-mode can select items based on various criteria, and display them
  3786. in a separate buffer. Six different view types are provided:
  3787. @itemize @bullet
  3788. @item
  3789. an @emph{agenda} that is like a calendar and shows information
  3790. for specific dates,
  3791. @item
  3792. a @emph{TODO list} that covers all unfinished
  3793. action items,
  3794. @item
  3795. a @emph{tags view}, showings headlines based on
  3796. the tags associated with them,
  3797. @item
  3798. a @emph{timeline view} that shows all events in a single Org-mode file,
  3799. in time-sorted view,
  3800. @item
  3801. a @emph{stuck projects view} showing projects that currently don't move
  3802. along, and
  3803. @item
  3804. @emph{custom views} that are special tag/keyword searches and
  3805. combinations of different views.
  3806. @end itemize
  3807. @noindent
  3808. The extracted information is displayed in a special @emph{agenda
  3809. buffer}. This buffer is read-only, but provides commands to visit the
  3810. corresponding locations in the original Org-mode files, and even to
  3811. edit these files remotely.
  3812. Two variables control how the agenda buffer is displayed and whether the
  3813. window configuration is restored when the agenda exits:
  3814. @code{org-agenda-window-setup} and
  3815. @code{org-agenda-restore-windows-after-quit}.
  3816. @menu
  3817. * Agenda files:: Files being searched for agenda information
  3818. * Agenda dispatcher:: Keyboard access to agenda views
  3819. * Built-in agenda views:: What is available out of the box?
  3820. * Presentation and sorting:: How agenda items are prepared for display
  3821. * Agenda commands:: Remote editing of org trees
  3822. * Custom agenda views:: Defining special searches and views
  3823. @end menu
  3824. @node Agenda files, Agenda dispatcher, Agenda views, Agenda views
  3825. @section Agenda files
  3826. @cindex agenda files
  3827. @cindex files for agenda
  3828. The information to be shown is collected from all @emph{agenda files},
  3829. the files listed in the variable @code{org-agenda-files}@footnote{If the
  3830. value of that variable is not a list, but a single file name, then the
  3831. list of agenda files will be maintained in that external file.}. Thus even
  3832. if you only work with a single Org-mode file, this file should be put
  3833. into that list@footnote{When using the dispatcher, pressing @kbd{1}
  3834. before selecting a command will actually limit the command to the
  3835. current file, and ignore @code{org-agenda-files} until the next
  3836. dispatcher command.}. You can customize @code{org-agenda-files}, but
  3837. the easiest way to maintain it is through the following commands
  3838. @cindex files, adding to agenda list
  3839. @table @kbd
  3840. @kindex C-c [
  3841. @item C-c [
  3842. Add current file to the list of agenda files. The file is added to
  3843. the front of the list. If it was already in the list, it is moved to
  3844. the front. With prefix arg, file is added/moved to the end.
  3845. @kindex C-c ]
  3846. @item C-c ]
  3847. Remove current file from the list of agenda files.
  3848. @kindex C-,
  3849. @kindex C-'
  3850. @item C-,
  3851. @itemx C-'
  3852. Cycle through agenda file list, visiting one file after the other.
  3853. @kindex C-c C-x /
  3854. @item C-c C-x /
  3855. Search for a regular rexpression in all agenda files and display the
  3856. results in an @code{occur} buffer.
  3857. @end table
  3858. @noindent
  3859. The Org menu contains the current list of files and can be used
  3860. to visit any of them.
  3861. @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda views
  3862. @section The agenda dispatcher
  3863. @cindex agenda dispatcher
  3864. @cindex dispatching agenda commands
  3865. The views are created through a dispatcher that should be bound to a
  3866. global key, for example @kbd{C-c a} (@pxref{Installation}). In the
  3867. following we will assume that @kbd{C-c a} is indeed how the dispatcher
  3868. is accessed and list keyboard access to commands accordingly. After
  3869. pressing @kbd{C-c a}, an additional letter is required to execute a
  3870. command. The dispatcher offers the following default commands:
  3871. @table @kbd
  3872. @item a
  3873. Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
  3874. @item t @r{/} T
  3875. Create a list of all TODO items (@pxref{Global TODO list}).
  3876. @item m @r{/} M
  3877. Create a list of headlines matching a TAGS expression (@pxref{Matching
  3878. tags and properties}).
  3879. @item L
  3880. Create the timeline view for the current buffer (@pxref{Timeline}).
  3881. @item # @r{/} !
  3882. Create a list of stuck projects (@pxref{Stuck projects}).
  3883. @item 1
  3884. Restrict an agenda command to the current buffer. After pressing
  3885. @kbd{1}, you still need to press the character selecting the command.
  3886. @item 0
  3887. If there is an active region, restrict the following agenda command to
  3888. the region. Otherwise, restrict it to the current subtree. After
  3889. pressing @kbd{0}, you still need to press the character selecting the
  3890. command.
  3891. @end table
  3892. You can also define custom commands that will be accessible through the
  3893. dispatcher, just like the default commands. This includes the
  3894. possibility to create extended agenda buffers that contain several
  3895. blocks together, for example the weekly agenda, the global TODO list and
  3896. a number of special tags matches. @xref{Custom agenda views}.
  3897. @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda views
  3898. @section The built-in agenda views
  3899. In this section we describe the built-in views.
  3900. @menu
  3901. * Weekly/Daily agenda:: The calendar page with current tasks
  3902. * Global TODO list:: All unfinished action items
  3903. * Matching tags and properties:: Structured information with fine-tuned search
  3904. * Timeline:: Time-sorted view for single file
  3905. * Stuck projects:: Find projects you need to review
  3906. @end menu
  3907. @node Weekly/Daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
  3908. @subsection The weekly/daily agenda
  3909. @cindex agenda
  3910. @cindex weekly agenda
  3911. @cindex daily agenda
  3912. The purpose of the weekly/daily @emph{agenda} is to act like a page of a
  3913. paper agenda, showing all the tasks for the current week or day.
  3914. @table @kbd
  3915. @cindex org-agenda, command
  3916. @kindex C-c a a
  3917. @item C-c a a
  3918. Compile an agenda for the current week from a list of org files. The
  3919. agenda shows the entries for each day. With a @kbd{C-u} prefix (or
  3920. when the variable @code{org-agenda-include-all-todo} is @code{t}), all
  3921. unfinished TODO items (including those without a date) are also listed at
  3922. the beginning of the buffer, before the first date.@*
  3923. @end table
  3924. Remote editing from the agenda buffer means, for example, that you can
  3925. change the dates of deadlines and appointments from the agenda buffer.
  3926. The commands available in the Agenda buffer are listed in @ref{Agenda
  3927. commands}.
  3928. @subsubheading Calendar/Diary integration
  3929. @cindex calendar integration
  3930. @cindex diary integration
  3931. Emacs contains the calendar and diary by Edward M. Reingold. The
  3932. calendar displays a three-month calendar with holidays from different
  3933. countries and cultures. The diary allows you to keep track of
  3934. anniversaries, lunar phases, sunrise/set, recurrent appointments
  3935. (weekly, monthly) and more. In this way, it is quite complementary to
  3936. Org-mode. It can be very useful to combine output from Org-mode with
  3937. the diary.
  3938. In order to include entries from the Emacs diary into Org-mode's
  3939. agenda, you only need to customize the variable
  3940. @lisp
  3941. (setq org-agenda-include-diary t)
  3942. @end lisp
  3943. @noindent After that, everything will happen automatically. All diary
  3944. entries including holidays, anniversaries etc will be included in the
  3945. agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and
  3946. @key{RET} can be used from the agenda buffer to jump to the diary
  3947. file in order to edit existing diary entries. The @kbd{i} command to
  3948. insert new entries for the current date works in the agenda buffer, as
  3949. well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
  3950. Sunrise/Sunset times, show lunar phases and to convert to other
  3951. calendars, respectively. @kbd{c} can be used to switch back and forth
  3952. between calendar and agenda.
  3953. If you are using the diary only for sexp entries and holidays, it is
  3954. faster to not use the above setting, but instead to copy or even move
  3955. the entries into an Org-mode file. Org-mode evaluates diary-style sexp
  3956. entries, and does it faster because there is no overhead for first
  3957. creating the diary display. Note that the sexp entries must start at
  3958. the left margin, no white space is allowed before them. For example,
  3959. the following segment of an Org-mode file will be processed and entries
  3960. will be made in the agenda:
  3961. @example
  3962. * Birthdays and similar stuff
  3963. #+CATEGORY: Holiday
  3964. %%(org-calendar-holiday) ; special function for holiday names
  3965. #+CATEGORY: Ann
  3966. %%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
  3967. %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
  3968. @end example
  3969. @subsubheading Appointment reminders
  3970. @cindex @file{appt.el}
  3971. @cindex appointment reminders
  3972. Org can interact with Emacs appointments notification facility.
  3973. To add all the appointments of your agenda files, use the command
  3974. @code{org-agenda-to-appt}. This commands also lets you filter through
  3975. the list of your appointments and add only those belonging to a specific
  3976. category or matching a regular expression. See the docstring for
  3977. details.
  3978. @node Global TODO list, Matching tags and properties, Weekly/Daily agenda, Built-in agenda views
  3979. @subsection The global TODO list
  3980. @cindex global TODO list
  3981. @cindex TODO list, global
  3982. The global TODO list contains all unfinished TODO items, formatted and
  3983. collected into a single place.
  3984. @table @kbd
  3985. @kindex C-c a t
  3986. @item C-c a t
  3987. Show the global TODO list. This collects the TODO items from all
  3988. agenda files (@pxref{Agenda views}) into a single buffer. The buffer is in
  3989. @code{agenda-mode}, so there are commands to examine and manipulate
  3990. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  3991. @kindex C-c a T
  3992. @item C-c a T
  3993. @cindex TODO keyword matching
  3994. Like the above, but allows selection of a specific TODO keyword. You
  3995. can also do this by specifying a prefix argument to @kbd{C-c a t}. With
  3996. a @kbd{C-u} prefix you are prompted for a keyword, and you may also
  3997. specify several keywords by separating them with @samp{|} as boolean OR
  3998. operator. With a numeric prefix, the Nth keyword in
  3999. @code{org-todo-keywords} is selected.
  4000. @kindex r
  4001. The @kbd{r} key in the agenda buffer regenerates it, and you can give
  4002. a prefix argument to this command to change the selected TODO keyword,
  4003. for example @kbd{3 r}. If you often need a search for a specific
  4004. keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
  4005. Matching specific TODO keywords can also be done as part of a tags
  4006. search (@pxref{Tag searches}).
  4007. @end table
  4008. Remote editing of TODO items means that you can change the state of a
  4009. TODO entry with a single key press. The commands available in the
  4010. TODO list are described in @ref{Agenda commands}.
  4011. @cindex sublevels, inclusion into todo list
  4012. Normally the global todo list simply shows all headlines with TODO
  4013. keywords. This list can become very long. There are two ways to keep
  4014. it more compact:
  4015. @itemize @minus
  4016. @item
  4017. Some people view a TODO item that has been @emph{scheduled} for
  4018. execution (@pxref{Time stamps}) as no longer @emph{open}. Configure the
  4019. variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
  4020. items from the global TODO list.
  4021. @item
  4022. TODO items may have sublevels to break up the task into subtasks. In
  4023. such cases it may be enough to list only the highest level TODO headline
  4024. and omit the sublevels from the global list. Configure the variable
  4025. @code{org-agenda-todo-list-sublevels} to get this behavior.
  4026. @end itemize
  4027. @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
  4028. @subsection Matching Tags and Properties
  4029. @cindex matching, of tags
  4030. @cindex matching, of properties
  4031. @cindex tags view
  4032. If headlines in the agenda files are marked with @emph{tags}
  4033. (@pxref{Tags}), you can select headlines based on the tags that apply
  4034. to them and collect them into an agenda buffer.
  4035. @table @kbd
  4036. @kindex C-c a m
  4037. @item C-c a m
  4038. Produce a list of all headlines that match a given set of tags. The
  4039. command prompts for a selection criterion, which is a boolean logic
  4040. expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
  4041. @samp{WORK|HOME} (@pxref{Tags}). If you often need a specific search,
  4042. define a custom command for it (@pxref{Agenda dispatcher}).
  4043. @kindex C-c a M
  4044. @item C-c a M
  4045. Like @kbd{C-c a m}, but only select headlines that are also TODO items
  4046. and force checking subitems (see variable
  4047. @code{org-tags-match-list-sublevels}). Matching specific todo keywords
  4048. together with a tags match is also possible, see @ref{Tag searches}.
  4049. @end table
  4050. The commands available in the tags list are described in @ref{Agenda
  4051. commands}.
  4052. @node Timeline, Stuck projects, Matching tags and properties, Built-in agenda views
  4053. @subsection Timeline for a single file
  4054. @cindex timeline, single file
  4055. @cindex time-sorted view
  4056. The timeline summarizes all time-stamped items from a single Org-mode
  4057. file in a @emph{time-sorted view}. The main purpose of this command is
  4058. to give an overview over events in a project.
  4059. @table @kbd
  4060. @kindex C-c a L
  4061. @item C-c a L
  4062. Show a time-sorted view of the org file, with all time-stamped items.
  4063. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  4064. (scheduled or not) are also listed under the current date.
  4065. @end table
  4066. @noindent
  4067. The commands available in the timeline buffer are listed in
  4068. @ref{Agenda commands}.
  4069. @node Stuck projects, , Timeline, Built-in agenda views
  4070. @subsection Stuck projects
  4071. If you are following a system like David Allen's GTD to organize your
  4072. work, one of the ``duties'' you have is a regular review to make sure
  4073. that all projects move along. A @emph{stuck} project is a project that
  4074. has no defined next actions, so it will never show up in the TODO lists
  4075. Org-mode produces. During the review, you need to identify such
  4076. projects and define next actions for them.
  4077. @table @kbd
  4078. @kindex C-c a #
  4079. @item C-c a #
  4080. List projects that are stuck.
  4081. @kindex C-c a !
  4082. @item C-c a !
  4083. Customize the variable @code{org-stuck-projects} to define what a stuck
  4084. project is and how to find it.
  4085. @end table
  4086. You almost certainly will have to configure this view before it will
  4087. work for you. The built-in default assumes that all your projects are
  4088. level-2 headlines, and that a project is not stuck if it has at least
  4089. one entry marked with a todo keyword TODO or NEXT or NEXTACTION.
  4090. Lets assume that you, in your own way of using Org-mode, identify
  4091. projects with a tag PROJECT, and that you use a todo keyword MAYBE to
  4092. indicate a project that should not be considered yet. Lets further
  4093. assume that the todo keyword DONE marks finished projects, and that NEXT
  4094. and TODO indicate next actions. The tag @@SHOP indicates shopping and
  4095. is a next action even without the NEXT tag. Finally, if the project
  4096. contains the special word IGNORE anywhere, it should not be listed
  4097. either. In this case you would start by identifying eligible projects
  4098. with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
  4099. TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
  4100. are not stuck. The correct customization for this is
  4101. @lisp
  4102. (setq org-stuck-projects
  4103. '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
  4104. "\\<IGNORE\\>"))
  4105. @end lisp
  4106. @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda views
  4107. @section Presentation and sorting
  4108. @cindex presentation, of agenda items
  4109. Before displaying items in an agenda view, Org-mode visually prepares
  4110. the items and sorts them. Each item occupies a single line. The line
  4111. starts with a @emph{prefix} that contains the @emph{category}
  4112. (@pxref{Categories}) of the item and other important information. You can
  4113. customize the prefix using the option @code{org-agenda-prefix-format}.
  4114. The prefix is followed by a cleaned-up version of the outline headline
  4115. associated with the item.
  4116. @menu
  4117. * Categories:: Not all tasks are equal
  4118. * Time-of-day specifications:: How the agenda knows the time
  4119. * Sorting of agenda items:: The order of things
  4120. @end menu
  4121. @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
  4122. @subsection Categories
  4123. @cindex category
  4124. The category is a broad label assigned to each agenda item. By default,
  4125. the category is simply derived from the file name, but you can also
  4126. specify it with a special line in the buffer, like this@footnote{If
  4127. there are several such lines in a file, each specifies the category for
  4128. the text below it. The first category also applies to any text before
  4129. the first CATEGORY line. This method is only kept for backward
  4130. compatibility. The preferred method for setting multiple categories in
  4131. a buffer is using a property.}:
  4132. @example
  4133. #+CATEGORY: Thesis
  4134. @end example
  4135. @noindent
  4136. If you would like to have a special CATEGORY for a single entry or a
  4137. (sub)tree, give the entry a @code{:CATEGORY:} property with the location
  4138. as the value (@pxref{Properties and columns}).
  4139. @noindent
  4140. The display in the agenda buffer looks best if the category is not
  4141. longer than 10 characters.
  4142. @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
  4143. @subsection Time-of-Day Specifications
  4144. @cindex time-of-day specification
  4145. Org-mode checks each agenda item for a time-of-day specification. The
  4146. time can be part of the time stamp that triggered inclusion into the
  4147. agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
  4148. ranges can be specified with two time stamps, like
  4149. @c
  4150. @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
  4151. In the headline of the entry itself, a time(range) may also appear as
  4152. plain text (like @samp{12:45} or a @samp{8:30-1pm}. If the agenda
  4153. integrates the Emacs diary (@pxref{Weekly/Daily agenda}), time
  4154. specifications in diary entries are recognized as well.
  4155. For agenda display, Org-mode extracts the time and displays it in a
  4156. standard 24 hour format as part of the prefix. The example times in
  4157. the previous paragraphs would end up in the agenda like this:
  4158. @example
  4159. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  4160. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  4161. 19:00...... The Vogon reads his poem
  4162. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  4163. @end example
  4164. @cindex time grid
  4165. If the agenda is in single-day mode, or for the display of today, the
  4166. timed entries are embedded in a time grid, like
  4167. @example
  4168. 8:00...... ------------------
  4169. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  4170. 10:00...... ------------------
  4171. 12:00...... ------------------
  4172. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  4173. 14:00...... ------------------
  4174. 16:00...... ------------------
  4175. 18:00...... ------------------
  4176. 19:00...... The Vogon reads his poem
  4177. 20:00...... ------------------
  4178. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  4179. @end example
  4180. The time grid can be turned on and off with the variable
  4181. @code{org-agenda-use-time-grid}, and can be configured with
  4182. @code{org-agenda-time-grid}.
  4183. @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
  4184. @subsection Sorting of agenda items
  4185. @cindex sorting, of agenda items
  4186. @cindex priorities, of agenda items
  4187. Before being inserted into a view, the items are sorted. How this is
  4188. done depends on the type of view.
  4189. @itemize @bullet
  4190. @item
  4191. For the daily/weekly agenda, the items for each day are sorted. The
  4192. default order is to first collect all items containing an explicit
  4193. time-of-day specification. These entries will be shown at the beginning
  4194. of the list, as a @emph{schedule} for the day. After that, items remain
  4195. grouped in categories, in the sequence given by @code{org-agenda-files}.
  4196. Within each category, items are sorted by priority (@pxref{Priorities}),
  4197. which is composed of the base priority (2000 for priority @samp{A}, 1000
  4198. for @samp{B}, and 0 for @samp{C}), plus additional increments for
  4199. overdue scheduled or deadline items.
  4200. @item
  4201. For the TODO list, items remain in the order of categories, but within
  4202. each category, sorting takes place according to priority
  4203. (@pxref{Priorities}).
  4204. @item
  4205. For tags matches, items are not sorted at all, but just appear in the
  4206. sequence in which they are found in the agenda files.
  4207. @end itemize
  4208. Sorting can be customized using the variable
  4209. @code{org-agenda-sorting-strategy}.
  4210. @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda views
  4211. @section Commands in the agenda buffer
  4212. @cindex commands, in agenda buffer
  4213. Entries in the agenda buffer are linked back to the org file or diary
  4214. file where they originate. You are not allowed to edit the agenda
  4215. buffer itself, but commands are provided to show and jump to the
  4216. original entry location, and to edit the org-files ``remotely'' from
  4217. the agenda buffer. In this way, all information is stored only once,
  4218. removing the risk that your agenda and note files may diverge.
  4219. Some commands can be executed with mouse clicks on agenda lines. For
  4220. the other commands, the cursor needs to be in the desired line.
  4221. @table @kbd
  4222. @tsubheading{Motion}
  4223. @cindex motion commands in agenda
  4224. @kindex n
  4225. @item n
  4226. Next line (same as @key{up} and @kbd{C-p}).
  4227. @kindex p
  4228. @item p
  4229. Previous line (same as @key{down} and @kbd{C-n}).
  4230. @tsubheading{View/GoTo org file}
  4231. @kindex mouse-3
  4232. @kindex @key{SPC}
  4233. @item mouse-3
  4234. @itemx @key{SPC}
  4235. Display the original location of the item in another window.
  4236. @c
  4237. @kindex L
  4238. @item L
  4239. Display original location and recenter that window.
  4240. @c
  4241. @kindex mouse-2
  4242. @kindex mouse-1
  4243. @kindex @key{TAB}
  4244. @item mouse-2
  4245. @itemx mouse-1
  4246. @itemx @key{TAB}
  4247. Go to the original location of the item in another window. Under Emacs
  4248. 22, @kbd{mouse-1} will also works for this.
  4249. @c
  4250. @kindex @key{RET}
  4251. @itemx @key{RET}
  4252. Go to the original location of the item and delete other windows.
  4253. @c
  4254. @kindex f
  4255. @item f
  4256. Toggle Follow mode. In Follow mode, as you move the cursor through
  4257. the agenda buffer, the other window always shows the corresponding
  4258. location in the org file. The initial setting for this mode in new
  4259. agenda buffers can be set with the variable
  4260. @code{org-agenda-start-with-follow-mode}.
  4261. @c
  4262. @kindex b
  4263. @item b
  4264. Display the entire subtree of the current item in an indirect buffer.
  4265. With numerical prefix ARG, go up to this level and then take that tree.
  4266. If ARG is negative, go up that many levels. With @kbd{C-u} prefix, do
  4267. not remove the previously used indirect buffer.
  4268. @c
  4269. @kindex l
  4270. @item l
  4271. Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
  4272. logging was on (variable @code{org-log-done}) are shown in the agenda,
  4273. as are entries that have been clocked on that day.
  4274. @tsubheading{Change display}
  4275. @cindex display changing, in agenda
  4276. @kindex o
  4277. @item o
  4278. Delete other windows.
  4279. @c
  4280. @kindex d
  4281. @kindex w
  4282. @kindex m
  4283. @kindex y
  4284. @item d w m y
  4285. Switch to day/week/month/year view. When switching to day or week view,
  4286. this setting becomes the default for subseqent agenda commands. Since
  4287. month and year views are slow to create, the do not become the default.
  4288. @c
  4289. @kindex D
  4290. @item D
  4291. Toggle the inclusion of diary entries. See @ref{Weekly/Daily agenda}.
  4292. @c
  4293. @kindex g
  4294. @item g
  4295. Toggle the time grid on and off. See also the variables
  4296. @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
  4297. @c
  4298. @kindex r
  4299. @item r
  4300. Recreate the agenda buffer, for example to reflect the changes
  4301. after modification of the time stamps of items with S-@key{left} and
  4302. S-@key{right}. When the buffer is the global todo list, a prefix
  4303. argument is interpreted to create a selective list for a specific TODO
  4304. keyword.
  4305. @c
  4306. @kindex s
  4307. @kindex C-x C-s
  4308. @item s
  4309. @itemx C-x C-s
  4310. Save all Org-mode buffers in the current Emacs session.
  4311. @c
  4312. @kindex @key{right}
  4313. @item @key{right}
  4314. Display the following @code{org-agenda-ndays} days. For example, if
  4315. the display covers a week, switch to the following week. With prefix
  4316. arg, go forward that many times @code{org-agenda-ndays} days.
  4317. @c
  4318. @kindex @key{left}
  4319. @item @key{left}
  4320. Display the previous dates.
  4321. @c
  4322. @kindex .
  4323. @item .
  4324. Goto today.
  4325. @tsubheading{Remote editing}
  4326. @cindex remote editing, from agenda
  4327. @item 0-9
  4328. Digit argument.
  4329. @c
  4330. @cindex undoing remote-editing events
  4331. @cindex remote editing, undo
  4332. @kindex C-_
  4333. @item C-_
  4334. Undo a change due to a remote editing command. The change is undone
  4335. both in the agenda buffer and in the remote buffer.
  4336. @c
  4337. @kindex t
  4338. @item t
  4339. Change the TODO state of the item, both in the agenda and in the
  4340. original org file.
  4341. @c
  4342. @kindex C-k
  4343. @item C-k
  4344. Delete the current agenda item along with the entire subtree belonging
  4345. to it in the original Org-mode file. If the text to be deleted remotely
  4346. is longer than one line, the kill needs to be confirmed by the user. See
  4347. variable @code{org-agenda-confirm-kill}.
  4348. @c
  4349. @kindex $
  4350. @item $
  4351. Archive the subtree corresponding to the current headline.
  4352. @c
  4353. @kindex T
  4354. @item T
  4355. Show all tags associated with the current item. Because of
  4356. inheritance, this may be more than the tags listed in the line itself.
  4357. @c
  4358. @kindex :
  4359. @item :
  4360. Set tags for the current headline. If there is an active region in the
  4361. agenda, change a tag for all headings in the region.
  4362. @c
  4363. @kindex a
  4364. @item a
  4365. Toggle the ARCHIVE tag for the current headline.
  4366. @c
  4367. @kindex ,
  4368. @item ,
  4369. Set the priority for the current item. Org-mode prompts for the
  4370. priority character. If you reply with @key{SPC}, the priority cookie
  4371. is removed from the entry.
  4372. @c
  4373. @kindex P
  4374. @item P
  4375. Display weighted priority of current item.
  4376. @c
  4377. @kindex +
  4378. @kindex S-@key{up}
  4379. @item +
  4380. @itemx S-@key{up}
  4381. Increase the priority of the current item. The priority is changed in
  4382. the original buffer, but the agenda is not resorted. Use the @kbd{r}
  4383. key for this.
  4384. @c
  4385. @kindex -
  4386. @kindex S-@key{down}
  4387. @item -
  4388. @itemx S-@key{down}
  4389. Decrease the priority of the current item.
  4390. @c
  4391. @kindex C-c C-s
  4392. @item C-c C-s
  4393. Schedule this item
  4394. @c
  4395. @kindex C-c C-d
  4396. @item C-c C-d
  4397. Set a deadline for this item.
  4398. @c
  4399. @kindex S-@key{right}
  4400. @item S-@key{right}
  4401. Change the time stamp associated with the current line by one day into
  4402. the future. With prefix argument, change it by that many days. For
  4403. example, @kbd{3 6 5 S-@key{right}} will change it by a year. The
  4404. stamp is changed in the original org file, but the change is not
  4405. directly reflected in the agenda buffer. Use the
  4406. @kbd{r} key to update the buffer.
  4407. @c
  4408. @kindex S-@key{left}
  4409. @item S-@key{left}
  4410. Change the time stamp associated with the current line by one day
  4411. into the past.
  4412. @c
  4413. @kindex >
  4414. @item >
  4415. Change the time stamp associated with the current line to today.
  4416. The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
  4417. on my keyboard.
  4418. @c
  4419. @kindex I
  4420. @item I
  4421. Start the clock on the current item. If a clock is running already, it
  4422. is stopped first.
  4423. @c
  4424. @kindex O
  4425. @item O
  4426. Stop the previously started clock.
  4427. @c
  4428. @kindex X
  4429. @item X
  4430. Cancel the currently running clock.
  4431. @kindex J
  4432. @item J
  4433. Jump to the running clock in another window.
  4434. @tsubheading{Calendar commands}
  4435. @cindex calendar commands, from agenda
  4436. @kindex c
  4437. @item c
  4438. Open the Emacs calendar and move to the date at the agenda cursor.
  4439. @c
  4440. @item c
  4441. When in the calendar, compute and show the Org-mode agenda for the
  4442. date at the cursor.
  4443. @c
  4444. @cindex diary entries, creating from agenda
  4445. @kindex i
  4446. @item i
  4447. Insert a new entry into the diary. Prompts for the type of entry
  4448. (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
  4449. entry in the diary, just as @kbd{i d} etc. would do in the calendar.
  4450. The date is taken from the cursor position.
  4451. @c
  4452. @kindex M
  4453. @item M
  4454. Show the phases of the moon for the three months around current date.
  4455. @c
  4456. @kindex S
  4457. @item S
  4458. Show sunrise and sunset times. The geographical location must be set
  4459. with calendar variables, see documentation of the Emacs calendar.
  4460. @c
  4461. @kindex C
  4462. @item C
  4463. Convert the date at cursor into many other cultural and historic
  4464. calendars.
  4465. @c
  4466. @kindex H
  4467. @item H
  4468. Show holidays for three month around the cursor date.
  4469. @c
  4470. @c FIXME: This should be a different key.
  4471. @kindex C-c C-x C-c
  4472. @item C-c C-x C-c
  4473. Export a single iCalendar file containing entries from all agenda files.
  4474. @tsubheading{Exporting to a file}
  4475. @kindex C-x C-w
  4476. @item C-x C-w
  4477. @cindex exporting agenda views
  4478. @cindex agenda views, exporting
  4479. Write the agenda view to a file. Depending on the extension of the
  4480. selected file name, the view will be exported as HTML (extension
  4481. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
  4482. plain text (any other extension). Use the variable
  4483. @code{org-agenda-exporter-settings} to set options for @file{ps-print}
  4484. and for @file{htmlize} to be used during export.
  4485. @tsubheading{Quit and Exit}
  4486. @kindex q
  4487. @item q
  4488. Quit agenda, remove the agenda buffer.
  4489. @c
  4490. @kindex x
  4491. @cindex agenda files, removing buffers
  4492. @item x
  4493. Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
  4494. for the compilation of the agenda. Buffers created by the user to
  4495. visit org files will not be removed.
  4496. @end table
  4497. @node Custom agenda views, , Agenda commands, Agenda views
  4498. @section Custom agenda views
  4499. @cindex custom agenda views
  4500. @cindex agenda views, custom
  4501. Custom agenda commands serve two purposes: to store and quickly access
  4502. frequently used TODO and tags searches, and to create special composite
  4503. agenda buffers. Custom agenda commands will be accessible through the
  4504. dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
  4505. @menu
  4506. * Storing searches:: Type once, use often
  4507. * Block agenda:: All the stuff you need in a single buffer
  4508. * Setting Options:: Changing the rules
  4509. * Exporting Agenda Views:: Writing agendas to files.
  4510. * Extracting Agenda Information for other programs::
  4511. @end menu
  4512. @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
  4513. @subsection Storing searches
  4514. The first application of custom searches is the definition of keyboard
  4515. shortcuts for frequently used searches, either creating an agenda
  4516. buffer, or a sparse tree (the latter covering of course only the current
  4517. buffer).
  4518. @kindex C-c a C
  4519. Custom commands are configured in the variable
  4520. @code{org-agenda-custom-commands}. You can customize this variable, for
  4521. example by pressing @kbd{C-c a C}. You can also directly set it with
  4522. Emacs Lisp in @file{.emacs}. The following example contains all valid
  4523. search types:
  4524. @lisp
  4525. @group
  4526. (setq org-agenda-custom-commands
  4527. '(("w" todo "WAITING")
  4528. ("W" todo-tree "WAITING")
  4529. ("u" tags "+BOSS-URGENT")
  4530. ("v" tags-todo "+BOSS-URGENT")
  4531. ("U" tags-tree "+BOSS-URGENT")
  4532. ("f" occur-tree "\\<FIXME\\>")))
  4533. @end group
  4534. @end lisp
  4535. @noindent
  4536. The initial single-character string in each entry defines the character
  4537. you have to press after the dispatcher command @kbd{C-c a} in order to
  4538. access the command. The second parameter is the search type, followed
  4539. by the string or regular expression to be used for the matching. The
  4540. example above will therefore define:
  4541. @table @kbd
  4542. @item C-c a w
  4543. as a global search for TODO entries with @samp{WAITING} as the TODO
  4544. keyword
  4545. @item C-c a W
  4546. as the same search, but only in the current buffer and displaying the
  4547. results as a sparse tree
  4548. @item C-c a u
  4549. as a global tags search for headlines marked @samp{:BOSS:} but not
  4550. @samp{:URGENT:}
  4551. @item C-c a v
  4552. as the same search as @kbd{C-c a u}, but limiting the search to
  4553. headlines that are also TODO items
  4554. @item C-c a U
  4555. as the same search as @kbd{C-c a u}, but only in the current buffer and
  4556. displaying the result as a sparse tree
  4557. @item C-c a f
  4558. to create a sparse tree (again: current buffer only) with all entries
  4559. containing the word @samp{FIXME}.
  4560. @end table
  4561. @node Block agenda, Setting Options, Storing searches, Custom agenda views
  4562. @subsection Block agenda
  4563. @cindex block agenda
  4564. @cindex agenda, with block views
  4565. Another possibility is the construction of agenda views that comprise
  4566. the results of @emph{several} commands, each of which creates a block in
  4567. the agenda buffer. The available commands include @code{agenda} for the
  4568. daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
  4569. for the global todo list (as constructed with @kbd{C-c a t}), and the
  4570. matching commands discussed above: @code{todo}, @code{tags}, and
  4571. @code{tags-todo}. Here are two examples:
  4572. @lisp
  4573. @group
  4574. (setq org-agenda-custom-commands
  4575. '(("h" "Agenda and Home-related tasks"
  4576. ((agenda)
  4577. (tags-todo "HOME")
  4578. (tags "GARDEN")))
  4579. ("o" "Agenda and Office-related tasks"
  4580. ((agenda)
  4581. (tags-todo "WORK")
  4582. (tags "OFFICE")))))
  4583. @end group
  4584. @end lisp
  4585. @noindent
  4586. This will define @kbd{C-c a h} to create a multi-block view for stuff
  4587. you need to attend to at home. The resulting agenda buffer will contain
  4588. your agenda for the current week, all TODO items that carry the tag
  4589. @samp{HOME}, and also all lines tagged with @samp{GARDEN}. Finally the
  4590. command @kbd{C-c a o} provides a similar view for office tasks.
  4591. @node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
  4592. @subsection Setting Options for custom commands
  4593. @cindex options, for custom agenda views
  4594. Org-mode contains a number of variables regulating agenda construction
  4595. and display. The global variables define the behavior for all agenda
  4596. commands, including the custom commands. However, if you want to change
  4597. some settings just for a single custom view, you can do so. Setting
  4598. options requires inserting a list of variable names and values at the
  4599. right spot in @code{org-agenda-custom-commands}. For example:
  4600. @lisp
  4601. @group
  4602. (setq org-agenda-custom-commands
  4603. '(("w" todo "WAITING"
  4604. ((org-agenda-sorting-strategy '(priority-down))
  4605. (org-agenda-prefix-format " Mixed: ")))
  4606. ("U" tags-tree "+BOSS-URGENT"
  4607. ((org-show-following-heading nil)
  4608. (org-show-hierarchy-above nil)))))
  4609. @end group
  4610. @end lisp
  4611. @noindent
  4612. Now the @kbd{C-c a w} command will sort the collected entries only by
  4613. priority, and the prefix format is modified to just say @samp{ Mixed:}
  4614. instead of giving the category of the entry. The sparse tags tree of
  4615. @kbd{C-c a U} will now turn out ultra-compact, because neither the
  4616. headline hierarchy above the match, nor the headline following the match
  4617. will be shown.
  4618. For command sets creating a block agenda,
  4619. @code{org-agenda-custom-commands} has two separate spots for setting
  4620. options. You can add options that should be valid for just a single
  4621. command in the set, and options that should be valid for all commands in
  4622. the set. The former are just added to the command entry, the latter
  4623. must come after the list of command entries. Going back to the block
  4624. agenda example (@pxref{Block agenda}), let's change the sorting strategy
  4625. for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
  4626. the results for GARDEN tags query in the opposite order,
  4627. @code{priority-up}. This would look like this:
  4628. @lisp
  4629. @group
  4630. (setq org-agenda-custom-commands
  4631. '(("h" "Agenda and Home-related tasks"
  4632. ((agenda)
  4633. (tags-todo "HOME")
  4634. (tags "GARDEN"
  4635. ((org-agenda-sorting-strategy '(priority-up)))))
  4636. ((org-agenda-sorting-strategy '(priority-down))))
  4637. ("o" "Agenda and Office-related tasks"
  4638. ((agenda)
  4639. (tags-todo "WORK")
  4640. (tags "OFFICE")))))
  4641. @end group
  4642. @end lisp
  4643. As you see, the values and parenthesis setting is a little complex.
  4644. When in doubt, use the customize interface to set this variable - it
  4645. fully supports its structure. Just one caveat: When setting options in
  4646. this interface, the @emph{values} are just lisp expressions. So if the
  4647. value is a string, you need to add the double quotes around the value
  4648. yourself.
  4649. @node Exporting Agenda Views, Extracting Agenda Information for other programs, Setting Options, Custom agenda views
  4650. @subsection Exporting Agenda Views
  4651. @cindex agenda views, exporting
  4652. If you are away from your computer, it can be very useful to have a
  4653. printed version of some agenda views to carry around. Org-mode can
  4654. export custom agenda views as plain text, HTML@footnote{You need to
  4655. install Hrvoje Niksic' @file{htmlize.el}.} and postscript. If you want
  4656. to do this only occasionally, use the command
  4657. @table @kbd
  4658. @kindex C-x C-w
  4659. @item C-x C-w
  4660. @cindex exporting agenda views
  4661. @cindex agenda views, exporting
  4662. Write the agenda view to a file. Depending on the extension of the
  4663. selected file name, the view will be exported as HTML (extension
  4664. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
  4665. plain text (any other extension). Use the variable
  4666. @code{org-agenda-exporter-settings} to set options for @file{ps-print}
  4667. and for @file{htmlize} to be used during export, for example
  4668. @lisp
  4669. (setq org-agenda-exporter-settings
  4670. '((ps-number-of-columns 2)
  4671. (ps-landscape-mode t)
  4672. (htmlize-output-type 'css)))
  4673. @end lisp
  4674. @end table
  4675. If you need to export certain agenda views frequently, you can associate
  4676. any custom agenda command with a list of output file names
  4677. @footnote{If you want to store standard views like the weekly agenda
  4678. or the global TODO list as well, you need to define custom commands for
  4679. them in order to be able to specify filenames.}. Here is an example
  4680. that first does define custom commands for the agenda and the global
  4681. todo list, together with a number of files to which to export them.
  4682. Then we define two block agenda commands and specify filenames for them
  4683. as well. File names can be relative to the current working directory,
  4684. or absolute.
  4685. @lisp
  4686. @group
  4687. (setq org-agenda-custom-commands
  4688. '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
  4689. ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
  4690. ("h" "Agenda and Home-related tasks"
  4691. ((agenda)
  4692. (tags-todo "HOME")
  4693. (tags "GARDEN"))
  4694. nil
  4695. ("~/views/home.html"))
  4696. ("o" "Agenda and Office-related tasks"
  4697. ((agenda)
  4698. (tags-todo "WORK")
  4699. (tags "OFFICE"))
  4700. nil
  4701. ("~/views/office.ps"))))
  4702. @end group
  4703. @end lisp
  4704. The extension of the file name determines the type of export. If it is
  4705. @file{.html}, Org-mode will use the @file{htmlize.el} package to convert
  4706. the buffer to HTML and save it to this file name. If the extension is
  4707. @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
  4708. postscript output. Any other extension produces a plain ASCII file.
  4709. The export files are @emph{not} created when you use one of those
  4710. commands interactively. Instead, there is a special command to produce
  4711. @emph{all} specified files in one step:
  4712. @table @kbd
  4713. @kindex C-c a e
  4714. @item C-c a e
  4715. Export all agenda views that have export filenames associated with
  4716. them.
  4717. @end table
  4718. You can use the options section of the custom agenda commands to also
  4719. set options for the export commands. For example:
  4720. @lisp
  4721. (setq org-agenda-custom-commands
  4722. '(("X" agenda ""
  4723. ((ps-number-of-columns 2)
  4724. (ps-landscape-mode t)
  4725. (org-agenda-prefix-format " [ ] ")
  4726. (org-agenda-with-colors nil)
  4727. (org-agenda-remove-tags t))
  4728. ("theagenda.ps"))))
  4729. @end lisp
  4730. @noindent
  4731. This command sets two options for the postscript exporter, to make it
  4732. print in two columns in landscape format - the resulting page can be cut
  4733. in two and then used in a paper agenda. The remaining settings modify
  4734. the agenda prefix to omit category and scheduling information, and
  4735. instead include a checkbox to check off items. We also remove the tags
  4736. to make the lines compact, and we don't want to use colors for the
  4737. black-and-white printer. Settings specified in
  4738. @code{org-agenda-exporter-settings} will also apply, but the settings
  4739. in @code{org-agenda-custom-commands} take precedence.
  4740. @noindent
  4741. From the command line you may also use
  4742. @example
  4743. emacs -f org-batch-store-agenda-views -kill
  4744. @end example
  4745. @noindent
  4746. or, if you need to modify some parameters
  4747. @example
  4748. emacs -eval '(org-batch-store-agenda-views \
  4749. org-agenda-ndays 30 \
  4750. org-agenda-include-diary nil \
  4751. org-agenda-files (quote ("~/org/project.org")))' \
  4752. -kill
  4753. @end example
  4754. @noindent
  4755. which will create the agenda views restricted to the file
  4756. @file{~/org/project.org}, without diary entries and with 30 days
  4757. extent.
  4758. @node Extracting Agenda Information for other programs, , Exporting Agenda Views, Custom agenda views
  4759. @subsection Extracting Agenda Information for other programs
  4760. @cindex agenda, pipe
  4761. @cindex Scripts, for agenda processing
  4762. Org-mode provides commands to access agenda information for the command
  4763. line in emacs batch mode. This extracted information can be sent
  4764. directly to a printer, or it can be read by a program that does further
  4765. processing of the data. The first of these commands is the function
  4766. @code{org-batch-agenda}, that produces an agenda view and sends it as
  4767. ASCII text to STDOUT. The command takes a single string as parameter.
  4768. If the string has length 1, it is used as a key to one of the commands
  4769. you have configured in @code{org-agenda-custom-commands}, basically any
  4770. key you can use after @kbd{C-c a}. For example, to directly print the
  4771. current TODO list, you could use
  4772. @example
  4773. emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
  4774. @end example
  4775. If the parameter is a string with 2 or more characters, it is used as a
  4776. tags/todo match string. For example, to print your local shopping list
  4777. (all items with the tag @samp{shop}, but excluding the tag
  4778. @samp{NewYork}), you could use
  4779. @example
  4780. emacs -batch -l ~/.emacs \
  4781. -eval '(org-batch-agenda "+shop-NewYork")' | lpr
  4782. @end example
  4783. @noindent
  4784. You may also modify parameters on the fly like this:
  4785. @example
  4786. emacs -batch -l ~/.emacs \
  4787. -eval '(org-batch-agenda "a" \
  4788. org-agenda-ndays 30 \
  4789. org-agenda-include-diary nil \
  4790. org-agenda-files (quote ("~/org/project.org")))' \
  4791. | lpr
  4792. @end example
  4793. @noindent
  4794. which will produce a 30 day agenda, fully restricted to the Org file
  4795. @file{~/org/projects.org}, not even including the diary.
  4796. If you want to process the agenda data in more sophisticated ways, you
  4797. can use the command @code{org-batch-agenda-csv} to get a comma-separated
  4798. list of values for each agenda item. Each line in the output will
  4799. contain a number of fields separated by commas. The fields in a line
  4800. are:
  4801. @example
  4802. category @r{The category of the item}
  4803. head @r{The headline, without TODO kwd, TAGS and PRIORITY}
  4804. type @r{The type of the agenda entry, can be}
  4805. todo @r{selected in TODO match}
  4806. tagsmatch @r{selected in tags match}
  4807. diary @r{imported from diary}
  4808. deadline @r{a deadline}
  4809. scheduled @r{scheduled}
  4810. timestamp @r{appointment, selected by timestamp}
  4811. closed @r{entry was closed on date}
  4812. upcoming-deadline @r{warning about nearing deadline}
  4813. past-scheduled @r{forwarded scheduled item}
  4814. block @r{entry has date block including date}
  4815. todo @r{The todo keyword, if any}
  4816. tags @r{All tags including inherited ones, separated by colons}
  4817. date @r{The relevant date, like 2007-2-14}
  4818. time @r{The time, like 15:00-16:50}
  4819. extra @r{String with extra planning info}
  4820. priority-l @r{The priority letter if any was given}
  4821. priority-n @r{The computed numerical priority}
  4822. @end example
  4823. @noindent
  4824. Time and date will only be given if a timestamp (or deadline/scheduled)
  4825. lead to the selection of the item.
  4826. A CSV list like this is very easy to use in a post processing script.
  4827. For example, here is a Perl program that gets the TODO list from
  4828. Emacs/org-mode and prints all the items, preceded by a checkbox:
  4829. @example
  4830. @group
  4831. #!/usr/bin/perl
  4832. # define the Emacs command to run
  4833. $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
  4834. # run it and capture the output
  4835. $agenda = qx@{$cmd 2>/dev/null@};
  4836. # loop over all lines
  4837. foreach $line (split(/\n/,$agenda)) @{
  4838. # get the individual values
  4839. ($category,$head,$type,$todo,$tags,$date,$time,$extra,
  4840. $priority_l,$priority_n) = split(/,/,$line);
  4841. # proccess and print
  4842. print "[ ] $head\n";
  4843. @}
  4844. @end group
  4845. @end example
  4846. @node Embedded LaTeX, Exporting, Agenda views, Top
  4847. @chapter Embedded LaTeX
  4848. @cindex @TeX{} interpretation
  4849. @cindex La@TeX{} interpretation
  4850. Plain ASCII is normally sufficient for almost all note taking. One
  4851. exception, however, are scientific notes which need to be able to
  4852. contain mathematical symbols and the occasional formula.
  4853. La@TeX{}@footnote{La@TeX{} is a macro system based on Donald E. Knuth's
  4854. @TeX{} system. Many of the features described here as ``La@TeX{}'' are
  4855. really from @TeX{}, but for simplicity I am blurring this distinction.}
  4856. is widely used to typeset scientific documents. Org-mode supports
  4857. embedding La@TeX{} code into its files, because many academics are used
  4858. to read La@TeX{} source code, and because it can be readily processed
  4859. into images for HTML production.
  4860. It is not necessary to mark La@TeX{} macros and code in any special way.
  4861. If you observe a few conventions, Org-mode knows how to find it and what
  4862. to do with it.
  4863. @menu
  4864. * Math symbols:: TeX macros for symbols and Greek letters
  4865. * Subscripts and Superscripts:: Simple syntax for raising/lowering text
  4866. * LaTeX fragments:: Complex formulas made easy
  4867. * Processing LaTeX fragments:: Previewing LaTeX processing
  4868. * CDLaTeX mode:: Speed up entering of formulas
  4869. @end menu
  4870. @node Math symbols, Subscripts and Superscripts, Embedded LaTeX, Embedded LaTeX
  4871. @section Math symbols
  4872. @cindex math symbols
  4873. @cindex TeX macros
  4874. You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
  4875. to indicate the Greek letter, or @samp{\to} to indicate an arrow.
  4876. Completion for these macros is available, just type @samp{\} and maybe a
  4877. few letters, and press @kbd{M-@key{TAB}} to see possible completions.
  4878. Unlike La@TeX{} code, Org-mode allows these macros to be present
  4879. without surrounding math delimiters, for example:
  4880. @example
  4881. Angles are written as Greek letters \alpha, \beta and \gamma.
  4882. @end example
  4883. During HTML export (@pxref{HTML export}), these symbols are translated
  4884. into the proper syntax for HTML, for the above examples this is
  4885. @samp{&alpha;} and @samp{&rarr;}, respectively.
  4886. @node Subscripts and Superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
  4887. @section Subscripts and Superscripts
  4888. @cindex subscript
  4889. @cindex superscript
  4890. Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
  4891. and subscripts. Again, these can be used without embedding them in
  4892. math-mode delimiters. To increase the readability of ASCII text, it is
  4893. not necessary (but OK) to surround multi-character sub- and superscripts
  4894. with curly braces. For example
  4895. @example
  4896. The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
  4897. the sun is R_@{sun@} = 6.96 x 10^8 m.
  4898. @end example
  4899. To avoid interpretation as raised or lowered text, you can quote
  4900. @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
  4901. During HTML export (@pxref{HTML export}), subscript and superscripts
  4902. are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
  4903. @node LaTeX fragments, Processing LaTeX fragments, Subscripts and Superscripts, Embedded LaTeX
  4904. @section LaTeX fragments
  4905. @cindex LaTeX fragments
  4906. With symbols, sub- and superscripts, HTML is pretty much at its end when
  4907. it comes to representing mathematical formulas@footnote{Yes, there is
  4908. MathML, but that is not yet fully supported by many browsers, and there
  4909. is no decent converter for turning La@TeX{} or ASCII representations of
  4910. formulas into MathML. So for the time being, converting formulas into
  4911. images seems the way to go.}. More complex expressions need a dedicated
  4912. formula processor. To this end, Org-mode can contain arbitrary La@TeX{}
  4913. fragments. It provides commands to preview the typeset result of these
  4914. fragments, and upon export to HTML, all fragments will be converted to
  4915. images and inlined into the HTML document@footnote{The La@TeX{} export
  4916. will not use images for displaying La@TeX{} fragments but include these
  4917. fragments directly into the La@TeX{} code.}. For this to work you
  4918. need to be on a system with a working La@TeX{} installation. You also
  4919. need the @file{dvipng} program, available at
  4920. @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
  4921. will be used when processing a fragment can be configured with the
  4922. variable @code{org-format-latex-header}.
  4923. La@TeX{} fragments don't need any special marking at all. The following
  4924. snippets will be identified as La@TeX{} source code:
  4925. @itemize @bullet
  4926. @item
  4927. Environments of any kind. The only requirement is that the
  4928. @code{\begin} statement appears on a new line, preceded by only
  4929. whitespace.
  4930. @item
  4931. Text within the usual La@TeX{} math delimiters. To avoid conflicts with
  4932. currency specifications, single @samp{$} characters are only recognized
  4933. as math delimiters if the enclosed text contains at most two line breaks,
  4934. is directly attached to the @samp{$} characters with no whitespace in
  4935. between, and if the closing @samp{$} is followed by whitespace or
  4936. punctuation. For the other delimiters, there is no such restriction, so
  4937. when in doubt, use @samp{\(...\)} as inline math delimiters.
  4938. @end itemize
  4939. @noindent For example:
  4940. @example
  4941. \begin@{equation@} % arbitrary environments,
  4942. x=\sqrt@{b@} % even tables, figures
  4943. \end@{equation@} % etc
  4944. If $a^2=b$ and \( b=2 \), then the solution must be
  4945. either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
  4946. @end example
  4947. @noindent
  4948. If you need any of the delimiter ASCII sequences for other purposes, you
  4949. can configure the option @code{org-format-latex-options} to deselect the
  4950. ones you do not wish to have interpreted by the La@TeX{} converter.
  4951. @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
  4952. @section Processing LaTeX fragments
  4953. @cindex LaTeX fragments, preview
  4954. La@TeX{} fragments can be processed to produce a preview images of the
  4955. typeset expressions:
  4956. @table @kbd
  4957. @kindex C-c C-x C-l
  4958. @item C-c C-x C-l
  4959. Produce a preview image of the La@TeX{} fragment at point and overlay it
  4960. over the source code. If there is no fragment at point, process all
  4961. fragments in the current entry (between two headlines). When called
  4962. with a prefix argument, process the entire subtree. When called with
  4963. two prefix arguments, or when the cursor is before the first headline,
  4964. process the entire buffer.
  4965. @kindex C-c C-c
  4966. @item C-c C-c
  4967. Remove the overlay preview images.
  4968. @end table
  4969. During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
  4970. converted into images and inlined into the document if the following
  4971. setting is active:
  4972. @lisp
  4973. (setq org-export-with-LaTeX-fragments t)
  4974. @end lisp
  4975. @node CDLaTeX mode, , Processing LaTeX fragments, Embedded LaTeX
  4976. @section Using CDLaTeX to enter math
  4977. @cindex CDLaTeX
  4978. CDLaTeX-mode is a minor mode that is normally used in combination with a
  4979. major La@TeX{} mode like AUCTeX in order to speed-up insertion of
  4980. environments and math templates. Inside Org-mode, you can make use of
  4981. some of the features of cdlatex-mode. You need to install
  4982. @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
  4983. AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
  4984. Don't turn cdlatex-mode itself under Org-mode, but use the light
  4985. version @code{org-cdlatex-mode} that comes as part of Org-mode. Turn it
  4986. on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
  4987. Org-mode files with
  4988. @lisp
  4989. (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
  4990. @end lisp
  4991. When this mode is enabled, the following features are present (for more
  4992. details see the documentation of cdlatex-mode):
  4993. @itemize @bullet
  4994. @kindex C-c @{
  4995. @item
  4996. Environment templates can be inserted with @kbd{C-c @{}.
  4997. @item
  4998. @kindex @key{TAB}
  4999. The @key{TAB} key will do template expansion if the cursor is inside a
  5000. La@TeX{} fragment@footnote{Org-mode has a method to test if the cursor is
  5001. inside such a fragment, see the documentation of the function
  5002. @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
  5003. expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
  5004. correctly inside the first brace. Another @key{TAB} will get you into
  5005. the second brace. Even outside fragments, @key{TAB} will expand
  5006. environment abbreviations at the beginning of a line. For example, if
  5007. you write @samp{equ} at the beginning of a line and press @key{TAB},
  5008. this abbreviation will be expanded to an @code{equation} environment.
  5009. To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
  5010. @item
  5011. @kindex _
  5012. @kindex ^
  5013. Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
  5014. characters together with a pair of braces. If you use @key{TAB} to move
  5015. out of the braces, and if the braces surround only a single character or
  5016. macro, they are removed again (depending on the variable
  5017. @code{cdlatex-simplify-sub-super-scripts}).
  5018. @item
  5019. @kindex `
  5020. Pressing the backquote @kbd{`} followed by a character inserts math
  5021. macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
  5022. after the backquote, a help window will pop up.
  5023. @item
  5024. @kindex '
  5025. Pressing the normal quote @kbd{'} followed by another character modifies
  5026. the symbol before point with an accent or a font. If you wait more than
  5027. 1.5 seconds after the backquote, a help window will pop up. Character
  5028. modification will work only inside La@TeX{} fragments, outside the quote
  5029. is normal.
  5030. @end itemize
  5031. @node Exporting, Publishing, Embedded LaTeX, Top
  5032. @chapter Exporting
  5033. @cindex exporting
  5034. Org-mode documents can be exported into a variety of other formats. For
  5035. printing and sharing of notes, ASCII export produces a readable and
  5036. simple version of an Org-mode file. HTML export allows you to publish a
  5037. notes file on the web, while the XOXO format provides a solid base for
  5038. exchange with a broad range of other applications. La@TeX{} export lets
  5039. you use Org-mode and its structured editing functions to easily create
  5040. La@TeX{} files. To incorporate entries with associated times like
  5041. deadlines or appointments into a desktop calendar program like iCal,
  5042. Org-mode can also produce extracts in the iCalendar format. Currently
  5043. Org-mode only supports export, not import of these different formats.
  5044. When exporting, Org-mode uses special conventions to enrich the output
  5045. produced. @xref{Text interpretation}, for more details.
  5046. @table @kbd
  5047. @kindex C-c C-e
  5048. @item C-c C-e
  5049. Dispatcher for export and publishing commands. Displays a help-window
  5050. listing the additional key(s) needed to launch an export or publishing
  5051. command.
  5052. @end table
  5053. @menu
  5054. * ASCII export:: Exporting to plain ASCII
  5055. * HTML export:: Exporting to HTML
  5056. * LaTeX export:: Exporting to LaTeX
  5057. * XOXO export:: Exporting to XOXO
  5058. * iCalendar export:: Exporting in iCalendar format
  5059. * Text interpretation:: How the exporter looks at the file
  5060. @end menu
  5061. @node ASCII export, HTML export, Exporting, Exporting
  5062. @section ASCII export
  5063. @cindex ASCII export
  5064. ASCII export produces a simple and very readable version of an Org-mode
  5065. file.
  5066. @cindex region, active
  5067. @cindex active region
  5068. @cindex transient-mark-mode
  5069. @table @kbd
  5070. @kindex C-c C-e a
  5071. @item C-c C-e a
  5072. Export as ASCII file. For an org file @file{myfile.org}, the ASCII file
  5073. will be @file{myfile.txt}. The file will be overwritten without
  5074. warning. If there is an active region, only the region will be
  5075. exported. If the selected region is a single tree, the tree head will
  5076. become the document title. If the tree head entry has or inherits an
  5077. EXPORT_FILE_NAME property, that name will be used for the export.
  5078. @kindex C-c C-e v a
  5079. @item C-c C-e v a
  5080. Export only the visible part of the document.
  5081. @end table
  5082. @cindex headline levels, for exporting
  5083. In the exported version, the first 3 outline levels will become
  5084. headlines, defining a general document structure. Additional levels
  5085. will be exported as itemized lists. If you want that transition to occur
  5086. at a different level, specify it with a prefix argument. For example,
  5087. @example
  5088. @kbd{C-1 C-c C-e a}
  5089. @end example
  5090. @noindent
  5091. creates only top level headlines and does the rest as items. When
  5092. headlines are converted to items, the indentation of the text following
  5093. the headline is changed to fit nicely under the item. This is done with
  5094. the assumption that the first bodyline indicates the base indentation of
  5095. the body text. Any indentation larger than this is adjusted to preserve
  5096. the layout relative to the first line. Should there be lines with less
  5097. indentation than the first, these are left alone.
  5098. @node HTML export, LaTeX export, ASCII export, Exporting
  5099. @section HTML export
  5100. @cindex HTML export
  5101. Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
  5102. HTML formatting, in ways similar to John Grubers @emph{markdown}
  5103. language, but with additional support for tables.
  5104. @menu
  5105. * HTML Export commands:: How to invoke LaTeX export
  5106. * Quoting HTML tags:: Using direct HTML in Org-mode
  5107. * Links:: Transformation of links for HTML
  5108. * Images:: How to include images
  5109. * CSS support:: Changing the appearence of the output
  5110. @end menu
  5111. @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
  5112. @subsection HTML export commands
  5113. @cindex region, active
  5114. @cindex active region
  5115. @cindex transient-mark-mode
  5116. @table @kbd
  5117. @kindex C-c C-e h
  5118. @item C-c C-e h
  5119. Export as HTML file @file{myfile.html}. For an org file
  5120. @file{myfile.org}, the ASCII file will be @file{myfile.html}. The file
  5121. will be overwritten without warning. If there is an active region, only
  5122. the region will be exported. If the selected region is a single tree,
  5123. the tree head will become the document title. If the tree head entry
  5124. has or inherits an EXPORT_FILE_NAME property, that name will be used for
  5125. the export.
  5126. @kindex C-c C-e b
  5127. @item C-c C-e b
  5128. Export as HTML file and immediately open it with a browser.
  5129. @kindex C-c C-e H
  5130. @item C-c C-e H
  5131. Export to a temporary buffer, do not create a file.
  5132. @kindex C-c C-e R
  5133. @item C-c C-e H
  5134. Export the active region to a temporary buffer. With prefix arg, do not
  5135. produce file header and foot, but just the plain HTML section for the
  5136. region. This is good for cut-and-paste operations.
  5137. @kindex C-c C-e v h
  5138. @kindex C-c C-e v b
  5139. @kindex C-c C-e v H
  5140. @kindex C-c C-e v R
  5141. @item C-c C-e v h
  5142. @item C-c C-e v b
  5143. @item C-c C-e v H
  5144. @item C-c C-e v R
  5145. Export only the visible part of the document.
  5146. @item M-x org-export-region-as-html
  5147. Convert the region to HTML under the assumption that it was org-mode
  5148. syntax before. This is a global command that can be invoked in any
  5149. buffer.
  5150. @item M-x org-replace-region-by-HTML
  5151. Replace the active region (assumed to be in Org-mode syntax) by HTML
  5152. code.
  5153. @end table
  5154. @cindex headline levels, for exporting
  5155. In the exported version, the first 3 outline levels will become
  5156. headlines, defining a general document structure. Additional levels
  5157. will be exported as itemized lists. If you want that transition to occur
  5158. at a different level, specify it with a prefix argument. For example,
  5159. @example
  5160. @kbd{C-2 C-c C-e b}
  5161. @end example
  5162. @noindent
  5163. creates two levels of headings and does the rest as items.
  5164. @node Quoting HTML tags, Links, HTML Export commands, HTML export
  5165. @subsection Quoting HTML tags
  5166. Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
  5167. @samp{&gt;} in HTML export. If you want to include simple HTML tags
  5168. which should be interpreted as such, mark them with @samp{@@} as in
  5169. @samp{@@<b>bold text@@</b>}. Note that this really works only for
  5170. simple tags. For more extensive HTML that should be copied verbatim to
  5171. the exported file use either
  5172. @example
  5173. #+HTML: Literal HTML code for export
  5174. @end example
  5175. @noindent or
  5176. @example
  5177. #+BEGIN_HTML
  5178. All lines between these markers are exported literally
  5179. #+END_HTML
  5180. @end example
  5181. @node Links, Images, Quoting HTML tags, HTML export
  5182. @subsection Links
  5183. @cindex links, in HTML export
  5184. @cindex internal links, in HTML export
  5185. @cindex external links, in HTML export
  5186. Internal links (@pxref{Internal links}) will continue to work in HTML
  5187. files only if they match a dedicated @samp{<<target>>}. Automatic links
  5188. created by radio targets (@pxref{Radio targets}) will also work in the
  5189. HTML file. Links to external files will still work if the HTML file is
  5190. in the same directory as the Org-mode file. Links to other @file{.org}
  5191. files will be translated into HTML links under the assumption that an
  5192. HTML version also exists of the linked file. For information related to
  5193. linking files while publishing them to a publishing directory see
  5194. @ref{Publishing links}.
  5195. @node Images, CSS support, Links, HTML export
  5196. @subsection Images
  5197. @cindex images, inline in HTML
  5198. @cindex inlining images in HTML
  5199. HTML export can inline images given as links in the Org-mode file, and
  5200. it can make an image the clickable part of a link. By
  5201. default@footnote{but see the variable
  5202. @code{org-export-html-inline-images}}, images are inlined if a link does
  5203. not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
  5204. while @samp{[[file:myimg.jpg][the image]]} will just produce a link
  5205. @samp{the image} that points to the image. If the description part
  5206. itself is a @code{file:} link or a @code{http:} URL pointing to an
  5207. image, this image will be inlined and activated so that clicking on the
  5208. image will activate the link. For example, to include a thumbnail that
  5209. will link to a high resolution version of the image, you could use:
  5210. @example
  5211. [[file:highres.jpg][file:thumb.jpg]]
  5212. @end example
  5213. @noindent
  5214. and you could use @code{http} addresses just as well.
  5215. @node CSS support, , Images, HTML export
  5216. @subsection CSS support
  5217. You can also give style information for the exported file. The HTML
  5218. exporter assigns the following CSS classes to appropriate parts of the
  5219. document - your style specifications may change these:
  5220. @example
  5221. .todo @r{TODO keywords}
  5222. .done @r{the DONE keyword}
  5223. .timestamp @r{time stamp}
  5224. .timestamp-kwd @r{keyword associated with a time stamp, like SCHEDULED}
  5225. .tag @r{tag in a headline}
  5226. .target @r{target for links}
  5227. @end example
  5228. The default style specification can be configured through the option
  5229. @code{org-export-html-style}. If you want to use a file-local style,
  5230. you may use file variables, best wrapped into a COMMENT section at the
  5231. end of the outline tree. For example@footnote{Under Emacs 21, the
  5232. continuation lines for a variable value should have no @samp{#} at the
  5233. start of the line.}:
  5234. @example
  5235. * COMMENT html style specifications
  5236. # Local Variables:
  5237. # org-export-html-style: " <style type=\"text/css\">
  5238. # p @{font-weight: normal; color: gray; @}
  5239. # h1 @{color: black; @}
  5240. # </style>"
  5241. # End:
  5242. @end example
  5243. Remember to execute @kbd{M-x normal-mode} after changing this to make
  5244. the new style visible to Emacs. This command restarts org-mode for the
  5245. current buffer and forces Emacs to re-evaluate the local variables
  5246. section in the buffer.
  5247. @c FIXME: More about header and footer styles
  5248. @c FIXME: Talk about links and targets.
  5249. @node LaTeX export, XOXO export, HTML export, Exporting
  5250. @section LaTeX export
  5251. @cindex LaTeX export
  5252. Org-mode contains a La@TeX{} exporter written by Bastien Guerry.
  5253. @menu
  5254. * LaTeX export commands:: How to invoke LaTeX export
  5255. * Quoting LaTeX code:: Incorporating literal LaTeX code
  5256. @end menu
  5257. @node LaTeX export commands, Quoting LaTeX code, LaTeX export, LaTeX export
  5258. @subsection LaTeX export commands
  5259. @table @kbd
  5260. @kindex C-c C-e l
  5261. @item C-c C-e l
  5262. Export as La@TeX{} file @file{myfile.tex}.
  5263. @kindex C-c C-e L
  5264. @item C-c C-e L
  5265. Export to a temporary buffer, do not create a file.
  5266. @kindex C-c C-e v l
  5267. @kindex C-c C-e v L
  5268. @item C-c C-e v l
  5269. @item C-c C-e v L
  5270. Export only the visible part of the document.
  5271. @item M-x org-export-region-as-latex
  5272. Convert the region to La@TeX{} under the assumption that it was org-mode
  5273. syntax before. This is a global command that can be invoked in any
  5274. buffer.
  5275. @item M-x org-replace-region-by-latex
  5276. Replace the active region (assumed to be in Org-mode syntax) by La@TeX{}
  5277. code.
  5278. @end table
  5279. @cindex headline levels, for exporting
  5280. In the exported version, the first 3 outline levels will become
  5281. headlines, defining a general document structure. Additional levels
  5282. will be exported as description lists. The exporter can ignore them or
  5283. convert them to a custom string depending on
  5284. @code{org-latex-low-levels}.
  5285. If you want that transition to occur at a different level, specify it
  5286. with a prefix argument. For example,
  5287. @example
  5288. @kbd{C-2 C-c C-e l}
  5289. @end example
  5290. @noindent
  5291. creates two levels of headings and does the rest as items.
  5292. @node Quoting LaTeX code, , LaTeX export commands, LaTeX export
  5293. @subsection Quoting LaTeX code
  5294. Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
  5295. inserted into the La@TeX{} file. Forthermore, you can add special code
  5296. that should only be present in La@TeX{} export with the following
  5297. constructs:
  5298. @example
  5299. #+LaTeX: Literal LaTeX code for export
  5300. @end example
  5301. @noindent or
  5302. @example
  5303. #+BEGIN_LaTeX
  5304. All lines between these markers are exported literally
  5305. #+END_LaTeX
  5306. @end example
  5307. @node XOXO export, iCalendar export, LaTeX export, Exporting
  5308. @section XOXO export
  5309. @cindex XOXO export
  5310. Org-mode contains an exporter that produces XOXO-style output.
  5311. Currently, this exporter only handles the general outline structure and
  5312. does not interpret any additional Org-mode features.
  5313. @table @kbd
  5314. @kindex C-c C-e x
  5315. @item C-c C-e x
  5316. Export as XOXO file @file{myfile.html}.
  5317. @kindex C-c C-e v
  5318. @item C-c C-e v x
  5319. Export only the visible part of the document.
  5320. @end table
  5321. @node iCalendar export, Text interpretation, XOXO export, Exporting
  5322. @section iCalendar export
  5323. @cindex iCalendar export
  5324. Some people like to use Org-mode for keeping track of projects, but
  5325. still prefer a standard calendar application for anniversaries and
  5326. appointments. In this case it can be useful to have deadlines and
  5327. other time-stamped items in Org-mode files show up in the calendar
  5328. application. Org-mode can export calendar information in the standard
  5329. iCalendar format. If you also want to have TODO entries included in the
  5330. export, configure the variable @code{org-icalendar-include-todo}.
  5331. @table @kbd
  5332. @kindex C-c C-e i
  5333. @item C-c C-e i
  5334. Create iCalendar entries for the current file and store them in the same
  5335. directory, using a file extension @file{.ics}.
  5336. @kindex C-c C-e I
  5337. @item C-c C-e I
  5338. Like @kbd{C-c C-e i}, but do this for all files in
  5339. @code{org-agenda-files}. For each of these files, a separate iCalendar
  5340. file will be written.
  5341. @kindex C-c C-e c
  5342. @item C-c C-e c
  5343. Create a single large iCalendar file from all files in
  5344. @code{org-agenda-files} and write it to the file given by
  5345. @code{org-combined-agenda-icalendar-file}.
  5346. @end table
  5347. The export will honor SUMMARY, DESCRIPTION and LOCATION properties if
  5348. the selected entries have them. If not, the summary will be derived
  5349. from the headline, and the description from the body (limited to
  5350. @code{org-icalendar-include-body} characters).
  5351. How this calendar is best read and updated, depends on the application
  5352. you are using. The FAQ covers this issue.
  5353. @node Text interpretation, , iCalendar export, Exporting
  5354. @section Text interpretation by the exporter
  5355. The exporter backends interpret additional structure in the Org-mode file
  5356. in order to produce better output.
  5357. @menu
  5358. * Comment lines:: Some lines will not be exported
  5359. * Initial text:: Text before the first headline
  5360. * Footnotes:: Numbers like [1]
  5361. * Enhancing text:: Subscripts, symbols and more
  5362. * Export options:: How to influence the export settings
  5363. @end menu
  5364. @node Comment lines, Initial text, Text interpretation, Text interpretation
  5365. @subsection Comment lines
  5366. @cindex comment lines
  5367. @cindex exporting, not
  5368. Lines starting with @samp{#} in column zero are treated as comments
  5369. and will never be exported. Also entire subtrees starting with the
  5370. word @samp{COMMENT} will never be exported.
  5371. @table @kbd
  5372. @kindex C-c ;
  5373. @item C-c ;
  5374. Toggle the COMMENT keyword at the beginning of an entry.
  5375. @end table
  5376. @node Initial text, Footnotes, Comment lines, Text interpretation
  5377. @subsection Text before the first headline
  5378. Org-mode normally ignores any text before the first headline when
  5379. exporting, leaving this region for internal links to speed up navigation
  5380. etc. However, in publishing-oriented files, you might want to have some
  5381. text before the first headline, like a small introduction, special HTML
  5382. code with a navigation bar, etc. You can ask to have this part of the
  5383. file exported as well by setting the variable
  5384. @code{org-export-skip-text-before-1st-heading} to @code{nil}. On a
  5385. per-file basis, you can get the same effect with
  5386. @example
  5387. #+OPTIONS: skip:nil
  5388. @end example
  5389. The text before the first headline will be fully processed
  5390. (@pxref{Enhancing text}), and the first non-comment line becomes the
  5391. title of the exported document. If you need to include literal HTML,
  5392. use the special constructs described in @ref{Quoting HTML tags}. The
  5393. table of contents is normally inserted directly before the first
  5394. headline of the file. If you would like to get it to a different
  5395. location, insert the string @code{[TABLE-OF-CONTENTS]} on a line by
  5396. itself at the desired location.
  5397. Finally, if you want to use the space before the first headline for
  5398. internal purposes, but @emph{still} want to place something before the
  5399. first headline when exporting the file, you can use the @code{#+TEXT}
  5400. construct:
  5401. @example
  5402. #+OPTIONS: skip:t
  5403. #+TEXT: This text will go before the *first* headline.
  5404. #+TEXT: We place the table of contents here:
  5405. #+TEXT: [TABLE-OF-CONTENTS]
  5406. #+TEXT: This goes between the table of contents and the first headline
  5407. @end example
  5408. @node Footnotes, Enhancing text, Initial text, Text interpretation
  5409. @subsection Footnotes
  5410. @cindex footnotes
  5411. @cindex @file{footnote.el}
  5412. Numbers in square brackets are treated as footnotes, so that you can use
  5413. the Emacs package @file{footnote.el} to create footnotes. For example:
  5414. @example
  5415. The org-mode homepage[1] clearly needs help from
  5416. a good web designer.
  5417. [1] The link is: http://orgmode.org
  5418. @end example
  5419. @noindent
  5420. @kindex C-c !
  5421. Note that the @file{footnote} package uses @kbd{C-c !} to invoke its
  5422. commands. This binding conflicts with the org-mode command for
  5423. inserting inactive time stamps. You could use the variable
  5424. @code{footnote-prefix} to switch footnotes commands to another key. Or,
  5425. if you are too used to this binding, you could use
  5426. @code{org-replace-disputed-keys} and @code{org-disputed-keys} to change
  5427. the settings in Org-mode.
  5428. @node Enhancing text, Export options, Footnotes, Text interpretation
  5429. @subsection Enhancing text for export
  5430. @cindex enhancing text
  5431. @cindex richer text
  5432. Some of the export backends of Org-mode allow for sophisticated text
  5433. formatting, this is true in particular for the HTML and La@TeX{}
  5434. backends. Org-mode has a number of typing conventions that allow to
  5435. produce a richly formatted output.
  5436. @itemize @bullet
  5437. @cindex hand-formatted lists
  5438. @cindex lists, hand-formatted
  5439. @item
  5440. Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
  5441. or @samp{2)} as enumerator will be recognized and transformed if the
  5442. backend supports lists. See @xref{Plain lists}.
  5443. @cindex underlined text
  5444. @cindex bold text
  5445. @cindex italic text
  5446. @item
  5447. You can make words @b{*bold*}, @i{/italic/}, _underlined_,
  5448. @code{=code=}, and even @samp{+strikethrough+}@footnote{but remember
  5449. that strikethrough is typographically evil and should @i{never} be
  5450. used.}.
  5451. @cindex horizontal rules, in exported files
  5452. @item
  5453. A line consisting of only dashes, and at least 5 of them, will be
  5454. exported as a horizontal line (@samp{<hr/>} in HTML).
  5455. @cindex LaTeX fragments, export
  5456. @cindex TeX macros, export
  5457. @item
  5458. Many @TeX{} macros and entire La@TeX{} fragments are converted into HTML
  5459. entities or images (@pxref{Embedded LaTeX}).
  5460. @cindex tables, export
  5461. @item
  5462. Tables are transformed into native tables under the exporter, if the
  5463. export backend supports this. Data fields before the first horizontal
  5464. separator line will be formatted as table header fields.
  5465. @cindex fixed width
  5466. @item
  5467. If a headline starts with the word @samp{QUOTE}, the text below the
  5468. headline will be typeset as fixed-width, to allow quoting of computer
  5469. codes etc. Lines starting with @samp{:} are also typeset in fixed-width
  5470. font.
  5471. @table @kbd
  5472. @kindex C-c :
  5473. @item C-c :
  5474. Toggle fixed-width for entry (QUOTE) or region, see below.
  5475. @end table
  5476. @cindex linebreak, forced
  5477. @item
  5478. A double backslash @emph{at the end of a line} enforces a line break at
  5479. this position.
  5480. @end itemize
  5481. If these conversions conflict with your habits of typing ASCII text,
  5482. they can all be turned off with corresponding variables. See the
  5483. customization group @code{org-export-general}, and the following section
  5484. which explains how to set export options with special lines in a
  5485. buffer.
  5486. @node Export options, , Enhancing text, Text interpretation
  5487. @subsection Export options
  5488. @cindex options, for export
  5489. @cindex completion, of option keywords
  5490. The exporter recognizes special lines in the buffer which provide
  5491. additional information. These lines may be put anywhere in the file.
  5492. The whole set of lines can be inserted into the buffer with @kbd{C-c
  5493. C-e t}. For individual lines, a good way to make sure the keyword is
  5494. correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
  5495. (@pxref{Completion}).
  5496. @table @kbd
  5497. @kindex C-c C-e t
  5498. @item C-c C-e t
  5499. Insert template with export options, see example below.
  5500. @end table
  5501. @example
  5502. #+TITLE: the title to be shown (default is the buffer name)
  5503. #+AUTHOR: the author (default taken from @code{user-full-name})
  5504. #+DATE: A date, fixed, of a format string for @code{format-time-string}
  5505. #+EMAIL: his/her email address (default from @code{user-mail-address})
  5506. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  5507. #+TEXT: Some descriptive text to be inserted at the beginning.
  5508. #+TEXT: Several lines may be given.
  5509. #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
  5510. @end example
  5511. @noindent
  5512. The OPTIONS line is a compact form to specify export settings. Here
  5513. you can:
  5514. @cindex headline levels
  5515. @cindex section-numbers
  5516. @cindex table of contents
  5517. @cindex linebreak preservation
  5518. @cindex quoted HTML tags
  5519. @cindex fixed-width sections
  5520. @cindex tables
  5521. @cindex @TeX{}-like syntax for sub- and superscripts
  5522. @cindex footnotes
  5523. @cindex emphasized text
  5524. @cindex @TeX{} macros
  5525. @cindex La@TeX{} fragments
  5526. @cindex author info, in export
  5527. @cindex time info, in export
  5528. @example
  5529. H: @r{set the number of headline levels for export}
  5530. num: @r{turn on/off section-numbers}
  5531. toc: @r{turn on/off table of contents, or set level limit (integer)}
  5532. \n: @r{turn on/off linebreak-preservation}
  5533. @@: @r{turn on/off quoted HTML tags}
  5534. :: @r{turn on/off fixed-width sections}
  5535. |: @r{turn on/off tables}
  5536. ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
  5537. @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
  5538. @r{the simple @code{a_b} will be left as it is.}
  5539. f: @r{turn on/off foototes like this[1].}
  5540. *: @r{turn on/off emphasized text (bold, italic, underlined)}
  5541. TeX: @r{turn on/off simple @TeX{} macros in plain text}
  5542. LaTeX: @r{turn on/off La@TeX{} fragments}
  5543. skip: @r{turn on/off skipping the text before the first heading}
  5544. author: @r{turn on/off inclusion of author name/email into exported file}
  5545. timestamp: @r{turn on/off inclusion creation time into exported file}
  5546. @end example
  5547. These options take effect in both the HTML and La@TeX{} export, except
  5548. for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
  5549. @code{nil} for the La@TeX{} export.
  5550. @node Publishing, Miscellaneous, Exporting, Top
  5551. @chapter Publishing
  5552. @cindex publishing
  5553. Org-mode includes@footnote{@file{org-publish.el} is not distributed with
  5554. Emacs 21, if you are still using Emacs 21, you need you need to download
  5555. this file separately.} a publishing management system that allows you to
  5556. configure automatic HTML conversion of @emph{projects} composed of
  5557. interlinked org files. This system is called @emph{org-publish}. You can
  5558. also configure org-publish to automatically upload your exported HTML
  5559. pages and related attachments, such as images and source code files, to
  5560. a web server. Org-publish turns org-mode into a web-site authoring tool.
  5561. You can also use Org-publish to convert files into La@TeX{}, or even
  5562. combine HTML and La@TeX{} conversion so that files are available in both
  5563. formats on the server@footnote{Since La@TeX{} files on a server are not
  5564. that helpful, you surely want to perform further conversion on them --
  5565. e.g. convert them to @code{PDF} format.}.
  5566. Org-publish has been contributed to Org-mode by David O'Toole.
  5567. @menu
  5568. * Configuration:: Defining projects
  5569. * Sample configuration:: Example projects
  5570. * Triggering publication:: Publication commands
  5571. @end menu
  5572. @node Configuration, Sample configuration, Publishing, Publishing
  5573. @section Configuration
  5574. Publishing needs significant configuration to specify files, destination
  5575. and many other properties of a project.
  5576. @menu
  5577. * Project alist:: The central configuration variable
  5578. * Sources and destinations:: From here to there
  5579. * Selecting files:: What files are part of the project?
  5580. * Publishing action:: Setting the function doing the publishing
  5581. * Publishing options:: Tweaking HTML export
  5582. * Publishing links:: Which links keep working after publishing?
  5583. * Project page index:: Publishing a list of project files
  5584. @end menu
  5585. @node Project alist, Sources and destinations, Configuration, Configuration
  5586. @subsection The variable @code{org-publish-project-alist}
  5587. @cindex org-publish-project-alist
  5588. @cindex projects, for publishing
  5589. Org-publish is configured almost entirely through setting the value of
  5590. one variable, called @code{org-publish-project-alist}.
  5591. Each element of the list configures one project, and may be in one of
  5592. the two following forms:
  5593. @lisp
  5594. ("project-name" :property value :property value ...)
  5595. @r{or}
  5596. ("project-name" :components ("project-name" "project-name" ...))
  5597. @end lisp
  5598. In both cases, projects are configured by specifying property values.
  5599. A project defines the set of files that will be published, as well as
  5600. the publishing configuration to use when publishing those files. When
  5601. a project takes the second form listed above, the individual members
  5602. of the ``components'' property are taken to be components of the
  5603. project, which group together files requiring different publishing
  5604. options. When you publish such a ``meta-project'' all the components
  5605. will also publish.
  5606. @node Sources and destinations, Selecting files, Project alist, Configuration
  5607. @subsection Sources and destinations for files
  5608. @cindex directories, for publishing
  5609. Most properties are optional, but some should always be set. In
  5610. particular, org-publish needs to know where to look for source files,
  5611. and where to put published files.
  5612. @multitable @columnfractions 0.3 0.7
  5613. @item @code{:base-directory}
  5614. @tab Directory containing publishing source files
  5615. @item @code{:publishing-directory}
  5616. @tab Directory (possibly remote) where output files will be published.
  5617. @item @code{:preparation-function}
  5618. @tab Function called before starting publishing process, for example to
  5619. run @code{make} for updating files to be published.
  5620. @end multitable
  5621. @noindent
  5622. @node Selecting files, Publishing action, Sources and destinations, Configuration
  5623. @subsection Selecting files
  5624. @cindex files, selecting for publishing
  5625. By default, all files with extension @file{.org} in the base directory
  5626. are considered part of the project. This can be modified by setting the
  5627. properties
  5628. @multitable @columnfractions 0.25 0.75
  5629. @item @code{:base-extension}
  5630. @tab Extension (without the dot!) of source files. This actually is a
  5631. regular expression.
  5632. @item @code{:exclude}
  5633. @tab Regular expression to match file names that should not be
  5634. published, even though they have been selected on the basis of their
  5635. extension.
  5636. @item @code{:include}
  5637. @tab List of files to be included regardless of @code{:base-extension}
  5638. and @code{:exclude}.
  5639. @end multitable
  5640. @node Publishing action, Publishing options, Selecting files, Configuration
  5641. @subsection Publishing Action
  5642. @cindex action, for publishing
  5643. Publishing means that a file is copied to the destination directory and
  5644. possibly transformed in the process. The default transformation is to
  5645. export Org-mode files as HTML files, and this is done by the function
  5646. @code{org-publish-org-to-html} which calls the HTML exporter
  5647. (@pxref{HTML export}). But you also can publish your files in La@TeX{} by
  5648. using the function @code{org-publish-org-to-latex} instead. Other files
  5649. like images only need to be copied to the publishing destination. For
  5650. non-Org-mode files, you need to specify the publishing function.
  5651. @multitable @columnfractions 0.3 0.7
  5652. @item @code{:publishing-function}
  5653. @tab Function executing the publication of a file. This may also be a
  5654. list of functions, which will all be called in turn.
  5655. @end multitable
  5656. The function must accept two arguments: a property list containing at
  5657. least a @code{:publishing-directory} property, and the name of the file
  5658. to be published. It should take the specified file, make the necessary
  5659. transformation (if any) and place the result into the destination folder.
  5660. You can write your own publishing function, but @code{org-publish}
  5661. provides one for attachments (files that only need to be copied):
  5662. @code{org-publish-attachment}.
  5663. @node Publishing options, Publishing links, Publishing action, Configuration
  5664. @subsection Options for the HTML/LaTeX exporters
  5665. @cindex options, for publishing
  5666. The property list can be used to set many export options for the HTML
  5667. and La@TeX{} exporters. In most cases, these properties correspond to user
  5668. variables in Org-mode. The table below lists these properties along
  5669. with the variable they belong to. See the documentation string for the
  5670. respective variable for details.
  5671. @multitable @columnfractions 0.3 0.7
  5672. @item @code{:language} @tab @code{org-export-default-language}
  5673. @item @code{:headline-levels} @tab @code{org-export-headline-levels}
  5674. @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
  5675. @item @code{:table-of-contents} @tab @code{org-export-with-toc}
  5676. @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
  5677. @item @code{:emphasize} @tab @code{org-export-with-emphasize}
  5678. @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
  5679. @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
  5680. @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
  5681. @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
  5682. @item @code{:timestamps} .@tab @code{org-export-with-timestamps}
  5683. @item @code{:tags} .@tab @code{org-export-with-tags}
  5684. @item @code{:tables} @tab @code{org-export-with-tables}
  5685. @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
  5686. @item @code{:style} @tab @code{org-export-html-style}
  5687. @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
  5688. @item @code{:inline-images} @tab @code{org-export-html-inline-images}
  5689. @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
  5690. @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
  5691. @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
  5692. @item @code{:preamble} @tab @code{org-export-html-preamble}
  5693. @item @code{:postamble} @tab @code{org-export-html-postamble}
  5694. @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
  5695. @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
  5696. @item @code{:author} @tab @code{user-full-name}
  5697. @item @code{:email} @tab @code{user-mail-address}
  5698. @end multitable
  5699. Most of the @code{org-export-with-*} variables have the same effect in
  5700. both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
  5701. @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
  5702. La@TeX{} export.
  5703. When a property is given a value in org-publish-project-alist, its
  5704. setting overrides the value of the corresponding user variable (if any)
  5705. during publishing. Options set within a file (@pxref{Export
  5706. options}), however, override everything.
  5707. @node Publishing links, Project page index, Publishing options, Configuration
  5708. @subsection Links between published files
  5709. @cindex links, publishing
  5710. To create a link from one Org-mode file to another, you would use
  5711. something like @samp{[[file:foo.org][The foo]]} or simply
  5712. @samp{file:foo.org.} (@pxref{Hyperlinks}). Upon publishing this link
  5713. becomes a link to @file{foo.html}. In this way, you can interlink the
  5714. pages of your "org web" project and the links will work as expected when
  5715. you publish them to HTML.
  5716. You may also link to related files, such as images. Provided you are
  5717. careful with relative pathnames, and provided you have also configured
  5718. org-publish to upload the related files, these links will work
  5719. too. @ref{Complex example} for an example of this usage.
  5720. Sometime an Org-mode file to be published may contain links that are
  5721. only valid in your production environment, but not in the publishing
  5722. location. In this case, use the property
  5723. @multitable @columnfractions 0.4 0.6
  5724. @item @code{:link-validation-function}
  5725. @tab Function to validate links
  5726. @end multitable
  5727. @noindent
  5728. to define a function for checking link validity. This function must
  5729. accept two arguments, the file name and a directory relative to which
  5730. the file name is interpreted in the production environment. If this
  5731. function returns @code{nil}, then the HTML generator will only insert a
  5732. description into the HTML file, but no link. One option for this
  5733. function is @code{org-publish-validate-link} which checks if the given
  5734. file is part of any project in @code{org-publish-project-alist}.
  5735. @node Project page index, , Publishing links, Configuration
  5736. @subsection Project page index
  5737. @cindex index, of published pages
  5738. The following properties may be used to control publishing of an
  5739. index of files or summary page for a given project.
  5740. @multitable @columnfractions 0.25 0.75
  5741. @item @code{:auto-index}
  5742. @tab When non-nil, publish an index during org-publish-current-project or
  5743. org-publish-all.
  5744. @item @code{:index-filename}
  5745. @tab Filename for output of index. Defaults to @file{index.org} (which
  5746. becomes @file{index.html}).
  5747. @item @code{:index-title}
  5748. @tab Title of index page. Defaults to name of file.
  5749. @item @code{:index-function}
  5750. @tab Plugin function to use for generation of index.
  5751. Defaults to @code{org-publish-org-index}, which generates a plain list
  5752. of links to all files in the project.
  5753. @end multitable
  5754. @node Sample configuration, Triggering publication, Configuration, Publishing
  5755. @section Sample configuration
  5756. Below we provide two example configurations. The first one is a simple
  5757. project publishing only a set of Org-mode files. The second example is
  5758. more complex, with a multi-component project.
  5759. @menu
  5760. * Simple example:: One-component publishing
  5761. * Complex example:: A multi-component publishing example
  5762. @end menu
  5763. @node Simple example, Complex example, Sample configuration, Sample configuration
  5764. @subsection Example: simple publishing configuration
  5765. This example publishes a set of Org-mode files to the @file{public_html}
  5766. directory on the local machine.
  5767. @lisp
  5768. (setq org-publish-project-alist
  5769. '(("org"
  5770. :base-directory "~/org/"
  5771. :publishing-directory "~/public_html"
  5772. :section-numbers nil
  5773. :table-of-contents nil
  5774. :style "<link rel=stylesheet
  5775. href=\"../other/mystyle.css\"
  5776. type=\"text/css\">")))
  5777. @end lisp
  5778. @node Complex example, , Simple example, Sample configuration
  5779. @subsection Example: complex publishing configuration
  5780. This more complicated example publishes an entire website, including
  5781. org files converted to HTML, image files, emacs lisp source code, and
  5782. stylesheets. The publishing-directory is remote and private files are
  5783. excluded.
  5784. To ensure that links are preserved, care should be taken to replicate
  5785. your directory structure on the web server, and to use relative file
  5786. paths. For example, if your org files are kept in @file{~/org} and your
  5787. publishable images in @file{~/images}, you'd link to an image with
  5788. @c
  5789. @example
  5790. file:../images/myimage.png
  5791. @end example
  5792. @c
  5793. On the web server, the relative path to the image should be the
  5794. same. You can accomplish this by setting up an "images" folder in the
  5795. right place on the webserver, and publishing images to it.
  5796. @lisp
  5797. (setq org-publish-project-alist
  5798. '(("orgfiles"
  5799. :base-directory "~/org/"
  5800. :base-extension "org"
  5801. :publishing-directory "/ssh:user@@host:~/html/notebook/"
  5802. :publishing-function org-publish-org-to-html
  5803. :exclude "PrivatePage.org" ;; regexp
  5804. :headline-levels 3
  5805. :section-numbers nil
  5806. :table-of-contents nil
  5807. :style "<link rel=stylesheet
  5808. href=\"../other/mystyle.css\" type=\"text/css\">"
  5809. :auto-preamble t
  5810. :auto-postamble nil)
  5811. ("images"
  5812. :base-directory "~/images/"
  5813. :base-extension "jpg\\|gif\\|png"
  5814. :publishing-directory "/ssh:user@@host:~/html/images/"
  5815. :publishing-function org-publish-attachment)
  5816. ("other"
  5817. :base-directory "~/other/"
  5818. :base-extension "css\\|el"
  5819. :publishing-directory "/ssh:user@@host:~/html/other/"
  5820. :publishing-function org-publish-attachment)
  5821. ("website" :components ("orgfiles" "images" "other"))))
  5822. @end lisp
  5823. @node Triggering publication, , Sample configuration, Publishing
  5824. @section Triggering publication
  5825. Once org-publish is properly configured, you can publish with the
  5826. following functions:
  5827. @table @kbd
  5828. @item C-c C-e C
  5829. Prompt for a specific project and publish all files that belong to it.
  5830. @item C-c C-e P
  5831. Publish the project containing the current file.
  5832. @item C-c C-e F
  5833. Publish only the current file.
  5834. @item C-c C-e A
  5835. Publish all projects.
  5836. @end table
  5837. Org uses timestamps to track when a file has changed. The above
  5838. functions normally only publish changed files. You can override this and
  5839. force publishing of all files by giving a prefix argument.
  5840. @node Miscellaneous, Extensions and Hacking, Publishing, Top
  5841. @chapter Miscellaneous
  5842. @menu
  5843. * Completion:: M-TAB knows what you need
  5844. * Customization:: Adapting Org-mode to your taste
  5845. * In-buffer settings:: Overview of the #+KEYWORDS
  5846. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  5847. * Clean view:: Getting rid of leading stars in the outline
  5848. * TTY keys:: Using Org-mode on a tty
  5849. * Interaction:: Other Emacs packages
  5850. * Bugs:: Things which do not work perfectly
  5851. @end menu
  5852. @node Completion, Customization, Miscellaneous, Miscellaneous
  5853. @section Completion
  5854. @cindex completion, of @TeX{} symbols
  5855. @cindex completion, of TODO keywords
  5856. @cindex completion, of dictionary words
  5857. @cindex completion, of option keywords
  5858. @cindex completion, of tags
  5859. @cindex completion, of property keys
  5860. @cindex completion, of link abbreviations
  5861. @cindex @TeX{} symbol completion
  5862. @cindex TODO keywords completion
  5863. @cindex dictionary word completion
  5864. @cindex option keyword completion
  5865. @cindex tag completion
  5866. @cindex link abbreviations, completion of
  5867. Org-mode supports in-buffer completion. This type of completion does
  5868. not make use of the minibuffer. You simply type a few letters into
  5869. the buffer and use the key to complete text right there.
  5870. @table @kbd
  5871. @kindex M-@key{TAB}
  5872. @item M-@key{TAB}
  5873. Complete word at point
  5874. @itemize @bullet
  5875. @item
  5876. At the beginning of a headline, complete TODO keywords.
  5877. @item
  5878. After @samp{\}, complete @TeX{} symbols supported by the exporter.
  5879. @item
  5880. After @samp{*}, complete headlines in the current buffer so that they
  5881. can be used in search links like @samp{[[*find this headline]]}.
  5882. @item
  5883. After @samp{:} in a headline, complete tags. The list of tags is taken
  5884. from the variable @code{org-tag-alist} (possibly set through the
  5885. @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
  5886. dynamically from all tags used in the current buffer.
  5887. @item
  5888. After @samp{:} and not in a headline, complete property keys. The list
  5889. of keys is constructed dynamically from all keys used in the current
  5890. buffer.
  5891. @item
  5892. After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
  5893. @item
  5894. After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
  5895. @samp{OPTIONS} which set file-specific options for Org-mode. When the
  5896. option keyword is already complete, pressing @kbd{M-@key{TAB}} again
  5897. will insert example settings for this keyword.
  5898. @item
  5899. In the line after @samp{#+STARTUP: }, complete startup keywords,
  5900. i.e. valid keys for this line.
  5901. @item
  5902. Elsewhere, complete dictionary words using ispell.
  5903. @end itemize
  5904. @end table
  5905. @node Customization, In-buffer settings, Completion, Miscellaneous
  5906. @section Customization
  5907. @cindex customization
  5908. @cindex options, for customization
  5909. @cindex variables, for customization
  5910. There are more than 180 variables that can be used to customize
  5911. Org-mode. For the sake of compactness of the manual, I am not
  5912. describing the variables here. A structured overview of customization
  5913. variables is available with @kbd{M-x org-customize}. Or select
  5914. @code{Browse Org Group} from the @code{Org->Customization} menu. Many
  5915. settings can also be activated on a per-file basis, by putting special
  5916. lines into the buffer (@pxref{In-buffer settings}).
  5917. @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
  5918. @section Summary of in-buffer settings
  5919. @cindex in-buffer settings
  5920. @cindex special keywords
  5921. Org-mode uses special lines in the buffer to define settings on a
  5922. per-file basis. These lines start with a @samp{#+} followed by a
  5923. keyword, a colon, and then individual words defining a setting. Several
  5924. setting words can be in the same line, but you can also have multiple
  5925. lines for the keyword. While these settings are described throughout
  5926. the manual, here is a summary. After changing any of those lines in the
  5927. buffer, press @kbd{C-c C-c} with the cursor still in the line to
  5928. activate the changes immediately. Otherwise they become effective only
  5929. when the file is visited again in a new Emacs session.
  5930. @table @kbd
  5931. @item #+ARCHIVE: %s_done::
  5932. This line sets the archive location for the agenda file. It applies for
  5933. all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
  5934. of the file. The first such line also applies to any entries before it.
  5935. The corresponding variable is @code{org-archive-location}.
  5936. @item #+CATEGORY:
  5937. This line sets the category for the agenda file. The category applies
  5938. for all subsequent lines until the next @samp{#+CATEGORY} line, or the
  5939. end of the file. The first such line also applies to any entries before it.
  5940. @item #+COLUMNS: %25ITEM .....
  5941. Set the default format for columns view. This format applies when
  5942. columns view is invoked in location where no COLUMNS property applies.
  5943. @item #+CONSTANTS: name1=value1 ...
  5944. Set file-local values for constants to be used in table formulas. This
  5945. line set the local variable @code{org-table-formula-constants-local}.
  5946. The global version of theis variable is
  5947. @code{org-table-formula-constants}.
  5948. corresponding
  5949. @item #+LINK: linkword replace
  5950. These lines (several are allowed) specify link abbreviations.
  5951. @xref{Link abbreviations}. The corresponding variable is
  5952. @code{org-link-abbrev-alist}.
  5953. @item #+PRIORITIES: highest lowest default
  5954. This line sets the limits and the default for the priorities. All three
  5955. must be either letters A-Z or numbers 0-9. The highest priority must
  5956. have a lower ASCII number that the lowest priority.
  5957. @item #+PROPERTY: Property_Name Value
  5958. This line sets a default inheritance value for entries in the current
  5959. buffer, most useful for specifying the allowed values of a property.
  5960. @item #+STARTUP:
  5961. This line sets options to be used at startup of Org-mode, when an
  5962. Org-mode file is being visited. The first set of options deals with the
  5963. initial visibility of the outline tree. The corresponding variable for
  5964. global default settings is @code{org-startup-folded}, with a default
  5965. value @code{t}, which means @code{overview}.
  5966. @cindex @code{overview}, STARTUP keyword
  5967. @cindex @code{content}, STARTUP keyword
  5968. @cindex @code{showall}, STARTUP keyword
  5969. @example
  5970. overview @r{top-level headlines only}
  5971. content @r{all headlines}
  5972. showall @r{no folding at all, show everything}
  5973. @end example
  5974. Then there are options for aligning tables upon visiting a file. This
  5975. is useful in files containing narrowed table columns. The corresponding
  5976. variable is @code{org-startup-align-all-tables}, with a default value
  5977. @code{nil}.
  5978. @cindex @code{align}, STARTUP keyword
  5979. @cindex @code{noalign}, STARTUP keyword
  5980. @example
  5981. align @r{align all tables}
  5982. noalign @r{don't align tables on startup}
  5983. @end example
  5984. Logging TODO state changes and clock intervals (variables
  5985. @code{org-log-done} and @code{org-log-repeat}) can be configured using
  5986. these options.
  5987. @cindex @code{logdone}, STARTUP keyword
  5988. @cindex @code{nologging}, STARTUP keyword
  5989. @cindex @code{lognotedone}, STARTUP keyword
  5990. @cindex @code{lognoteclock-out}, STARTUP keyword
  5991. @cindex @code{lognotestate}, STARTUP keyword
  5992. @cindex @code{logrepeat}, STARTUP keyword
  5993. @cindex @code{nologrepeat}, STARTUP keyword
  5994. @example
  5995. logging @r{record a timestamp when an item is marked DONE}
  5996. nologging @r{don't record when items are marked DONE}
  5997. lognotedone @r{record timestamp and a note when DONE}
  5998. lognotestate @r{record timestamp and a note when TODO state changes}
  5999. logrepeat @r{record a note when re-instating a repeating item}
  6000. nologrepeat @r{do not record when re-instating repeating item}
  6001. lognoteclock-out @r{record timestamp and a note when clocking out}
  6002. @end example
  6003. Here are the options for hiding leading stars in outline headings. The
  6004. corresponding variables are @code{org-hide-leading-stars} and
  6005. @code{org-odd-levels-only}, both with a default setting @code{nil}
  6006. (meaning @code{showstars} and @code{oddeven}).
  6007. @cindex @code{hidestars}, STARTUP keyword
  6008. @cindex @code{showstars}, STARTUP keyword
  6009. @cindex @code{odd}, STARTUP keyword
  6010. @cindex @code{even}, STARTUP keyword
  6011. @example
  6012. hidestars @r{make all but one of the stars starting a headline invisible.}
  6013. showstars @r{show all stars starting a headline}
  6014. odd @r{allow only odd outline levels (1,3,...)}
  6015. oddeven @r{allow all outline levels}
  6016. @end example
  6017. To turn on custom format overlays over time stamps (variables
  6018. @code{org-put-time-stamp-overlays} and
  6019. @code{org-time-stamp-overlay-formats}), use
  6020. @cindex @code{customtime}, STARTUP keyword
  6021. @example
  6022. customtime @r{overlay custom time format}
  6023. @end example
  6024. The following options influence the table spreadsheet (variable
  6025. @code{constants-unit-system}).
  6026. @cindex @code{constcgs}, STARTUP keyword
  6027. @cindex @code{constSI}, STARTUP keyword
  6028. @example
  6029. constcgs @r{@file{constants.el} should use the c-g-s unit system}
  6030. constSI @r{@file{constants.el} should use the SI unit system}
  6031. @end example
  6032. @item #+TAGS: TAG1(c1) TAG2(c2)
  6033. These lines (several such lines are allowed) specify the legal tags in
  6034. this file, and (potentially) the corresponding @emph{fast tag selection}
  6035. keys. The corresponding variable is @code{org-tag-alist}.
  6036. @item #+TBLFM:
  6037. This line contains the formulas for the table directly above the line.
  6038. @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS, #+DATE:
  6039. These lines provide settings for exporting files. For more details see
  6040. @ref{Export options}.
  6041. @item #+SEQ_TODO: #+TYP_TODO:
  6042. These lines set the TODO keywords and their interpretation in the
  6043. current file. The corresponding variables are @code{org-todo-keywords}
  6044. and @code{org-todo-interpretation}.
  6045. @end table
  6046. @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
  6047. @section The very busy C-c C-c key
  6048. @kindex C-c C-c
  6049. @cindex C-c C-c, overview
  6050. The key @kbd{C-c C-c} has many purposes in org-mode, which are all
  6051. mentioned scattered throughout this manual. One specific function of
  6052. this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
  6053. other circumstances it means something like @emph{Hey Org-mode, look
  6054. here and update according to what you see here}. Here is a summary of
  6055. what this means in different contexts.
  6056. @itemize @minus
  6057. @item
  6058. If there are highlights in the buffer from the creation of a sparse
  6059. tree, or from clock display, remove these highlights.
  6060. @item
  6061. If the cursor is in one of the special @code{#+KEYWORD} lines, this
  6062. triggers scanning the buffer for these lines and updating the
  6063. information.
  6064. @item
  6065. If the cursor is inside a table, realign the table. This command
  6066. works even if the automatic table editor has been turned off.
  6067. @item
  6068. If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
  6069. the entire table.
  6070. @item
  6071. If the cursor is inside a table created by the @file{table.el} package,
  6072. activate that table.
  6073. @item
  6074. If the current buffer is a remember buffer, close the note and file it.
  6075. With a prefix argument, file it, without further interaction, to the
  6076. default location.
  6077. @item
  6078. If the cursor is on a @code{<<<target>>>}, update radio targets and
  6079. corresponding links in this buffer.
  6080. @item
  6081. If the cursor is in a property line or at the start or end of a property
  6082. drawer, offer property commands.
  6083. @item
  6084. If the cursor is in a plain list item with a checkbox, toggle the status
  6085. of the checkbox.
  6086. @item
  6087. If the cursor is on a numbered item in a plain list, renumber the
  6088. ordered list.
  6089. @item
  6090. If the cursor is on the @code{#+BEGIN} line of a dynamical block, the
  6091. block is updated.
  6092. @end itemize
  6093. @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
  6094. @section A cleaner outline view
  6095. @cindex hiding leading stars
  6096. @cindex clean outline view
  6097. Some people find it noisy and distracting that the Org-mode headlines
  6098. are starting with a potentially large number of stars. For example
  6099. the tree from @ref{Headlines}:
  6100. @example
  6101. * Top level headline
  6102. ** Second level
  6103. *** 3rd level
  6104. some text
  6105. *** 3rd level
  6106. more text
  6107. * Another top level headline
  6108. @end example
  6109. @noindent
  6110. Unfortunately this is deeply ingrained into the code of Org-mode and
  6111. cannot be easily changed. You can, however, modify the display in such
  6112. a way that all leading stars become invisible and the outline more easy
  6113. to read. To do this, customize the variable
  6114. @code{org-hide-leading-stars} like this:
  6115. @lisp
  6116. (setq org-hide-leading-stars t)
  6117. @end lisp
  6118. @noindent
  6119. or change this on a per-file basis with one of the lines (anywhere in
  6120. the buffer)
  6121. @example
  6122. #+STARTUP: showstars
  6123. #+STARTUP: hidestars
  6124. @end example
  6125. @noindent
  6126. Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
  6127. the modifications.
  6128. With stars hidden, the tree becomes:
  6129. @example
  6130. * Top level headline
  6131. * Second level
  6132. * 3rd level
  6133. some text
  6134. * 3rd level
  6135. more text
  6136. * Another top level headline
  6137. @end example
  6138. @noindent
  6139. Note that the leading stars are not truly replaced by whitespace, they
  6140. are only fontified with the face @code{org-hide} that uses the
  6141. background color as font color. If you are not using either white or
  6142. black background, you may have to customize this face to get the wanted
  6143. effect. Another possibility is to set this font such that the extra
  6144. stars are @i{almost} invisible, for example using the color
  6145. @code{grey90} on a white background.
  6146. Things become cleaner still if you skip all the even levels and use only
  6147. odd levels 1, 3, 5..., effectively adding two stars to go from one
  6148. outline level to the next:
  6149. @example
  6150. * Top level headline
  6151. * Second level
  6152. * 3rd level
  6153. some text
  6154. * 3rd level
  6155. more text
  6156. * Another top level headline
  6157. @end example
  6158. @noindent
  6159. In order to make the structure editing and export commands handle this
  6160. convention correctly, use
  6161. @lisp
  6162. (setq org-odd-levels-only t)
  6163. @end lisp
  6164. @noindent
  6165. or set this on a per-file basis with one of the following lines (don't
  6166. forget to press @kbd{C-c C-c} with the cursor in the startup line to
  6167. activate changes immediately).
  6168. @example
  6169. #+STARTUP: odd
  6170. #+STARTUP: oddeven
  6171. @end example
  6172. You can convert an Org-mode file from single-star-per-level to the
  6173. double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
  6174. RET} in that file. The reverse operation is @kbd{M-x
  6175. org-convert-to-oddeven-levels}.
  6176. @node TTY keys, Interaction, Clean view, Miscellaneous
  6177. @section Using org-mode on a tty
  6178. @cindex tty keybindings
  6179. Org-mode uses a number of keys that are not accessible on a tty. This
  6180. applies to most special keys like cursor keys, @key{TAB} and
  6181. @key{RET}, when these are combined with modifier keys like @key{Meta}
  6182. and/or @key{Shift}. Org-mode uses these bindings because it needs to
  6183. provide keys for a large number of commands, and because these keys
  6184. appeared particularly easy to remember. In order to still be able to
  6185. access the core functionality of Org-mode on a tty, alternative
  6186. bindings are provided. Here is a complete list of these bindings,
  6187. which are obviously more cumbersome to use. Note that sometimes a
  6188. work-around can be better. For example changing a time stamp is
  6189. really only fun with @kbd{S-@key{cursor}} keys. On a tty you would
  6190. rather use @kbd{C-c .} to re-insert the timestamp.
  6191. @multitable @columnfractions 0.15 0.2 0.2
  6192. @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
  6193. @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
  6194. @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
  6195. @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
  6196. @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}}
  6197. @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
  6198. @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
  6199. @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
  6200. @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
  6201. @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
  6202. @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
  6203. @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
  6204. @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
  6205. @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab
  6206. @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab
  6207. @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab
  6208. @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab
  6209. @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
  6210. @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
  6211. @end multitable
  6212. @node Interaction, Bugs, TTY keys, Miscellaneous
  6213. @section Interaction with other packages
  6214. @cindex packages, interaction with other
  6215. Org-mode lives in the world of GNU Emacs and interacts in various ways
  6216. with other code out there.
  6217. @menu
  6218. * Cooperation:: Packages Org-mode cooperates with
  6219. * Conflicts:: Packages that lead to conflicts
  6220. @end menu
  6221. @node Cooperation, Conflicts, Interaction, Interaction
  6222. @subsection Packages that Org-mode cooperates with
  6223. @table @asis
  6224. @cindex @file{calc.el}
  6225. @item @file{calc.el} by Dave Gillespie
  6226. Org-mode uses the calc package for implementing spreadsheet
  6227. functionality in its tables (@pxref{The spreadsheet}). Org-mode
  6228. checks for the availability of calc by looking for the function
  6229. @code{calc-eval} which should be autoloaded in your setup if calc has
  6230. been installed properly. As of Emacs 22, calc is part of the Emacs
  6231. distribution. Another possibility for interaction between the two
  6232. packages is using calc for embedded calculations. @xref{Embedded Mode,
  6233. , Embedded Mode, calc, GNU Emacs Calc Manual}.
  6234. @cindex @file{constants.el}
  6235. @item @file{constants.el} by Carsten Dominik
  6236. In a table formula (@pxref{The spreadsheet}), it is possible to use
  6237. names for natural constants or units. Instead of defining your own
  6238. constants in the variable @code{org-table-formula-constants}, install
  6239. the @file{constants} package which defines a large number of constants
  6240. and units, and lets you use unit prefixes like @samp{M} for
  6241. @samp{Mega} etc. You will need version 2.0 of this package, available
  6242. at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
  6243. the function @code{constants-get}, which has to be autoloaded in your
  6244. setup. See the installation instructions in the file
  6245. @file{constants.el}.
  6246. @item @file{cdlatex.el} by Carsten Dominik
  6247. @cindex @file{cdlatex.el}
  6248. Org-mode can make use of the cdlatex package to efficiently enter
  6249. La@TeX{} fragments into Org-mode files. See @ref{CDLaTeX mode}.
  6250. @item @file{remember.el} by John Wiegley
  6251. @cindex @file{remember.el}
  6252. Org mode cooperates with remember, see @ref{Remember}.
  6253. @file{Remember.el} is not part of Emacs, find it on the web.
  6254. @cindex @file{table.el}
  6255. @item @file{table.el} by Takaaki Ota
  6256. @kindex C-c C-c
  6257. @cindex table editor, @file{table.el}
  6258. @cindex @file{table.el}
  6259. Complex ASCII tables with automatic line wrapping, column- and
  6260. row-spanning, and alignment can be created using the Emacs table
  6261. package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
  6262. and also part of Emacs 22).
  6263. When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
  6264. will call @command{table-recognize-table} and move the cursor into the
  6265. table. Inside a table, the keymap of Org-mode is inactive. In order
  6266. to execute Org-mode-related commands, leave the table.
  6267. @table @kbd
  6268. @kindex C-c C-c
  6269. @item C-c C-c
  6270. Recognize @file{table.el} table. Works when the cursor is in a
  6271. table.el table.
  6272. @c
  6273. @kindex C-c ~
  6274. @item C-c ~
  6275. Insert a table.el table. If there is already a table at point, this
  6276. command converts it between the table.el format and the Org-mode
  6277. format. See the documentation string of the command
  6278. @code{org-convert-table} for the restrictions under which this is
  6279. possible.
  6280. @end table
  6281. @file{table.el} is part of Emacs 22.
  6282. @cindex @file{footnote.el}
  6283. @item @file{footnote.el} by Steven L. Baur
  6284. Org-mode recognizes numerical footnotes as provided by this package
  6285. (@pxref{Footnotes}).
  6286. @end table
  6287. @node Conflicts, , Cooperation, Interaction
  6288. @subsection Packages that lead to conflicts with Org-mode
  6289. @table @asis
  6290. @cindex @file{allout.el}
  6291. @item @file{allout.el} by Ken Manheimer
  6292. Startup of Org-mode may fail with the error message
  6293. @code{(wrong-type-argument keymapp nil)} when there is an outdated
  6294. version @file{allout.el} on the load path, for example the version
  6295. distributed with Emacs 21.x. Upgrade to Emacs 22 and this problem will
  6296. disappear. If for some reason you cannot do this, make sure that org.el
  6297. is loaded @emph{before} @file{allout.el}, for example by putting
  6298. @code{(require 'org)} early enough into your @file{.emacs} file.
  6299. @cindex @file{CUA.el}
  6300. @item @file{CUA.el} by Kim. F. Storm
  6301. Keybindings in Org-mode conflict with the @kbd{S-<cursor>} keys
  6302. used by CUA-mode (as well as pc-select-mode and s-region-mode) to
  6303. select and extend the region. If you want to use one of these
  6304. packages along with Org-mode, configure the variable
  6305. @code{org-CUA-compatible}. When set, Org-mode will move the following
  6306. keybindings in Org-mode files, and in the agenda buffer (but not
  6307. during date selection).
  6308. @example
  6309. S-UP -> M-p S-DOWN -> M-n
  6310. S-LEFT -> M-- S-RIGHT -> M-+
  6311. @end example
  6312. Yes, these are unfortunately more difficult to remember. If you want
  6313. to have other replacement keys, look at the variable
  6314. @code{org-disputed-keys}.
  6315. @item @file{windmove.el} by Hovav Shacham
  6316. @cindex @file{windmove.el}
  6317. Also this package uses the @kbd{S-<cursor>} keys, so everything written
  6318. in the paragraph above about CUA mode also applies here.
  6319. @cindex @file{footnote.el}
  6320. @item @file{footnote.el} by Steven L. Baur
  6321. Org-mode supports the syntax of the footnote package, but only the
  6322. numerical footnote markers. Also, the default key for footnote
  6323. commands, @kbd{C-c !} is already used by Org-mode. You could use the
  6324. variable @code{footnote-prefix} to switch footnotes commands to another
  6325. key. Or, you could use @code{org-replace-disputed-keys} and
  6326. @code{org-disputed-keys} to change the settings in Org-mode.
  6327. @end table
  6328. @node Bugs, , Interaction, Miscellaneous
  6329. @section Bugs
  6330. @cindex bugs
  6331. Here is a list of things that should work differently, but which I
  6332. have found too hard to fix.
  6333. @itemize @bullet
  6334. @item
  6335. If a table field starts with a link, and if the corresponding table
  6336. column is narrowed (@pxref{Narrow columns}) to a width too small to
  6337. display the link, the field would look entirely empty even though it is
  6338. not. To prevent this, Org-mode throws an error. The work-around is to
  6339. make the column wide enough to fit the link, or to add some text (at
  6340. least 2 characters) before the link in the same field.
  6341. @item
  6342. Narrowing table columns does not work on XEmacs, because the
  6343. @code{format} function does not transport text properties.
  6344. @item
  6345. Text in an entry protected with the @samp{QUOTE} keyword should not
  6346. autowrap.
  6347. @item
  6348. When the application called by @kbd{C-c C-o} to open a file link fails
  6349. (for example because the application does not exist or refuses to open
  6350. the file), it does so silently. No error message is displayed.
  6351. @item
  6352. Recalculating a table line applies the formulas from left to right.
  6353. If a formula uses @emph{calculated} fields further down the row,
  6354. multiple recalculation may be needed to get all fields consistent. You
  6355. may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
  6356. recalculate until convergence.
  6357. @item
  6358. A single letter cannot be made bold, for example @samp{*a*}.
  6359. @item
  6360. The exporters work well, but could be made more efficient.
  6361. @end itemize
  6362. @node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
  6363. @appendix Extensions, Hooks and Hacking
  6364. This appendix lists extensions for Org-mode written by other authors.
  6365. It also covers some aspects where users can extend the functionality of
  6366. Org-mode.
  6367. @menu
  6368. * Extensions:: Existing 3rd-part extensions
  6369. * Adding hyperlink types:: New custom link types
  6370. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  6371. * Dynamic blocks:: Automatically filled blocks
  6372. * Special agenda views:: Customized views
  6373. * Using the property API:: Writing programs that use entry properties
  6374. @end menu
  6375. @node Extensions, Adding hyperlink types, Extensions and Hacking, Extensions and Hacking
  6376. @section Third-party extensions for Org-mode
  6377. @cindex extension, third-party
  6378. The following extensions for Org-mode have been written by other people:
  6379. @table @asis
  6380. @cindex @file{org-publish.el}
  6381. @item @file{org-publish.el} by David O'Toole
  6382. This package provides facilities for publishing related sets of Org-mode
  6383. files together with linked files like images as webpages. It is
  6384. highly configurable and can be used for other publishing purposes as
  6385. well. As of Org-mode version 4.30, @file{org-publish.el} is part of the
  6386. Org-mode distribution. It is not yet part of Emacs, however, a delay
  6387. caused by the preparations for the 22.1 release. In the mean time,
  6388. @file{org-publish.el} can be downloaded from David's site:
  6389. @url{http://dto.freeshell.org/e/org-publish.el}.
  6390. @cindex @file{org-mouse.el}
  6391. @item @file{org-mouse.el} by Piotr Zielinski
  6392. This package implements extended mouse functionality for Org-mode. It
  6393. allows you to cycle visibility and to edit the document structure with
  6394. the mouse. Best of all, it provides a context-sensitive menu on
  6395. @key{mouse-3} that changes depending on the context of a mouse-click.
  6396. As of Org-mode version 4.53, @file{org-mouse.el} is part of the
  6397. Org-mode distribution. It is not yet part of Emacs, however, a delay
  6398. caused by the preparations for the 22.1 release. In the mean time,
  6399. @file{org-mouse.el} can be downloaded from Piotr's site:
  6400. @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
  6401. @cindex @file{org-blog.el}
  6402. @item @file{org-blog.el} by David O'Toole
  6403. A blogging plug-in for @file{org-publish.el}.@*
  6404. @url{http://dto.freeshell.org/notebook/OrgMode.html}.
  6405. @cindex @file{blorg.el}
  6406. @item @file{blorg.el} by Bastien Guerry
  6407. Publish Org-mode files as
  6408. blogs. @url{http://www.cognition.ens.fr/~guerry/blorg.html}.
  6409. @cindex @file{org2rem.el}
  6410. @item @file{org2rem.el} by Bastien Guerry
  6411. Translates Org-mode files into something readable by
  6412. Remind. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
  6413. @item @file{org-toc.el} by Bastien Guerry
  6414. Produces a simple table of contents of an Org-mode file, for easy
  6415. navigation. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
  6416. @item @file{org-registry.el} by Bastien Guerry
  6417. Find which Org-file link to a certain document.
  6418. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
  6419. @end table
  6420. @page
  6421. @node Adding hyperlink types, Tables in arbitrary syntax, Extensions, Extensions and Hacking
  6422. @section Adding hyperlink types
  6423. @cindex hyperlinks, adding new types
  6424. Org-mode has a large number of hyperlink types built-in
  6425. (@pxref{Hyperlinks}). If you would like to add new link types, it
  6426. provides an interface for doing so. Lets look at an example file
  6427. @file{org-man.el} that will add support for creating links like
  6428. @samp{[[man:printf][The printf manpage]]} to show unix manual pages inside
  6429. emacs:
  6430. @lisp
  6431. ;;; org-man.el - Support for links to manpages in Org-mode
  6432. (require 'org)
  6433. (org-add-link-type "man" 'org-man-open)
  6434. (add-hook 'org-store-link-functions 'org-man-store-link)
  6435. (defcustom org-man-command 'man
  6436. "The Emacs command to be used to display a man page."
  6437. :group 'org-link
  6438. :type '(choice (const man) (const woman)))
  6439. (defun org-man-open (path)
  6440. "Visit the manpage on PATH.
  6441. PATH should be a topic that can be thrown at the man command."
  6442. (funcall org-man-command path))
  6443. (defun org-man-store-link ()
  6444. "Store a link to a manpage."
  6445. (when (memq major-mode '(Man-mode woman-mode))
  6446. ;; This is a man page, we do make this link
  6447. (let* ((page (org-man-get-page-name))
  6448. (link (concat "man:" page))
  6449. (description (format "Manpage for %s" page)))
  6450. (org-store-link-props
  6451. :type "man"
  6452. :link link
  6453. :description description))))
  6454. (defun org-man-get-page-name ()
  6455. "Extract the page name from the buffer name."
  6456. ;; This works for both `Man-mode' and `woman-mode'.
  6457. (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
  6458. (match-string 1 (buffer-name))
  6459. (error "Cannot create link to this man page")))
  6460. (provide 'org-man)
  6461. ;;; org-man.el ends here
  6462. @end lisp
  6463. @noindent
  6464. You would activate this new link type in @file{.emacs} with
  6465. @lisp
  6466. (require 'org-man)
  6467. @end lisp
  6468. @noindent
  6469. Lets go through the file and see what it does.
  6470. @enumerate
  6471. @item
  6472. It does @code{(require 'org)} to make sure that @file{org.el} has been
  6473. loaded.
  6474. @item
  6475. The next line calls @code{org-add-link-type} to define a new link type
  6476. with prefix @samp{man}. The call also contains the name of a function
  6477. that will be called to follow such a link.
  6478. @item
  6479. The next line adds a function to @code{org-store-link-functions}, in
  6480. order to allow the command @kbd{C-c l} to record a useful link in a
  6481. buffer displaying a man page.
  6482. @end enumerate
  6483. The rest of the file defines the necessary variables and functions.
  6484. First there is a customization variable that determines which emacs
  6485. command should be used to display manpages. There are two options,
  6486. @code{man} and @code{woman}. Then the function to follow a link is
  6487. defined. It gets the link path as an argument - in this case the link
  6488. path is just a topic for the manual command. The function calls the
  6489. value of @code{org-man-command} to display the man page.
  6490. Finally the function @code{org-man-store-link} is defined. When you try
  6491. to store a link with @kbd{C-c l}, also this function will be called to
  6492. try to make a link. The function must first decide if it is supposed to
  6493. create the link for this buffer type, we do this by checking the value
  6494. of the variable @code{major-mode}. If not, the function must exit and
  6495. retunr the value @code{nil}. If yes, the link is created by getting the
  6496. manual tpoic from the buffer name and prefixing it with the string
  6497. @samp{man:}. Then it must call the command @code{org-store-link-props}
  6498. and set the @code{:type} and @code{:link} properties. Optionally you
  6499. can also set the @code{:description} property to provide a default for
  6500. the link description when the link is later inserted into tan Org-mode
  6501. buffer with @kbd{C-c C-l}.
  6502. @node Tables in arbitrary syntax, Dynamic blocks, Adding hyperlink types, Extensions and Hacking
  6503. @section Tables in arbitrary syntax
  6504. @cindex tables, in other modes
  6505. @cindex orgtbl-mode
  6506. Since Orgtbl-mode can be used as a minor mode in arbitrary buffers, a
  6507. frequent feature request has been to make it work with native tables in
  6508. specific languages, for example La@TeX{}. However, this is extremely hard
  6509. to do in a general way, would lead to a customization nightmare, and
  6510. would take away much of the simplicity of the Orgtbl-mode table editor.
  6511. This appendix describes a different approach. We keep the Orgtbl-mode
  6512. table in its native format (the @i{source table}), and use a custom
  6513. function to @i{translate} the table to the correct syntax, and to
  6514. @i{install} it in the right location (the @i{target table}). This puts
  6515. the burden of writing conversion functions on the user, but it allows
  6516. for a very flexible system.
  6517. @menu
  6518. * Radio tables:: Sending and receiving
  6519. * A LaTeX example:: Step by step, almost a tutorial
  6520. * Translator functions:: Copy and modify
  6521. @end menu
  6522. @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
  6523. @subsection Radio tables
  6524. @cindex radio tables
  6525. To define the location of the target table, you first need to create two
  6526. lines that are comments in the current mode, but contain magic words for
  6527. Orgtbl-mode to find. Orgtbl-mode will insert the translated table
  6528. between these lines, replacing whatever was there before. For example:
  6529. @example
  6530. /* BEGIN RECEIVE ORGTBL table_name */
  6531. /* END RECEIVE ORGTBL table_name */
  6532. @end example
  6533. @noindent
  6534. Just above the source table, we put a special line that tells
  6535. Orgtbl-mode how to translate this table and where to install it. For
  6536. example:
  6537. @example
  6538. #+ORGTBL: SEND table_name translation_function arguments....
  6539. @end example
  6540. @noindent
  6541. @code{table_name} is the reference name for the table that is also used
  6542. in the receiver lines. @code{translation_function} is the Lisp function
  6543. that does the translation. Furthermore, the line can contain a list of
  6544. arguments (alternating key and value) at the end. The arguments will be
  6545. passed as a property list to the translation function for
  6546. interpretation. A few standard parameters are already recognized and
  6547. acted upon before the translation function is called:
  6548. @table @code
  6549. @item :skip N
  6550. Skip the first N lines of the table. Hlines do count!
  6551. @item :skipcols (n1 n2 ...)
  6552. List of columns that should be skipped. If the table has a column with
  6553. calculation marks, that column is automatically discarded as well.
  6554. Please note that the translator function sees the table @emph{after} the
  6555. removal of these columns, the function never knows that there have been
  6556. additional columns.
  6557. @end table
  6558. @noindent
  6559. The one problem remaining is how to keep the source table in the buffer
  6560. without disturbing the normal workings of the file, for example during
  6561. compilation of a C file or processing of a La@TeX{} file. There are a
  6562. number of different solutions:
  6563. @itemize @bullet
  6564. @item
  6565. The table could be placed in a block comment if that is supported by the
  6566. language. For example, in C-mode you could wrap the table between
  6567. @samp{/*} and @samp{*/} lines.
  6568. @item
  6569. Sometimes it is possible to put the table after some kind of @i{END}
  6570. statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
  6571. in La@TeX{}.
  6572. @item
  6573. You can just comment the table line by line whenever you want to process
  6574. the file, and uncomment it whenever you need to edit the table. This
  6575. only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
  6576. make this comment-toggling very easy, in particular if you bind it to a
  6577. key.
  6578. @end itemize
  6579. @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
  6580. @subsection A LaTeX example
  6581. @cindex LaTeX, and orgtbl-mode
  6582. The best way to wrap the source table in La@TeX{} is to use the
  6583. @code{comment} environment provided by @file{comment.sty}. It has to be
  6584. activated by placing @code{\usepackage@{comment@}} into the document
  6585. header. Orgtbl-mode can insert a radio table skeleton@footnote{By
  6586. default this works only for La@TeX{}, HTML, and TeXInfo. Configure the
  6587. variable @code{orgtbl-radio-tables} to install templates for other
  6588. modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
  6589. be prompted for a table name, lets say we use @samp{salesfigures}. You
  6590. will then get the following template:
  6591. @example
  6592. % BEGIN RECEIVE ORGTBL salesfigures
  6593. % END RECEIVE ORGTBL salesfigures
  6594. \begin@{comment@}
  6595. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  6596. | | |
  6597. \end@{comment@}
  6598. @end example
  6599. @noindent
  6600. The @code{#+ORGTBL: SEND} line tells orgtbl-mode to use the function
  6601. @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
  6602. into the receiver location with name @code{salesfigures}. You may now
  6603. fill in the table, feel free to use the spreadsheet features@footnote{If
  6604. the @samp{#+TBLFM} line contains an odd number of dollar characters,
  6605. this may cause problems with font-lock in latex-mode. As shown in the
  6606. example you can fix this by adding an extra line inside the
  6607. @code{comment} environment that is used to balance the dollar
  6608. expressions. If you are using AUCTeX with the font-latex library, a
  6609. much better solution is to add the @code{comment} environment to the
  6610. variable @code{LaTeX-verbatim-environments}.}:
  6611. @example
  6612. % BEGIN RECEIVE ORGTBL salesfigures
  6613. % END RECEIVE ORGTBL salesfigures
  6614. \begin@{comment@}
  6615. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  6616. | Month | Days | Nr sold | per day |
  6617. |-------+------+---------+---------|
  6618. | Jan | 23 | 55 | 2.4 |
  6619. | Feb | 21 | 16 | 0.8 |
  6620. | March | 22 | 278 | 12.6 |
  6621. #+TBLFM: $4=$3/$2;%.1f
  6622. % $ (optional extra dollar to keep font-lock happy, see footnote)
  6623. \end@{comment@}
  6624. @end example
  6625. @noindent
  6626. When you are done, press @kbd{C-c C-c} in the table to get the converted
  6627. table inserted between the two marker lines.
  6628. Now lets assume you want to make the table header by hand, because you
  6629. want to control how columns are aligned etc. In this case we make sure
  6630. that the table translator does skip the first 2 lines of the source
  6631. table, and tell the command to work as a @i{splice}, i.e. to not produce
  6632. header and footer commands of the target table:
  6633. @example
  6634. \begin@{tabular@}@{lrrr@}
  6635. Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
  6636. % BEGIN RECEIVE ORGTBL salesfigures
  6637. % END RECEIVE ORGTBL salesfigures
  6638. \end@{tabular@}
  6639. %
  6640. \begin@{comment@}
  6641. #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
  6642. | Month | Days | Nr sold | per day |
  6643. |-------+------+---------+---------|
  6644. | Jan | 23 | 55 | 2.4 |
  6645. | Feb | 21 | 16 | 0.8 |
  6646. | March | 22 | 278 | 12.6 |
  6647. #+TBLFM: $4=$3/$2;%.1f
  6648. \end@{comment@}
  6649. @end example
  6650. The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
  6651. Orgtbl-mode. It uses a @code{tabular} environment to typeset the table
  6652. and marks horizontal lines with @code{\hline}. Furthermore, it
  6653. interprets the following parameters:
  6654. @table @code
  6655. @item :splice nil/t
  6656. When set to t, return only table body lines, don't wrap them into a
  6657. tabular environment. Default is nil.
  6658. @item :fmt fmt
  6659. A format to be used to wrap each field, should contain @code{%s} for the
  6660. original field value. For example, to wrap each field value in dollars,
  6661. you could use @code{:fmt "$%s$"}. This may also be a property list with
  6662. column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
  6663. @item :efmt efmt
  6664. Use this format to print numbers with exponentials. The format should
  6665. have @code{%s} twice for inserting mantissa and exponent, for example
  6666. @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
  6667. may also be a property list with column numbers and formats, for example
  6668. @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
  6669. @code{efmt} has been applied to a value, @code{fmt} will also be
  6670. applied.
  6671. @end table
  6672. @node Translator functions, , A LaTeX example, Tables in arbitrary syntax
  6673. @subsection Translator functions
  6674. @cindex HTML, and orgtbl-mode
  6675. @cindex translator function
  6676. Orgtbl-mode has several translator functions built-in:
  6677. @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and
  6678. @code{orgtbl-to-texinfo}. Except for @code{orgtbl-to-html}@footnote{The
  6679. HTML translator uses the same code that produces tables during HTML
  6680. export.}, these all use a generic translator, @code{orgtbl-to-generic}.
  6681. For example, @code{orgtbl-to-latex} itself is a very short function that
  6682. computes the column definitions for the @code{tabular} environment,
  6683. defines a few field and line separators and then hands over to the
  6684. generic translator. Here is the entire code:
  6685. @lisp
  6686. @group
  6687. (defun orgtbl-to-latex (table params)
  6688. "Convert the orgtbl-mode TABLE to LaTeX."
  6689. (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
  6690. org-table-last-alignment ""))
  6691. (params2
  6692. (list
  6693. :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
  6694. :tend "\\end@{tabular@}"
  6695. :lstart "" :lend " \\\\" :sep " & "
  6696. :efmt "%s\\,(%s)" :hline "\\hline")))
  6697. (orgtbl-to-generic table (org-combine-plists params2 params))))
  6698. @end group
  6699. @end lisp
  6700. As you can see, the properties passed into the function (variable
  6701. @var{PARAMS}) are combined with the ones newly defined in the function
  6702. (variable @var{PARAMS2}). The ones passed into the function (i.e. the
  6703. ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
  6704. would like to use the La@TeX{} translator, but wanted the line endings to
  6705. be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
  6706. overrule the default with
  6707. @example
  6708. #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
  6709. @end example
  6710. For a new language, you can either write your own converter function in
  6711. analogy with the La@TeX{} translator, or you can use the generic function
  6712. directly. For example, if you have a language where a table is started
  6713. with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
  6714. started with @samp{!BL!}, ended with @samp{!EL!} and where the field
  6715. separator is a TAB, you could call the generic translator like this (on
  6716. a single line!):
  6717. @example
  6718. #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
  6719. :lstart "!BL! " :lend " !EL!" :sep "\t"
  6720. @end example
  6721. @noindent
  6722. Please check the documentation string of the function
  6723. @code{orgtbl-to-generic} for a full list of parameters understood by
  6724. that function and remember that you can pass each of them into
  6725. @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
  6726. using the generic function.
  6727. Of course you can also write a completely new function doing complicated
  6728. things the generic translator cannot do. A translator function takes
  6729. two arguments. The first argument is the table, a list of lines, each
  6730. line either the symbol @code{hline} or a list of fields. The second
  6731. argument is the property list containing all parameters specified in the
  6732. @samp{#+ORGTBL: SEND} line. The function must return a single string
  6733. containing the formatted table. If you write a generally useful
  6734. translator, please post it on @code{emacs-orgmode@@gnu.org} so that
  6735. others can benefit from your work.
  6736. @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Extensions and Hacking
  6737. @section Dynamic blocks
  6738. @cindex dynamic blocks
  6739. Org-mode documents can contain @emph{dynamic blocks}. These are
  6740. specially marked regions that are updated by some user-written function.
  6741. A good example for such a block is the clock table inserted by the
  6742. command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
  6743. Dynamic block are enclosed by a BEGIN-END structure that assigns a name
  6744. to the block and can also specify parameters for the function producing
  6745. the content of the block.
  6746. @example
  6747. #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
  6748. #+END:
  6749. @end example
  6750. Dynamic blocks are updated with the following commands
  6751. @table @kbd
  6752. @kindex C-c C-x C-u
  6753. @item C-c C-x C-u
  6754. Update dynamic block at point.
  6755. @kindex C-u C-c C-x C-u
  6756. @item C-u C-c C-x C-u
  6757. Update all dynamic blocks in the current file.
  6758. @end table
  6759. Updating a dynamic block means to remove all the text between BEGIN and
  6760. END, parse the BEGIN line for parameters and then call the specific
  6761. writer function for this block to insert the new content. For a block
  6762. with name @code{myblock}, the writer function is
  6763. @code{org-dblock-write:myblock} with as only parameter a property list
  6764. with the parameters given in the begin line. Here is a trivial example
  6765. of a block that keeps track of when the block update function was last
  6766. run:
  6767. @example
  6768. #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
  6769. #+END:
  6770. @end example
  6771. @noindent
  6772. The corresponding block writer function could look like this:
  6773. @lisp
  6774. (defun org-dblock-write:block-update-time (params)
  6775. (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
  6776. (insert "Last block update at: "
  6777. (format-time-string fmt (current-time)))))
  6778. @end lisp
  6779. If you want to make sure that all dynamic blocks are always up-to-date,
  6780. you could add the function @code{org-update-all-dblocks} to a hook, for
  6781. example @code{before-save-hook}. @code{org-update-all-dblocks} is
  6782. written in a way that is does nothing in buffers that are not in Org-mode.
  6783. @node Special agenda views, Using the property API, Dynamic blocks, Extensions and Hacking
  6784. @section Special Agenda Views
  6785. @cindex agenda views, user-defined
  6786. Org-mode provides a special hook that can be used to narrow down the
  6787. selection made by any of the agenda views. You may specify a function
  6788. that is used at each match to verify if the match should indeed be part
  6789. of the agenda view, and if not, how much should be skipped.
  6790. Let's say you want to produce a list of projects that contain a WAITING
  6791. tag anywhere in the project tree. Let's further assume that you have
  6792. marked all tree headings that define a project with the todo keyword
  6793. PROJECT. In this case you would run a todo search for the keyword
  6794. PROJECT, but skip the match unless there is a WAITING tag anywhere in
  6795. the subtree belonging to the project line.
  6796. To achieve this, you must write a function that searches the subtree for
  6797. the tag. If the tag is found, the function must return @code{nil} to
  6798. indicate that this match should not be skipped. If there is no such
  6799. tag, return the location of the end of the subtree, to indicate that
  6800. search should continue from there.
  6801. @lisp
  6802. (defun my-skip-unless-waiting ()
  6803. "Skip trees that are not waiting"
  6804. (let ((subtree-end (save-excursion (org-end-of-subtree t))))
  6805. (if (re-search-forward ":WAITING:" subtree-end t)
  6806. nil ; tag found, do not skip
  6807. subtree-end))) ; tag not found, continue after end of subtree
  6808. @end lisp
  6809. Now you may use this function in an agenda custom command, for example
  6810. like this:
  6811. @lisp
  6812. (org-add-agenda-custom-command
  6813. '("b" todo "PROJECT"
  6814. ((org-agenda-skip-function 'my-org-waiting-projects)
  6815. (org-agenda-overriding-header "Projects waiting for something: "))))
  6816. @end lisp
  6817. Note that this also binds @code{org-agenda-overriding-header} to get a
  6818. meaningful header in the agenda view.
  6819. You may also put a Lisp form into @code{org-agenda-skip-function}. In
  6820. particular, you may use the functions @code{org-agenda-skip-entry-if}
  6821. and @code{org-agenda-skip-subtree-if} in this form, for example:
  6822. @table @code
  6823. @item '(org-agenda-skip-entry-if 'scheduled)
  6824. Skip current entry if it has been scheduled.
  6825. @item '(org-agenda-skip-entry-if 'notscheduled)
  6826. Skip current entry if it has not been scheduled.
  6827. @item '(org-agenda-skip-entry-if 'deadline)
  6828. Skip current entry if it has a deadline.
  6829. @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
  6830. Skip current entry if it has a deadline, or if it is scheduled.
  6831. @item '(org-agenda-skip-entry 'regexp "regular expression")
  6832. Skip current entry if the regular expression matches in the entry.
  6833. @item '(org-agenda-skip-entry 'notregexp "regular expression")
  6834. Skip current entry unless the regular expression matches.
  6835. @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
  6836. Same as above, but check and skip the entire subtree.
  6837. @end table
  6838. Therefore we could also have written the search for WAITING projects
  6839. like this, even without defining a special function:
  6840. @lisp
  6841. (org-add-agenda-custom-command
  6842. '("b" todo "PROJECT"
  6843. ((org-agenda-skip-function '(org-agenda-skip-subtree-if
  6844. 'regexp ":WAITING:"))
  6845. (org-agenda-overriding-header "Projects waiting for something: "))))
  6846. @end lisp
  6847. @node Using the property API, , Special agenda views, Extensions and Hacking
  6848. @section Using the property API
  6849. @cindex API, for properties
  6850. @cindex properties, API
  6851. Here is a description of the functions that can be used to work with
  6852. properties.
  6853. @defun org-entry-properties &optional pom which
  6854. Get all properties of the entry at point-or-marker POM.
  6855. This includes the TODO keyword, the tags, time strings for deadline,
  6856. scheduled, and clocking, and any additional properties defined in the
  6857. entry. The return value is an alist, keys may occur multiple times
  6858. if the property key was used several times.
  6859. POM may also be nil, in which case the current entry is used.
  6860. If WHICH is nil or `all', get all properties. If WHICH is
  6861. `special' or `standard', only get that subclass.
  6862. @end defun
  6863. @defun org-entry-get pom property &optional inherit
  6864. Get value of PROPERTY for entry at point-or-marker POM.
  6865. If INHERIT is non-nil and the entry does not have the property,
  6866. then also check higher levels of the hierarchy.
  6867. @end defun
  6868. @defun org-entry-delete pom property
  6869. Delete the property PROPERTY from entry at point-or-marker POM.
  6870. @end defun
  6871. @defun org-entry-put pom property value
  6872. Set PROPERTY to VALUE for entry at point-or-marker POM.
  6873. @end defun
  6874. @defun org-buffer-property-keys &optional include-specials
  6875. Get all property keys in the current buffer.
  6876. @end defun
  6877. @defun org-insert-property-drawer
  6878. Insert a property drawer at point.
  6879. @end defun
  6880. @node History and Acknowledgments, Index, Extensions and Hacking, Top
  6881. @appendix History and Acknowledgments
  6882. @cindex acknowledgments
  6883. @cindex history
  6884. @cindex thanks
  6885. Org-mode was borne in 2003, out of frustration over the user interface
  6886. of the Emacs outline-mode. I was trying to organize my notes and
  6887. projects, and using Emacs seemed to be the natural way to go. However,
  6888. having to remember eleven different commands with two or three keys per
  6889. command, only to hide and unhide parts of the outline tree, that seemed
  6890. entirely unacceptable to me. Also, when using outlines to take notes, I
  6891. constantly want to restructure the tree, organizing it parallel to my
  6892. thoughts and plans. @emph{Visibility cycling} and @emph{structure
  6893. editing} were originally implemented in the package
  6894. @file{outline-magic.el}, but quickly moved to the more general
  6895. @file{org.el}. As this environment became comfortable for project
  6896. planning, the next step was adding @emph{TODO entries}, basic @emph{time
  6897. stamps}, and @emph{table support}. These areas highlight the two main
  6898. goals that Org-mode still has today: To create a new, outline-based,
  6899. plain text mode with innovative and intuitive editing features, and to
  6900. incorporate project planning functionality directly into a notes file.
  6901. Since the first release, literally thousands of emails to me or on
  6902. @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
  6903. reports, feedback, new ideas, and sometimes patches and add-on code.
  6904. Many thanks to everyone who has helped to improve this package. I am
  6905. trying to keep here a list of the people who had significant influence
  6906. in shaping one or more aspects of Org-mode. The list may not be
  6907. complete, if I have forgotten someone, please accept my apologies and
  6908. let me know.
  6909. @itemize @bullet
  6910. @item
  6911. @i{Russel Adams} came up with the idea for drawers.
  6912. @item
  6913. @i{Thomas Baumann} contributed the code for links to the MH-E email
  6914. system.
  6915. @item
  6916. @i{Alex Bochannek} provided a patch for rounding time stamps.
  6917. @item
  6918. @i{Charles Cave}'s suggestion sparked the implementation of templates
  6919. for Remember.
  6920. @item
  6921. @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
  6922. specified time.
  6923. @item
  6924. @i{Gregory Chernov} patched support for lisp forms into table
  6925. calculations and improved XEmacs compatibility, in particular by porting
  6926. @file{nouline.el} to XEmacs.
  6927. @item
  6928. @i{Sacha Chua} suggested to copy some linking code from Planner.
  6929. @item
  6930. @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
  6931. came up with the idea of properties, and that there should be an API for
  6932. them.
  6933. @item
  6934. @i{Kees Dullemond} used to edit projects lists directly in HTML and so
  6935. inspired some of the early development, including HTML export. He also
  6936. asked for a way to narrow wide table columns.
  6937. @item
  6938. @i{Christian Egli} converted the documentation into TeXInfo format,
  6939. patched CSS formatting into the HTML exporter, and inspired the agenda.
  6940. @item
  6941. @i{David Emery} provided a patch for custom CSS support in exported
  6942. HTML agendas.
  6943. @item
  6944. @i{Nic Ferrier} contributed mailcap and XOXO support.
  6945. @item
  6946. @i{John Foerch} figured out how to make incremental search show context
  6947. around a match in a hidden outline tree.
  6948. @item
  6949. @i{Niels Giessen} had the idea to automatically archive DONE trees.
  6950. @item
  6951. @i{Bastien Guerry} wrote the La@TeX{} exporter and has been prolific
  6952. with patches, ideas, and bug reports.
  6953. @item
  6954. @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
  6955. @item
  6956. @i{Scott Jaderholm} proposed footnotes, control over whitespace between
  6957. folded entries, and column view for properties.
  6958. @item
  6959. @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
  6960. provided frequent feedback and some patches.
  6961. @item
  6962. @i{Jason F. McBrayer} suggested agenda export to CSV format.
  6963. @item
  6964. @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
  6965. basis.
  6966. @item
  6967. @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
  6968. happy.
  6969. @item
  6970. @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file.
  6971. @item
  6972. @i{Todd Neal} provided patches for links to Info files and elisp forms.
  6973. @item
  6974. @i{Tim O'Callaghan} suggested in-file links, search options for general
  6975. file links, and TAGS.
  6976. @item
  6977. @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
  6978. into Japanese.
  6979. @item
  6980. @i{Oliver Oppitz} suggested multi-state TODO items.
  6981. @item
  6982. @i{Scott Otterson} sparked the introduction of descriptive text for
  6983. links, among other things.
  6984. @item
  6985. @i{Pete Phillips} helped during the development of the TAGS feature, and
  6986. provided frequent feedback.
  6987. @item
  6988. @i{T.V. Raman} reported bugs and suggested improvements.
  6989. @item
  6990. @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
  6991. control.
  6992. @item
  6993. @i{Kevin Rogers} contributed code to access VM files on remote hosts.
  6994. @item
  6995. @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
  6996. conflict with @file{allout.el}.
  6997. @item
  6998. @i{Jason Riedy} sent a patch to fix a bug with export of TODO keywords.
  6999. @item
  7000. @i{Philip Rooke} created the Org-mode reference card and provided lots
  7001. of feedback.
  7002. @item
  7003. @i{Christian Schlauer} proposed angular brackets around links, among
  7004. other things.
  7005. @item
  7006. Linking to VM/BBDB/GNUS was inspired by @i{Tom Shannon}'s
  7007. @file{organizer-mode.el}.
  7008. @item
  7009. @i{Daniel Sinder} came up with the idea of internal archiving by locking
  7010. subtrees.
  7011. @item
  7012. @i{Dale Smith} proposed link abbreviations.
  7013. @item
  7014. @i{Adam Spiers} asked for global linking commands and inspired the link
  7015. extension system. support mairix.
  7016. @item
  7017. @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
  7018. chapter about publishing.
  7019. @item
  7020. @i{J@"urgen Vollmer} contributed code generating the table of contents
  7021. in HTML output.
  7022. @item
  7023. @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
  7024. keyword.
  7025. @item
  7026. @i{David Wainberg} suggested archiving, and improvements to the linking
  7027. system.
  7028. @item
  7029. @i{John Wiegley} wrote @file{emacs-wiki.el} and @file{planner.el}. The
  7030. development of Org-mode was fully independent, and both systems are
  7031. really different beasts in their basic ideas and implementation details.
  7032. I later looked at John's code, however, and learned from his
  7033. implementation of (i) links where the link itself is hidden and only a
  7034. description is shown, and (ii) popping up a calendar to select a date.
  7035. John has also contributed a number of great ideas directly to Org-mode.
  7036. @item
  7037. @i{Carsten Wimmer} suggested some changes and helped fix a bug in
  7038. linking to GNUS.
  7039. @item
  7040. @i{Roland Winkler} requested additional keybindings to make Org-mode
  7041. work on a tty.
  7042. @item
  7043. @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
  7044. and contributed various ideas and code snippets.
  7045. @end itemize
  7046. @node Index, Key Index, History and Acknowledgments, Top
  7047. @unnumbered Index
  7048. @printindex cp
  7049. @node Key Index, , Index, Top
  7050. @unnumbered Key Index
  7051. @printindex ky
  7052. @bye
  7053. @ignore
  7054. arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
  7055. @end ignore