org.texi 310 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061
  1. \input texinfo
  2. @c %**start of header
  3. @setfilename ../info/org
  4. @settitle Org Mode Manual
  5. @set VERSION 5.10
  6. @set DATE September 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}. Completion, on the
  2006. other hand, will help you to insert valid link prefixes like
  2007. @samp{http:} or @samp{ftp:}, including the prefixes defined through link
  2008. abbreviations (@pxref{Link abbreviations}). The link will be inserted
  2009. into the buffer@footnote{After insertion of a stored link, the link will
  2010. be removed from the list of stored links. To keep it in the list later
  2011. use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the
  2012. option @code{org-keep-stored-link-after-insertion}.}, along with a
  2013. descriptive text. If some text was selected when this command is
  2014. called, the selected text becomes the default description.@* Note that
  2015. you don't have to use this command to insert a link. Links in Org-mode
  2016. are plain text, and you can type or paste them straight into the buffer.
  2017. By using this command, the links are automatically enclosed in double
  2018. brackets, and you will be asked for the optional descriptive text.
  2019. @c
  2020. @c If the link is a @samp{file:} link and
  2021. @c the linked file is located in the same directory as the current file or
  2022. @c a subdirectory of it, the path of the file will be inserted relative to
  2023. @c the current directory.
  2024. @c
  2025. @kindex C-u C-c C-l
  2026. @cindex file name completion
  2027. @cindex completion, of file names
  2028. @item C-u C-c C-l
  2029. When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
  2030. a file will be inserted and you may use file name completion to select
  2031. the name of the file. The path to the file is inserted relative to the
  2032. directory of the current org file, if the linked file is in the current
  2033. directory or in a subdirectory of it, or if the path is written relative
  2034. to the current directory using @samp{../}. Otherwise an absolute path
  2035. is used, if possible with @samp{~/} for your home directory. You can
  2036. force an absolute path with two @kbd{C-u} prefixes.
  2037. @c
  2038. @item C-c C-l @r{(with cursor on existing link)}
  2039. When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
  2040. link and description parts of the link.
  2041. @c
  2042. @cindex following links
  2043. @kindex C-c C-o
  2044. @item C-c C-o
  2045. Open link at point. This will launch a web browser for URLs (using
  2046. @command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb
  2047. for the corresponding links, and execute the command in a shell link.
  2048. When the cursor is on an internal link, this commands runs the
  2049. corresponding search. When the cursor is on a TAG list in a headline,
  2050. it creates the corresponding TAGS view. If the cursor is on a time
  2051. stamp, it compiles the agenda for that date. Furthermore, it will visit
  2052. text and remote files in @samp{file:} links with Emacs and select a
  2053. suitable application for local non-text files. Classification of files
  2054. is based on file extension only. See option @code{org-file-apps}. If
  2055. you want to override the default application and visit the file with
  2056. Emacs, use a @kbd{C-u} prefix.
  2057. @c
  2058. @kindex mouse-2
  2059. @kindex mouse-1
  2060. @item mouse-2
  2061. @itemx mouse-1
  2062. On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
  2063. would. Under Emacs 22, also @kbd{mouse-1} will follow a link.
  2064. @c
  2065. @kindex mouse-3
  2066. @item mouse-3
  2067. Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
  2068. internal links to be displayed in another window@footnote{See the
  2069. variable @code{org-display-internal-link-with-indirect-buffer}}.
  2070. @c
  2071. @cindex mark ring
  2072. @kindex C-c %
  2073. @item C-c %
  2074. Push the current position onto the mark ring, to be able to return
  2075. easily. Commands following an internal link do this automatically.
  2076. @c
  2077. @cindex links, returning to
  2078. @kindex C-c &
  2079. @item C-c &
  2080. Jump back to a recorded position. A position is recorded by the
  2081. commands following internal links, and by @kbd{C-c %}. Using this
  2082. command several times in direct succession moves through a ring of
  2083. previously recorded positions.
  2084. @c
  2085. @kindex C-c C-x C-n
  2086. @kindex C-c C-x C-p
  2087. @cindex links, finding next/previous
  2088. @item C-c C-x C-n
  2089. @itemx C-c C-x C-p
  2090. Move forward/backward to the next link in the buffer. At the limit of
  2091. the buffer, the search fails once, and then wraps around. The key
  2092. bindings for this are really too long, you might want to bind this also
  2093. to @kbd{C-n} and @kbd{C-p}
  2094. @lisp
  2095. (add-hook 'org-load-hook
  2096. (lambda ()
  2097. (define-key 'org-mode-map "\C-n" 'org-next-link)
  2098. (define-key 'org-mode-map "\C-p" 'org-previous-link)))
  2099. @end lisp
  2100. @end table
  2101. @node Using links outside Org-mode, Link abbreviations, Handling links, Hyperlinks
  2102. @section Using links outside Org-mode
  2103. You can insert and follow links that have Org-mode syntax not only in
  2104. Org-mode, but in any Emacs buffer. For this, you should create two
  2105. global commands, like this (please select suitable global keys
  2106. yourself):
  2107. @lisp
  2108. (global-set-key "\C-c L" 'org-insert-link-global)
  2109. (global-set-key "\C-c o" 'org-open-at-point-global)
  2110. @end lisp
  2111. @node Link abbreviations, Search options, Using links outside Org-mode, Hyperlinks
  2112. @section Link abbreviations
  2113. @cindex link abbreviations
  2114. @cindex abbreviation, links
  2115. Long URLs can be cumbersome to type, and often many similar links are
  2116. needed in a document. For this you can use link abbreviations. An
  2117. abbreviated link looks like this
  2118. @example
  2119. [[linkword:tag][description]]
  2120. @end example
  2121. @noindent
  2122. where the tag is optional. Such abbreviations are resolved according to
  2123. the information in the variable @code{org-link-abbrev-alist} that
  2124. relates the linkwords to replacement text. Here is an example:
  2125. @lisp
  2126. @group
  2127. (setq org-link-abbrev-alist
  2128. '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
  2129. ("google" . "http://www.google.com/search?q=")
  2130. ("ads" . "http://adsabs.harvard.edu/cgi-bin/
  2131. nph-abs_connect?author=%s&db_key=AST")))
  2132. @end group
  2133. @end lisp
  2134. If the replacement text contains the string @samp{%s}, it will be
  2135. replaced with the tag. Otherwise the tag will be appended to the string
  2136. in order to create the link. You may also specify a function that will
  2137. be called with the tag as the only argument to create the link.
  2138. With the above setting, you could link to a specific bug with
  2139. @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
  2140. @code{[[google:OrgMode]]} and find out what the Org-mode author is
  2141. doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
  2142. If you need special abbreviations just for a single Org-mode buffer, you
  2143. can define them in the file with
  2144. @example
  2145. #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
  2146. #+LINK: google http://www.google.com/search?q=%s
  2147. @end example
  2148. @noindent
  2149. In-buffer completion @pxref{Completion} can be used after @samp{[} to
  2150. complete link abbreviations.
  2151. @node Search options, Custom searches, Link abbreviations, Hyperlinks
  2152. @section Search options in file links
  2153. @cindex search option in file links
  2154. @cindex file links, searching
  2155. File links can contain additional information to make Emacs jump to a
  2156. particular location in the file when following a link. This can be a
  2157. line number or a search option after a double@footnote{For backward
  2158. compatibility, line numbers can also follow a single colon.} colon. For
  2159. example, when the command @kbd{C-c l} creates a link (@pxref{Handling
  2160. links}) to a file, it encodes the words in the current line as a search
  2161. string that can be used to find this line back later when following the
  2162. link with @kbd{C-c C-o}.
  2163. Here is the syntax of the different ways to attach a search to a file
  2164. link, together with an explanation:
  2165. @example
  2166. [[file:~/code/main.c::255]]
  2167. [[file:~/xx.org::My Target]]
  2168. [[file:~/xx.org::*My Target]]
  2169. [[file:~/xx.org::/regexp/]]
  2170. @end example
  2171. @table @code
  2172. @item 255
  2173. Jump to line 255.
  2174. @item My Target
  2175. Search for a link target @samp{<<My Target>>}, or do a text search for
  2176. @samp{my target}, similar to the search in internal links, see
  2177. @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
  2178. link will become an HTML reference to the corresponding named anchor in
  2179. the linked file.
  2180. @item *My Target
  2181. In an Org-mode file, restrict search to headlines.
  2182. @item /regexp/
  2183. Do a regular expression search for @code{regexp}. This uses the Emacs
  2184. command @code{occur} to list all matches in a separate window. If the
  2185. target file is in Org-mode, @code{org-occur} is used to create a
  2186. sparse tree with the matches.
  2187. @c If the target file is a directory,
  2188. @c @code{grep} will be used to search all files in the directory.
  2189. @end table
  2190. As a degenerate case, a file link with an empty file name can be used
  2191. to search the current file. For example, @code{[[file:::find me]]} does
  2192. a search for @samp{find me} in the current file, just as
  2193. @samp{[[find me]]} would.
  2194. @node Custom searches, , Search options, Hyperlinks
  2195. @section Custom Searches
  2196. @cindex custom search strings
  2197. @cindex search strings, custom
  2198. The default mechanism for creating search strings and for doing the
  2199. actual search related to a file link may not work correctly in all
  2200. cases. For example, BibTeX database files have many entries like
  2201. @samp{year="1993"} which would not result in good search strings,
  2202. because the only unique identification for a BibTeX entry is the
  2203. citation key.
  2204. If you come across such a problem, you can write custom functions to set
  2205. the right search string for a particular file type, and to do the search
  2206. for the string in the file. Using @code{add-hook}, these functions need
  2207. to be added to the hook variables
  2208. @code{org-create-file-search-functions} and
  2209. @code{org-execute-file-search-functions}. See the docstring for these
  2210. variables for more information. Org-mode actually uses this mechanism
  2211. for Bib@TeX{} database files, and you can use the corresponding code as
  2212. an implementation example. Search for @samp{BibTeX links} in the source
  2213. file.
  2214. @node TODO items, Tags, Hyperlinks, Top
  2215. @chapter TODO items
  2216. @cindex TODO items
  2217. Org-mode does not maintain TODO lists as a separate document. TODO
  2218. items are an integral part of the notes file, because TODO items
  2219. usually come up while taking notes! With Org-mode, you simply mark
  2220. any entry in a tree as being a TODO item. In this way, the
  2221. information is not duplicated, and the entire context from which the
  2222. item emerged is always present when you check.
  2223. Of course, this technique causes TODO items to be scattered throughout
  2224. your file. Org-mode provides methods to give you an overview over all
  2225. things you have to do.
  2226. @menu
  2227. * TODO basics:: Marking and displaying TODO entries
  2228. * TODO extensions:: Workflow and assignments
  2229. * Progress logging:: Dates and notes for progress
  2230. * Priorities:: Some things are more important than others
  2231. * Breaking down tasks:: Splitting a task into manageable pieces
  2232. * Checkboxes:: Tick-off lists
  2233. @end menu
  2234. @node TODO basics, TODO extensions, TODO items, TODO items
  2235. @section Basic TODO functionality
  2236. Any headline can become a TODO item by starting it with the word TODO,
  2237. for example:
  2238. @example
  2239. *** TODO Write letter to Sam Fortune
  2240. @end example
  2241. @noindent
  2242. The most important commands to work with TODO entries are:
  2243. @table @kbd
  2244. @kindex C-c C-t
  2245. @cindex cycling, of TODO states
  2246. @item C-c C-t
  2247. Rotate the TODO state of the current item among
  2248. @example
  2249. ,-> (unmarked) -> TODO -> DONE --.
  2250. '--------------------------------'
  2251. @end example
  2252. The same rotation can also be done ``remotely'' from the timeline and
  2253. agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
  2254. @kindex C-u C-c C-t
  2255. @item C-u C-c C-t
  2256. Select a specific keyword using completion of (if it has been set up)
  2257. the fast selection interface.
  2258. @kindex S-@key{right}
  2259. @kindex S-@key{left}
  2260. @item S-@key{right}
  2261. @itemx S-@key{left}
  2262. Select the following/preceding TODO state, similar to cycling. Mostly
  2263. useful if more than two TODO states are possible (@pxref{TODO
  2264. extensions}).
  2265. @kindex C-c C-c
  2266. @item C-c C-c
  2267. Use the fast tag interface to quickly and directly select a specific
  2268. TODO state. For this you need to assign keys to TODO state, like this:
  2269. @example
  2270. #+SEQ_TODO: TODO(t) STARTED(s) WAITING(w) | DONE(d)
  2271. @end example
  2272. @noindent See @ref{Per file keywords} and @ref{Setting tags} for more
  2273. information.
  2274. @kindex C-c C-v
  2275. @cindex sparse tree, for TODO
  2276. @item C-c C-v
  2277. View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
  2278. the entire buffer, but shows all TODO items and the headings hierarchy
  2279. above them. With prefix arg, search for a specific TODO. You will be
  2280. prompted for the keyword, and you can also give a list of keywords like
  2281. @code{kwd1|kwd2|...}. With numerical prefix N, show the tree for the
  2282. Nth keyword in the variable @code{org-todo-keywords}. With two prefix
  2283. args, find all TODO and DONE entries.
  2284. @kindex C-c a t
  2285. @item C-c a t
  2286. Show the global TODO list. This collects the TODO items from all
  2287. agenda files (@pxref{Agenda views}) into a single buffer. The buffer is in
  2288. @code{agenda-mode}, so there are commands to examine and manipulate
  2289. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  2290. @xref{Global TODO list}, for more information.
  2291. @kindex S-M-@key{RET}
  2292. @item S-M-@key{RET}
  2293. Insert a new TODO entry below the current one.
  2294. @end table
  2295. @node TODO extensions, Progress logging, TODO basics, TODO items
  2296. @section Extended use of TODO keywords
  2297. @cindex extended TODO keywords
  2298. The default implementation of TODO entries is just two states: TODO and
  2299. DONE. You can use the TODO feature for more complicated things by
  2300. configuring the variable @code{org-todo-keywords}. With special setup,
  2301. the TODO keyword system can work differently in different files.
  2302. Note that @i{tags} are another way to classify headlines in general and
  2303. TODO items in particular (@pxref{Tags}).
  2304. @menu
  2305. * Workflow states:: From TODO to DONE in steps
  2306. * TODO types:: I do this, Fred the rest
  2307. * Multiple sets in one file:: Mixing it all, and still finding your way
  2308. * Fast access to TODO states:: Single letter selection of a state
  2309. * Per file keywords:: Different files, different requirements
  2310. * Faces for TODO keywords:: Highlighting states
  2311. @end menu
  2312. @node Workflow states, TODO types, TODO extensions, TODO extensions
  2313. @subsection TODO keywords as workflow states
  2314. @cindex TODO workflow
  2315. @cindex workflow states as TODO keywords
  2316. You can use TODO keywords to indicate different @emph{sequential} states
  2317. in the process of working on an item, for example@footnote{Changing
  2318. this variable only becomes effective after restarting Org-mode in a
  2319. buffer.}:
  2320. @lisp
  2321. (setq org-todo-keywords
  2322. '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
  2323. @end lisp
  2324. The vertical bar separates the TODO keywords (states that @emph{need
  2325. action}) from the DONE states (which need @emph{no further action}. If
  2326. you don't provide the separator bar, the last state is used as the DONE
  2327. state.
  2328. @cindex completion, of TODO keywords
  2329. With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
  2330. to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
  2331. also use a prefix argument to quickly select a specific state. For
  2332. example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
  2333. If you define many keywords, you can use in-buffer completion (see
  2334. @ref{Completion}) to insert these words into the buffer. Changing a
  2335. todo state can be logged with a timestamp, see @ref{Tracking TODO state
  2336. changes} for more information.
  2337. @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
  2338. @subsection TODO keywords as types
  2339. @cindex TODO types
  2340. @cindex names as TODO keywords
  2341. @cindex types as TODO keywords
  2342. The second possibility is to use TODO keywords to indicate different
  2343. @emph{types} of action items. For example, you might want to indicate
  2344. that items are for ``work'' or ``home''. Or, when you work with several
  2345. people on a single project, you might want to assign action items
  2346. directly to persons, by using their names as TODO keywords. This would
  2347. be set up like this:
  2348. @lisp
  2349. (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
  2350. @end lisp
  2351. In this case, different keywords do not indicate a sequence, but rather
  2352. different types. So the normal work flow would be to assign a task to a
  2353. person, and later to mark it DONE. Org-mode supports this style by
  2354. adapting the workings of the command @kbd{C-c C-t}@footnote{This is also
  2355. true for the @kbd{t} command in the timeline and agenda buffers.}. When
  2356. used several times in succession, it will still cycle through all names,
  2357. in order to first select the right type for a task. But when you return
  2358. to the item after some time and execute @kbd{C-c C-t} again, it will
  2359. switch from any name directly to DONE. Use prefix arguments or
  2360. completion to quickly select a specific name. You can also review the
  2361. items of a specific TODO type in a sparse tree by using a numeric prefix
  2362. to @kbd{C-c C-v}. For example, to see all things Lucy has to do, you
  2363. would use @kbd{C-3 C-c C-v}. To collect Lucy's items from all agenda
  2364. files into a single buffer, you would use the prefix arg as well when
  2365. creating the global todo list: @kbd{C-3 C-c t}.
  2366. @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
  2367. @subsection Multiple keyword sets in one file
  2368. @cindex todo keyword sets
  2369. Sometimes you may want to use different sets of TODO keywords in
  2370. parallel. For example, you may want to have the basic
  2371. @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
  2372. separate state indicating that an item has been canceled (so it is not
  2373. DONE, but also does not require action). Your setup would then look
  2374. like this:
  2375. @lisp
  2376. (setq org-todo-keywords
  2377. '((sequence "TODO" "|" "DONE")
  2378. (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
  2379. (sequence "|" "CANCELED")))
  2380. @end lisp
  2381. The keywords should all be different, this helps Org-mode to keep track
  2382. of which subsequence should be used for a given entry. In this setup,
  2383. @kbd{C-c C-t} only operates within a subsequence, so it switches from
  2384. @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
  2385. (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
  2386. select the correct sequence. Besides the obvious ways like typing a
  2387. keyword or using completion, you may also apply the following commands:
  2388. @table @kbd
  2389. @kindex C-S-@key{right}
  2390. @kindex C-S-@key{left}
  2391. @item C-S-@key{right}
  2392. @itemx C-S-@key{left}
  2393. These keys jump from one TODO subset to the next. In the above example,
  2394. @kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
  2395. @code{REPORT}, and any of the words in the second row to @code{CANCELED}.
  2396. @kindex S-@key{right}
  2397. @kindex S-@key{left}
  2398. @item S-@key{right}
  2399. @itemx S-@key{left}
  2400. @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
  2401. @emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
  2402. would switch from @code{DONE} to @code{REPORT} in the example above.
  2403. @end table
  2404. @node Fast access to TODO states, Per file keywords, Multiple sets in one file, TODO extensions
  2405. @subsection Fast access to TODO states
  2406. If you would like to quickly change an entry to an arbitrary TODO state
  2407. instead of cycling through the states, you can set up keys for
  2408. single-letter access to the states. This is done by adding the section
  2409. key after each keyword, in parenthesis. For example:
  2410. @lisp
  2411. (setq org-todo-keywords
  2412. '((sequence "TODO(t)" "|" "DONE(d)")
  2413. (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
  2414. (sequence "|" "CANCELED(c)")))
  2415. @end lisp
  2416. If you then press @code{C-u C-c C-t} followed by the selection key, the
  2417. entry will be switched to this state. @key{SPC} can be used to remove
  2418. any TODO keyword from an entry. Should you like this way of selecting
  2419. TODO states a lot, you might want to set the variable
  2420. @code{org-use-fast-todo-selection} to @code{t} and make this behavior
  2421. the default. Check also the variable
  2422. @code{org-fast-tag-selection-include-todo}, it allows to change the TODO
  2423. state through the tags interface (@pxref{Setting tags}).
  2424. @node Per file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
  2425. @subsection Setting up keywords for individual files
  2426. @cindex keyword options
  2427. @cindex per file keywords
  2428. It can be very useful to use different aspects of the TODO mechanism in
  2429. different files. For file-local settings, you need to add special lines
  2430. to the file which set the keywords and interpretation for that file
  2431. only. For example, to set one of the two examples discussed above, you
  2432. need one of the following lines, starting in column zero anywhere in the
  2433. file:
  2434. @example
  2435. #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
  2436. @end example
  2437. or
  2438. @example
  2439. #+TYP_TODO: Fred Sara Lucy Mike | DONE
  2440. @end example
  2441. A setup for using several sets in parallel would be:
  2442. @example
  2443. #+SEQ_TODO: TODO | DONE
  2444. #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
  2445. #+SEQ_TODO: | CANCELED
  2446. @end example
  2447. @cindex completion, of option keywords
  2448. @kindex M-@key{TAB}
  2449. @noindent To make sure you are using the correct keyword, type
  2450. @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
  2451. @cindex DONE, final TODO keyword
  2452. Remember that the keywords after the vertical bar (or the last keyword
  2453. if no bar is there) must always mean that the item is DONE (although you
  2454. may use a different word). After changing one of these lines, use
  2455. @kbd{C-c C-c} with the cursor still in the line to make the changes
  2456. known to Org-mode@footnote{Org-mode parses these lines only when
  2457. Org-mode is activated after visiting a file. @kbd{C-c C-c} with the
  2458. cursor in a line starting with @samp{#+} is simply restarting Org-mode
  2459. for the current buffer.}.
  2460. @node Faces for TODO keywords, , Per file keywords, TODO extensions
  2461. @subsection Faces for TODO keywords
  2462. @cindex faces, for TODO keywords
  2463. Org-mode highlights TODO keywords with special faces: @code{org-todo}
  2464. for keywords indicating that an item still has to be acted upon, and
  2465. @code{org-done} for keywords indicating that an item is finished. If
  2466. you are using more than 2 different states, you might want to use
  2467. special faces for some of them. This can be done using the variable
  2468. @code{org-todo-keyword-faces}. For example:
  2469. @lisp
  2470. (setq org-todo-keyword-faces
  2471. '(("TODO" . org-warning)
  2472. ("DEFERRED" . shadow)
  2473. ("CANCELED" . (:foreground "blue" :weight bold))))
  2474. @end lisp
  2475. @node Progress logging, Priorities, TODO extensions, TODO items
  2476. @section Progress Logging
  2477. @cindex progress logging
  2478. @cindex logging, of progress
  2479. Org-mode can automatically record a time stamp and even a note when you
  2480. mark a TODO item as DONE, or even each time you change the state of
  2481. a TODO item.
  2482. @menu
  2483. * Closing items:: When was this entry marked DONE?
  2484. * Tracking TODO state changes:: When did the status change?
  2485. @end menu
  2486. @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
  2487. @subsection Closing items
  2488. If you want to keep track of @emph{when} a certain TODO item was
  2489. finished, turn on logging with@footnote{The corresponding in-buffer
  2490. setting is: @code{#+STARTUP: logdone}}
  2491. @lisp
  2492. (setq org-log-done t)
  2493. @end lisp
  2494. @noindent
  2495. Then each time you turn a TODO entry into DONE using either @kbd{C-c
  2496. C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
  2497. @samp{CLOSED: [timestamp]} will be inserted just after the headline. If
  2498. you turn the entry back into a TODO item through further state cycling,
  2499. that line will be removed again. In the timeline (@pxref{Timeline}) and
  2500. in the agenda (@pxref{Weekly/Daily agenda}), you can then use the
  2501. @kbd{l} key to display the TODO items closed on each day, giving you an
  2502. overview of what has been done on a day. If you want to record a note
  2503. along with the timestamp, use@footnote{The corresponding in-buffer
  2504. setting is: @code{#+STARTUP: lognotedone}}
  2505. @lisp
  2506. (setq org-log-done '(done))
  2507. @end lisp
  2508. @node Tracking TODO state changes, , Closing items, Progress logging
  2509. @subsection Tracking TODO state changes
  2510. When TODO keywords are used as workflow states (@pxref{Workflow
  2511. states}), you might want to keep track of when a state change occurred
  2512. and record a note about this change. With the setting
  2513. @lisp
  2514. (setq org-log-done '(state))
  2515. @end lisp
  2516. @noindent
  2517. each state change will prompt you for a note that will be attached to
  2518. the current headline. If you press @kbd{C-c C-c} without typing
  2519. anything into the note buffer, only the time of the state change will be
  2520. noted. Very likely you do not want this verbose tracking all the time,
  2521. so it is probably better to configure this behavior with in-buffer
  2522. options. For example, if you are tracking purchases, put these into a
  2523. separate file that contains:
  2524. @example
  2525. #+SEQ_TODO: TODO(t) ORDERED(o) INVOICE(i) PAYED(p) | RECEIVED(r)
  2526. #+STARTUP: lognotestate
  2527. @end example
  2528. If you only need to take a note for some of the states, mark those
  2529. states with an additional @samp{@@}, like this:
  2530. @example
  2531. #+SEQ_TODO: TODO(t) ORDERED(o@@) INVOICE(i@@) PAYED(p) | RECEIVED(r)
  2532. #+STARTUP: lognotestate
  2533. @end example
  2534. @node Priorities, Breaking down tasks, Progress logging, TODO items
  2535. @section Priorities
  2536. @cindex priorities
  2537. If you use Org-mode extensively to organize your work, you may end up
  2538. with a number of TODO entries so large that you'd like to prioritize
  2539. them. This can be done by placing a @emph{priority cookie} into the
  2540. headline, like this
  2541. @example
  2542. *** TODO [#A] Write letter to Sam Fortune
  2543. @end example
  2544. @noindent
  2545. With its standard setup, Org-mode supports priorities @samp{A},
  2546. @samp{B}, and @samp{C}. @samp{A} is the highest priority. An entry
  2547. without a cookie is treated as priority @samp{B}. Priorities make a
  2548. difference only in the agenda (@pxref{Weekly/Daily agenda}).
  2549. @table @kbd
  2550. @kindex @kbd{C-c ,}
  2551. @item @kbd{C-c ,}
  2552. Set the priority of the current headline. The command prompts for a
  2553. priority character @samp{A}, @samp{B} or @samp{C}. When you press
  2554. @key{SPC} instead, the priority cookie is removed from the headline.
  2555. The priorities can also be changed ``remotely'' from the timeline and
  2556. agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
  2557. @c
  2558. @kindex S-@key{up}
  2559. @kindex S-@key{down}
  2560. @item S-@key{up}
  2561. @itemx S-@key{down}
  2562. Increase/decrease priority of current headline@footnote{See also the
  2563. option @code{org-priority-start-cycle-with-default'}.}. Note that these
  2564. keys are also used to modify time stamps (@pxref{Creating timestamps}).
  2565. Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}).
  2566. @end table
  2567. You can change the range of allowed priorities by setting the variables
  2568. @code{org-highest-priority}, @code{org-lowest-priority}, and
  2569. @code{org-default-priority}. For an individual buffer, you may set
  2570. these values (highest, lowest, default) like this (please make sure that
  2571. the highest priority is earlier in the alphabet than the lowest
  2572. priority):
  2573. @example
  2574. #+PRIORITIES: A C B
  2575. @end example
  2576. @node Breaking down tasks, Checkboxes, Priorities, TODO items
  2577. @section Breaking tasks down into subtasks
  2578. @cindex tasks, breaking down
  2579. It is often advisable to break down large tasks into smaller, manageable
  2580. subtasks. You can do this by creating an outline tree below a TODO
  2581. item, with detailed subtasks on the tree@footnote{To keep subtasks out
  2582. of the global TODO list, see the
  2583. @code{org-agenda-todo-list-sublevels}.}. Another possibility is the use
  2584. of checkboxes to identify (a hierarchy of) a large number of subtasks
  2585. (@pxref{Checkboxes}).
  2586. @node Checkboxes, , Breaking down tasks, TODO items
  2587. @section Checkboxes
  2588. @cindex checkboxes
  2589. Every item in a plain list (@pxref{Plain lists}) can be made a checkbox
  2590. by starting it with the string @samp{[ ]}. This feature is similar to
  2591. TODO items (@pxref{TODO items}), but more lightweight. Checkboxes are
  2592. not included into the global TODO list, so they are often great to split
  2593. a task into a number of simple steps. Or you can use them in a shopping
  2594. list. To toggle a checkbox, use @kbd{C-c C-c}, or try Piotr Zielinski's
  2595. @file{org-mouse.el}. Here is an example of a checkbox list.
  2596. @example
  2597. * TODO Organize party [3/6]
  2598. - call people [1/3]
  2599. - [ ] Peter
  2600. - [X] Sarah
  2601. - [ ] Sam
  2602. - [X] order food
  2603. - [ ] think about what music to play
  2604. - [X] talk to the neighbors
  2605. @end example
  2606. @cindex statistics, for checkboxes
  2607. @cindex checkbox statistics
  2608. The @samp{[3/6]} and @samp{[1/3]} in the first and second line are
  2609. cookies indicating how many checkboxes are present in this entry, and
  2610. how many of them have been checked off. This can give you an idea on
  2611. how many checkboxes remain, even without opening a folded entry. The
  2612. cookies can be placed into a headline or into (the first line of) a
  2613. plain list item. Each cookie covers all checkboxes structurally below
  2614. that headline/item. You have to insert the cookie yourself by typing
  2615. either @samp{[/]} or @samp{[%]}. In the first case you get an @samp{n
  2616. out of m} result, in the second case you get information about the
  2617. percentage of checkboxes checked (in the above example, this would be
  2618. @samp{[50%]} and @samp{[33%], respectively}).
  2619. @noindent The following commands work with checkboxes:
  2620. @table @kbd
  2621. @kindex C-c C-c
  2622. @item C-c C-c
  2623. Toggle checkbox at point. With prefix argument, set it to @samp{[-]},
  2624. which is considered to be an intermediate state.
  2625. @kindex C-c C-x C-b
  2626. @item C-c C-x C-b
  2627. Toggle checkbox at point.
  2628. @itemize @minus
  2629. @item
  2630. If there is an active region, toggle the first checkbox in the region
  2631. and set all remaining boxes to the same status as the first. If you
  2632. want to toggle all boxes in the region independently, use a prefix
  2633. argument.
  2634. @item
  2635. If the cursor is in a headline, toggle checkboxes in the region between
  2636. this headline and the next (so @emph{not} the entire subtree).
  2637. @item
  2638. If there is no active region, just toggle the checkbox at point.
  2639. @end itemize
  2640. @kindex M-S-@key{RET}
  2641. @item M-S-@key{RET}
  2642. Insert a new item with a checkbox.
  2643. This works only if the cursor is already in a plain list item
  2644. (@pxref{Plain lists}).
  2645. @kindex C-c #
  2646. @item C-c #
  2647. Update the checkbox statistics in the current outline entry. When
  2648. called with a @kbd{C-u} prefix, update the entire file. Checkbox
  2649. statistic cookies are updated automatically if you toggle checkboxes
  2650. with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}. If you
  2651. delete boxes or add/change them by hand, use this command to get things
  2652. back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
  2653. @end table
  2654. @node Tags, Properties and columns, TODO items, Top
  2655. @chapter Tags
  2656. @cindex tags
  2657. @cindex headline tagging
  2658. @cindex matching, tags
  2659. @cindex sparse tree, tag based
  2660. If you wish to implement a system of labels and contexts for
  2661. cross-correlating information, an excellent way is to assign @i{tags} to
  2662. headlines. Org-mode has extensive support for using tags.
  2663. Every headline can contain a list of tags, at the end of the headline.
  2664. Tags are normal words containing letters, numbers, @samp{_}, and
  2665. @samp{@@}. Tags must be preceded and followed by a single colon; like
  2666. @samp{:WORK:}. Several tags can be specified like @samp{:WORK:URGENT:}.
  2667. @menu
  2668. * Tag inheritance:: Tags use the tree structure of the outline
  2669. * Setting tags:: How to assign tags to a headline
  2670. * Tag searches:: Searching for combinations of tags
  2671. @end menu
  2672. @node Tag inheritance, Setting tags, Tags, Tags
  2673. @section Tag inheritance
  2674. @cindex inheritance, of tags
  2675. @cindex sublevels, inclusion into tags match
  2676. @i{Tags} make use of the hierarchical structure of outline trees. If a
  2677. heading has a certain tag, all subheadings will inherit the tag as
  2678. well. For example, in the list
  2679. @example
  2680. * Meeting with the French group :WORK:
  2681. ** Summary by Frank :BOSS:NOTES:
  2682. *** TODO Prepare slides for him :ACTION:
  2683. @end example
  2684. @noindent
  2685. the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
  2686. @samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and
  2687. Org-mode finds that a certain headline matches the search criterion, it
  2688. will not check any sublevel headline, assuming that these likely also
  2689. match, and that the list of matches can become very long. This may
  2690. not be what you want, however, and you can influence inheritance and
  2691. searching using the variables @code{org-use-tag-inheritance} and
  2692. @code{org-tags-match-list-sublevels}.
  2693. @node Setting tags, Tag searches, Tag inheritance, Tags
  2694. @section Setting tags
  2695. @cindex setting tags
  2696. @cindex tags, setting
  2697. @kindex M-@key{TAB}
  2698. Tags can simply be typed into the buffer at the end of a headline.
  2699. After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
  2700. also a special command for inserting tags:
  2701. @table @kbd
  2702. @kindex C-c C-c
  2703. @item C-c C-c
  2704. @cindex completion, of tags
  2705. Enter new tags for the current headline. Org-mode will either offer
  2706. completion or a special single-key interface for setting tags, see
  2707. below. After pressing @key{RET}, the tags will be inserted and aligned
  2708. to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
  2709. tags in the current buffer will be aligned to that column, just to make
  2710. things look nice. TAGS are automatically realigned after promotion,
  2711. demotion, and TODO state changes (@pxref{TODO basics}).
  2712. @end table
  2713. Org will support tag insertion based on a @emph{list of tags}. By
  2714. default this list is constructed dynamically, containing all tags
  2715. currently used in the buffer. You may also globally specify a hard list
  2716. of tags with the variable @code{org-tag-alist}. Finally you can set
  2717. the default tags for a given file with lines like
  2718. @example
  2719. #+TAGS: @@WORK @@HOME @@TENNISCLUB
  2720. #+TAGS: Laptop Car PC Sailboat
  2721. @end example
  2722. If you have globally defined your preferred set of tags using the
  2723. variable @code{org-tag-alist}, but would like to use a dynamic tag list
  2724. in a specific file: Just add an empty TAGS option line to that file:
  2725. @example
  2726. #+TAGS:
  2727. @end example
  2728. The default support method for entering tags is minibuffer completion.
  2729. However, Org-mode also implements a much better method: @emph{fast tag
  2730. selection}. This method allows to select and deselect tags with a
  2731. single key per tag. To function efficiently, you should assign unique
  2732. keys to most tags. This can be done globally with
  2733. @lisp
  2734. (setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
  2735. @end lisp
  2736. @noindent or on a per-file basis with
  2737. @example
  2738. #+TAGS: @@WORK(w) @@HOME(h) @@TENNISCLUB(t) Laptop(l) PC(p)
  2739. @end example
  2740. @noindent
  2741. You can also group together tags that are mutually exclusive. With
  2742. curly braces@footnote{In @code{org-mode-alist} use
  2743. @code{'(:startgroup)} and @code{'(:endgroup)}, respectively. Several
  2744. groups are allowed.}
  2745. @example
  2746. #+TAGS: @{ @@WORK(w) @@HOME(h) @@TENNISCLUB(t) @} Laptop(l) PC(p)
  2747. @end example
  2748. @noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
  2749. and @samp{@@TENNISCLUB} should be selected.
  2750. @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
  2751. these lines to activate any changes.
  2752. If at least one tag has a selection key, pressing @kbd{C-c C-c} will
  2753. automatically present you with a special interface, listing inherited
  2754. tags, the tags of the current headline, and a list of all legal tags
  2755. with corresponding keys@footnote{Keys will automatically be assigned to
  2756. tags which have no configured keys.}. In this interface, you can use
  2757. the following keys:
  2758. @table @kbd
  2759. @item a-z...
  2760. Pressing keys assigned to tags will add or remove them from the list of
  2761. tags in the current line. Selecting a tag in a group of mutually
  2762. exclusive tags will turn off any other tags from that group.
  2763. @kindex @key{TAB}
  2764. @item @key{TAB}
  2765. Enter a tag in the minibuffer, even if the tag is not in the predefined
  2766. list. You will be able to complete on all tags present in the buffer.
  2767. @kindex @key{SPC}
  2768. @item @key{SPC}
  2769. Clear all tags for this line.
  2770. @kindex @key{RET}
  2771. @item @key{RET}
  2772. Accept the modified set.
  2773. @item C-g
  2774. Abort without installing changes.
  2775. @item q
  2776. If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
  2777. @item !
  2778. Turn off groups of mutually exclusive tags. Use this to (as an
  2779. exception) assign several tags from such a group.
  2780. @item C-c
  2781. Toggle auto-exit after the next change (see below).
  2782. If you are using expert mode, the first @kbd{C-c} will display the
  2783. selection window.
  2784. @end table
  2785. @noindent
  2786. This method lets you assign tags to a headline with very few keys. With
  2787. the above setup, you could clear the current tags and set @samp{@@HOME},
  2788. @samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
  2789. C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@HOME} to
  2790. @samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
  2791. alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
  2792. @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
  2793. @key{RET} @key{RET}}.
  2794. If you find that most of the time, you need only a single keypress to
  2795. modify your list of tags, set the variable
  2796. @code{org-fast-tag-selection-single-key}. Then you no longer have to
  2797. press @key{RET} to exit fast tag selection - it will immediately exit
  2798. after the first change. If you then occasionally need more keys, press
  2799. @kbd{C-c} to turn off auto-exit for the current tag selection process
  2800. (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
  2801. C-c}). If you set the variable to the value @code{expert}, the special
  2802. window is not even shown for single-key tag selection, it comes up only
  2803. when you press an extra @kbd{C-c}.
  2804. @node Tag searches, , Setting tags, Tags
  2805. @section Tag searches
  2806. @cindex tag searches
  2807. @cindex searching for tags
  2808. Once a tags system has been set up, it can be used to collect related
  2809. information into special lists.
  2810. @table @kbd
  2811. @kindex C-c \
  2812. @item C-c \
  2813. Create a sparse tree with all headlines matching a tags search. With a
  2814. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  2815. @kindex C-c a m
  2816. @item C-c a m
  2817. Create a global list of tag matches from all agenda files.
  2818. @xref{Matching tags and properties}.
  2819. @kindex C-c a M
  2820. @item C-c a M
  2821. Create a global list of tag matches from all agenda files, but check
  2822. only TODO items and force checking subitems (see variable
  2823. @code{org-tags-match-list-sublevels}).
  2824. @end table
  2825. @cindex Boolean logic, for tag searches
  2826. A @i{tags} search string can use Boolean operators @samp{&} for AND and
  2827. @samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
  2828. Parenthesis are currently not implemented. A tag may also be preceded
  2829. by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
  2830. positive selection. The AND operator @samp{&} is optional when @samp{+}
  2831. or @samp{-} is present. Examples:
  2832. @table @samp
  2833. @item +WORK-BOSS
  2834. Select headlines tagged @samp{:WORK:}, but discard those also tagged
  2835. @samp{:BOSS:}.
  2836. @item WORK|LAPTOP
  2837. Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
  2838. @item WORK|LAPTOP&NIGHT
  2839. Like before, but require the @samp{:LAPTOP:} lines to be tagged also
  2840. @samp{NIGHT}.
  2841. @end table
  2842. @cindex TODO keyword matching, with tags search
  2843. If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
  2844. can be useful to also match on the TODO keyword. This can be done by
  2845. adding a condition after a slash to a tags match. The syntax is similar
  2846. to the tag matches, but should be applied with consideration: For
  2847. example, a positive selection on several TODO keywords can not
  2848. meaningfully be combined with boolean AND. However, @emph{negative
  2849. selection} combined with AND can be meaningful. To make sure that only
  2850. lines are checked that actually have any TODO keyword, use @kbd{C-c a
  2851. M}, or equivalently start the todo part after the slash with @samp{!}.
  2852. Examples:
  2853. @table @samp
  2854. @item WORK/WAITING
  2855. Select @samp{:WORK:}-tagged TODO lines with the specific TODO
  2856. keyword @samp{WAITING}.
  2857. @item WORK/!-WAITING-NEXT
  2858. Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
  2859. nor @samp{NEXT}
  2860. @item WORK/+WAITING|+NEXT
  2861. Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
  2862. @samp{NEXT}.
  2863. @end table
  2864. @cindex regular expressions, with tags search
  2865. Any element of the tag/todo match can be a regular expression - in this
  2866. case it must be enclosed in curly braces. For example,
  2867. @samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
  2868. @samp{WORK} and any tag @i{starting} with @samp{BOSS}.
  2869. @cindex level, require for tags match
  2870. You can also require a headline to be of a certain level, by writing
  2871. instead of any TAG an expression like @samp{LEVEL=3}. For example, a
  2872. search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
  2873. have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
  2874. @node Properties and columns, Timestamps, Tags, Top
  2875. @chapter Properties and Columns
  2876. @cindex properties
  2877. Properties are a set of key-value pairs associated with an entry. There
  2878. are two main applications for properties in Org-mode. First, properties
  2879. are like tags, but with a value. For example, in a file where you
  2880. document bugs and plan releases of a piece of software, instead of using
  2881. tags like @code{:release_1:}, @code{:release_2:}, it can be more
  2882. efficient to use a property @code{RELEASE} with a value @code{1.0} or
  2883. @code{2.0}. Second, you can use properties to implement (very basic)
  2884. database capabilities in an Org-mode buffer, for example to create a
  2885. list of Music CD's you own. You can edit and view properties
  2886. conveniently in column view (@pxref{Column view}).
  2887. @menu
  2888. * Property syntax:: How properties are spelled out
  2889. * Special properties:: Access to other Org-mode features
  2890. * Property searches:: Matching property values
  2891. * Column view:: Tabular viewing and editing
  2892. * Property API:: Properties for Lisp programmers
  2893. @end menu
  2894. @node Property syntax, Special properties, Properties and columns, Properties and columns
  2895. @section Property Syntax
  2896. @cindex property syntax
  2897. @cindex drawer, for properties
  2898. Properties are key-value pairs. They need to be inserted into a special
  2899. drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
  2900. is specified on a single line, with the key (surrounded by colons)
  2901. first, and the value after it. Here is an example:
  2902. @example
  2903. * CD collection
  2904. ** Classic
  2905. *** Goldberg Variations
  2906. :PROPERTIES:
  2907. :Title: Goldberg Variations
  2908. :Composer: J.S. Bach
  2909. :Artist: Glen Gould
  2910. :Publisher: Deutsche Grammphon
  2911. :NDisks: 1
  2912. :END:
  2913. @end example
  2914. You may define the allowed values for a particular property @samp{XYZ}
  2915. by setting a property @samp{XYZ_ALL}. This special property is
  2916. @emph{inherited}, so if you set it in a level 1 entry, it will apply to
  2917. the entire tree. When allowed values are defined, setting the
  2918. corresponding property becomes easier and is less prone to typing
  2919. errors. For the example with the CD collection, we can predefine
  2920. publishers and the number of disks in a box like this:
  2921. @example
  2922. * CD collection
  2923. :PROPERTIES:
  2924. :NDisks_ALL: 1 2 3 4
  2925. :Publisher_ALL: "Deutsche Grammophon" Phillips EMI
  2926. :END:
  2927. @end example
  2928. If you want to set properties that can be inherited by any entry in a
  2929. file, use a line like
  2930. @example
  2931. #+PROPERTY: NDisks_ALL 1 2 3 4
  2932. @end example
  2933. Property values set with the global variable
  2934. @code{org-global-properties} can be inherited by all entries in all
  2935. Org-mode files.
  2936. @noindent
  2937. The following commands help to work with properties:
  2938. @table @kbd
  2939. @kindex M-@key{TAB}
  2940. @item M-@key{TAB}
  2941. After an initial colon in a line, complete property keys. All keys used
  2942. in the current file will be offered as possible completions.
  2943. @item M-x org-insert-property-drawer
  2944. Insert a property drawer into the current entry. The drawer will be
  2945. inserted early in the entry, but after the lines with planning
  2946. information like deadlines.
  2947. @kindex C-c C-c
  2948. @item C-c C-c
  2949. With the cursor in a property drawer, this executes property commands.
  2950. @item C-c C-c s
  2951. Set a property in the current entry. Both the property and the value
  2952. can be inserted using completion.
  2953. @kindex S-@key{right}
  2954. @kindex S-@key{left}
  2955. @item S-@key{left}/@key{right}
  2956. Switch property at point to the next/previous allowed value.
  2957. @item C-c C-c d
  2958. Remove a property from the current entry.
  2959. @item C-c C-c D
  2960. Globally remove a property, from all entries in the current file.
  2961. @end table
  2962. @node Special properties, Property searches, Property syntax, Properties and columns
  2963. @section Special Properties
  2964. @cindex properties, special
  2965. Special properties provide alternative access method to Org-mode
  2966. features discussed in the previous chapters, like the TODO state or the
  2967. priority of an entry. This interface exists so that you can include
  2968. these states into columns view (@pxref{Column view}). The following
  2969. property names are special and should not be used as keys in the
  2970. properties drawer:
  2971. @example
  2972. TODO @r{The TODO keyword of the entry.}
  2973. TAGS @r{The tags defined directly in the headline.}
  2974. ALLTAGS @r{All tags, including inherited ones.}
  2975. PRIORITY @r{The priority of the entry, a string with a single letter.}
  2976. DEADLINE @r{The deadline time string, without the angular brackets.}
  2977. SCHEDULED @r{The scheduling time stamp, without the angular brackets.}
  2978. @end example
  2979. @node Property searches, Column view, Special properties, Properties and columns
  2980. @section Property searches
  2981. @cindex properties, searching
  2982. To create sparse trees and special lists with selection based on
  2983. properties, the same commands are used as for tag searches (@pxref{Tag
  2984. searches}), and the same logic applies. For example, a search string
  2985. @example
  2986. +WORK-BOSS+PRIORITY="A"+coffee="unlimited"+with=@{Sarah\|Denny@}
  2987. @end example
  2988. @noindent
  2989. finds entries tagged @samp{:WORK:} but not @samp{:BOSS:}, which
  2990. also have a priority value @samp{A}, a @samp{:coffee:} property with the
  2991. value @samp{unlimited}, and a @samp{:with:} property that is matched by
  2992. the regular expression @samp{Sarah\|Denny}.
  2993. @node Column view, Property API, Property searches, Properties and columns
  2994. @section Column View
  2995. A great way to view and edit properties in an outline tree is
  2996. @emph{column view}. In column view, each outline item is turned into a
  2997. table row. Columns in this table provide access to properties of the
  2998. entries. Org-mode implements columns by overlaying a tabular structure
  2999. over the headline of each item. While the headlines have been turned
  3000. into a table row, you can still change the visibility of the outline
  3001. tree. For example, you get a compact table by switching to CONTENTS
  3002. view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
  3003. is active), but you can still open, read, and edit the entry below each
  3004. headline. Or, you can switch to column view after executing a sparse
  3005. tree command and in this way get a table only for the selected items.
  3006. Column view also works in agenda buffers (@pxref{Agenda views}) where
  3007. queries have collected selected items, possibly from a number of files.
  3008. @menu
  3009. * Defining columns:: The COLUMNS format property
  3010. * Using column view:: How to create and use column view
  3011. @end menu
  3012. @node Defining columns, Using column view, Column view, Column view
  3013. @subsection Defining Columns
  3014. @cindex column view, for properties
  3015. @cindex properties, column view
  3016. Setting up a column view first requires defining the columns. This is
  3017. done by defining a column format line.
  3018. @menu
  3019. * Scope of column definitions:: Where defined, where valid?
  3020. * Column attributes:: Appearance and content of a column
  3021. @end menu
  3022. @node Scope of column definitions, Column attributes, Defining columns, Defining columns
  3023. @subsubsection Scope of column definitions
  3024. To define a column format for an entire file, use a line like
  3025. @example
  3026. #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3027. @end example
  3028. To specify a format that only applies to a specific tree, add a COLUMNS
  3029. property to the top node of that tree, for example
  3030. @example
  3031. ** Top node for columns view
  3032. :PROPERTIES:
  3033. :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3034. :END:
  3035. @end example
  3036. If a @code{COLUMNS} property is present in an entry, it defines columns
  3037. for the entry itself, and for the entire subtree below it. Since the
  3038. column definition is part of the hierarchical structure of the document,
  3039. you can define columns on level 1 that are general enough for all
  3040. sublevels, and more specific columns further down, when you edit a
  3041. deeper part of the tree.
  3042. @node Column attributes, , Scope of column definitions, Defining columns
  3043. @subsubsection Column attributes
  3044. A column definition sets the attributes of a column. The general
  3045. definition looks like this:
  3046. @example
  3047. %[width]property[(title)][@{summary-type@}]
  3048. @end example
  3049. @noindent
  3050. Except for the percent sign and the property name, all items are
  3051. optional. The individual parts have the following meaning:
  3052. @example
  3053. width @r{An integer specifying the width of the column in characters.}
  3054. @r{If omitted, the width will be determined automatically.}
  3055. property @r{The property that should be edited in this column.}
  3056. (title) @r{The header text for the column. If omitted, the}
  3057. @r{property name is used.}
  3058. @{summary-type@} @r{The summary type. If specified, the column values for}
  3059. @r{parent nodes are computed from the children.}
  3060. @r{Supported summary types are:}
  3061. @{+@} @r{Sum numbers in this column.}
  3062. @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
  3063. @{X@} @r{Checkbox status, [X] if all children are [X].}
  3064. @end example
  3065. @noindent
  3066. Here is an example for a complete columns definition, along with allowed
  3067. values.
  3068. @example
  3069. :COLUMNS: %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status %10Time_Spent@{:@}
  3070. :Owner_ALL: Tammy Mark Karl Lisa Don
  3071. :Status_ALL: "In progress" "Not started yet" "Finished" ""
  3072. :Approved_ALL: "[ ]" "[X]"
  3073. @end example
  3074. The first column, @samp{%25ITEM}, means the first 25 characters of the
  3075. item itself, i.e. of the headline. You probably always should start the
  3076. column definition with the ITEM specifier. The other specifiers create
  3077. columns @samp{Owner} with a list of names as allowed values, for
  3078. @samp{Status} with four different possible values, and for a checkbox
  3079. field @samp{Approved}. When no width is given after the @samp{%}
  3080. character, the column will be exactly as wide as it needs to be in order
  3081. to fully display all values. The @samp{Approved} column does have a
  3082. modified title (@samp{Approved?}, with a question mark). Summaries will
  3083. be created for the @samp{Time_Spent} column by adding time duration
  3084. expressions like HH:MM, and for the @samp{Approved} column, by providing
  3085. an @samp{[X]} status if all children have been checked.
  3086. @node Using column view, , Defining columns, Column view
  3087. @subsection Using Column View
  3088. @table @kbd
  3089. @tsubheading{Turning column view on and off}
  3090. @kindex C-c C-x C-c
  3091. @item C-c C-x C-c
  3092. Create the column view for the local environment. This command searches
  3093. the hierarchy, up from point, for a @code{COLUMNS} property that defines
  3094. a format. When one is found, the column view table is established for
  3095. the entire tree, starting from the entry that contains the @code{COLUMNS}
  3096. property. If none is found, the format is taken from the @code{#+COLUMNS}
  3097. line or from the variable @code{org-columns-default-format}, and column
  3098. view is established for the current entry and its subtree.
  3099. @kindex q
  3100. @item q
  3101. Exit column view.
  3102. @tsubheading{Editing values}
  3103. @item @key{left} @key{right} @key{up} @key{down}
  3104. Move through the column view from field to field.
  3105. @kindex S-@key{left}
  3106. @kindex S-@key{right}
  3107. @item S-@key{left}/@key{right}
  3108. Switch to the next/previous allowed value of the field. For this, you
  3109. have to have specified allowed values for a property.
  3110. @kindex n
  3111. @kindex p
  3112. @itemx n / p
  3113. Same as @kbd{S-@key{left}/@key{right}}
  3114. @kindex e
  3115. @item e
  3116. Edit the property at point. For the special properties, this will
  3117. invoke the same interface that you normally use to change that
  3118. property. For example, when editing a TAGS property, the tag completion
  3119. or fast selection interface will pop up.
  3120. @kindex v
  3121. @item v
  3122. View the full value of this property. This is useful if the width of
  3123. the column is smaller than that of the value.
  3124. @kindex a
  3125. @item a
  3126. Edit the list of allowed values for this property. If the list is found
  3127. in the hierarchy, the modified values is stored there. If no list is
  3128. found, the new value is stored in the first entry that is part of the
  3129. current column view.
  3130. @tsubheading{Modifying the table structure}
  3131. @kindex <
  3132. @kindex >
  3133. @item < / >
  3134. Make the column narrower/wider by one character.
  3135. @kindex S-M-@key{right}
  3136. @item S-M-@key{right}
  3137. Insert a new column, to the right of the current column.
  3138. @kindex S-M-@key{left}
  3139. @item S-M-@key{left}
  3140. Delete the current column.
  3141. @end table
  3142. @node Property API, , Column view, Properties and columns
  3143. @section The Property API
  3144. @cindex properties, API
  3145. @cindex API, for properties
  3146. There is a full API for accessing and changing properties. This API can
  3147. be used by Emacs Lisp programs to work with properties and to implement
  3148. features based on them. For more information see @ref{Using the
  3149. property API}.
  3150. @node Timestamps, Remember, Properties and columns, Top
  3151. @chapter Timestamps
  3152. @cindex time stamps
  3153. @cindex date stamps
  3154. Items can be labeled with timestamps to make them useful for project
  3155. planning.
  3156. @menu
  3157. * Time stamps:: Assigning a time to a tree entry
  3158. * Creating timestamps:: Commands which insert timestamps
  3159. * Deadlines and scheduling:: Planning your work
  3160. * Clocking work time::
  3161. @end menu
  3162. @node Time stamps, Creating timestamps, Timestamps, Timestamps
  3163. @section Time stamps, deadlines and scheduling
  3164. @cindex time stamps
  3165. @cindex ranges, time
  3166. @cindex date stamps
  3167. @cindex deadlines
  3168. @cindex scheduling
  3169. A time stamp is a specification of a date (possibly with time or a range
  3170. of times) in a special format, either @samp{<2003-09-16 Tue>} or
  3171. @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
  3172. 12:00-12:30>}@footnote{This is the standard ISO date/time format. If
  3173. you cannot get used to these, see @ref{Custom time format}}. A time
  3174. stamp can appear anywhere in the headline or body of an org-tree entry.
  3175. Its presence causes entries to be shown on specific dates in the agenda
  3176. (@pxref{Weekly/Daily agenda}). We distinguish:
  3177. @table @var
  3178. @item Plain time stamp, Event, Appointment
  3179. @cindex timestamp
  3180. A simple time stamp just assigns a date/time to an item. This is just
  3181. like writing down an appointment or event in a paper agenda. In the
  3182. timeline and agenda displays, the headline of an entry associated with a
  3183. plain time stamp will be shown exactly on that date.
  3184. @example
  3185. * Meet Peter at the movies <2006-11-01 Wed 19:15>
  3186. * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
  3187. @end example
  3188. @item Time stamp with repeater interval
  3189. @cindex timestamp, with repeater interval
  3190. A time stamp may contain a @emph{repeater interval}, indicating that it
  3191. applies not only on the given date, but again and again after a certain
  3192. interval of N days (d), weeks (w), months(m), or years(y). The
  3193. following will show up in the agenda every Wednesday:
  3194. @example
  3195. * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
  3196. @end example
  3197. @item Diary-style sexp entries
  3198. For more complex date specifications, Org-mode supports using the
  3199. special sexp diary entries implemented in the Emacs calendar/diary
  3200. package. For example
  3201. @example
  3202. * The nerd meeting on every 2nd Thursday of the month
  3203. <%%(diary-float t 4 2)>
  3204. @end example
  3205. @item Time/Date range
  3206. @cindex timerange
  3207. @cindex date range
  3208. Two time stamps connected by @samp{--} denote a range. The headline
  3209. will be shown on the first and last day of the range, and on any dates
  3210. that are displayed and fall in the range. Here is an example:
  3211. @example
  3212. ** Meeting in Amsterdam
  3213. <2004-08-23 Mon>--<2004-08-26 Thu>
  3214. @end example
  3215. @item Inactive time stamp
  3216. @cindex timestamp, inactive
  3217. @cindex inactive timestamp
  3218. Just like a plain time stamp, but with square brackets instead of
  3219. angular ones. These time stamps are inactive in the sense that they do
  3220. @emph{not} trigger an entry to show up in the agenda.
  3221. @example
  3222. * Gillian comes late for the fifth time [2006-11-01 Wed]
  3223. @end example
  3224. @end table
  3225. @node Creating timestamps, Deadlines and scheduling, Time stamps, Timestamps
  3226. @section Creating timestamps
  3227. @cindex creating timestamps
  3228. @cindex timestamps, creating
  3229. For Org-mode to recognize time stamps, they need to be in the specific
  3230. format. All commands listed below produce time stamps in the correct
  3231. format.
  3232. @table @kbd
  3233. @kindex C-c .
  3234. @item C-c .
  3235. Prompt for a date and insert a corresponding time stamp. When the
  3236. cursor is at a previously used time stamp, it is updated to NOW. When
  3237. this command is used twice in succession, a time range is inserted.
  3238. @c
  3239. @kindex C-u C-c .
  3240. @item C-u C-c .
  3241. Like @kbd{C-c .}, but use the alternative format which contains date
  3242. and time. The default time can be rounded to multiples of 5 minutes,
  3243. see the option @code{org-time-stamp-rounding-minutes}.
  3244. @c
  3245. @kindex C-c !
  3246. @item C-c !
  3247. Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
  3248. an agenda entry.
  3249. @c
  3250. @kindex C-c <
  3251. @item C-c <
  3252. Insert a time stamp corresponding to the cursor date in the Calendar.
  3253. @c
  3254. @kindex C-c >
  3255. @item C-c >
  3256. Access the Emacs calendar for the current date. If there is a
  3257. timestamp in the current line, goto the corresponding date
  3258. instead.
  3259. @c
  3260. @kindex C-c C-o
  3261. @item C-c C-o
  3262. Access the agenda for the date given by the time stamp or -range at
  3263. point (@pxref{Weekly/Daily agenda}).
  3264. @c
  3265. @kindex S-@key{left}
  3266. @kindex S-@key{right}
  3267. @item S-@key{left}
  3268. @itemx S-@key{right}
  3269. Change date at cursor by one day. These key bindings conflict with
  3270. CUA-mode (@pxref{Conflicts}).
  3271. @c
  3272. @kindex S-@key{up}
  3273. @kindex S-@key{down}
  3274. @item S-@key{up}
  3275. @itemx S-@key{down}
  3276. Change the item under the cursor in a timestamp. The cursor can be on a
  3277. year, month, day, hour or minute. Note that if the cursor is in a
  3278. headline and not at a time stamp, these same keys modify the priority of
  3279. an item. (@pxref{Priorities}). The key bindings also conflict with
  3280. CUA-mode (@pxref{Conflicts}).
  3281. @c
  3282. @kindex C-c C-y
  3283. @cindex evaluate time range
  3284. @item C-c C-y
  3285. Evaluate a time range by computing the difference between start and
  3286. end. With prefix arg, insert result after the time range (in a table:
  3287. into the following column).
  3288. @end table
  3289. @menu
  3290. * The date/time prompt:: How org-mode helps you entering date and time
  3291. * Custom time format:: Making dates look differently
  3292. @end menu
  3293. @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
  3294. @subsection The date/time prompt
  3295. @cindex date, reading in minibuffer
  3296. @cindex time, reading in minibuffer
  3297. When Org-mode prompts for a date/time, the prompt suggests to enter an
  3298. ISO date. But it will in fact accept any string containing some date
  3299. and/or time information. You can, for example, use @kbd{C-y} to paste a
  3300. (possibly multi-line) string copied from an email message. Org-mode
  3301. will find whatever information is in there and will replace anything not
  3302. specified with the current date and time. For example:
  3303. @example
  3304. 3-2-5 --> 2003-02-05
  3305. feb 15 --> currentyear-02-15
  3306. sep 12 9 --> 2009-09-12
  3307. 12:45 --> today 12:45
  3308. 22 sept 0:34 --> currentyear-09-22 0:34
  3309. 12 --> currentyear-currentmonth-12
  3310. Fri --> nearest Friday (today or later)
  3311. +4 --> 4 days from now (if +N is the only thing given)
  3312. @end example
  3313. The function understands English month and weekday abbreviations. If
  3314. you want to use unabbreviated names and/or other languages, configure
  3315. the variables @code{parse-time-months} and @code{parse-time-weekdays}.
  3316. @cindex calendar, for selecting date
  3317. Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
  3318. you don't need/want the calendar, configure the variable
  3319. @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
  3320. prompt, either by clicking on a date in the calendar, or by pressing
  3321. @key{RET}, the date selected in the calendar will be combined with the
  3322. information entered at the prompt. You can control the calendar fully
  3323. from the minibuffer:
  3324. @table @kbd
  3325. @kindex <
  3326. @item <
  3327. Scroll calendar backwards by one month.
  3328. @kindex >
  3329. @item >
  3330. Scroll calendar forwards by one month.
  3331. @kindex mouse-1
  3332. @item mouse-1
  3333. Select date by clicking on it.
  3334. @kindex S-@key{right}
  3335. @item S-@key{right}
  3336. One day forward.
  3337. @kindex S-@key{left}
  3338. @item S-@key{left}
  3339. One day back.
  3340. @kindex S-@key{down}
  3341. @item S-@key{down}
  3342. One week forward.
  3343. @kindex S-@key{up}
  3344. @item S-@key{up}
  3345. One week back.
  3346. @kindex M-S-@key{right}
  3347. @item M-S-@key{right}
  3348. One month forward.
  3349. @kindex M-S-@key{left}
  3350. @item M-S-@key{left}
  3351. One month back.
  3352. @kindex @key{RET}
  3353. @item @key{RET}
  3354. Choose date in calendar (only if nothing was typed into minibuffer).
  3355. @end table
  3356. @node Custom time format, , The date/time prompt, Creating timestamps
  3357. @subsection Custom time format
  3358. @cindex custom date/time format
  3359. @cindex time format, custom
  3360. @cindex date format, custom
  3361. Org-mode uses the standard ISO notation for dates and times as it is
  3362. defined in ISO 8601. If you cannot get used to this and require another
  3363. representation of date and time to keep you happy, you can get it by
  3364. customizing the variables @code{org-display-custom-times} and
  3365. @code{org-time-stamp-custom-formats}.
  3366. @table @kbd
  3367. @kindex C-c C-x C-t
  3368. @item C-c C-x C-t
  3369. Toggle the display of custom formats for dates and times.
  3370. @end table
  3371. @noindent
  3372. Org-mode needs the default format for scanning, so the custom date/time
  3373. format does not @emph{replace} the default format - instead it is put
  3374. @emph{over} the default format using text properties. This has the
  3375. following consequences:
  3376. @itemize @bullet
  3377. @item
  3378. You cannot place the cursor onto a time stamp anymore, only before or
  3379. after.
  3380. @item
  3381. The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
  3382. each component of a time stamp. If the cursor is at the beginning of
  3383. the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
  3384. just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
  3385. time will be changed by one minute.
  3386. @item
  3387. If the time stamp contains a range of clock times or a repeater, these
  3388. will not be overlayed, but remain in the buffer as they were.
  3389. @item
  3390. When you delete a time stamp character-by-character, it will only
  3391. disappear from the buffer after @emph{all} (invisible) characters
  3392. belonging to the ISO timestamp have been removed.
  3393. @item
  3394. If the custom time stamp format is longer than the default and you are
  3395. using dates in tables, table alignment will be messed up. If the custom
  3396. format is shorter, things do work as expected.
  3397. @end itemize
  3398. @node Deadlines and scheduling, Clocking work time, Creating timestamps, Timestamps
  3399. @section Deadlines and Scheduling
  3400. A time stamp may be preceded by special keywords to facilitate planning
  3401. of work:
  3402. @table @var
  3403. @item DEADLINE
  3404. @cindex DEADLINE keyword
  3405. The task (most likely a TODO item) is supposed to be finished on that
  3406. date, and it will be listed then. In addition, the compilation for
  3407. @emph{today} will carry a warning about the approaching or missed
  3408. deadline, starting @code{org-deadline-warning-days} before the due date,
  3409. and continuing until the entry is marked DONE. An example:
  3410. @example
  3411. *** TODO write article about the Earth for the Guide
  3412. The editor in charge is [[bbdb:Ford Prefect]]
  3413. DEADLINE: <2004-02-29 Sun>
  3414. @end example
  3415. You can specify a different lead time for warnings for a specific
  3416. deadlines using the following syntax. Here is an example with a warning
  3417. period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
  3418. @item SCHEDULED
  3419. @cindex SCHEDULED keyword
  3420. You are planning to start working on that task on the given date. The
  3421. headline will be listed under the given date@footnote{It will still be
  3422. listed on that date after it has been marked DONE. If you don't like
  3423. this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
  3424. addition, a reminder that the scheduled date has passed will be present
  3425. in the compilation for @emph{today}, until the entry is marked DONE.
  3426. I.e., the task will automatically be forwarded until completed.
  3427. @example
  3428. *** TODO Call Trillian for a date on New Years Eve.
  3429. SCHEDULED: <2004-12-25 Sat>
  3430. @end example
  3431. @noindent
  3432. @b{Important:} Scheduling an item in Org-mode should @i{not} be
  3433. understood like @i{Scheduling a meeting}. Setting a date for a meeting
  3434. is just a simple appointment, you should mark this entry with a simple
  3435. plain time stamp, to get this item shown on the date where it applies.
  3436. This is a frequent mis-understanding from Org-users. In Org-mode,
  3437. @i{Scheduling} means setting a date when you want to start working on an
  3438. action item.
  3439. @end table
  3440. @menu
  3441. * Inserting deadline/schedule:: Planning items
  3442. * Repeated tasks:: Items that show up again and again
  3443. @end menu
  3444. @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
  3445. @subsection Inserting deadline/schedule
  3446. The following commands allow to quickly insert a deadline or to schedule
  3447. an item:
  3448. @table @kbd
  3449. @c
  3450. @kindex C-c C-d
  3451. @item C-c C-d
  3452. Insert @samp{DEADLINE} keyword along with a stamp. The insertion will
  3453. happen in the line directly following the headline.
  3454. @c FIXME Any CLOSED timestamp will be removed.????????
  3455. @c
  3456. @kindex C-c C-w
  3457. @cindex sparse tree, for deadlines
  3458. @item C-c C-w
  3459. Create a sparse tree with all deadlines that are either past-due, or
  3460. which will become due within @code{org-deadline-warning-days}.
  3461. With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
  3462. prefix, check that many days. For example, @kbd{C-1 C-c C-w} shows
  3463. all deadlines due tomorrow.
  3464. @c
  3465. @kindex C-c C-s
  3466. @item C-c C-s
  3467. Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
  3468. happen in the line directly following the headline. Any CLOSED
  3469. timestamp will be removed.
  3470. @end table
  3471. @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
  3472. @subsection Repeated Tasks
  3473. Some tasks need to be repeated again and again, and Org-mode therefore
  3474. allows to use a repeater in a DEADLINE or SCHEDULED time stamp, for
  3475. example:
  3476. @example
  3477. ** TODO Pay the rent
  3478. DEADLINE: <2005-10-01 Sat +1m>
  3479. @end example
  3480. Deadlines and scheduled items produce entries in the agenda when they
  3481. are over-due, so it is important to be able to mark such an entry as
  3482. completed once you have done so. When you mark a DEADLINE or a SCHEDULE
  3483. with the todo keyword DONE, it will no longer produce entries in the
  3484. agenda. The problem with this is, however, that then also the
  3485. @emph{next} instance of the repeated entry will not be active. Org-mode
  3486. deals with this in the following way: When you try to mark such an entry
  3487. DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
  3488. time stamp by the repeater interval, and immediately set the entry state
  3489. back to TODO. In the example above, setting the state to DONE would
  3490. actually switch the date like this:
  3491. @example
  3492. ** TODO Pay the rent
  3493. DEADLINE: <2005-11-01 Tue +1m>
  3494. @end example
  3495. You will also be prompted for a note that will be put under the DEADLINE
  3496. line to keep a record that you actually acted on the previous instance
  3497. of this deadline.
  3498. As a consequence of shifting the base date, this entry will no longer be
  3499. visible in the agenda when checking past dates, but all future instances
  3500. will be visible.
  3501. You may have both scheduling and deadline information for a specific
  3502. task - just make sure that the repeater intervals on both are the same.
  3503. @node Clocking work time, , Deadlines and scheduling, Timestamps
  3504. @section Clocking work time
  3505. Org-mode allows you to clock the time you spent on specific tasks in a
  3506. project. When you start working on an item, you can start the clock.
  3507. When you stop working on that task, or when you mark the task done, the
  3508. clock is stopped and the corresponding time interval is recorded. It
  3509. also computes the total time spent on each subtree of a project.
  3510. @table @kbd
  3511. @kindex C-c C-x C-i
  3512. @item C-c C-x C-i
  3513. Start the clock on the current item (clock-in). This inserts the CLOCK
  3514. keyword together with a timestamp.
  3515. @kindex C-c C-x C-o
  3516. @item C-c C-x C-o
  3517. Stop the clock (clock-out). The inserts another timestamp at the same
  3518. location where the clock was last started. It also directly computes
  3519. the resulting time in inserts it after the time range as @samp{=>
  3520. HH:MM}. See the variable @code{org-log-done} for the possibility to
  3521. record an additional note together with the clock-out time
  3522. stamp@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:
  3523. lognoteclock-out}}.
  3524. @kindex C-c C-y
  3525. @item C-c C-y
  3526. Recompute the time interval after changing one of the time stamps. This
  3527. is only necessary if you edit the time stamps directly. If you change
  3528. them with @kbd{S-@key{cursor}} keys, the update is automatic.
  3529. @kindex C-c C-t
  3530. @item C-c C-t
  3531. Changing the TODO state of an item to DONE automatically stops the clock
  3532. if it is running in this same item.
  3533. @kindex C-c C-x C-x
  3534. @item C-c C-x C-x
  3535. Cancel the current clock. This is useful if a clock was started by
  3536. mistake, or if you ended up working on something else.
  3537. @kindex C-c C-x C-d
  3538. @item C-c C-x C-d
  3539. Display time summaries for each subtree in the current buffer. This
  3540. puts overlays at the end of each headline, showing the total time
  3541. recorded under that heading, including the time of any subheadings. You
  3542. can use visibility cycling to study the tree, but the overlays disappear
  3543. when you change the buffer (see variable
  3544. @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
  3545. @kindex C-c C-x C-r
  3546. @item C-c C-x C-r
  3547. Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
  3548. report as an org-mode table into the current file.
  3549. @example
  3550. #+BEGIN: clocktable :maxlevel 2 :emphasize nil
  3551. #+END: clocktable
  3552. @end example
  3553. @noindent
  3554. If such a block already exists, its content is replaced by the new
  3555. table. The @samp{BEGIN} line can specify options:
  3556. @example
  3557. :maxlevel @r{Maximum level depth to which times are listed in the table.}
  3558. :emphasize @r{When @code{t}, emphasize level one and level two items}
  3559. :scope @r{The scope to consider. This can be any of the following:}
  3560. nil @r{the current buffer or narrowed region}
  3561. file @r{the full current buffer}
  3562. subtree @r{the subtree where the clocktable is located}
  3563. treeN @r{the surrounding level N tree, for example @code{tree3}}
  3564. tree @r{the surrounding level 1 tree}
  3565. agenda @r{all agenda files}
  3566. ("file"..) @r{scan these files}
  3567. :block @r{The time block to consider. This block is specified relative}
  3568. @r{to the current time and may be any of these keywords:}
  3569. @r{@code{today}, @code{yesterday}, @code{thisweek}, @code{lastweek},}
  3570. @r{@code{thismonth}, @code{lastmonth}, @code{thisyear}, or @code{lastyear}}.
  3571. :tstart @r{A time string specifying when to start considering times}
  3572. :tend @r{A time string specifying when to stop considering times}
  3573. @end example
  3574. So to get a clock summary of the current level 1 tree, for the current
  3575. day, you could write
  3576. @example
  3577. #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1
  3578. #+END: clocktable
  3579. @end example
  3580. and to use a specific time range you could write@footnote{Note that all
  3581. parameters must be specified in a single line - the line is broken here
  3582. only to fit it onto the manual.}
  3583. @example
  3584. #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
  3585. :tend "<2006-08-10 Thu 12:00>"
  3586. #+END: clocktable
  3587. @end example
  3588. @kindex C-c C-c
  3589. @item C-c C-c
  3590. @kindex C-c C-x C-u
  3591. @itemx C-c C-x C-u
  3592. Update dynamical block at point. The cursor needs to be in the
  3593. @code{#+BEGIN} line of the dynamic block.
  3594. @kindex C-u C-c C-x C-u
  3595. @item C-u C-c C-x C-u
  3596. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  3597. you have several clocktable blocks in a buffer.
  3598. @end table
  3599. The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
  3600. the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
  3601. worked on or closed during a day.
  3602. @node Remember, Agenda views, Timestamps, Top
  3603. @chapter Remember
  3604. @cindex @file{remember.el}
  3605. The @i{Remember} package by John Wiegley lets you store quick notes with
  3606. little interruption of your work flow. See
  3607. @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
  3608. information. It is an excellent way to add new notes and TODO items to
  3609. Org-mode files. Org-mode significantly expands the possibilities of
  3610. @i{remember}: You may define templates for different note types, and to
  3611. associate target files and headlines with specific templates. It also
  3612. allows you to select the location where a note should be stored
  3613. interactively, on the fly.
  3614. @menu
  3615. * Setting up remember:: Some code for .emacs to get things going
  3616. * Remember templates:: Define the outline of different note types
  3617. * Storing notes:: Directly get the note to where it belongs
  3618. @end menu
  3619. @node Setting up remember, Remember templates, Remember, Remember
  3620. @section Setting up remember
  3621. The following customization will tell @i{remember} to use org files as
  3622. target, and to create annotations compatible with Org-mode links.
  3623. @example
  3624. (setq org-directory "~/path/to/my/orgfiles/")
  3625. (setq org-default-notes-file (concat org-directory "/notes.org"))
  3626. (setq remember-annotation-functions '(org-remember-annotation))
  3627. (setq remember-handler-functions '(org-remember-handler))
  3628. (add-hook 'remember-mode-hook 'org-remember-apply-template)
  3629. @end example
  3630. @node Remember templates, Storing notes, Setting up remember, Remember
  3631. @section Remember templates
  3632. @cindex templates, for remember
  3633. In combination with Org-mode, you can use templates to generate
  3634. different types of @i{remember} notes. For example, if you would like
  3635. to use one template to create general TODO entries, another one for
  3636. journal entries, and a third one for collecting random ideas, you could
  3637. use:
  3638. @example
  3639. (setq org-remember-templates
  3640. '((?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
  3641. (?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
  3642. (?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  3643. @end example
  3644. @noindent In these entries, the character specifies how to select the
  3645. template. The first string specifies the template. Two more (optional)
  3646. strings give the file in which, and the headline under which the new
  3647. note should be stored. The file defaults (if not present or @code{nil})
  3648. to @code{org-default-notes-file}, the heading to
  3649. @code{org-remember-default-headline}. Both defaults help to get to the
  3650. storing location quickly, but you can change the location interactively
  3651. while storing the note.
  3652. When you call @kbd{M-x remember} (or @kbd{M-x org-remember}) to remember
  3653. something, org will prompt for a key to select the template (if you have
  3654. more than one template) and then prepare the buffer like
  3655. @example
  3656. * TODO
  3657. [[file:link to where you called remember]]
  3658. @end example
  3659. @noindent or
  3660. @example
  3661. * [2006-03-21 Tue 15:37]
  3662. [[file:link to where you called remember]]
  3663. @end example
  3664. @noindent
  3665. During expansion of the template, special @kbd{%}-escapes allow dynamic
  3666. insertion of content:
  3667. @example
  3668. %^@{prompt@} @r{prompt the user for a string and replace this sequence with it.}
  3669. %t @r{time stamp, date only}
  3670. %T @r{time stamp with date and time}
  3671. %u, %U @r{like the above, but inactive time stamps}
  3672. %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
  3673. @r{You may define a prompt like @code{%^@{Birthday@}t}}
  3674. %n @r{user name (taken from @code{user-full-name})}
  3675. %a @r{annotation, normally the link created with @code{org-store-link}}
  3676. %A @r{like @code{%a}, but prompt for the description part}
  3677. %i @r{initial content, the region when remember is called with C-u.}
  3678. @r{The entire text will be indented like @code{%i} itself.}
  3679. %^g @r{prompt for tags, with completion on tags in target file.}
  3680. %^G @r{prompt for tags, with completion all tags in all agenda files.}
  3681. %:keyword @r{specific information for certain link types, see below}
  3682. @end example
  3683. @noindent
  3684. For specific link types, the following keywords will be
  3685. defined@footnote{If you define your own link types (@pxref{Adding
  3686. hyperlink types}), any property you store with
  3687. @code{org-store-link-props} can be accessed in remember templates in a
  3688. similar way.}:
  3689. @example
  3690. Link type | Available keywords
  3691. -------------------+----------------------------------------------
  3692. bbdb | %:name %:company
  3693. vm, wl, mh, rmail | %:type %:subject %:message-id
  3694. | %:from %:fromname %:fromaddress
  3695. | %:to %:toname %:toaddress
  3696. | %: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}.}}
  3697. gnus | %:group, @r{for messages also all email fields}
  3698. w3, w3m | %:url
  3699. info | %:file %:node
  3700. calendar | %:date"
  3701. @end example
  3702. @noindent
  3703. To place the cursor after template expansion use:
  3704. @example
  3705. %? @r{After completing the template, position cursor here.}
  3706. @end example
  3707. @noindent
  3708. If you change you mind about which template to use, call
  3709. @code{org-remember} in the remember buffer. You may then select a new
  3710. template that will be filled with the previous context information.
  3711. @node Storing notes, , Remember templates, Remember
  3712. @section Storing notes
  3713. When you are finished preparing a note with @i{remember}, you have to press
  3714. @kbd{C-c C-c} to file the note away. The handler will store the note in
  3715. the file and under the headline specified in the template, or it will
  3716. use the default file and headlines. The window configuration will be
  3717. restored, and you are back in the working context before the call to
  3718. @code{remember}. To re-use the location found during the last call to
  3719. @code{remember}, exit the remember buffer with @kbd{C-u C-u C-c C-c},
  3720. i.e. specify a double prefix argument to @kbd{C-c C-c}.
  3721. If you want to store the note to a different place, use @kbd{C-u C-c
  3722. C-c} instead to exit remember@footnote{Configure the variable
  3723. @code{org-remember-store-without-prompt} to make this behavior the
  3724. default.}. The handler will then first prompt for a target file - if you
  3725. press @key{RET}, the value specified for the template is used. Then the
  3726. command offers the headings tree of the selected file, with the cursor
  3727. position at the default headline (if you had specified one in the
  3728. template). You can either immediately press @key{RET} to get the note
  3729. placed there. Or you can use the following keys to find a different
  3730. location:
  3731. @example
  3732. @key{TAB} @r{Cycle visibility.}
  3733. @key{down} / @key{up} @r{Next/previous visible headline.}
  3734. n / p @r{Next/previous visible headline.}
  3735. f / b @r{Next/previous headline same level.}
  3736. u @r{One level up.}
  3737. @c 0-9 @r{Digit argument.}
  3738. @end example
  3739. @noindent
  3740. Pressing @key{RET} or @key{left} or @key{right}
  3741. then leads to the following result.
  3742. @multitable @columnfractions 0.2 0.15 0.65
  3743. @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
  3744. @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
  3745. @item @tab @tab depending on @code{org-reverse-note-order}.
  3746. @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
  3747. @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
  3748. @item @tab @tab depending on @code{org-reverse-note-order}.
  3749. @item not on headline @tab @key{RET}
  3750. @tab at cursor position, level taken from context.
  3751. @end multitable
  3752. Before inserting the text into a tree, the function ensures that the
  3753. text has a headline, i.e. a first line that starts with a @samp{*}. If
  3754. not, a headline is constructed from the current date and some additional
  3755. data. If you have indented the text of the note below the headline, the
  3756. indentation will be adapted if inserting the note into the tree requires
  3757. demotion from level 1.
  3758. @node Agenda views, Embedded LaTeX, Remember, Top
  3759. @chapter Agenda Views
  3760. @cindex agenda views
  3761. Due to the way Org-mode works, TODO items, time-stamped items, and
  3762. tagged headlines can be scattered throughout a file or even a number of
  3763. files. To get an overview over open action items, or over events that
  3764. are important for a particular date, this information must be collected,
  3765. sorted and displayed in an organized way.
  3766. Org-mode can select items based on various criteria, and display them
  3767. in a separate buffer. Six different view types are provided:
  3768. @itemize @bullet
  3769. @item
  3770. an @emph{agenda} that is like a calendar and shows information
  3771. for specific dates,
  3772. @item
  3773. a @emph{TODO list} that covers all unfinished
  3774. action items,
  3775. @item
  3776. a @emph{tags view}, showings headlines based on
  3777. the tags associated with them,
  3778. @item
  3779. a @emph{timeline view} that shows all events in a single Org-mode file,
  3780. in time-sorted view,
  3781. @item
  3782. a @emph{stuck projects view} showing projects that currently don't move
  3783. along, and
  3784. @item
  3785. @emph{custom views} that are special tag/keyword searches and
  3786. combinations of different views.
  3787. @end itemize
  3788. @noindent
  3789. The extracted information is displayed in a special @emph{agenda
  3790. buffer}. This buffer is read-only, but provides commands to visit the
  3791. corresponding locations in the original Org-mode files, and even to
  3792. edit these files remotely.
  3793. Two variables control how the agenda buffer is displayed and whether the
  3794. window configuration is restored when the agenda exits:
  3795. @code{org-agenda-window-setup} and
  3796. @code{org-agenda-restore-windows-after-quit}.
  3797. @menu
  3798. * Agenda files:: Files being searched for agenda information
  3799. * Agenda dispatcher:: Keyboard access to agenda views
  3800. * Built-in agenda views:: What is available out of the box?
  3801. * Presentation and sorting:: How agenda items are prepared for display
  3802. * Agenda commands:: Remote editing of org trees
  3803. * Custom agenda views:: Defining special searches and views
  3804. @end menu
  3805. @node Agenda files, Agenda dispatcher, Agenda views, Agenda views
  3806. @section Agenda files
  3807. @cindex agenda files
  3808. @cindex files for agenda
  3809. The information to be shown is collected from all @emph{agenda files},
  3810. the files listed in the variable @code{org-agenda-files}@footnote{If the
  3811. value of that variable is not a list, but a single file name, then the
  3812. list of agenda files will be maintained in that external file.}. Thus even
  3813. if you only work with a single Org-mode file, this file should be put
  3814. into that list@footnote{When using the dispatcher, pressing @kbd{1}
  3815. before selecting a command will actually limit the command to the
  3816. current file, and ignore @code{org-agenda-files} until the next
  3817. dispatcher command.}. You can customize @code{org-agenda-files}, but
  3818. the easiest way to maintain it is through the following commands
  3819. @cindex files, adding to agenda list
  3820. @table @kbd
  3821. @kindex C-c [
  3822. @item C-c [
  3823. Add current file to the list of agenda files. The file is added to
  3824. the front of the list. If it was already in the list, it is moved to
  3825. the front. With prefix arg, file is added/moved to the end.
  3826. @kindex C-c ]
  3827. @item C-c ]
  3828. Remove current file from the list of agenda files.
  3829. @kindex C-,
  3830. @kindex C-'
  3831. @item C-,
  3832. @itemx C-'
  3833. Cycle through agenda file list, visiting one file after the other.
  3834. @kindex C-c C-x /
  3835. @item C-c C-x /
  3836. Search for a regular rexpression in all agenda files and display the
  3837. results in an @code{occur} buffer.
  3838. @end table
  3839. @noindent
  3840. The Org menu contains the current list of files and can be used
  3841. to visit any of them.
  3842. @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda views
  3843. @section The agenda dispatcher
  3844. @cindex agenda dispatcher
  3845. @cindex dispatching agenda commands
  3846. The views are created through a dispatcher that should be bound to a
  3847. global key, for example @kbd{C-c a} (@pxref{Installation}). In the
  3848. following we will assume that @kbd{C-c a} is indeed how the dispatcher
  3849. is accessed and list keyboard access to commands accordingly. After
  3850. pressing @kbd{C-c a}, an additional letter is required to execute a
  3851. command. The dispatcher offers the following default commands:
  3852. @table @kbd
  3853. @item a
  3854. Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
  3855. @item t @r{/} T
  3856. Create a list of all TODO items (@pxref{Global TODO list}).
  3857. @item m @r{/} M
  3858. Create a list of headlines matching a TAGS expression (@pxref{Matching
  3859. tags and properties}).
  3860. @item L
  3861. Create the timeline view for the current buffer (@pxref{Timeline}).
  3862. @item # @r{/} !
  3863. Create a list of stuck projects (@pxref{Stuck projects}).
  3864. @item 1
  3865. Restrict an agenda command to the current buffer. After pressing
  3866. @kbd{1}, you still need to press the character selecting the command.
  3867. @item 0
  3868. If there is an active region, restrict the following agenda command to
  3869. the region. Otherwise, restrict it to the current subtree. After
  3870. pressing @kbd{0}, you still need to press the character selecting the
  3871. command.
  3872. @end table
  3873. You can also define custom commands that will be accessible through the
  3874. dispatcher, just like the default commands. This includes the
  3875. possibility to create extended agenda buffers that contain several
  3876. blocks together, for example the weekly agenda, the global TODO list and
  3877. a number of special tags matches. @xref{Custom agenda views}.
  3878. @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda views
  3879. @section The built-in agenda views
  3880. In this section we describe the built-in views.
  3881. @menu
  3882. * Weekly/Daily agenda:: The calendar page with current tasks
  3883. * Global TODO list:: All unfinished action items
  3884. * Matching tags and properties:: Structured information with fine-tuned search
  3885. * Timeline:: Time-sorted view for single file
  3886. * Stuck projects:: Find projects you need to review
  3887. @end menu
  3888. @node Weekly/Daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
  3889. @subsection The weekly/daily agenda
  3890. @cindex agenda
  3891. @cindex weekly agenda
  3892. @cindex daily agenda
  3893. The purpose of the weekly/daily @emph{agenda} is to act like a page of a
  3894. paper agenda, showing all the tasks for the current week or day.
  3895. @table @kbd
  3896. @cindex org-agenda, command
  3897. @kindex C-c a a
  3898. @item C-c a a
  3899. Compile an agenda for the current week from a list of org files. The
  3900. agenda shows the entries for each day. With a @kbd{C-u} prefix (or
  3901. when the variable @code{org-agenda-include-all-todo} is @code{t}), all
  3902. unfinished TODO items (including those without a date) are also listed at
  3903. the beginning of the buffer, before the first date.@*
  3904. @end table
  3905. Remote editing from the agenda buffer means, for example, that you can
  3906. change the dates of deadlines and appointments from the agenda buffer.
  3907. The commands available in the Agenda buffer are listed in @ref{Agenda
  3908. commands}.
  3909. @subsubheading Calendar/Diary integration
  3910. @cindex calendar integration
  3911. @cindex diary integration
  3912. Emacs contains the calendar and diary by Edward M. Reingold. The
  3913. calendar displays a three-month calendar with holidays from different
  3914. countries and cultures. The diary allows you to keep track of
  3915. anniversaries, lunar phases, sunrise/set, recurrent appointments
  3916. (weekly, monthly) and more. In this way, it is quite complementary to
  3917. Org-mode. It can be very useful to combine output from Org-mode with
  3918. the diary.
  3919. In order to include entries from the Emacs diary into Org-mode's
  3920. agenda, you only need to customize the variable
  3921. @lisp
  3922. (setq org-agenda-include-diary t)
  3923. @end lisp
  3924. @noindent After that, everything will happen automatically. All diary
  3925. entries including holidays, anniversaries etc will be included in the
  3926. agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and
  3927. @key{RET} can be used from the agenda buffer to jump to the diary
  3928. file in order to edit existing diary entries. The @kbd{i} command to
  3929. insert new entries for the current date works in the agenda buffer, as
  3930. well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
  3931. Sunrise/Sunset times, show lunar phases and to convert to other
  3932. calendars, respectively. @kbd{c} can be used to switch back and forth
  3933. between calendar and agenda.
  3934. If you are using the diary only for sexp entries and holidays, it is
  3935. faster to not use the above setting, but instead to copy or even move
  3936. the entries into an Org-mode file. Org-mode evaluates diary-style sexp
  3937. entries, and does it faster because there is no overhead for first
  3938. creating the diary display. Note that the sexp entries must start at
  3939. the left margin, no white space is allowed before them. For example,
  3940. the following segment of an Org-mode file will be processed and entries
  3941. will be made in the agenda:
  3942. @example
  3943. * Birthdays and similar stuff
  3944. #+CATEGORY: Holiday
  3945. %%(org-calendar-holiday) ; special function for holiday names
  3946. #+CATEGORY: Ann
  3947. %%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
  3948. %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
  3949. @end example
  3950. @node Global TODO list, Matching tags and properties, Weekly/Daily agenda, Built-in agenda views
  3951. @subsection The global TODO list
  3952. @cindex global TODO list
  3953. @cindex TODO list, global
  3954. The global TODO list contains all unfinished TODO items, formatted and
  3955. collected into a single place.
  3956. @table @kbd
  3957. @kindex C-c a t
  3958. @item C-c a t
  3959. Show the global TODO list. This collects the TODO items from all
  3960. agenda files (@pxref{Agenda views}) into a single buffer. The buffer is in
  3961. @code{agenda-mode}, so there are commands to examine and manipulate
  3962. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  3963. @kindex C-c a T
  3964. @item C-c a T
  3965. @cindex TODO keyword matching
  3966. Like the above, but allows selection of a specific TODO keyword. You
  3967. can also do this by specifying a prefix argument to @kbd{C-c a t}. With
  3968. a @kbd{C-u} prefix you are prompted for a keyword, and you may also
  3969. specify several keywords by separating them with @samp{|} as boolean OR
  3970. operator. With a numeric prefix, the Nth keyword in
  3971. @code{org-todo-keywords} is selected.
  3972. @kindex r
  3973. The @kbd{r} key in the agenda buffer regenerates it, and you can give
  3974. a prefix argument to this command to change the selected TODO keyword,
  3975. for example @kbd{3 r}. If you often need a search for a specific
  3976. keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
  3977. Matching specific TODO keywords can also be done as part of a tags
  3978. search (@pxref{Tag searches}).
  3979. @end table
  3980. Remote editing of TODO items means that you can change the state of a
  3981. TODO entry with a single key press. The commands available in the
  3982. TODO list are described in @ref{Agenda commands}.
  3983. @cindex sublevels, inclusion into todo list
  3984. Normally the global todo list simply shows all headlines with TODO
  3985. keywords. This list can become very long. There are two ways to keep
  3986. it more compact:
  3987. @itemize @minus
  3988. @item
  3989. Some people view a TODO item that has been @emph{scheduled} for
  3990. execution (@pxref{Time stamps}) as no longer @emph{open}. Configure the
  3991. variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
  3992. items from the global TODO list.
  3993. @item
  3994. TODO items may have sublevels to break up the task into subtasks. In
  3995. such cases it may be enough to list only the highest level TODO headline
  3996. and omit the sublevels from the global list. Configure the variable
  3997. @code{org-agenda-todo-list-sublevels} to get this behavior.
  3998. @end itemize
  3999. @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
  4000. @subsection Matching Tags and Properties
  4001. @cindex matching, of tags
  4002. @cindex matching, of properties
  4003. @cindex tags view
  4004. If headlines in the agenda files are marked with @emph{tags}
  4005. (@pxref{Tags}), you can select headlines based on the tags that apply
  4006. to them and collect them into an agenda buffer.
  4007. @table @kbd
  4008. @kindex C-c a m
  4009. @item C-c a m
  4010. Produce a list of all headlines that match a given set of tags. The
  4011. command prompts for a selection criterion, which is a boolean logic
  4012. expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
  4013. @samp{WORK|HOME} (@pxref{Tags}). If you often need a specific search,
  4014. define a custom command for it (@pxref{Agenda dispatcher}).
  4015. @kindex C-c a M
  4016. @item C-c a M
  4017. Like @kbd{C-c a m}, but only select headlines that are also TODO items
  4018. and force checking subitems (see variable
  4019. @code{org-tags-match-list-sublevels}). Matching specific todo keywords
  4020. together with a tags match is also possible, see @ref{Tag searches}.
  4021. @end table
  4022. The commands available in the tags list are described in @ref{Agenda
  4023. commands}.
  4024. @node Timeline, Stuck projects, Matching tags and properties, Built-in agenda views
  4025. @subsection Timeline for a single file
  4026. @cindex timeline, single file
  4027. @cindex time-sorted view
  4028. The timeline summarizes all time-stamped items from a single Org-mode
  4029. file in a @emph{time-sorted view}. The main purpose of this command is
  4030. to give an overview over events in a project.
  4031. @table @kbd
  4032. @kindex C-c a L
  4033. @item C-c a L
  4034. Show a time-sorted view of the org file, with all time-stamped items.
  4035. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  4036. (scheduled or not) are also listed under the current date.
  4037. @end table
  4038. @noindent
  4039. The commands available in the timeline buffer are listed in
  4040. @ref{Agenda commands}.
  4041. @node Stuck projects, , Timeline, Built-in agenda views
  4042. @subsection Stuck projects
  4043. If you are following a system like David Allen's GTD to organize your
  4044. work, one of the ``duties'' you have is a regular review to make sure
  4045. that all projects move along. A @emph{stuck} project is a project that
  4046. has no defined next actions, so it will never show up in the TODO lists
  4047. Org-mode produces. During the review, you need to identify such
  4048. projects and define next actions for them.
  4049. @table @kbd
  4050. @kindex C-c a #
  4051. @item C-c a #
  4052. List projects that are stuck.
  4053. @kindex C-c a !
  4054. @item C-c a !
  4055. Customize the variable @code{org-stuck-projects} to define what a stuck
  4056. project is and how to find it.
  4057. @end table
  4058. You almost certainly will have to configure this view before it will
  4059. work for you. The built-in default assumes that all your projects are
  4060. level-2 headlines, and that a project is not stuck if it has at least
  4061. one entry marked with a todo keyword TODO or NEXT or NEXTACTION.
  4062. Lets assume that you, in your own way of using Org-mode, identify
  4063. projects with a tag PROJECT, and that you use a todo keyword MAYBE to
  4064. indicate a project that should not be considered yet. Lets further
  4065. assume that the todo keyword DONE marks finished projects, and that NEXT
  4066. and TODO indicate next actions. The tag @@SHOP indicates shopping and
  4067. is a next action even without the NEXT tag. Finally, if the project
  4068. contains the special word IGNORE anywhere, it should not be listed
  4069. either. In this case you would start by identifying eligible projects
  4070. with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
  4071. TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
  4072. are not stuck. The correct customization for this is
  4073. @lisp
  4074. (setq org-stuck-projects
  4075. '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
  4076. "\\<IGNORE\\>"))
  4077. @end lisp
  4078. @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda views
  4079. @section Presentation and sorting
  4080. @cindex presentation, of agenda items
  4081. Before displaying items in an agenda view, Org-mode visually prepares
  4082. the items and sorts them. Each item occupies a single line. The line
  4083. starts with a @emph{prefix} that contains the @emph{category}
  4084. (@pxref{Categories}) of the item and other important information. You can
  4085. customize the prefix using the option @code{org-agenda-prefix-format}.
  4086. The prefix is followed by a cleaned-up version of the outline headline
  4087. associated with the item.
  4088. @menu
  4089. * Categories:: Not all tasks are equal
  4090. * Time-of-day specifications:: How the agenda knows the time
  4091. * Sorting of agenda items:: The order of things
  4092. @end menu
  4093. @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
  4094. @subsection Categories
  4095. @cindex category
  4096. The category is a broad label assigned to each agenda item. By default,
  4097. the category is simply derived from the file name, but you can also
  4098. specify it with a special line in the buffer, like this@footnote{If
  4099. there are several such lines in a file, each specifies the category for
  4100. the text below it. The first category also applies to any text before
  4101. the first CATEGORY line. This method is only kept for backward
  4102. compatibility. The preferred method for setting multiple categories in
  4103. a buffer is using a property.}:
  4104. @example
  4105. #+CATEGORY: Thesis
  4106. @end example
  4107. @noindent
  4108. If you would like to have a special CATEGORY for a single entry or a
  4109. (sub)tree, give the entry a @code{:CATEGORY:} property with the location
  4110. as the value (@pxref{Properties and columns}).
  4111. @noindent
  4112. The display in the agenda buffer looks best if the category is not
  4113. longer than 10 characters.
  4114. @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
  4115. @subsection Time-of-Day Specifications
  4116. @cindex time-of-day specification
  4117. Org-mode checks each agenda item for a time-of-day specification. The
  4118. time can be part of the time stamp that triggered inclusion into the
  4119. agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
  4120. ranges can be specified with two time stamps, like
  4121. @c
  4122. @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
  4123. In the headline of the entry itself, a time(range) may also appear as
  4124. plain text (like @samp{12:45} or a @samp{8:30-1pm}. If the agenda
  4125. integrates the Emacs diary (@pxref{Weekly/Daily agenda}), time
  4126. specifications in diary entries are recognized as well.
  4127. For agenda display, Org-mode extracts the time and displays it in a
  4128. standard 24 hour format as part of the prefix. The example times in
  4129. the previous paragraphs would end up in the agenda like this:
  4130. @example
  4131. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  4132. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  4133. 19:00...... The Vogon reads his poem
  4134. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  4135. @end example
  4136. @cindex time grid
  4137. If the agenda is in single-day mode, or for the display of today, the
  4138. timed entries are embedded in a time grid, like
  4139. @example
  4140. 8:00...... ------------------
  4141. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  4142. 10:00...... ------------------
  4143. 12:00...... ------------------
  4144. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  4145. 14:00...... ------------------
  4146. 16:00...... ------------------
  4147. 18:00...... ------------------
  4148. 19:00...... The Vogon reads his poem
  4149. 20:00...... ------------------
  4150. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  4151. @end example
  4152. The time grid can be turned on and off with the variable
  4153. @code{org-agenda-use-time-grid}, and can be configured with
  4154. @code{org-agenda-time-grid}.
  4155. @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
  4156. @subsection Sorting of agenda items
  4157. @cindex sorting, of agenda items
  4158. @cindex priorities, of agenda items
  4159. Before being inserted into a view, the items are sorted. How this is
  4160. done depends on the type of view.
  4161. @itemize @bullet
  4162. @item
  4163. For the daily/weekly agenda, the items for each day are sorted. The
  4164. default order is to first collect all items containing an explicit
  4165. time-of-day specification. These entries will be shown at the beginning
  4166. of the list, as a @emph{schedule} for the day. After that, items remain
  4167. grouped in categories, in the sequence given by @code{org-agenda-files}.
  4168. Within each category, items are sorted by priority (@pxref{Priorities}),
  4169. which is composed of the base priority (2000 for priority @samp{A}, 1000
  4170. for @samp{B}, and 0 for @samp{C}), plus additional increments for
  4171. overdue scheduled or deadline items.
  4172. @item
  4173. For the TODO list, items remain in the order of categories, but within
  4174. each category, sorting takes place according to priority
  4175. (@pxref{Priorities}).
  4176. @item
  4177. For tags matches, items are not sorted at all, but just appear in the
  4178. sequence in which they are found in the agenda files.
  4179. @end itemize
  4180. Sorting can be customized using the variable
  4181. @code{org-agenda-sorting-strategy}.
  4182. @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda views
  4183. @section Commands in the agenda buffer
  4184. @cindex commands, in agenda buffer
  4185. Entries in the agenda buffer are linked back to the org file or diary
  4186. file where they originate. You are not allowed to edit the agenda
  4187. buffer itself, but commands are provided to show and jump to the
  4188. original entry location, and to edit the org-files ``remotely'' from
  4189. the agenda buffer. In this way, all information is stored only once,
  4190. removing the risk that your agenda and note files may diverge.
  4191. Some commands can be executed with mouse clicks on agenda lines. For
  4192. the other commands, the cursor needs to be in the desired line.
  4193. @table @kbd
  4194. @tsubheading{Motion}
  4195. @cindex motion commands in agenda
  4196. @kindex n
  4197. @item n
  4198. Next line (same as @key{up}).
  4199. @kindex p
  4200. @item p
  4201. Previous line (same as @key{down}).
  4202. @tsubheading{View/GoTo org file}
  4203. @kindex mouse-3
  4204. @kindex @key{SPC}
  4205. @item mouse-3
  4206. @itemx @key{SPC}
  4207. Display the original location of the item in another window.
  4208. @c
  4209. @kindex L
  4210. @item L
  4211. Display original location and recenter that window.
  4212. @c
  4213. @kindex mouse-2
  4214. @kindex mouse-1
  4215. @kindex @key{TAB}
  4216. @item mouse-2
  4217. @itemx mouse-1
  4218. @itemx @key{TAB}
  4219. Go to the original location of the item in another window. Under Emacs
  4220. 22, @kbd{mouse-1} will also works for this.
  4221. @c
  4222. @kindex @key{RET}
  4223. @itemx @key{RET}
  4224. Go to the original location of the item and delete other windows.
  4225. @c
  4226. @kindex f
  4227. @item f
  4228. Toggle Follow mode. In Follow mode, as you move the cursor through
  4229. the agenda buffer, the other window always shows the corresponding
  4230. location in the org file. The initial setting for this mode in new
  4231. agenda buffers can be set with the variable
  4232. @code{org-agenda-start-with-follow-mode}.
  4233. @c
  4234. @kindex b
  4235. @item b
  4236. Display the entire subtree of the current item in an indirect buffer.
  4237. With numerical prefix ARG, go up to this level and then take that tree.
  4238. If ARG is negative, go up that many levels. With @kbd{C-u} prefix, do
  4239. not remove the previously used indirect buffer.
  4240. @c
  4241. @kindex l
  4242. @item l
  4243. Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
  4244. logging was on (variable @code{org-log-done}) are shown in the agenda,
  4245. as are entries that have been clocked on that day.
  4246. @tsubheading{Change display}
  4247. @cindex display changing, in agenda
  4248. @kindex o
  4249. @item o
  4250. Delete other windows.
  4251. @c
  4252. @kindex d
  4253. @kindex w
  4254. @kindex m
  4255. @kindex y
  4256. @item d w m y
  4257. Switch to day/week/month/year view. When switching to day or week view,
  4258. this setting becomes the default for subseqent agenda commands. Since
  4259. month and year views are slow to create, the do not become the default.
  4260. @c
  4261. @kindex D
  4262. @item D
  4263. Toggle the inclusion of diary entries. See @ref{Weekly/Daily agenda}.
  4264. @c
  4265. @kindex g
  4266. @item g
  4267. Toggle the time grid on and off. See also the variables
  4268. @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
  4269. @c
  4270. @kindex r
  4271. @item r
  4272. Recreate the agenda buffer, for example to reflect the changes
  4273. after modification of the time stamps of items with S-@key{left} and
  4274. S-@key{right}. When the buffer is the global todo list, a prefix
  4275. argument is interpreted to create a selective list for a specific TODO
  4276. keyword.
  4277. @c
  4278. @kindex s
  4279. @item s
  4280. Save all Org-mode buffers in the current Emacs session.
  4281. @c
  4282. @kindex @key{right}
  4283. @item @key{right}
  4284. Display the following @code{org-agenda-ndays} days. For example, if
  4285. the display covers a week, switch to the following week. With prefix
  4286. arg, go forward that many times @code{org-agenda-ndays} days.
  4287. @c
  4288. @kindex @key{left}
  4289. @item @key{left}
  4290. Display the previous dates.
  4291. @c
  4292. @kindex .
  4293. @item .
  4294. Goto today.
  4295. @tsubheading{Remote editing}
  4296. @cindex remote editing, from agenda
  4297. @item 0-9
  4298. Digit argument.
  4299. @c
  4300. @cindex undoing remote-editing events
  4301. @cindex remote editing, undo
  4302. @kindex C-_
  4303. @item C-_
  4304. Undo a change due to a remote editing command. The change is undone
  4305. both in the agenda buffer and in the remote buffer.
  4306. @c
  4307. @kindex t
  4308. @item t
  4309. Change the TODO state of the item, both in the agenda and in the
  4310. original org file.
  4311. @c
  4312. @kindex C-k
  4313. @item C-k
  4314. Delete the current agenda item along with the entire subtree belonging
  4315. to it in the original Org-mode file. If the text to be deleted remotely
  4316. is longer than one line, the kill needs to be confirmed by the user. See
  4317. variable @code{org-agenda-confirm-kill}.
  4318. @c
  4319. @kindex $
  4320. @item $
  4321. Archive the subtree corresponding to the current headline.
  4322. @c
  4323. @kindex T
  4324. @item T
  4325. Show all tags associated with the current item. Because of
  4326. inheritance, this may be more than the tags listed in the line itself.
  4327. @c
  4328. @kindex :
  4329. @item :
  4330. Set tags for the current headline. If there is an active region in the
  4331. agenda, change a tag for all headings in the region.
  4332. @c
  4333. @kindex a
  4334. @item a
  4335. Toggle the ARCHIVE tag for the current headline.
  4336. @c
  4337. @kindex ,
  4338. @item ,
  4339. Set the priority for the current item. Org-mode prompts for the
  4340. priority character. If you reply with @key{SPC}, the priority cookie
  4341. is removed from the entry.
  4342. @c
  4343. @kindex P
  4344. @item P
  4345. Display weighted priority of current item.
  4346. @c
  4347. @kindex +
  4348. @kindex S-@key{up}
  4349. @item +
  4350. @itemx S-@key{up}
  4351. Increase the priority of the current item. The priority is changed in
  4352. the original buffer, but the agenda is not resorted. Use the @kbd{r}
  4353. key for this.
  4354. @c
  4355. @kindex -
  4356. @kindex S-@key{down}
  4357. @item -
  4358. @itemx S-@key{down}
  4359. Decrease the priority of the current item.
  4360. @c
  4361. @kindex C-c C-s
  4362. @item C-c C-s
  4363. Schedule this item
  4364. @c
  4365. @kindex C-c C-d
  4366. @item C-c C-d
  4367. Set a deadline for this item.
  4368. @c
  4369. @kindex S-@key{right}
  4370. @item S-@key{right}
  4371. Change the time stamp associated with the current line by one day into
  4372. the future. With prefix argument, change it by that many days. For
  4373. example, @kbd{3 6 5 S-@key{right}} will change it by a year. The
  4374. stamp is changed in the original org file, but the change is not
  4375. directly reflected in the agenda buffer. Use the
  4376. @kbd{r} key to update the buffer.
  4377. @c
  4378. @kindex S-@key{left}
  4379. @item S-@key{left}
  4380. Change the time stamp associated with the current line by one day
  4381. into the past.
  4382. @c
  4383. @kindex >
  4384. @item >
  4385. Change the time stamp associated with the current line to today.
  4386. The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
  4387. on my keyboard.
  4388. @c
  4389. @kindex I
  4390. @item I
  4391. Start the clock on the current item. If a clock is running already, it
  4392. is stopped first.
  4393. @c
  4394. @kindex O
  4395. @item O
  4396. Stop the previously started clock.
  4397. @c
  4398. @kindex X
  4399. @item X
  4400. Cancel the currently running clock.
  4401. @tsubheading{Calendar commands}
  4402. @cindex calendar commands, from agenda
  4403. @kindex c
  4404. @item c
  4405. Open the Emacs calendar and move to the date at the agenda cursor.
  4406. @c
  4407. @item c
  4408. When in the calendar, compute and show the Org-mode agenda for the
  4409. date at the cursor.
  4410. @c
  4411. @cindex diary entries, creating from agenda
  4412. @kindex i
  4413. @item i
  4414. Insert a new entry into the diary. Prompts for the type of entry
  4415. (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
  4416. entry in the diary, just as @kbd{i d} etc. would do in the calendar.
  4417. The date is taken from the cursor position.
  4418. @c
  4419. @kindex M
  4420. @item M
  4421. Show the phases of the moon for the three months around current date.
  4422. @c
  4423. @kindex S
  4424. @item S
  4425. Show sunrise and sunset times. The geographical location must be set
  4426. with calendar variables, see documentation of the Emacs calendar.
  4427. @c
  4428. @kindex C
  4429. @item C
  4430. Convert the date at cursor into many other cultural and historic
  4431. calendars.
  4432. @c
  4433. @kindex H
  4434. @item H
  4435. Show holidays for three month around the cursor date.
  4436. @c
  4437. @c FIXME: This should be a different key.
  4438. @kindex C-c C-x C-c
  4439. @item C-c C-x C-c
  4440. Export a single iCalendar file containing entries from all agenda files.
  4441. @tsubheading{Exporting to a file}
  4442. @kindex C-x C-w
  4443. @item C-x C-w
  4444. @cindex exporting agenda views
  4445. @cindex agenda views, exporting
  4446. Write the agenda view to a file. Depending on the extension of the
  4447. selected file name, the view will be exported as HTML (extension
  4448. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
  4449. plain text (any other extension). Use the variable
  4450. @code{org-agenda-exporter-settings} to set options for @file{ps-print}
  4451. and for @file{htmlize} to be used during export.
  4452. @tsubheading{Quit and Exit}
  4453. @kindex q
  4454. @item q
  4455. Quit agenda, remove the agenda buffer.
  4456. @c
  4457. @kindex x
  4458. @cindex agenda files, removing buffers
  4459. @item x
  4460. Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
  4461. for the compilation of the agenda. Buffers created by the user to
  4462. visit org files will not be removed.
  4463. @end table
  4464. @node Custom agenda views, , Agenda commands, Agenda views
  4465. @section Custom agenda views
  4466. @cindex custom agenda views
  4467. @cindex agenda views, custom
  4468. Custom agenda commands serve two purposes: to store and quickly access
  4469. frequently used TODO and tags searches, and to create special composite
  4470. agenda buffers. Custom agenda commands will be accessible through the
  4471. dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
  4472. @menu
  4473. * Storing searches:: Type once, use often
  4474. * Block agenda:: All the stuff you need in a single buffer
  4475. * Setting Options:: Changing the rules
  4476. * Exporting Agenda Views:: Writing agendas to files.
  4477. * Extracting Agenda Information for other programs::
  4478. @end menu
  4479. @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
  4480. @subsection Storing searches
  4481. The first application of custom searches is the definition of keyboard
  4482. shortcuts for frequently used searches, either creating an agenda
  4483. buffer, or a sparse tree (the latter covering of course only the current
  4484. buffer).
  4485. @kindex C-c a C
  4486. Custom commands are configured in the variable
  4487. @code{org-agenda-custom-commands}. You can customize this variable, for
  4488. example by pressing @kbd{C-c a C}. You can also directly set it with
  4489. Emacs Lisp in @file{.emacs}. The following example contains all valid
  4490. search types:
  4491. @lisp
  4492. @group
  4493. (setq org-agenda-custom-commands
  4494. '(("w" todo "WAITING")
  4495. ("W" todo-tree "WAITING")
  4496. ("u" tags "+BOSS-URGENT")
  4497. ("v" tags-todo "+BOSS-URGENT")
  4498. ("U" tags-tree "+BOSS-URGENT")
  4499. ("f" occur-tree "\\<FIXME\\>")))
  4500. @end group
  4501. @end lisp
  4502. @noindent
  4503. The initial single-character string in each entry defines the character
  4504. you have to press after the dispatcher command @kbd{C-c a} in order to
  4505. access the command. The second parameter is the search type, followed
  4506. by the string or regular expression to be used for the matching. The
  4507. example above will therefore define:
  4508. @table @kbd
  4509. @item C-c a w
  4510. as a global search for TODO entries with @samp{WAITING} as the TODO
  4511. keyword
  4512. @item C-c a W
  4513. as the same search, but only in the current buffer and displaying the
  4514. results as a sparse tree
  4515. @item C-c a u
  4516. as a global tags search for headlines marked @samp{:BOSS:} but not
  4517. @samp{:URGENT:}
  4518. @item C-c a v
  4519. as the same search as @kbd{C-c a u}, but limiting the search to
  4520. headlines that are also TODO items
  4521. @item C-c a U
  4522. as the same search as @kbd{C-c a u}, but only in the current buffer and
  4523. displaying the result as a sparse tree
  4524. @item C-c a f
  4525. to create a sparse tree (again: current buffer only) with all entries
  4526. containing the word @samp{FIXME}.
  4527. @end table
  4528. @node Block agenda, Setting Options, Storing searches, Custom agenda views
  4529. @subsection Block agenda
  4530. @cindex block agenda
  4531. @cindex agenda, with block views
  4532. Another possibility is the construction of agenda views that comprise
  4533. the results of @emph{several} commands, each of which creates a block in
  4534. the agenda buffer. The available commands include @code{agenda} for the
  4535. daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
  4536. for the global todo list (as constructed with @kbd{C-c a t}), and the
  4537. matching commands discussed above: @code{todo}, @code{tags}, and
  4538. @code{tags-todo}. Here are two examples:
  4539. @lisp
  4540. @group
  4541. (setq org-agenda-custom-commands
  4542. '(("h" "Agenda and Home-related tasks"
  4543. ((agenda)
  4544. (tags-todo "HOME")
  4545. (tags "GARDEN")))
  4546. ("o" "Agenda and Office-related tasks"
  4547. ((agenda)
  4548. (tags-todo "WORK")
  4549. (tags "OFFICE")))))
  4550. @end group
  4551. @end lisp
  4552. @noindent
  4553. This will define @kbd{C-c a h} to create a multi-block view for stuff
  4554. you need to attend to at home. The resulting agenda buffer will contain
  4555. your agenda for the current week, all TODO items that carry the tag
  4556. @samp{HOME}, and also all lines tagged with @samp{GARDEN}. Finally the
  4557. command @kbd{C-c a o} provides a similar view for office tasks.
  4558. @node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
  4559. @subsection Setting Options for custom commands
  4560. @cindex options, for custom agenda views
  4561. Org-mode contains a number of variables regulating agenda construction
  4562. and display. The global variables define the behavior for all agenda
  4563. commands, including the custom commands. However, if you want to change
  4564. some settings just for a single custom view, you can do so. Setting
  4565. options requires inserting a list of variable names and values at the
  4566. right spot in @code{org-agenda-custom-commands}. For example:
  4567. @lisp
  4568. @group
  4569. (setq org-agenda-custom-commands
  4570. '(("w" todo "WAITING"
  4571. ((org-agenda-sorting-strategy '(priority-down))
  4572. (org-agenda-prefix-format " Mixed: ")))
  4573. ("U" tags-tree "+BOSS-URGENT"
  4574. ((org-show-following-heading nil)
  4575. (org-show-hierarchy-above nil)))))
  4576. @end group
  4577. @end lisp
  4578. @noindent
  4579. Now the @kbd{C-c a w} command will sort the collected entries only by
  4580. priority, and the prefix format is modified to just say @samp{ Mixed:}
  4581. instead of giving the category of the entry. The sparse tags tree of
  4582. @kbd{C-c a U} will now turn out ultra-compact, because neither the
  4583. headline hierarchy above the match, nor the headline following the match
  4584. will be shown.
  4585. For command sets creating a block agenda,
  4586. @code{org-agenda-custom-commands} has two separate spots for setting
  4587. options. You can add options that should be valid for just a single
  4588. command in the set, and options that should be valid for all commands in
  4589. the set. The former are just added to the command entry, the latter
  4590. must come after the list of command entries. Going back to the block
  4591. agenda example (@pxref{Block agenda}), let's change the sorting strategy
  4592. for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
  4593. the results for GARDEN tags query in the opposite order,
  4594. @code{priority-up}. This would look like this:
  4595. @lisp
  4596. @group
  4597. (setq org-agenda-custom-commands
  4598. '(("h" "Agenda and Home-related tasks"
  4599. ((agenda)
  4600. (tags-todo "HOME")
  4601. (tags "GARDEN"
  4602. ((org-agenda-sorting-strategy '(priority-up)))))
  4603. ((org-agenda-sorting-strategy '(priority-down))))
  4604. ("o" "Agenda and Office-related tasks"
  4605. ((agenda)
  4606. (tags-todo "WORK")
  4607. (tags "OFFICE")))))
  4608. @end group
  4609. @end lisp
  4610. As you see, the values and parenthesis setting is a little complex.
  4611. When in doubt, use the customize interface to set this variable - it
  4612. fully supports its structure. Just one caveat: When setting options in
  4613. this interface, the @emph{values} are just lisp expressions. So if the
  4614. value is a string, you need to add the double quotes around the value
  4615. yourself.
  4616. @node Exporting Agenda Views, Extracting Agenda Information for other programs, Setting Options, Custom agenda views
  4617. @subsection Exporting Agenda Views
  4618. @cindex agenda views, exporting
  4619. If you are away from your computer, it can be very useful to have a
  4620. printed version of some agenda views to carry around. Org-mode can
  4621. export custom agenda views as plain text, HTML@footnote{You need to
  4622. install Hrvoje Niksic' @file{htmlize.el}.} and postscript. If you want
  4623. to do this only occasionally, use the command
  4624. @table @kbd
  4625. @kindex C-x C-w
  4626. @item C-x C-w
  4627. @cindex exporting agenda views
  4628. @cindex agenda views, exporting
  4629. Write the agenda view to a file. Depending on the extension of the
  4630. selected file name, the view will be exported as HTML (extension
  4631. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
  4632. plain text (any other extension). Use the variable
  4633. @code{org-agenda-exporter-settings} to set options for @file{ps-print}
  4634. and for @file{htmlize} to be used during export, for example
  4635. @lisp
  4636. (setq org-agenda-exporter-settings
  4637. '((ps-number-of-columns 2)
  4638. (ps-landscape-mode t)
  4639. (htmlize-output-type 'css)))
  4640. @end lisp
  4641. @end table
  4642. If you need to export certain agenda views frequently, you can associate
  4643. any custom agenda command with a list of output file names
  4644. @footnote{If you want to store standard views like the weekly agenda
  4645. or the global TODO list as well, you need to define custom commands for
  4646. them in order to be able to specify filenames.}. Here is an example
  4647. that first does define custom commands for the agenda and the global
  4648. todo list, together with a number of files to which to export them.
  4649. Then we define two block agenda commands and specify filenames for them
  4650. as well. File names can be relative to the current working directory,
  4651. or absolute.
  4652. @lisp
  4653. @group
  4654. (setq org-agenda-custom-commands
  4655. '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
  4656. ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
  4657. ("h" "Agenda and Home-related tasks"
  4658. ((agenda)
  4659. (tags-todo "HOME")
  4660. (tags "GARDEN"))
  4661. nil
  4662. ("~/views/home.html"))
  4663. ("o" "Agenda and Office-related tasks"
  4664. ((agenda)
  4665. (tags-todo "WORK")
  4666. (tags "OFFICE"))
  4667. nil
  4668. ("~/views/office.ps"))))
  4669. @end group
  4670. @end lisp
  4671. The extension of the file name determines the type of export. If it is
  4672. @file{.html}, Org-mode will use the @file{htmlize.el} package to convert
  4673. the buffer to HTML and save it to this file name. If the extension is
  4674. @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
  4675. postscript output. Any other extension produces a plain ASCII file.
  4676. The export files are @emph{not} created when you use one of those
  4677. commands interactively. Instead, there is a special command to produce
  4678. @emph{all} specified files in one step:
  4679. @table @kbd
  4680. @kindex C-c a e
  4681. @item C-c a e
  4682. Export all agenda views that have export filenames associated with
  4683. them.
  4684. @end table
  4685. You can use the options section of the custom agenda commands to also
  4686. set options for the export commands. For example:
  4687. @lisp
  4688. (setq org-agenda-custom-commands
  4689. '(("X" agenda ""
  4690. ((ps-number-of-columns 2)
  4691. (ps-landscape-mode t)
  4692. (org-agenda-prefix-format " [ ] ")
  4693. (org-agenda-with-colors nil)
  4694. (org-agenda-remove-tags t))
  4695. ("theagenda.ps"))))
  4696. @end lisp
  4697. @noindent
  4698. This command sets two options for the postscript exporter, to make it
  4699. print in two columns in landscape format - the resulting page can be cut
  4700. in two and then used in a paper agenda. The remaining settings modify
  4701. the agenda prefix to omit category and scheduling information, and
  4702. instead include a checkbox to check off items. We also remove the tags
  4703. to make the lines compact, and we don't want to use colors for the
  4704. black-and-white printer. Settings specified in
  4705. @code{org-agenda-exporter-settings} will also apply, but the settings
  4706. in @code{org-agenda-custom-commands} take precedence.
  4707. @noindent
  4708. From the command line you may also use
  4709. @example
  4710. emacs -f org-batch-store-agenda-views -kill
  4711. @end example
  4712. @noindent
  4713. or, if you need to modify some parameters
  4714. @example
  4715. emacs -eval '(org-batch-store-agenda-views \
  4716. org-agenda-ndays 30 \
  4717. org-agenda-include-diary nil \
  4718. org-agenda-files (quote ("~/org/project.org")))' \
  4719. -kill
  4720. @end example
  4721. @noindent
  4722. which will create the agenda views restricted to the file
  4723. @file{~/org/project.org}, without diary entries and with 30 days
  4724. extent.
  4725. @node Extracting Agenda Information for other programs, , Exporting Agenda Views, Custom agenda views
  4726. @subsection Extracting Agenda Information for other programs
  4727. @cindex agenda, pipe
  4728. @cindex Scripts, for agenda processing
  4729. Org-mode provides commands to access agenda information for the command
  4730. line in emacs batch mode. This extracted information can be sent
  4731. directly to a printer, or it can be read by a program that does further
  4732. processing of the data. The first of these commands is the function
  4733. @code{org-batch-agenda}, that produces an agenda view and sends it as
  4734. ASCII text to STDOUT. The command takes a single string as parameter.
  4735. If the string has length 1, it is used as a key to one of the commands
  4736. you have configured in @code{org-agenda-custom-commands}, basically any
  4737. key you can use after @kbd{C-c a}. For example, to directly print the
  4738. current TODO list, you could use
  4739. @example
  4740. emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
  4741. @end example
  4742. If the parameter is a string with 2 or more characters, it is used as a
  4743. tags/todo match string. For example, to print your local shopping list
  4744. (all items with the tag @samp{shop}, but excluding the tag
  4745. @samp{NewYork}), you could use
  4746. @example
  4747. emacs -batch -l ~/.emacs \
  4748. -eval '(org-batch-agenda "+shop-NewYork")' | lpr
  4749. @end example
  4750. @noindent
  4751. You may also modify parameters on the fly like this:
  4752. @example
  4753. emacs -batch -l ~/.emacs \
  4754. -eval '(org-batch-agenda "a" \
  4755. org-agenda-ndays 30 \
  4756. org-agenda-include-diary nil \
  4757. org-agenda-files (quote ("~/org/project.org")))' \
  4758. | lpr
  4759. @end example
  4760. @noindent
  4761. which will produce a 30 day agenda, fully restricted to the Org file
  4762. @file{~/org/projects.org}, not even including the diary.
  4763. If you want to process the agenda data in more sophisticated ways, you
  4764. can use the command @code{org-batch-agenda-csv} to get a comma-separated
  4765. list of values for each agenda item. Each line in the output will
  4766. contain a number of fields separated by commas. The fields in a line
  4767. are:
  4768. @example
  4769. category @r{The category of the item}
  4770. head @r{The headline, without TODO kwd, TAGS and PRIORITY}
  4771. type @r{The type of the agenda entry, can be}
  4772. todo @r{selected in TODO match}
  4773. tagsmatch @r{selected in tags match}
  4774. diary @r{imported from diary}
  4775. deadline @r{a deadline}
  4776. scheduled @r{scheduled}
  4777. timestamp @r{appointment, selected by timestamp}
  4778. closed @r{entry was closed on date}
  4779. upcoming-deadline @r{warning about nearing deadline}
  4780. past-scheduled @r{forwarded scheduled item}
  4781. block @r{entry has date block including date}
  4782. todo @r{The todo keyword, if any}
  4783. tags @r{All tags including inherited ones, separated by colons}
  4784. date @r{The relevant date, like 2007-2-14}
  4785. time @r{The time, like 15:00-16:50}
  4786. extra @r{String with extra planning info}
  4787. priority-l @r{The priority letter if any was given}
  4788. priority-n @r{The computed numerical priority}
  4789. @end example
  4790. @noindent
  4791. Time and date will only be given if a timestamp (or deadline/scheduled)
  4792. lead to the selection of the item.
  4793. A CSV list like this is very easy to use in a post processing script.
  4794. For example, here is a Perl program that gets the TODO list from
  4795. Emacs/org-mode and prints all the items, preceded by a checkbox:
  4796. @example
  4797. @group
  4798. #!/usr/bin/perl
  4799. # define the Emacs command to run
  4800. $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
  4801. # run it and capture the output
  4802. $agenda = qx@{$cmd 2>/dev/null@};
  4803. # loop over all lines
  4804. foreach $line (split(/\n/,$agenda)) @{
  4805. # get the individual values
  4806. ($category,$head,$type,$todo,$tags,$date,$time,$extra,
  4807. $priority_l,$priority_n) = split(/,/,$line);
  4808. # proccess and print
  4809. print "[ ] $head\n";
  4810. @}
  4811. @end group
  4812. @end example
  4813. @node Embedded LaTeX, Exporting, Agenda views, Top
  4814. @chapter Embedded LaTeX
  4815. @cindex @TeX{} interpretation
  4816. @cindex La@TeX{} interpretation
  4817. Plain ASCII is normally sufficient for almost all note taking. One
  4818. exception, however, are scientific notes which need to be able to
  4819. contain mathematical symbols and the occasional formula.
  4820. La@TeX{}@footnote{La@TeX{} is a macro system based on Donald E. Knuth's
  4821. @TeX{} system. Many of the features described here as ``La@TeX{}'' are
  4822. really from @TeX{}, but for simplicity I am blurring this distinction.}
  4823. is widely used to typeset scientific documents. Org-mode supports
  4824. embedding La@TeX{} code into its files, because many academics are used
  4825. to read La@TeX{} source code, and because it can be readily processed
  4826. into images for HTML production.
  4827. It is not necessary to mark La@TeX{} macros and code in any special way.
  4828. If you observe a few conventions, Org-mode knows how to find it and what
  4829. to do with it.
  4830. @menu
  4831. * Math symbols:: TeX macros for symbols and Greek letters
  4832. * Subscripts and Superscripts:: Simple syntax for raising/lowering text
  4833. * LaTeX fragments:: Complex formulas made easy
  4834. * Processing LaTeX fragments:: Previewing LaTeX processing
  4835. * CDLaTeX mode:: Speed up entering of formulas
  4836. @end menu
  4837. @node Math symbols, Subscripts and Superscripts, Embedded LaTeX, Embedded LaTeX
  4838. @section Math symbols
  4839. @cindex math symbols
  4840. @cindex TeX macros
  4841. You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
  4842. to indicate the Greek letter, or @samp{\to} to indicate an arrow.
  4843. Completion for these macros is available, just type @samp{\} and maybe a
  4844. few letters, and press @kbd{M-@key{TAB}} to see possible completions.
  4845. Unlike La@TeX{} code, Org-mode allows these macros to be present
  4846. without surrounding math delimiters, for example:
  4847. @example
  4848. Angles are written as Greek letters \alpha, \beta and \gamma.
  4849. @end example
  4850. During HTML export (@pxref{HTML export}), these symbols are translated
  4851. into the proper syntax for HTML, for the above examples this is
  4852. @samp{&alpha;} and @samp{&rarr;}, respectively.
  4853. @node Subscripts and Superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
  4854. @section Subscripts and Superscripts
  4855. @cindex subscript
  4856. @cindex superscript
  4857. Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
  4858. and subscripts. Again, these can be used without embedding them in
  4859. math-mode delimiters. To increase the readability of ASCII text, it is
  4860. not necessary (but OK) to surround multi-character sub- and superscripts
  4861. with curly braces. For example
  4862. @example
  4863. The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
  4864. the sun is R_@{sun@} = 6.96 x 10^8 m.
  4865. @end example
  4866. To avoid interpretation as raised or lowered text, you can quote
  4867. @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
  4868. During HTML export (@pxref{HTML export}), subscript and superscripts
  4869. are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
  4870. @node LaTeX fragments, Processing LaTeX fragments, Subscripts and Superscripts, Embedded LaTeX
  4871. @section LaTeX fragments
  4872. @cindex LaTeX fragments
  4873. With symbols, sub- and superscripts, HTML is pretty much at its end when
  4874. it comes to representing mathematical formulas@footnote{Yes, there is
  4875. MathML, but that is not yet fully supported by many browsers, and there
  4876. is no decent converter for turning La@TeX{} or ASCII representations of
  4877. formulas into MathML. So for the time being, converting formulas into
  4878. images seems the way to go.}. More complex expressions need a dedicated
  4879. formula processor. To this end, Org-mode can contain arbitrary La@TeX{}
  4880. fragments. It provides commands to preview the typeset result of these
  4881. fragments, and upon export to HTML, all fragments will be converted to
  4882. images and inlined into the HTML document@footnote{The La@TeX{} export
  4883. will not use images for displaying La@TeX{} fragments but include these
  4884. fragments directly into the La@TeX{} code.}. For this to work you
  4885. need to be on a system with a working La@TeX{} installation. You also
  4886. need the @file{dvipng} program, available at
  4887. @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
  4888. will be used when processing a fragment can be configured with the
  4889. variable @code{org-format-latex-header}.
  4890. La@TeX{} fragments don't need any special marking at all. The following
  4891. snippets will be identified as La@TeX{} source code:
  4892. @itemize @bullet
  4893. @item
  4894. Environments of any kind. The only requirement is that the
  4895. @code{\begin} statement appears on a new line, preceded by only
  4896. whitespace.
  4897. @item
  4898. Text within the usual La@TeX{} math delimiters. To avoid conflicts with
  4899. currency specifications, single @samp{$} characters are only recognized
  4900. as math delimiters if the enclosed text contains at most two line breaks,
  4901. is directly attached to the @samp{$} characters with no whitespace in
  4902. between, and if the closing @samp{$} is followed by whitespace or
  4903. punctuation. For the other delimiters, there is no such restriction, so
  4904. when in doubt, use @samp{\(...\)} as inline math delimiters.
  4905. @end itemize
  4906. @noindent For example:
  4907. @example
  4908. \begin@{equation@} % arbitrary environments,
  4909. x=\sqrt@{b@} % even tables, figures
  4910. \end@{equation@} % etc
  4911. If $a^2=b$ and \( b=2 \), then the solution must be
  4912. either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
  4913. @end example
  4914. @noindent
  4915. If you need any of the delimiter ASCII sequences for other purposes, you
  4916. can configure the option @code{org-format-latex-options} to deselect the
  4917. ones you do not wish to have interpreted by the La@TeX{} converter.
  4918. @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
  4919. @section Processing LaTeX fragments
  4920. @cindex LaTeX fragments, preview
  4921. La@TeX{} fragments can be processed to produce a preview images of the
  4922. typeset expressions:
  4923. @table @kbd
  4924. @kindex C-c C-x C-l
  4925. @item C-c C-x C-l
  4926. Produce a preview image of the La@TeX{} fragment at point and overlay it
  4927. over the source code. If there is no fragment at point, process all
  4928. fragments in the current entry (between two headlines). When called
  4929. with a prefix argument, process the entire subtree. When called with
  4930. two prefix arguments, or when the cursor is before the first headline,
  4931. process the entire buffer.
  4932. @kindex C-c C-c
  4933. @item C-c C-c
  4934. Remove the overlay preview images.
  4935. @end table
  4936. During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
  4937. converted into images and inlined into the document if the following
  4938. setting is active:
  4939. @lisp
  4940. (setq org-export-with-LaTeX-fragments t)
  4941. @end lisp
  4942. @node CDLaTeX mode, , Processing LaTeX fragments, Embedded LaTeX
  4943. @section Using CDLaTeX to enter math
  4944. @cindex CDLaTeX
  4945. CDLaTeX-mode is a minor mode that is normally used in combination with a
  4946. major La@TeX{} mode like AUCTeX in order to speed-up insertion of
  4947. environments and math templates. Inside Org-mode, you can make use of
  4948. some of the features of cdlatex-mode. You need to install
  4949. @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
  4950. AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
  4951. Don't turn cdlatex-mode itself under Org-mode, but use the light
  4952. version @code{org-cdlatex-mode} that comes as part of Org-mode. Turn it
  4953. on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
  4954. Org-mode files with
  4955. @lisp
  4956. (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
  4957. @end lisp
  4958. When this mode is enabled, the following features are present (for more
  4959. details see the documentation of cdlatex-mode):
  4960. @itemize @bullet
  4961. @kindex C-c @{
  4962. @item
  4963. Environment templates can be inserted with @kbd{C-c @{}.
  4964. @item
  4965. @kindex @key{TAB}
  4966. The @key{TAB} key will do template expansion if the cursor is inside a
  4967. La@TeX{} fragment@footnote{Org-mode has a method to test if the cursor is
  4968. inside such a fragment, see the documentation of the function
  4969. @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
  4970. expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
  4971. correctly inside the first brace. Another @key{TAB} will get you into
  4972. the second brace. Even outside fragments, @key{TAB} will expand
  4973. environment abbreviations at the beginning of a line. For example, if
  4974. you write @samp{equ} at the beginning of a line and press @key{TAB},
  4975. this abbreviation will be expanded to an @code{equation} environment.
  4976. To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
  4977. @item
  4978. @kindex _
  4979. @kindex ^
  4980. Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
  4981. characters together with a pair of braces. If you use @key{TAB} to move
  4982. out of the braces, and if the braces surround only a single character or
  4983. macro, they are removed again (depending on the variable
  4984. @code{cdlatex-simplify-sub-super-scripts}).
  4985. @item
  4986. @kindex `
  4987. Pressing the backquote @kbd{`} followed by a character inserts math
  4988. macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
  4989. after the backquote, a help window will pop up.
  4990. @item
  4991. @kindex '
  4992. Pressing the normal quote @kbd{'} followed by another character modifies
  4993. the symbol before point with an accent or a font. If you wait more than
  4994. 1.5 seconds after the backquote, a help window will pop up. Character
  4995. modification will work only inside La@TeX{} fragments, outside the quote
  4996. is normal.
  4997. @end itemize
  4998. @node Exporting, Publishing, Embedded LaTeX, Top
  4999. @chapter Exporting
  5000. @cindex exporting
  5001. Org-mode documents can be exported into a variety of other formats. For
  5002. printing and sharing of notes, ASCII export produces a readable and
  5003. simple version of an Org-mode file. HTML export allows you to publish a
  5004. notes file on the web, while the XOXO format provides a solid base for
  5005. exchange with a broad range of other applications. La@TeX{} export lets
  5006. you use Org-mode and its structured editing functions to easily create
  5007. La@TeX{} files. To incorporate entries with associated times like
  5008. deadlines or appointments into a desktop calendar program like iCal,
  5009. Org-mode can also produce extracts in the iCalendar format. Currently
  5010. Org-mode only supports export, not import of these different formats.
  5011. When exporting, Org-mode uses special conventions to enrich the output
  5012. produced. @xref{Text interpretation}, for more details.
  5013. @table @kbd
  5014. @kindex C-c C-e
  5015. @item C-c C-e
  5016. Dispatcher for export and publishing commands. Displays a help-window
  5017. listing the additional key(s) needed to launch an export or publishing
  5018. command.
  5019. @end table
  5020. @menu
  5021. * ASCII export:: Exporting to plain ASCII
  5022. * HTML export:: Exporting to HTML
  5023. * LaTeX export:: Exporting to LaTeX
  5024. * XOXO export:: Exporting to XOXO
  5025. * iCalendar export:: Exporting in iCalendar format
  5026. * Text interpretation:: How the exporter looks at the file
  5027. @end menu
  5028. @node ASCII export, HTML export, Exporting, Exporting
  5029. @section ASCII export
  5030. @cindex ASCII export
  5031. ASCII export produces a simple and very readable version of an Org-mode
  5032. file.
  5033. @cindex region, active
  5034. @cindex active region
  5035. @cindex transient-mark-mode
  5036. @table @kbd
  5037. @kindex C-c C-e a
  5038. @item C-c C-e a
  5039. Export as ASCII file. For an org file @file{myfile.org}, the ASCII file
  5040. will be @file{myfile.txt}. The file will be overwritten without
  5041. warning. If there is an active region, only the region will be
  5042. exported. If the selected region is a single tree, the tree head will
  5043. become the document title. If the tree head entry has or inherits an
  5044. EXPORT_FILE_NAME property, that name will be used for the export.
  5045. @kindex C-c C-e v a
  5046. @item C-c C-e v a
  5047. Export only the visible part of the document.
  5048. @end table
  5049. @cindex headline levels, for exporting
  5050. In the exported version, the first 3 outline levels will become
  5051. headlines, defining a general document structure. Additional levels
  5052. will be exported as itemized lists. If you want that transition to occur
  5053. at a different level, specify it with a prefix argument. For example,
  5054. @example
  5055. @kbd{C-1 C-c C-e a}
  5056. @end example
  5057. @noindent
  5058. creates only top level headlines and does the rest as items. When
  5059. headlines are converted to items, the indentation of the text following
  5060. the headline is changed to fit nicely under the item. This is done with
  5061. the assumption that the first bodyline indicates the base indentation of
  5062. the body text. Any indentation larger than this is adjusted to preserve
  5063. the layout relative to the first line. Should there be lines with less
  5064. indentation than the first, these are left alone.
  5065. @node HTML export, LaTeX export, ASCII export, Exporting
  5066. @section HTML export
  5067. @cindex HTML export
  5068. Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
  5069. HTML formatting, in ways similar to John Grubers @emph{markdown}
  5070. language, but with additional support for tables.
  5071. @menu
  5072. * HTML Export commands:: How to invoke LaTeX export
  5073. * Quoting HTML tags:: Using direct HTML in Org-mode
  5074. * Links:: Transformation of links for HTML
  5075. * Images:: How to include images
  5076. * CSS support:: Changing the appearence of the output
  5077. @end menu
  5078. @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
  5079. @subsection HTML export commands
  5080. @cindex region, active
  5081. @cindex active region
  5082. @cindex transient-mark-mode
  5083. @table @kbd
  5084. @kindex C-c C-e h
  5085. @item C-c C-e h
  5086. Export as HTML file @file{myfile.html}. For an org file
  5087. @file{myfile.org}, the ASCII file will be @file{myfile.html}. The file
  5088. will be overwritten without warning. If there is an active region, only
  5089. the region will be exported. If the selected region is a single tree,
  5090. the tree head will become the document title. If the tree head entry
  5091. has or inherits an EXPORT_FILE_NAME property, that name will be used for
  5092. the export.
  5093. @kindex C-c C-e b
  5094. @item C-c C-e b
  5095. Export as HTML file and immediately open it with a browser.
  5096. @kindex C-c C-e H
  5097. @item C-c C-e H
  5098. Export to a temporary buffer, do not create a file.
  5099. @kindex C-c C-e R
  5100. @item C-c C-e H
  5101. Export the active region to a temporary buffer. With prefix arg, do not
  5102. produce file header and foot, but just the plain HTML section for the
  5103. region. This is good for cut-and-paste operations.
  5104. @kindex C-c C-e v h
  5105. @kindex C-c C-e v b
  5106. @kindex C-c C-e v H
  5107. @kindex C-c C-e v R
  5108. @item C-c C-e v h
  5109. @item C-c C-e v b
  5110. @item C-c C-e v H
  5111. @item C-c C-e v R
  5112. Export only the visible part of the document.
  5113. @item M-x org-export-region-as-html
  5114. Convert the region to HTML under the assumption that it was org-mode
  5115. syntax before. This is a global command that can be invoked in any
  5116. buffer.
  5117. @item M-x org-replace-region-by-HTML
  5118. Replace the active region (assumed to be in Org-mode syntax) by HTML
  5119. code.
  5120. @end table
  5121. @cindex headline levels, for exporting
  5122. In the exported version, the first 3 outline levels will become
  5123. headlines, defining a general document structure. Additional levels
  5124. will be exported as itemized lists. If you want that transition to occur
  5125. at a different level, specify it with a prefix argument. For example,
  5126. @example
  5127. @kbd{C-2 C-c C-e b}
  5128. @end example
  5129. @noindent
  5130. creates two levels of headings and does the rest as items.
  5131. @node Quoting HTML tags, Links, HTML Export commands, HTML export
  5132. @subsection Quoting HTML tags
  5133. Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
  5134. @samp{&gt;} in HTML export. If you want to include simple HTML tags
  5135. which should be interpreted as such, mark them with @samp{@@} as in
  5136. @samp{@@<b>bold text@@</b>}. Note that this really works only for
  5137. simple tags. For more extensive HTML that should be copied verbatim to
  5138. the exported file use either
  5139. @example
  5140. #+HTML: Literal HTML code for export
  5141. @end example
  5142. @noindent or
  5143. @example
  5144. #+BEGIN_HTML
  5145. All lines between these markers are exported literally
  5146. #+END_HTML
  5147. @end example
  5148. @node Links, Images, Quoting HTML tags, HTML export
  5149. @subsection Links
  5150. @cindex links, in HTML export
  5151. @cindex internal links, in HTML export
  5152. @cindex external links, in HTML export
  5153. Internal links (@pxref{Internal links}) will continue to work in HTML
  5154. files only if they match a dedicated @samp{<<target>>}. Automatic links
  5155. created by radio targets (@pxref{Radio targets}) will also work in the
  5156. HTML file. Links to external files will still work if the HTML file is
  5157. in the same directory as the Org-mode file. Links to other @file{.org}
  5158. files will be translated into HTML links under the assumption that an
  5159. HTML version also exists of the linked file. For information related to
  5160. linking files while publishing them to a publishing directory see
  5161. @ref{Publishing links}.
  5162. @node Images, CSS support, Links, HTML export
  5163. @subsection Images
  5164. @cindex images, inline in HTML
  5165. @cindex inlining images in HTML
  5166. HTML export can inline images given as links in the Org-mode file, and
  5167. it can make an image the clickable part of a link. By
  5168. default@footnote{but see the variable
  5169. @code{org-export-html-inline-images}}, images are inlined if a link does
  5170. not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
  5171. while @samp{[[file:myimg.jpg][the image]]} will just produce a link
  5172. @samp{the image} that points to the image. If the description part
  5173. itself is a @code{file:} link or a @code{http:} URL pointing to an
  5174. image, this image will be inlined and activated so that clicking on the
  5175. image will activate the link. For example, to include a thumbnail that
  5176. will link to a high resolution version of the image, you could use:
  5177. @example
  5178. [[file:highres.jpg][file:thumb.jpg]]
  5179. @end example
  5180. @noindent
  5181. and you could use @code{http} addresses just as well.
  5182. @node CSS support, , Images, HTML export
  5183. @subsection CSS support
  5184. You can also give style information for the exported file. The HTML
  5185. exporter assigns the following CSS classes to appropriate parts of the
  5186. document - your style specifications may change these:
  5187. @example
  5188. .todo @r{TODO keywords}
  5189. .done @r{the DONE keyword}
  5190. .timestamp @r{time stamp}
  5191. .timestamp-kwd @r{keyword associated with a time stamp, like SCHEDULED}
  5192. .tag @r{tag in a headline}
  5193. .target @r{target for links}
  5194. @end example
  5195. The default style specification can be configured through the option
  5196. @code{org-export-html-style}. If you want to use a file-local style,
  5197. you may use file variables, best wrapped into a COMMENT section at the
  5198. end of the outline tree. For example@footnote{Under Emacs 21, the
  5199. continuation lines for a variable value should have no @samp{#} at the
  5200. start of the line.}:
  5201. @example
  5202. * COMMENT html style specifications
  5203. # Local Variables:
  5204. # org-export-html-style: " <style type=\"text/css\">
  5205. # p @{font-weight: normal; color: gray; @}
  5206. # h1 @{color: black; @}
  5207. # </style>"
  5208. # End:
  5209. @end example
  5210. Remember to execute @kbd{M-x normal-mode} after changing this to make
  5211. the new style visible to Emacs. This command restarts org-mode for the
  5212. current buffer and forces Emacs to re-evaluate the local variables
  5213. section in the buffer.
  5214. @c FIXME: More about header and footer styles
  5215. @c FIXME: Talk about links and targets.
  5216. @node LaTeX export, XOXO export, HTML export, Exporting
  5217. @section LaTeX export
  5218. @cindex LaTeX export
  5219. Org-mode contains a La@TeX{} exporter written by Bastien Guerry.
  5220. @menu
  5221. * LaTeX export commands:: How to invoke LaTeX export
  5222. * Quoting LaTeX code:: Incorporating literal LaTeX code
  5223. @end menu
  5224. @node LaTeX export commands, Quoting LaTeX code, LaTeX export, LaTeX export
  5225. @subsection LaTeX export commands
  5226. @table @kbd
  5227. @kindex C-c C-e l
  5228. @item C-c C-e l
  5229. Export as La@TeX{} file @file{myfile.tex}.
  5230. @kindex C-c C-e L
  5231. @item C-c C-e L
  5232. Export to a temporary buffer, do not create a file.
  5233. @kindex C-c C-e v l
  5234. @kindex C-c C-e v L
  5235. @item C-c C-e v l
  5236. @item C-c C-e v L
  5237. Export only the visible part of the document.
  5238. @item M-x org-export-region-as-latex
  5239. Convert the region to La@TeX{} under the assumption that it was org-mode
  5240. syntax before. This is a global command that can be invoked in any
  5241. buffer.
  5242. @item M-x org-replace-region-by-latex
  5243. Replace the active region (assumed to be in Org-mode syntax) by La@TeX{}
  5244. code.
  5245. @end table
  5246. @cindex headline levels, for exporting
  5247. In the exported version, the first 3 outline levels will become
  5248. headlines, defining a general document structure. Additional levels
  5249. will be exported as description lists. The exporter can ignore them or
  5250. convert them to a custom string depending on
  5251. @code{org-latex-low-levels}.
  5252. If you want that transition to occur at a different level, specify it
  5253. with a prefix argument. For example,
  5254. @example
  5255. @kbd{C-2 C-c C-e l}
  5256. @end example
  5257. @noindent
  5258. creates two levels of headings and does the rest as items.
  5259. @node Quoting LaTeX code, , LaTeX export commands, LaTeX export
  5260. @subsection Quoting LaTeX code
  5261. Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
  5262. inserted into the La@TeX{} file. Forthermore, you can add special code
  5263. that should only be present in La@TeX{} export with the following
  5264. constructs:
  5265. @example
  5266. #+LaTeX: Literal LaTeX code for export
  5267. @end example
  5268. @noindent or
  5269. @example
  5270. #+BEGIN_LaTeX
  5271. All lines between these markers are exported literally
  5272. #+END_LaTeX
  5273. @end example
  5274. @node XOXO export, iCalendar export, LaTeX export, Exporting
  5275. @section XOXO export
  5276. @cindex XOXO export
  5277. Org-mode contains an exporter that produces XOXO-style output.
  5278. Currently, this exporter only handles the general outline structure and
  5279. does not interpret any additional Org-mode features.
  5280. @table @kbd
  5281. @kindex C-c C-e x
  5282. @item C-c C-e x
  5283. Export as XOXO file @file{myfile.html}.
  5284. @kindex C-c C-e v
  5285. @item C-c C-e v x
  5286. Export only the visible part of the document.
  5287. @end table
  5288. @node iCalendar export, Text interpretation, XOXO export, Exporting
  5289. @section iCalendar export
  5290. @cindex iCalendar export
  5291. Some people like to use Org-mode for keeping track of projects, but
  5292. still prefer a standard calendar application for anniversaries and
  5293. appointments. In this case it can be useful to have deadlines and
  5294. other time-stamped items in Org-mode files show up in the calendar
  5295. application. Org-mode can export calendar information in the standard
  5296. iCalendar format. If you also want to have TODO entries included in the
  5297. export, configure the variable @code{org-icalendar-include-todo}.
  5298. @table @kbd
  5299. @kindex C-c C-e i
  5300. @item C-c C-e i
  5301. Create iCalendar entries for the current file and store them in the same
  5302. directory, using a file extension @file{.ics}.
  5303. @kindex C-c C-e I
  5304. @item C-c C-e I
  5305. Like @kbd{C-c C-e i}, but do this for all files in
  5306. @code{org-agenda-files}. For each of these files, a separate iCalendar
  5307. file will be written.
  5308. @kindex C-c C-e c
  5309. @item C-c C-e c
  5310. Create a single large iCalendar file from all files in
  5311. @code{org-agenda-files} and write it to the file given by
  5312. @code{org-combined-agenda-icalendar-file}.
  5313. @end table
  5314. How this calendar is best read and updated, depends on the application
  5315. you are using. The FAQ covers this issue.
  5316. @node Text interpretation, , iCalendar export, Exporting
  5317. @section Text interpretation by the exporter
  5318. The exporter backends interpret additional structure in the Org-mode file
  5319. in order to produce better output.
  5320. @menu
  5321. * Comment lines:: Some lines will not be exported
  5322. * Initial text:: Text before the first headline
  5323. * Footnotes:: Numbers like [1]
  5324. * Enhancing text:: Subscripts, symbols and more
  5325. * Export options:: How to influence the export settings
  5326. @end menu
  5327. @node Comment lines, Initial text, Text interpretation, Text interpretation
  5328. @subsection Comment lines
  5329. @cindex comment lines
  5330. @cindex exporting, not
  5331. Lines starting with @samp{#} in column zero are treated as comments
  5332. and will never be exported. Also entire subtrees starting with the
  5333. word @samp{COMMENT} will never be exported.
  5334. @table @kbd
  5335. @kindex C-c ;
  5336. @item C-c ;
  5337. Toggle the COMMENT keyword at the beginning of an entry.
  5338. @end table
  5339. @node Initial text, Footnotes, Comment lines, Text interpretation
  5340. @subsection Text before the first headline
  5341. Org-mode normally ignores any text before the first headline when
  5342. exporting, leaving this region for internal links to speed up navigation
  5343. etc. However, in publishing-oriented files, you might want to have some
  5344. text before the first headline, like a small introduction, special HTML
  5345. code with a navigation bar, etc. You can ask to have this part of the
  5346. file exported as well by setting the variable
  5347. @code{org-export-skip-text-before-1st-heading} to @code{nil}. On a
  5348. per-file basis, you can get the same effect with
  5349. @example
  5350. #+OPTIONS: skip:nil
  5351. @end example
  5352. The text before the first headline will be fully processed
  5353. (@pxref{Enhancing text}), and the first non-comment line becomes the
  5354. title of the exported document. If you need to include literal HTML,
  5355. use the special constructs described in @ref{Quoting HTML tags}. The
  5356. table of contents is normally inserted directly before the first
  5357. headline of the file. If you would like to get it to a different
  5358. location, insert the string @code{[TABLE-OF-CONTENTS]} on a line by
  5359. itself at the desired location.
  5360. Finally, if you want to use the space before the first headline for
  5361. internal purposes, but @emph{still} want to place something before the
  5362. first headline when exporting the file, you can use the @code{#+TEXT}
  5363. construct:
  5364. @example
  5365. #+OPTIONS: skip:t
  5366. #+TEXT: This text will go before the *first* headline.
  5367. #+TEXT: We place the table of contents here:
  5368. #+TEXT: [TABLE-OF-CONTENTS]
  5369. #+TEXT: This goes between the table of contents and the first headline
  5370. @end example
  5371. @node Footnotes, Enhancing text, Initial text, Text interpretation
  5372. @subsection Footnotes
  5373. @cindex footnotes
  5374. @cindex @file{footnote.el}
  5375. Numbers in square brackets are treated as footnotes, so that you can use
  5376. the Emacs package @file{footnote.el} to create footnotes. For example:
  5377. @example
  5378. The org-mode homepage[1] clearly needs help from
  5379. a good web designer.
  5380. [1] The link is: http://orgmode.org
  5381. @end example
  5382. @noindent
  5383. @kindex C-c !
  5384. Note that the @file{footnote} package uses @kbd{C-c !} to invoke its
  5385. commands. This binding conflicts with the org-mode command for
  5386. inserting inactive time stamps. You could use the variable
  5387. @code{footnote-prefix} to switch footnotes commands to another key. Or,
  5388. if you are too used to this binding, you could use
  5389. @code{org-replace-disputed-keys} and @code{org-disputed-keys} to change
  5390. the settings in Org-mode.
  5391. @node Enhancing text, Export options, Footnotes, Text interpretation
  5392. @subsection Enhancing text for export
  5393. @cindex enhancing text
  5394. @cindex richer text
  5395. Some of the export backends of Org-mode allow for sophisticated text
  5396. formatting, this is true in particular for the HTML and La@TeX{}
  5397. backends. Org-mode has a number of typing conventions that allow to
  5398. produce a richly formatted output.
  5399. @itemize @bullet
  5400. @cindex hand-formatted lists
  5401. @cindex lists, hand-formatted
  5402. @item
  5403. Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
  5404. or @samp{2)} as enumerator will be recognized and transformed if the
  5405. backend supports lists. See @xref{Plain lists}.
  5406. @cindex underlined text
  5407. @cindex bold text
  5408. @cindex italic text
  5409. @item
  5410. You can make words @b{*bold*}, @i{/italic/}, _underlined_,
  5411. @code{=code=}, and even @samp{+strikethrough+}@footnote{but remember
  5412. that strikethrough is typographically evil and should @i{never} be
  5413. used.}.
  5414. @cindex horizontal rules, in exported files
  5415. @item
  5416. A line consisting of only dashes, and at least 5 of them, will be
  5417. exported as a horizontal line (@samp{<hr/>} in HTML).
  5418. @cindex LaTeX fragments, export
  5419. @cindex TeX macros, export
  5420. @item
  5421. Many @TeX{} macros and entire La@TeX{} fragments are converted into HTML
  5422. entities or images (@pxref{Embedded LaTeX}).
  5423. @cindex tables, export
  5424. @item
  5425. Tables are transformed into native tables under the exporter, if the
  5426. export backend supports this. Data fields before the first horizontal
  5427. separator line will be formatted as table header fields.
  5428. @cindex fixed width
  5429. @item
  5430. If a headline starts with the word @samp{QUOTE}, the text below the
  5431. headline will be typeset as fixed-width, to allow quoting of computer
  5432. codes etc. Lines starting with @samp{:} are also typeset in fixed-width
  5433. font.
  5434. @table @kbd
  5435. @kindex C-c :
  5436. @item C-c :
  5437. Toggle fixed-width for entry (QUOTE) or region, see below.
  5438. @end table
  5439. @cindex linebreak, forced
  5440. @item
  5441. A double backslash @emph{at the end of a line} enforces a line break at
  5442. this position.
  5443. @end itemize
  5444. If these conversions conflict with your habits of typing ASCII text,
  5445. they can all be turned off with corresponding variables. See the
  5446. customization group @code{org-export-general}, and the following section
  5447. which explains how to set export options with special lines in a
  5448. buffer.
  5449. @node Export options, , Enhancing text, Text interpretation
  5450. @subsection Export options
  5451. @cindex options, for export
  5452. @cindex completion, of option keywords
  5453. The exporter recognizes special lines in the buffer which provide
  5454. additional information. These lines may be put anywhere in the file.
  5455. The whole set of lines can be inserted into the buffer with @kbd{C-c
  5456. C-e t}. For individual lines, a good way to make sure the keyword is
  5457. correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
  5458. (@pxref{Completion}).
  5459. @table @kbd
  5460. @kindex C-c C-e t
  5461. @item C-c C-e t
  5462. Insert template with export options, see example below.
  5463. @end table
  5464. @example
  5465. #+TITLE: the title to be shown (default is the buffer name)
  5466. #+AUTHOR: the author (default taken from @code{user-full-name})
  5467. #+DATE: A date, fixed, of a format string for @code{format-time-string}
  5468. #+EMAIL: his/her email address (default from @code{user-mail-address})
  5469. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  5470. #+TEXT: Some descriptive text to be inserted at the beginning.
  5471. #+TEXT: Several lines may be given.
  5472. #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
  5473. @end example
  5474. @noindent
  5475. The OPTIONS line is a compact form to specify export settings. Here
  5476. you can:
  5477. @cindex headline levels
  5478. @cindex section-numbers
  5479. @cindex table of contents
  5480. @cindex linebreak preservation
  5481. @cindex quoted HTML tags
  5482. @cindex fixed-width sections
  5483. @cindex tables
  5484. @cindex @TeX{}-like syntax for sub- and superscripts
  5485. @cindex footnotes
  5486. @cindex emphasized text
  5487. @cindex @TeX{} macros
  5488. @cindex La@TeX{} fragments
  5489. @cindex author info, in export
  5490. @cindex time info, in export
  5491. @example
  5492. H: @r{set the number of headline levels for export}
  5493. num: @r{turn on/off section-numbers}
  5494. toc: @r{turn on/off table of contents, or set level limit (integer)}
  5495. \n: @r{turn on/off linebreak-preservation}
  5496. @@: @r{turn on/off quoted HTML tags}
  5497. :: @r{turn on/off fixed-width sections}
  5498. |: @r{turn on/off tables}
  5499. ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
  5500. @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
  5501. @r{the simple @code{a_b} will be left as it is.}
  5502. f: @r{turn on/off foototes like this[1].}
  5503. *: @r{turn on/off emphasized text (bold, italic, underlined)}
  5504. TeX: @r{turn on/off simple @TeX{} macros in plain text}
  5505. LaTeX: @r{turn on/off La@TeX{} fragments}
  5506. skip: @r{turn on/off skipping the text before the first heading}
  5507. author: @r{turn on/off inclusion of author name/email into exported file}
  5508. timestamp: @r{turn on/off inclusion creation time into exported file}
  5509. @end example
  5510. These options take effect in both the HTML and La@TeX{} export, except
  5511. for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
  5512. @code{nil} for the La@TeX{} export.
  5513. @node Publishing, Miscellaneous, Exporting, Top
  5514. @chapter Publishing
  5515. @cindex publishing
  5516. Org-mode includes@footnote{@file{org-publish.el} is not distributed with
  5517. Emacs 21, if you are still using Emacs 21, you need you need to download
  5518. this file separately.} a publishing management system that allows you to
  5519. configure automatic HTML conversion of @emph{projects} composed of
  5520. interlinked org files. This system is called @emph{org-publish}. You can
  5521. also configure org-publish to automatically upload your exported HTML
  5522. pages and related attachments, such as images and source code files, to
  5523. a web server. Org-publish turns org-mode into a web-site authoring tool.
  5524. You can also use Org-publish to convert files into La@TeX{}, or even
  5525. combine HTML and La@TeX{} conversion so that files are available in both
  5526. formats on the server@footnote{Since La@TeX{} files on a server are not
  5527. that helpful, you surely want to perform further conversion on them --
  5528. e.g. convert them to @code{PDF} format.}.
  5529. Org-publish has been contributed to Org-mode by David O'Toole.
  5530. @menu
  5531. * Configuration:: Defining projects
  5532. * Sample configuration:: Example projects
  5533. * Triggering publication:: Publication commands
  5534. @end menu
  5535. @node Configuration, Sample configuration, Publishing, Publishing
  5536. @section Configuration
  5537. Publishing needs significant configuration to specify files, destination
  5538. and many other properties of a project.
  5539. @menu
  5540. * Project alist:: The central configuration variable
  5541. * Sources and destinations:: From here to there
  5542. * Selecting files:: What files are part of the project?
  5543. * Publishing action:: Setting the function doing the publishing
  5544. * Publishing options:: Tweaking HTML export
  5545. * Publishing links:: Which links keep working after publishing?
  5546. * Project page index:: Publishing a list of project files
  5547. @end menu
  5548. @node Project alist, Sources and destinations, Configuration, Configuration
  5549. @subsection The variable @code{org-publish-project-alist}
  5550. @cindex org-publish-project-alist
  5551. @cindex projects, for publishing
  5552. Org-publish is configured almost entirely through setting the value of
  5553. one variable, called @code{org-publish-project-alist}.
  5554. Each element of the list configures one project, and may be in one of
  5555. the two following forms:
  5556. @lisp
  5557. ("project-name" :property value :property value ...)
  5558. @r{or}
  5559. ("project-name" :components ("project-name" "project-name" ...))
  5560. @end lisp
  5561. In both cases, projects are configured by specifying property values.
  5562. A project defines the set of files that will be published, as well as
  5563. the publishing configuration to use when publishing those files. When
  5564. a project takes the second form listed above, the individual members
  5565. of the ``components'' property are taken to be components of the
  5566. project, which group together files requiring different publishing
  5567. options. When you publish such a ``meta-project'' all the components
  5568. will also publish.
  5569. @node Sources and destinations, Selecting files, Project alist, Configuration
  5570. @subsection Sources and destinations for files
  5571. @cindex directories, for publishing
  5572. Most properties are optional, but some should always be set. In
  5573. particular, org-publish needs to know where to look for source files,
  5574. and where to put published files.
  5575. @multitable @columnfractions 0.3 0.7
  5576. @item @code{:base-directory}
  5577. @tab Directory containing publishing source files
  5578. @item @code{:publishing-directory}
  5579. @tab Directory (possibly remote) where output files will be published.
  5580. @item @code{:preparation-function}
  5581. @tab Function called before starting publishing process, for example to
  5582. run @code{make} for updating files to be published.
  5583. @end multitable
  5584. @noindent
  5585. @node Selecting files, Publishing action, Sources and destinations, Configuration
  5586. @subsection Selecting files
  5587. @cindex files, selecting for publishing
  5588. By default, all files with extension @file{.org} in the base directory
  5589. are considered part of the project. This can be modified by setting the
  5590. properties
  5591. @multitable @columnfractions 0.25 0.75
  5592. @item @code{:base-extension}
  5593. @tab Extension (without the dot!) of source files. This actually is a
  5594. regular expression.
  5595. @item @code{:exclude}
  5596. @tab Regular expression to match file names that should not be
  5597. published, even though they have been selected on the basis of their
  5598. extension.
  5599. @item @code{:include}
  5600. @tab List of files to be included regardless of @code{:base-extension}
  5601. and @code{:exclude}.
  5602. @end multitable
  5603. @node Publishing action, Publishing options, Selecting files, Configuration
  5604. @subsection Publishing Action
  5605. @cindex action, for publishing
  5606. Publishing means that a file is copied to the destination directory and
  5607. possibly transformed in the process. The default transformation is to
  5608. export Org-mode files as HTML files, and this is done by the function
  5609. @code{org-publish-org-to-html} which calls the HTML exporter
  5610. (@pxref{HTML export}). But you also can publish your files in La@TeX{} by
  5611. using the function @code{org-publish-org-to-latex} instead. Other files
  5612. like images only need to be copied to the publishing destination. For
  5613. non-Org-mode files, you need to specify the publishing function.
  5614. @multitable @columnfractions 0.3 0.7
  5615. @item @code{:publishing-function}
  5616. @tab Function executing the publication of a file. This may also be a
  5617. list of functions, which will all be called in turn.
  5618. @end multitable
  5619. The function must accept two arguments: a property list containing at
  5620. least a @code{:publishing-directory} property, and the name of the file
  5621. to be published. It should take the specified file, make the necessary
  5622. transformation (if any) and place the result into the destination folder.
  5623. You can write your own publishing function, but @code{org-publish}
  5624. provides one for attachments (files that only need to be copied):
  5625. @code{org-publish-attachment}.
  5626. @node Publishing options, Publishing links, Publishing action, Configuration
  5627. @subsection Options for the HTML/LaTeX exporters
  5628. @cindex options, for publishing
  5629. The property list can be used to set many export options for the HTML
  5630. and La@TeX{} exporters. In most cases, these properties correspond to user
  5631. variables in Org-mode. The table below lists these properties along
  5632. with the variable they belong to. See the documentation string for the
  5633. respective variable for details.
  5634. @multitable @columnfractions 0.3 0.7
  5635. @item @code{:language} @tab @code{org-export-default-language}
  5636. @item @code{:headline-levels} @tab @code{org-export-headline-levels}
  5637. @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
  5638. @item @code{:table-of-contents} @tab @code{org-export-with-toc}
  5639. @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
  5640. @item @code{:emphasize} @tab @code{org-export-with-emphasize}
  5641. @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
  5642. @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
  5643. @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
  5644. @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
  5645. @item @code{:timestamps} .@tab @code{org-export-with-timestamps}
  5646. @item @code{:tags} .@tab @code{org-export-with-tags}
  5647. @item @code{:tables} @tab @code{org-export-with-tables}
  5648. @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
  5649. @item @code{:style} @tab @code{org-export-html-style}
  5650. @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
  5651. @item @code{:inline-images} @tab @code{org-export-html-inline-images}
  5652. @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
  5653. @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
  5654. @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
  5655. @item @code{:preamble} @tab @code{org-export-html-preamble}
  5656. @item @code{:postamble} @tab @code{org-export-html-postamble}
  5657. @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
  5658. @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
  5659. @item @code{:author} @tab @code{user-full-name}
  5660. @item @code{:email} @tab @code{user-mail-address}
  5661. @end multitable
  5662. Most of the @code{org-export-with-*} variables have the same effect in
  5663. both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
  5664. @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
  5665. La@TeX{} export.
  5666. When a property is given a value in org-publish-project-alist, its
  5667. setting overrides the value of the corresponding user variable (if any)
  5668. during publishing. Options set within a file (@pxref{Export
  5669. options}), however, override everything.
  5670. @node Publishing links, Project page index, Publishing options, Configuration
  5671. @subsection Links between published files
  5672. @cindex links, publishing
  5673. To create a link from one Org-mode file to another, you would use
  5674. something like @samp{[[file:foo.org][The foo]]} or simply
  5675. @samp{file:foo.org.} (@pxref{Hyperlinks}). Upon publishing this link
  5676. becomes a link to @file{foo.html}. In this way, you can interlink the
  5677. pages of your "org web" project and the links will work as expected when
  5678. you publish them to HTML.
  5679. You may also link to related files, such as images. Provided you are
  5680. careful with relative pathnames, and provided you have also configured
  5681. org-publish to upload the related files, these links will work
  5682. too. @ref{Complex example} for an example of this usage.
  5683. Sometime an Org-mode file to be published may contain links that are
  5684. only valid in your production environment, but not in the publishing
  5685. location. In this case, use the property
  5686. @multitable @columnfractions 0.4 0.6
  5687. @item @code{:link-validation-function}
  5688. @tab Function to validate links
  5689. @end multitable
  5690. @noindent
  5691. to define a function for checking link validity. This function must
  5692. accept two arguments, the file name and a directory relative to which
  5693. the file name is interpreted in the production environment. If this
  5694. function returns @code{nil}, then the HTML generator will only insert a
  5695. description into the HTML file, but no link. One option for this
  5696. function is @code{org-publish-validate-link} which checks if the given
  5697. file is part of any project in @code{org-publish-project-alist}.
  5698. @node Project page index, , Publishing links, Configuration
  5699. @subsection Project page index
  5700. @cindex index, of published pages
  5701. The following properties may be used to control publishing of an
  5702. index of files or summary page for a given project.
  5703. @multitable @columnfractions 0.25 0.75
  5704. @item @code{:auto-index}
  5705. @tab When non-nil, publish an index during org-publish-current-project or
  5706. org-publish-all.
  5707. @item @code{:index-filename}
  5708. @tab Filename for output of index. Defaults to @file{index.org} (which
  5709. becomes @file{index.html}).
  5710. @item @code{:index-title}
  5711. @tab Title of index page. Defaults to name of file.
  5712. @item @code{:index-function}
  5713. @tab Plugin function to use for generation of index.
  5714. Defaults to @code{org-publish-org-index}, which generates a plain list
  5715. of links to all files in the project.
  5716. @end multitable
  5717. @node Sample configuration, Triggering publication, Configuration, Publishing
  5718. @section Sample configuration
  5719. Below we provide two example configurations. The first one is a simple
  5720. project publishing only a set of Org-mode files. The second example is
  5721. more complex, with a multi-component project.
  5722. @menu
  5723. * Simple example:: One-component publishing
  5724. * Complex example:: A multi-component publishing example
  5725. @end menu
  5726. @node Simple example, Complex example, Sample configuration, Sample configuration
  5727. @subsection Example: simple publishing configuration
  5728. This example publishes a set of Org-mode files to the @file{public_html}
  5729. directory on the local machine.
  5730. @lisp
  5731. (setq org-publish-project-alist
  5732. '(("org"
  5733. :base-directory "~/org/"
  5734. :publishing-directory "~/public_html"
  5735. :section-numbers nil
  5736. :table-of-contents nil
  5737. :style "<link rel=stylesheet
  5738. href=\"../other/mystyle.css\"
  5739. type=\"text/css\">")))
  5740. @end lisp
  5741. @node Complex example, , Simple example, Sample configuration
  5742. @subsection Example: complex publishing configuration
  5743. This more complicated example publishes an entire website, including
  5744. org files converted to HTML, image files, emacs lisp source code, and
  5745. stylesheets. The publishing-directory is remote and private files are
  5746. excluded.
  5747. To ensure that links are preserved, care should be taken to replicate
  5748. your directory structure on the web server, and to use relative file
  5749. paths. For example, if your org files are kept in @file{~/org} and your
  5750. publishable images in @file{~/images}, you'd link to an image with
  5751. @c
  5752. @example
  5753. file:../images/myimage.png
  5754. @end example
  5755. @c
  5756. On the web server, the relative path to the image should be the
  5757. same. You can accomplish this by setting up an "images" folder in the
  5758. right place on the webserver, and publishing images to it.
  5759. @lisp
  5760. (setq org-publish-project-alist
  5761. '(("orgfiles"
  5762. :base-directory "~/org/"
  5763. :base-extension "org"
  5764. :publishing-directory "/ssh:user@@host:~/html/notebook/"
  5765. :publishing-function org-publish-org-to-html
  5766. :exclude "PrivatePage.org" ;; regexp
  5767. :headline-levels 3
  5768. :section-numbers nil
  5769. :table-of-contents nil
  5770. :style "<link rel=stylesheet
  5771. href=\"../other/mystyle.css\" type=\"text/css\">"
  5772. :auto-preamble t
  5773. :auto-postamble nil)
  5774. ("images"
  5775. :base-directory "~/images/"
  5776. :base-extension "jpg\\|gif\\|png"
  5777. :publishing-directory "/ssh:user@@host:~/html/images/"
  5778. :publishing-function org-publish-attachment)
  5779. ("other"
  5780. :base-directory "~/other/"
  5781. :base-extension "css\\|el"
  5782. :publishing-directory "/ssh:user@@host:~/html/other/"
  5783. :publishing-function org-publish-attachment)
  5784. ("website" :components ("orgfiles" "images" "other"))))
  5785. @end lisp
  5786. @node Triggering publication, , Sample configuration, Publishing
  5787. @section Triggering publication
  5788. Once org-publish is properly configured, you can publish with the
  5789. following functions:
  5790. @table @kbd
  5791. @item C-c C-e C
  5792. Prompt for a specific project and publish all files that belong to it.
  5793. @item C-c C-e P
  5794. Publish the project containing the current file.
  5795. @item C-c C-e F
  5796. Publish only the current file.
  5797. @item C-c C-e A
  5798. Publish all projects.
  5799. @end table
  5800. Org uses timestamps to track when a file has changed. The above
  5801. functions normally only publish changed files. You can override this and
  5802. force publishing of all files by giving a prefix argument.
  5803. @node Miscellaneous, Extensions and Hacking, Publishing, Top
  5804. @chapter Miscellaneous
  5805. @menu
  5806. * Completion:: M-TAB knows what you need
  5807. * Customization:: Adapting Org-mode to your taste
  5808. * In-buffer settings:: Overview of the #+KEYWORDS
  5809. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  5810. * Clean view:: Getting rid of leading stars in the outline
  5811. * TTY keys:: Using Org-mode on a tty
  5812. * Interaction:: Other Emacs packages
  5813. * Bugs:: Things which do not work perfectly
  5814. @end menu
  5815. @node Completion, Customization, Miscellaneous, Miscellaneous
  5816. @section Completion
  5817. @cindex completion, of @TeX{} symbols
  5818. @cindex completion, of TODO keywords
  5819. @cindex completion, of dictionary words
  5820. @cindex completion, of option keywords
  5821. @cindex completion, of tags
  5822. @cindex completion, of property keys
  5823. @cindex completion, of link abbreviations
  5824. @cindex @TeX{} symbol completion
  5825. @cindex TODO keywords completion
  5826. @cindex dictionary word completion
  5827. @cindex option keyword completion
  5828. @cindex tag completion
  5829. @cindex link abbreviations, completion of
  5830. Org-mode supports in-buffer completion. This type of completion does
  5831. not make use of the minibuffer. You simply type a few letters into
  5832. the buffer and use the key to complete text right there.
  5833. @table @kbd
  5834. @kindex M-@key{TAB}
  5835. @item M-@key{TAB}
  5836. Complete word at point
  5837. @itemize @bullet
  5838. @item
  5839. At the beginning of a headline, complete TODO keywords.
  5840. @item
  5841. After @samp{\}, complete @TeX{} symbols supported by the exporter.
  5842. @item
  5843. After @samp{*}, complete headlines in the current buffer so that they
  5844. can be used in search links like @samp{[[*find this headline]]}.
  5845. @item
  5846. After @samp{:} in a headline, complete tags. The list of tags is taken
  5847. from the variable @code{org-tag-alist} (possibly set through the
  5848. @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
  5849. dynamically from all tags used in the current buffer.
  5850. @item
  5851. After @samp{:} and not in a headline, complete property keys. The list
  5852. of keys is constructed dynamically from all keys used in the current
  5853. buffer.
  5854. @item
  5855. After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
  5856. @item
  5857. After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
  5858. @samp{OPTIONS} which set file-specific options for Org-mode. When the
  5859. option keyword is already complete, pressing @kbd{M-@key{TAB}} again
  5860. will insert example settings for this keyword.
  5861. @item
  5862. In the line after @samp{#+STARTUP: }, complete startup keywords,
  5863. i.e. valid keys for this line.
  5864. @item
  5865. Elsewhere, complete dictionary words using ispell.
  5866. @end itemize
  5867. @end table
  5868. @node Customization, In-buffer settings, Completion, Miscellaneous
  5869. @section Customization
  5870. @cindex customization
  5871. @cindex options, for customization
  5872. @cindex variables, for customization
  5873. There are more than 180 variables that can be used to customize
  5874. Org-mode. For the sake of compactness of the manual, I am not
  5875. describing the variables here. A structured overview of customization
  5876. variables is available with @kbd{M-x org-customize}. Or select
  5877. @code{Browse Org Group} from the @code{Org->Customization} menu. Many
  5878. settings can also be activated on a per-file basis, by putting special
  5879. lines into the buffer (@pxref{In-buffer settings}).
  5880. @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
  5881. @section Summary of in-buffer settings
  5882. @cindex in-buffer settings
  5883. @cindex special keywords
  5884. Org-mode uses special lines in the buffer to define settings on a
  5885. per-file basis. These lines start with a @samp{#+} followed by a
  5886. keyword, a colon, and then individual words defining a setting. Several
  5887. setting words can be in the same line, but you can also have multiple
  5888. lines for the keyword. While these settings are described throughout
  5889. the manual, here is a summary. After changing any of those lines in the
  5890. buffer, press @kbd{C-c C-c} with the cursor still in the line to
  5891. activate the changes immediately. Otherwise they become effective only
  5892. when the file is visited again in a new Emacs session.
  5893. @table @kbd
  5894. @item #+ARCHIVE: %s_done::
  5895. This line sets the archive location for the agenda file. It applies for
  5896. all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
  5897. of the file. The first such line also applies to any entries before it.
  5898. The corresponding variable is @code{org-archive-location}.
  5899. @item #+CATEGORY:
  5900. This line sets the category for the agenda file. The category applies
  5901. for all subsequent lines until the next @samp{#+CATEGORY} line, or the
  5902. end of the file. The first such line also applies to any entries before it.
  5903. @item #+COLUMNS: %25ITEM .....
  5904. Set the default format for columns view. This format applies when
  5905. columns view is invoked in location where no COLUMNS property applies.
  5906. @item #+CONSTANTS: name1=value1 ...
  5907. Set file-local values for constants to be used in table formulas. This
  5908. line set the local variable @code{org-table-formula-constants-local}.
  5909. The global version of theis variable is
  5910. @code{org-table-formula-constants}.
  5911. corresponding
  5912. @item #+LINK: linkword replace
  5913. These lines (several are allowed) specify link abbreviations.
  5914. @xref{Link abbreviations}. The corresponding variable is
  5915. @code{org-link-abbrev-alist}.
  5916. @item #+PRIORITIES: highest lowest default
  5917. This line sets the limits and the default for the priorities. All three
  5918. must be either letters A-Z or numbers 0-9. The highest priority must
  5919. have a lower ASCII number that the lowest priority.
  5920. @item #+PROPERTY: Property_Name Value
  5921. This line sets a default inheritance value for entries in the current
  5922. buffer, most useful for specifying the allowed values of a property.
  5923. @item #+STARTUP:
  5924. This line sets options to be used at startup of Org-mode, when an
  5925. Org-mode file is being visited. The first set of options deals with the
  5926. initial visibility of the outline tree. The corresponding variable for
  5927. global default settings is @code{org-startup-folded}, with a default
  5928. value @code{t}, which means @code{overview}.
  5929. @cindex @code{overview}, STARTUP keyword
  5930. @cindex @code{content}, STARTUP keyword
  5931. @cindex @code{showall}, STARTUP keyword
  5932. @example
  5933. overview @r{top-level headlines only}
  5934. content @r{all headlines}
  5935. showall @r{no folding at all, show everything}
  5936. @end example
  5937. Then there are options for aligning tables upon visiting a file. This
  5938. is useful in files containing narrowed table columns. The corresponding
  5939. variable is @code{org-startup-align-all-tables}, with a default value
  5940. @code{nil}.
  5941. @cindex @code{align}, STARTUP keyword
  5942. @cindex @code{noalign}, STARTUP keyword
  5943. @example
  5944. align @r{align all tables}
  5945. noalign @r{don't align tables on startup}
  5946. @end example
  5947. Logging TODO state changes and clock intervals (variable
  5948. @code{org-log-done}) can be configured using these options.
  5949. @cindex @code{logdone}, STARTUP keyword
  5950. @cindex @code{nologging}, STARTUP keyword
  5951. @cindex @code{lognotedone}, STARTUP keyword
  5952. @cindex @code{lognoteclock-out}, STARTUP keyword
  5953. @cindex @code{lognotestate}, STARTUP keyword
  5954. @cindex @code{logrepeat}, STARTUP keyword
  5955. @cindex @code{nologrepeat}, STARTUP keyword
  5956. @example
  5957. logging @r{record a timestamp when an item is marked DONE}
  5958. nologging @r{don't record when items are marked DONE}
  5959. lognotedone @r{record timestamp and a note when DONE}
  5960. lognotestate @r{record timestamp and a note when TODO state changes}
  5961. logrepeat @r{record a note when re-instating a repeating item}
  5962. nologrepeat @r{do not record when re-instating repeating item}
  5963. lognoteclock-out @r{record timestamp and a note when clocking out}
  5964. @end example
  5965. Here are the options for hiding leading stars in outline headings. The
  5966. corresponding variables are @code{org-hide-leading-stars} and
  5967. @code{org-odd-levels-only}, both with a default setting @code{nil}
  5968. (meaning @code{showstars} and @code{oddeven}).
  5969. @cindex @code{hidestars}, STARTUP keyword
  5970. @cindex @code{showstars}, STARTUP keyword
  5971. @cindex @code{odd}, STARTUP keyword
  5972. @cindex @code{even}, STARTUP keyword
  5973. @example
  5974. hidestars @r{make all but one of the stars starting a headline invisible.}
  5975. showstars @r{show all stars starting a headline}
  5976. odd @r{allow only odd outline levels (1,3,...)}
  5977. oddeven @r{allow all outline levels}
  5978. @end example
  5979. To turn on custom format overlays over time stamps (variables
  5980. @code{org-put-time-stamp-overlays} and
  5981. @code{org-time-stamp-overlay-formats}), use
  5982. @cindex @code{customtime}, STARTUP keyword
  5983. @example
  5984. customtime @r{overlay custom time format}
  5985. @end example
  5986. The following options influence the table spreadsheet (variable
  5987. @code{constants-unit-system}).
  5988. @cindex @code{constcgs}, STARTUP keyword
  5989. @cindex @code{constSI}, STARTUP keyword
  5990. @example
  5991. constcgs @r{@file{constants.el} should use the c-g-s unit system}
  5992. constSI @r{@file{constants.el} should use the SI unit system}
  5993. @end example
  5994. @item #+TAGS: TAG1(c1) TAG2(c2)
  5995. These lines (several such lines are allowed) specify the legal tags in
  5996. this file, and (potentially) the corresponding @emph{fast tag selection}
  5997. keys. The corresponding variable is @code{org-tag-alist}.
  5998. @item #+TBLFM:
  5999. This line contains the formulas for the table directly above the line.
  6000. @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS, #+DATE:
  6001. These lines provide settings for exporting files. For more details see
  6002. @ref{Export options}.
  6003. @item #+SEQ_TODO: #+TYP_TODO:
  6004. These lines set the TODO keywords and their interpretation in the
  6005. current file. The corresponding variables are @code{org-todo-keywords}
  6006. and @code{org-todo-interpretation}.
  6007. @end table
  6008. @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
  6009. @section The very busy C-c C-c key
  6010. @kindex C-c C-c
  6011. @cindex C-c C-c, overview
  6012. The key @kbd{C-c C-c} has many purposes in org-mode, which are all
  6013. mentioned scattered throughout this manual. One specific function of
  6014. this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
  6015. other circumstances it means something like @emph{Hey Org-mode, look
  6016. here and update according to what you see here}. Here is a summary of
  6017. what this means in different contexts.
  6018. @itemize @minus
  6019. @item
  6020. If there are highlights in the buffer from the creation of a sparse
  6021. tree, or from clock display, remove these highlights.
  6022. @item
  6023. If the cursor is in one of the special @code{#+KEYWORD} lines, this
  6024. triggers scanning the buffer for these lines and updating the
  6025. information.
  6026. @item
  6027. If the cursor is inside a table, realign the table. This command
  6028. works even if the automatic table editor has been turned off.
  6029. @item
  6030. If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
  6031. the entire table.
  6032. @item
  6033. If the cursor is inside a table created by the @file{table.el} package,
  6034. activate that table.
  6035. @item
  6036. If the current buffer is a remember buffer, close the note and file it.
  6037. With a prefix argument, file it, without further interaction, to the
  6038. default location.
  6039. @item
  6040. If the cursor is on a @code{<<<target>>>}, update radio targets and
  6041. corresponding links in this buffer.
  6042. @item
  6043. If the cursor is in a property line or at the start or end of a property
  6044. drawer, offer property commands.
  6045. @item
  6046. If the cursor is in a plain list item with a checkbox, toggle the status
  6047. of the checkbox.
  6048. @item
  6049. If the cursor is on a numbered item in a plain list, renumber the
  6050. ordered list.
  6051. @item
  6052. If the cursor is on the @code{#+BEGIN} line of a dynamical block, the
  6053. block is updated.
  6054. @end itemize
  6055. @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
  6056. @section A cleaner outline view
  6057. @cindex hiding leading stars
  6058. @cindex clean outline view
  6059. Some people find it noisy and distracting that the Org-mode headlines
  6060. are starting with a potentially large number of stars. For example
  6061. the tree from @ref{Headlines}:
  6062. @example
  6063. * Top level headline
  6064. ** Second level
  6065. *** 3rd level
  6066. some text
  6067. *** 3rd level
  6068. more text
  6069. * Another top level headline
  6070. @end example
  6071. @noindent
  6072. Unfortunately this is deeply ingrained into the code of Org-mode and
  6073. cannot be easily changed. You can, however, modify the display in such
  6074. a way that all leading stars become invisible and the outline more easy
  6075. to read. To do this, customize the variable
  6076. @code{org-hide-leading-stars} like this:
  6077. @lisp
  6078. (setq org-hide-leading-stars t)
  6079. @end lisp
  6080. @noindent
  6081. or change this on a per-file basis with one of the lines (anywhere in
  6082. the buffer)
  6083. @example
  6084. #+STARTUP: showstars
  6085. #+STARTUP: hidestars
  6086. @end example
  6087. @noindent
  6088. Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
  6089. the modifications.
  6090. With stars hidden, the tree becomes:
  6091. @example
  6092. * Top level headline
  6093. * Second level
  6094. * 3rd level
  6095. some text
  6096. * 3rd level
  6097. more text
  6098. * Another top level headline
  6099. @end example
  6100. @noindent
  6101. Note that the leading stars are not truly replaced by whitespace, they
  6102. are only fontified with the face @code{org-hide} that uses the
  6103. background color as font color. If you are not using either white or
  6104. black background, you may have to customize this face to get the wanted
  6105. effect. Another possibility is to set this font such that the extra
  6106. stars are @i{almost} invisible, for example using the color
  6107. @code{grey90} on a white background.
  6108. Things become cleaner still if you skip all the even levels and use only
  6109. odd levels 1, 3, 5..., effectively adding two stars to go from one
  6110. outline level to the next:
  6111. @example
  6112. * Top level headline
  6113. * Second level
  6114. * 3rd level
  6115. some text
  6116. * 3rd level
  6117. more text
  6118. * Another top level headline
  6119. @end example
  6120. @noindent
  6121. In order to make the structure editing and export commands handle this
  6122. convention correctly, use
  6123. @lisp
  6124. (setq org-odd-levels-only t)
  6125. @end lisp
  6126. @noindent
  6127. or set this on a per-file basis with one of the following lines (don't
  6128. forget to press @kbd{C-c C-c} with the cursor in the startup line to
  6129. activate changes immediately).
  6130. @example
  6131. #+STARTUP: odd
  6132. #+STARTUP: oddeven
  6133. @end example
  6134. You can convert an Org-mode file from single-star-per-level to the
  6135. double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
  6136. RET} in that file. The reverse operation is @kbd{M-x
  6137. org-convert-to-oddeven-levels}.
  6138. @node TTY keys, Interaction, Clean view, Miscellaneous
  6139. @section Using org-mode on a tty
  6140. @cindex tty keybindings
  6141. Org-mode uses a number of keys that are not accessible on a tty. This
  6142. applies to most special keys like cursor keys, @key{TAB} and
  6143. @key{RET}, when these are combined with modifier keys like @key{Meta}
  6144. and/or @key{Shift}. Org-mode uses these bindings because it needs to
  6145. provide keys for a large number of commands, and because these keys
  6146. appeared particularly easy to remember. In order to still be able to
  6147. access the core functionality of Org-mode on a tty, alternative
  6148. bindings are provided. Here is a complete list of these bindings,
  6149. which are obviously more cumbersome to use. Note that sometimes a
  6150. work-around can be better. For example changing a time stamp is
  6151. really only fun with @kbd{S-@key{cursor}} keys. On a tty you would
  6152. rather use @kbd{C-c .} to re-insert the timestamp.
  6153. @multitable @columnfractions 0.15 0.2 0.2
  6154. @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
  6155. @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
  6156. @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
  6157. @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
  6158. @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}}
  6159. @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
  6160. @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
  6161. @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
  6162. @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
  6163. @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
  6164. @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
  6165. @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
  6166. @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
  6167. @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab
  6168. @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab
  6169. @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab
  6170. @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab
  6171. @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
  6172. @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
  6173. @end multitable
  6174. @node Interaction, Bugs, TTY keys, Miscellaneous
  6175. @section Interaction with other packages
  6176. @cindex packages, interaction with other
  6177. Org-mode lives in the world of GNU Emacs and interacts in various ways
  6178. with other code out there.
  6179. @menu
  6180. * Cooperation:: Packages Org-mode cooperates with
  6181. * Conflicts:: Packages that lead to conflicts
  6182. @end menu
  6183. @node Cooperation, Conflicts, Interaction, Interaction
  6184. @subsection Packages that Org-mode cooperates with
  6185. @table @asis
  6186. @cindex @file{calc.el}
  6187. @item @file{calc.el} by Dave Gillespie
  6188. Org-mode uses the calc package for implementing spreadsheet
  6189. functionality in its tables (@pxref{The spreadsheet}). Org-mode
  6190. checks for the availability of calc by looking for the function
  6191. @code{calc-eval} which should be autoloaded in your setup if calc has
  6192. been installed properly. As of Emacs 22, calc is part of the Emacs
  6193. distribution. Another possibility for interaction between the two
  6194. packages is using calc for embedded calculations. @xref{Embedded Mode,
  6195. , Embedded Mode, calc, GNU Emacs Calc Manual}.
  6196. @cindex @file{constants.el}
  6197. @item @file{constants.el} by Carsten Dominik
  6198. In a table formula (@pxref{The spreadsheet}), it is possible to use
  6199. names for natural constants or units. Instead of defining your own
  6200. constants in the variable @code{org-table-formula-constants}, install
  6201. the @file{constants} package which defines a large number of constants
  6202. and units, and lets you use unit prefixes like @samp{M} for
  6203. @samp{Mega} etc. You will need version 2.0 of this package, available
  6204. at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
  6205. the function @code{constants-get}, which has to be autoloaded in your
  6206. setup. See the installation instructions in the file
  6207. @file{constants.el}.
  6208. @item @file{cdlatex.el} by Carsten Dominik
  6209. @cindex @file{cdlatex.el}
  6210. Org-mode can make use of the cdlatex package to efficiently enter
  6211. La@TeX{} fragments into Org-mode files. See @ref{CDLaTeX mode}.
  6212. @item @file{remember.el} by John Wiegley
  6213. @cindex @file{remember.el}
  6214. Org mode cooperates with remember, see @ref{Remember}.
  6215. @file{Remember.el} is not part of Emacs, find it on the web.
  6216. @cindex @file{table.el}
  6217. @item @file{table.el} by Takaaki Ota
  6218. @kindex C-c C-c
  6219. @cindex table editor, @file{table.el}
  6220. @cindex @file{table.el}
  6221. Complex ASCII tables with automatic line wrapping, column- and
  6222. row-spanning, and alignment can be created using the Emacs table
  6223. package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
  6224. and also part of Emacs 22).
  6225. When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
  6226. will call @command{table-recognize-table} and move the cursor into the
  6227. table. Inside a table, the keymap of Org-mode is inactive. In order
  6228. to execute Org-mode-related commands, leave the table.
  6229. @table @kbd
  6230. @kindex C-c C-c
  6231. @item C-c C-c
  6232. Recognize @file{table.el} table. Works when the cursor is in a
  6233. table.el table.
  6234. @c
  6235. @kindex C-c ~
  6236. @item C-c ~
  6237. Insert a table.el table. If there is already a table at point, this
  6238. command converts it between the table.el format and the Org-mode
  6239. format. See the documentation string of the command
  6240. @code{org-convert-table} for the restrictions under which this is
  6241. possible.
  6242. @end table
  6243. @file{table.el} is part of Emacs 22.
  6244. @cindex @file{footnote.el}
  6245. @item @file{footnote.el} by Steven L. Baur
  6246. Org-mode recognizes numerical footnotes as provided by this package
  6247. (@pxref{Footnotes}).
  6248. @end table
  6249. @node Conflicts, , Cooperation, Interaction
  6250. @subsection Packages that lead to conflicts with Org-mode
  6251. @table @asis
  6252. @cindex @file{allout.el}
  6253. @item @file{allout.el} by Ken Manheimer
  6254. Startup of Org-mode may fail with the error message
  6255. @code{(wrong-type-argument keymapp nil)} when there is an outdated
  6256. version @file{allout.el} on the load path, for example the version
  6257. distributed with Emacs 21.x. Upgrade to Emacs 22 and this problem will
  6258. disappear. If for some reason you cannot do this, make sure that org.el
  6259. is loaded @emph{before} @file{allout.el}, for example by putting
  6260. @code{(require 'org)} early enough into your @file{.emacs} file.
  6261. @cindex @file{CUA.el}
  6262. @item @file{CUA.el} by Kim. F. Storm
  6263. Keybindings in Org-mode conflict with the @kbd{S-<cursor>} keys
  6264. used by CUA-mode (as well as pc-select-mode and s-region-mode) to
  6265. select and extend the region. If you want to use one of these
  6266. packages along with Org-mode, configure the variable
  6267. @code{org-CUA-compatible}. When set, Org-mode will move the following
  6268. keybindings in Org-mode files, and in the agenda buffer (but not
  6269. during date selection).
  6270. @example
  6271. S-UP -> M-p S-DOWN -> M-n
  6272. S-LEFT -> M-- S-RIGHT -> M-+
  6273. @end example
  6274. Yes, these are unfortunately more difficult to remember. If you want
  6275. to have other replacement keys, look at the variable
  6276. @code{org-disputed-keys}.
  6277. @item @file{windmove.el} by Hovav Shacham
  6278. @cindex @file{windmove.el}
  6279. Also this package uses the @kbd{S-<cursor>} keys, so everything written
  6280. in the paragraph above about CUA mode also applies here.
  6281. @cindex @file{footnote.el}
  6282. @item @file{footnote.el} by Steven L. Baur
  6283. Org-mode supports the syntax of the footnote package, but only the
  6284. numerical footnote markers. Also, the default key for footnote
  6285. commands, @kbd{C-c !} is already used by Org-mode. You could use the
  6286. variable @code{footnote-prefix} to switch footnotes commands to another
  6287. key. Or, you could use @code{org-replace-disputed-keys} and
  6288. @code{org-disputed-keys} to change the settings in Org-mode.
  6289. @end table
  6290. @node Bugs, , Interaction, Miscellaneous
  6291. @section Bugs
  6292. @cindex bugs
  6293. Here is a list of things that should work differently, but which I
  6294. have found too hard to fix.
  6295. @itemize @bullet
  6296. @item
  6297. If a table field starts with a link, and if the corresponding table
  6298. column is narrowed (@pxref{Narrow columns}) to a width too small to
  6299. display the link, the field would look entirely empty even though it is
  6300. not. To prevent this, Org-mode throws an error. The work-around is to
  6301. make the column wide enough to fit the link, or to add some text (at
  6302. least 2 characters) before the link in the same field.
  6303. @item
  6304. Narrowing table columns does not work on XEmacs, because the
  6305. @code{format} function does not transport text properties.
  6306. @item
  6307. Text in an entry protected with the @samp{QUOTE} keyword should not
  6308. autowrap.
  6309. @item
  6310. When the application called by @kbd{C-c C-o} to open a file link fails
  6311. (for example because the application does not exist or refuses to open
  6312. the file), it does so silently. No error message is displayed.
  6313. @item
  6314. Recalculating a table line applies the formulas from left to right.
  6315. If a formula uses @emph{calculated} fields further down the row,
  6316. multiple recalculation may be needed to get all fields consistent. You
  6317. may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
  6318. recalculate until convergence.
  6319. @item
  6320. A single letter cannot be made bold, for example @samp{*a*}.
  6321. @item
  6322. The exporters work well, but could be made more efficient.
  6323. @end itemize
  6324. @node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
  6325. @appendix Extensions, Hooks and Hacking
  6326. This appendix lists extensions for Org-mode written by other authors.
  6327. It also covers some aspects where users can extend the functionality of
  6328. Org-mode.
  6329. @menu
  6330. * Extensions:: Existing 3rd-part extensions
  6331. * Adding hyperlink types:: New custom link types
  6332. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  6333. * Dynamic blocks:: Automatically filled blocks
  6334. * Special agenda views:: Customized views
  6335. * Using the property API:: Writing programs that use entry properties
  6336. @end menu
  6337. @node Extensions, Adding hyperlink types, Extensions and Hacking, Extensions and Hacking
  6338. @section Third-party extensions for Org-mode
  6339. @cindex extension, third-party
  6340. The following extensions for Org-mode have been written by other people:
  6341. @table @asis
  6342. @cindex @file{org-publish.el}
  6343. @item @file{org-publish.el} by David O'Toole
  6344. This package provides facilities for publishing related sets of Org-mode
  6345. files together with linked files like images as webpages. It is
  6346. highly configurable and can be used for other publishing purposes as
  6347. well. As of Org-mode version 4.30, @file{org-publish.el} is part of the
  6348. Org-mode distribution. It is not yet part of Emacs, however, a delay
  6349. caused by the preparations for the 22.1 release. In the mean time,
  6350. @file{org-publish.el} can be downloaded from David's site:
  6351. @url{http://dto.freeshell.org/e/org-publish.el}.
  6352. @cindex @file{org-mouse.el}
  6353. @item @file{org-mouse.el} by Piotr Zielinski
  6354. This package implements extended mouse functionality for Org-mode. It
  6355. allows you to cycle visibility and to edit the document structure with
  6356. the mouse. Best of all, it provides a context-sensitive menu on
  6357. @key{mouse-3} that changes depending on the context of a mouse-click.
  6358. As of Org-mode version 4.53, @file{org-mouse.el} is part of the
  6359. Org-mode distribution. It is not yet part of Emacs, however, a delay
  6360. caused by the preparations for the 22.1 release. In the mean time,
  6361. @file{org-mouse.el} can be downloaded from Piotr's site:
  6362. @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
  6363. @cindex @file{org-blog.el}
  6364. @item @file{org-blog.el} by David O'Toole
  6365. A blogging plug-in for @file{org-publish.el}.@*
  6366. @url{http://dto.freeshell.org/notebook/OrgMode.html}.
  6367. @cindex @file{blorg.el}
  6368. @item @file{blorg.el} by Bastien Guerry
  6369. Publish Org-mode files as
  6370. blogs. @url{http://www.cognition.ens.fr/~guerry/blorg.html}.
  6371. @cindex @file{org2rem.el}
  6372. @item @file{org2rem.el} by Bastien Guerry
  6373. Translates Org-mode files into something readable by
  6374. Remind. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
  6375. @item @file{org-toc.el} by Bastien Guerry
  6376. Produces a simple table of contents of an Org-mode file, for easy
  6377. navigation. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
  6378. @item @file{org-registry.el} by Bastien Guerry
  6379. Find which Org-file link to a certain document.
  6380. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
  6381. @end table
  6382. @page
  6383. @node Adding hyperlink types, Tables in arbitrary syntax, Extensions, Extensions and Hacking
  6384. @section Adding hyperlink types
  6385. @cindex hyperlinks, adding new types
  6386. Org-mode has a large number of hyperlink types built-in
  6387. (@pxref{Hyperlinks}). If you would like to add new link types, it
  6388. provides an interface for doing so. Lets look at an example file
  6389. @file{org-man.el} that will add support for creating links like
  6390. @samp{[[man:printf][The printf manpage]]} to show unix manual pages inside
  6391. emacs:
  6392. @lisp
  6393. ;;; org-man.el - Support for links to manpages in Org-mode
  6394. (require 'org)
  6395. (org-add-link-type "man" 'org-man-open)
  6396. (add-hook 'org-store-link-functions 'org-man-store-link)
  6397. (defcustom org-man-command 'man
  6398. "The Emacs command to be used to display a man page."
  6399. :group 'org-link
  6400. :type '(choice (const man) (const woman)))
  6401. (defun org-man-open (path)
  6402. "Visit the manpage on PATH.
  6403. PATH should be a topic that can be thrown at the man command."
  6404. (funcall org-man-command path))
  6405. (defun org-man-store-link ()
  6406. "Store a link to a manpage."
  6407. (when (memq major-mode '(Man-mode woman-mode))
  6408. ;; This is a man page, we do make this link
  6409. (let* ((page (org-man-get-page-name))
  6410. (link (concat "man:" page))
  6411. (description (format "Manpage for %s" page)))
  6412. (org-store-link-props
  6413. :type "man"
  6414. :link link
  6415. :description description))))
  6416. (defun org-man-get-page-name ()
  6417. "Extract the page name from the buffer name."
  6418. ;; This works for both `Man-mode' and `woman-mode'.
  6419. (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
  6420. (match-string 1 (buffer-name))
  6421. (error "Cannot create link to this man page")))
  6422. (provide 'org-man)
  6423. ;;; org-man.el ends here
  6424. @end lisp
  6425. @noindent
  6426. You would activate this new link type in @file{.emacs} with
  6427. @lisp
  6428. (require 'org-man)
  6429. @end lisp
  6430. @noindent
  6431. Lets go through the file and see what it does.
  6432. @enumerate
  6433. @item
  6434. It does @code{(require 'org)} to make sure that @file{org.el} has been
  6435. loaded.
  6436. @item
  6437. The next line calls @code{org-add-link-type} to define a new link type
  6438. with prefix @samp{man}. The call also contains the name of a function
  6439. that will be called to follow such a link.
  6440. @item
  6441. The next line adds a function to @code{org-store-link-functions}, in
  6442. order to allow the command @kbd{C-c l} to record a useful link in a
  6443. buffer displaying a man page.
  6444. @end enumerate
  6445. The rest of the file defines the necessary variables and functions.
  6446. First there is a customization variable that determines which emacs
  6447. command should be used to display manpages. There are two options,
  6448. @code{man} and @code{woman}. Then the function to follow a link is
  6449. defined. It gets the link path as an argument - in this case the link
  6450. path is just a topic for the manual command. The function calls the
  6451. value of @code{org-man-command} to display the man page.
  6452. Finally the function @code{org-man-store-link} is defined. When you try
  6453. to store a link with @kbd{C-c l}, also this function will be called to
  6454. try to make a link. The function must first decide if it is supposed to
  6455. create the link for this buffer type, we do this by checking the value
  6456. of the variable @code{major-mode}. If not, the function must exit and
  6457. retunr the value @code{nil}. If yes, the link is created by getting the
  6458. manual tpoic from the buffer name and prefixing it with the string
  6459. @samp{man:}. Then it must call the command @code{org-store-link-props}
  6460. and set the @code{:type} and @code{:link} properties. Optionally you
  6461. can also set the @code{:description} property to provide a default for
  6462. the link description when the link is later inserted into tan Org-mode
  6463. buffer with @kbd{C-c C-l}.
  6464. @node Tables in arbitrary syntax, Dynamic blocks, Adding hyperlink types, Extensions and Hacking
  6465. @section Tables in arbitrary syntax
  6466. @cindex tables, in other modes
  6467. @cindex orgtbl-mode
  6468. Since Orgtbl-mode can be used as a minor mode in arbitrary buffers, a
  6469. frequent feature request has been to make it work with native tables in
  6470. specific languages, for example La@TeX{}. However, this is extremely hard
  6471. to do in a general way, would lead to a customization nightmare, and
  6472. would take away much of the simplicity of the Orgtbl-mode table editor.
  6473. This appendix describes a different approach. We keep the Orgtbl-mode
  6474. table in its native format (the @i{source table}), and use a custom
  6475. function to @i{translate} the table to the correct syntax, and to
  6476. @i{install} it in the right location (the @i{target table}). This puts
  6477. the burden of writing conversion functions on the user, but it allows
  6478. for a very flexible system.
  6479. @menu
  6480. * Radio tables:: Sending and receiving
  6481. * A LaTeX example:: Step by step, almost a tutorial
  6482. * Translator functions:: Copy and modify
  6483. @end menu
  6484. @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
  6485. @subsection Radio tables
  6486. @cindex radio tables
  6487. To define the location of the target table, you first need to create two
  6488. lines that are comments in the current mode, but contain magic words for
  6489. Orgtbl-mode to find. Orgtbl-mode will insert the translated table
  6490. between these lines, replacing whatever was there before. For example:
  6491. @example
  6492. /* BEGIN RECEIVE ORGTBL table_name */
  6493. /* END RECEIVE ORGTBL table_name */
  6494. @end example
  6495. @noindent
  6496. Just above the source table, we put a special line that tells
  6497. Orgtbl-mode how to translate this table and where to install it. For
  6498. example:
  6499. @example
  6500. #+ORGTBL: SEND table_name translation_function arguments....
  6501. @end example
  6502. @noindent
  6503. @code{table_name} is the reference name for the table that is also used
  6504. in the receiver lines. @code{translation_function} is the Lisp function
  6505. that does the translation. Furthermore, the line can contain a list of
  6506. arguments (alternating key and value) at the end. The arguments will be
  6507. passed as a property list to the translation function for
  6508. interpretation. A few standard parameters are already recognized and
  6509. acted upon before the translation function is called:
  6510. @table @code
  6511. @item :skip N
  6512. Skip the first N lines of the table. Hlines do count!
  6513. @item :skipcols (n1 n2 ...)
  6514. List of columns that should be skipped. If the table has a column with
  6515. calculation marks, that column is automatically discarded as well.
  6516. Please note that the translator function sees the table @emph{after} the
  6517. removal of these columns, the function never knows that there have been
  6518. additional columns.
  6519. @end table
  6520. @noindent
  6521. The one problem remaining is how to keep the source table in the buffer
  6522. without disturbing the normal workings of the file, for example during
  6523. compilation of a C file or processing of a La@TeX{} file. There are a
  6524. number of different solutions:
  6525. @itemize @bullet
  6526. @item
  6527. The table could be placed in a block comment if that is supported by the
  6528. language. For example, in C-mode you could wrap the table between
  6529. @samp{/*} and @samp{*/} lines.
  6530. @item
  6531. Sometimes it is possible to put the table after some kind of @i{END}
  6532. statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
  6533. in La@TeX{}.
  6534. @item
  6535. You can just comment the table line by line whenever you want to process
  6536. the file, and uncomment it whenever you need to edit the table. This
  6537. only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
  6538. make this comment-toggling very easy, in particular if you bind it to a
  6539. key.
  6540. @end itemize
  6541. @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
  6542. @subsection A LaTeX example
  6543. @cindex LaTeX, and orgtbl-mode
  6544. The best way to wrap the source table in La@TeX{} is to use the
  6545. @code{comment} environment provided by @file{comment.sty}. It has to be
  6546. activated by placing @code{\usepackage@{comment@}} into the document
  6547. header. Orgtbl-mode can insert a radio table skeleton@footnote{By
  6548. default this works only for La@TeX{}, HTML, and TeXInfo. Configure the
  6549. variable @code{orgtbl-radio-tables} to install templates for other
  6550. modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
  6551. be prompted for a table name, lets say we use @samp{salesfigures}. You
  6552. will then get the following template:
  6553. @example
  6554. % BEGIN RECEIVE ORGTBL salesfigures
  6555. % END RECEIVE ORGTBL salesfigures
  6556. \begin@{comment@}
  6557. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  6558. | | |
  6559. \end@{comment@}
  6560. @end example
  6561. @noindent
  6562. The @code{#+ORGTBL: SEND} line tells orgtbl-mode to use the function
  6563. @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
  6564. into the receiver location with name @code{salesfigures}. You may now
  6565. fill in the table, feel free to use the spreadsheet features@footnote{If
  6566. the @samp{#+TBLFM} line contains an odd number of dollar characters,
  6567. this may cause problems with font-lock in latex-mode. As shown in the
  6568. example you can fix this by adding an extra line inside the
  6569. @code{comment} environment that is used to balance the dollar
  6570. expressions. If you are using AUCTeX with the font-latex library, a
  6571. much better solution is to add the @code{comment} environment to the
  6572. variable @code{LaTeX-verbatim-environments}.}:
  6573. @example
  6574. % BEGIN RECEIVE ORGTBL salesfigures
  6575. % END RECEIVE ORGTBL salesfigures
  6576. \begin@{comment@}
  6577. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  6578. | Month | Days | Nr sold | per day |
  6579. |-------+------+---------+---------|
  6580. | Jan | 23 | 55 | 2.4 |
  6581. | Feb | 21 | 16 | 0.8 |
  6582. | March | 22 | 278 | 12.6 |
  6583. #+TBLFM: $4=$3/$2;%.1f
  6584. % $ (optional extra dollar to keep font-lock happy, see footnote)
  6585. \end@{comment@}
  6586. @end example
  6587. @noindent
  6588. When you are done, press @kbd{C-c C-c} in the table to get the converted
  6589. table inserted between the two marker lines.
  6590. Now lets assume you want to make the table header by hand, because you
  6591. want to control how columns are aligned etc. In this case we make sure
  6592. that the table translator does skip the first 2 lines of the source
  6593. table, and tell the command to work as a @i{splice}, i.e. to not produce
  6594. header and footer commands of the target table:
  6595. @example
  6596. \begin@{tabular@}@{lrrr@}
  6597. Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
  6598. % BEGIN RECEIVE ORGTBL salesfigures
  6599. % END RECEIVE ORGTBL salesfigures
  6600. \end@{tabular@}
  6601. %
  6602. \begin@{comment@}
  6603. #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
  6604. | Month | Days | Nr sold | per day |
  6605. |-------+------+---------+---------|
  6606. | Jan | 23 | 55 | 2.4 |
  6607. | Feb | 21 | 16 | 0.8 |
  6608. | March | 22 | 278 | 12.6 |
  6609. #+TBLFM: $4=$3/$2;%.1f
  6610. \end@{comment@}
  6611. @end example
  6612. The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
  6613. Orgtbl-mode. It uses a @code{tabular} environment to typeset the table
  6614. and marks horizontal lines with @code{\hline}. Furthermore, it
  6615. interprets the following parameters:
  6616. @table @code
  6617. @item :splice nil/t
  6618. When set to t, return only table body lines, don't wrap them into a
  6619. tabular environment. Default is nil.
  6620. @item :fmt fmt
  6621. A format to be used to wrap each field, should contain @code{%s} for the
  6622. original field value. For example, to wrap each field value in dollars,
  6623. you could use @code{:fmt "$%s$"}. This may also be a property list with
  6624. column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
  6625. @item :efmt efmt
  6626. Use this format to print numbers with exponentials. The format should
  6627. have @code{%s} twice for inserting mantissa and exponent, for example
  6628. @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
  6629. may also be a property list with column numbers and formats, for example
  6630. @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
  6631. @code{efmt} has been applied to a value, @code{fmt} will also be
  6632. applied.
  6633. @end table
  6634. @node Translator functions, , A LaTeX example, Tables in arbitrary syntax
  6635. @subsection Translator functions
  6636. @cindex HTML, and orgtbl-mode
  6637. @cindex translator function
  6638. Orgtbl-mode has several translator functions built-in:
  6639. @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and
  6640. @code{orgtbl-to-texinfo}. Except for @code{orgtbl-to-html}@footnote{The
  6641. HTML translator uses the same code that produces tables during HTML
  6642. export.}, these all use a generic translator, @code{orgtbl-to-generic}.
  6643. For example, @code{orgtbl-to-latex} itself is a very short function that
  6644. computes the column definitions for the @code{tabular} environment,
  6645. defines a few field and line separators and then hands over to the
  6646. generic translator. Here is the entire code:
  6647. @lisp
  6648. @group
  6649. (defun orgtbl-to-latex (table params)
  6650. "Convert the orgtbl-mode TABLE to LaTeX."
  6651. (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
  6652. org-table-last-alignment ""))
  6653. (params2
  6654. (list
  6655. :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
  6656. :tend "\\end@{tabular@}"
  6657. :lstart "" :lend " \\\\" :sep " & "
  6658. :efmt "%s\\,(%s)" :hline "\\hline")))
  6659. (orgtbl-to-generic table (org-combine-plists params2 params))))
  6660. @end group
  6661. @end lisp
  6662. As you can see, the properties passed into the function (variable
  6663. @var{PARAMS}) are combined with the ones newly defined in the function
  6664. (variable @var{PARAMS2}). The ones passed into the function (i.e. the
  6665. ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
  6666. would like to use the La@TeX{} translator, but wanted the line endings to
  6667. be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
  6668. overrule the default with
  6669. @example
  6670. #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
  6671. @end example
  6672. For a new language, you can either write your own converter function in
  6673. analogy with the La@TeX{} translator, or you can use the generic function
  6674. directly. For example, if you have a language where a table is started
  6675. with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
  6676. started with @samp{!BL!}, ended with @samp{!EL!} and where the field
  6677. separator is a TAB, you could call the generic translator like this (on
  6678. a single line!):
  6679. @example
  6680. #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
  6681. :lstart "!BL! " :lend " !EL!" :sep "\t"
  6682. @end example
  6683. @noindent
  6684. Please check the documentation string of the function
  6685. @code{orgtbl-to-generic} for a full list of parameters understood by
  6686. that function and remember that you can pass each of them into
  6687. @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
  6688. using the generic function.
  6689. Of course you can also write a completely new function doing complicated
  6690. things the generic translator cannot do. A translator function takes
  6691. two arguments. The first argument is the table, a list of lines, each
  6692. line either the symbol @code{hline} or a list of fields. The second
  6693. argument is the property list containing all parameters specified in the
  6694. @samp{#+ORGTBL: SEND} line. The function must return a single string
  6695. containing the formatted table. If you write a generally useful
  6696. translator, please post it on @code{emacs-orgmode@@gnu.org} so that
  6697. others can benefit from your work.
  6698. @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Extensions and Hacking
  6699. @section Dynamic blocks
  6700. @cindex dynamic blocks
  6701. Org-mode documents can contain @emph{dynamic blocks}. These are
  6702. specially marked regions that are updated by some user-written function.
  6703. A good example for such a block is the clock table inserted by the
  6704. command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
  6705. Dynamic block are enclosed by a BEGIN-END structure that assigns a name
  6706. to the block and can also specify parameters for the function producing
  6707. the content of the block.
  6708. @example
  6709. #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
  6710. #+END:
  6711. @end example
  6712. Dynamic blocks are updated with the following commands
  6713. @table @kbd
  6714. @kindex C-c C-x C-u
  6715. @item C-c C-x C-u
  6716. Update dynamic block at point.
  6717. @kindex C-u C-c C-x C-u
  6718. @item C-u C-c C-x C-u
  6719. Update all dynamic blocks in the current file.
  6720. @end table
  6721. Updating a dynamic block means to remove all the text between BEGIN and
  6722. END, parse the BEGIN line for parameters and then call the specific
  6723. writer function for this block to insert the new content. For a block
  6724. with name @code{myblock}, the writer function is
  6725. @code{org-dblock-write:myblock} with as only parameter a property list
  6726. with the parameters given in the begin line. Here is a trivial example
  6727. of a block that keeps track of when the block update function was last
  6728. run:
  6729. @example
  6730. #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
  6731. #+END:
  6732. @end example
  6733. @noindent
  6734. The corresponding block writer function could look like this:
  6735. @lisp
  6736. (defun org-dblock-write:block-update-time (params)
  6737. (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
  6738. (insert "Last block update at: "
  6739. (format-time-string fmt (current-time)))))
  6740. @end lisp
  6741. If you want to make sure that all dynamic blocks are always up-to-date,
  6742. you could add the function @code{org-update-all-dblocks} to a hook, for
  6743. example @code{before-save-hook}. @code{org-update-all-dblocks} is
  6744. written in a way that is does nothing in buffers that are not in Org-mode.
  6745. @node Special agenda views, Using the property API, Dynamic blocks, Extensions and Hacking
  6746. @section Special Agenda Views
  6747. @cindex agenda views, user-defined
  6748. Org-mode provides a special hook that can be used to narrow down the
  6749. selection made by any of the agenda views. You may specify a function
  6750. that is used at each match to verify if the match should indeed be part
  6751. of the agenda view, and if not, how much should be skipped.
  6752. Let's say you want to produce a list of projects that contain a WAITING
  6753. tag anywhere in the project tree. Let's further assume that you have
  6754. marked all tree headings that define a project with the todo keyword
  6755. PROJECT. In this case you would run a todo search for the keyword
  6756. PROJECT, but skip the match unless there is a WAITING tag anywhere in
  6757. the subtree belonging to the project line.
  6758. To achieve this, you must write a function that searches the subtree for
  6759. the tag. If the tag is found, the function must return @code{nil} to
  6760. indicate that this match should not be skipped. If there is no such
  6761. tag, return the location of the end of the subtree, to indicate that
  6762. search should continue from there.
  6763. @lisp
  6764. (defun my-skip-unless-waiting ()
  6765. "Skip trees that are not waiting"
  6766. (let ((subtree-end (save-excursion (org-end-of-subtree t))))
  6767. (if (re-search-forward ":WAITING:" subtree-end t)
  6768. nil ; tag found, do not skip
  6769. subtree-end))) ; tag not found, continue after end of subtree
  6770. @end lisp
  6771. Now you may use this function in an agenda custom command, for example
  6772. like this:
  6773. @lisp
  6774. (org-add-agenda-custom-command
  6775. '("b" todo "PROJECT"
  6776. ((org-agenda-skip-function 'my-org-waiting-projects)
  6777. (org-agenda-overriding-header "Projects waiting for something: "))))
  6778. @end lisp
  6779. Note that this also binds @code{org-agenda-overriding-header} to get a
  6780. meaningful header in the agenda view.
  6781. You may also put a Lisp form into @code{org-agenda-skip-function}. In
  6782. particular, you may use the functions @code{org-agenda-skip-entry-if}
  6783. and @code{org-agenda-skip-subtree-if} in this form, for example:
  6784. @table @code
  6785. @item '(org-agenda-skip-entry-if 'scheduled)
  6786. Skip current entry if it has been scheduled.
  6787. @item '(org-agenda-skip-entry-if 'notscheduled)
  6788. Skip current entry if it has not been scheduled.
  6789. @item '(org-agenda-skip-entry-if 'deadline)
  6790. Skip current entry if it has a deadline.
  6791. @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
  6792. Skip current entry if it has a deadline, or if it is scheduled.
  6793. @item '(org-agenda-skip-entry 'regexp "regular expression")
  6794. Skip current entry if the regular expression matches in the entry.
  6795. @item '(org-agenda-skip-entry 'notregexp "regular expression")
  6796. Skip current entry unless the regular expression matches.
  6797. @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
  6798. Same as above, but check and skip the entire subtree.
  6799. @end table
  6800. Therefore we could also have written the search for WAITING projects
  6801. like this, even without defining a special function:
  6802. @lisp
  6803. (org-add-agenda-custom-command
  6804. '("b" todo "PROJECT"
  6805. ((org-agenda-skip-function '(org-agenda-skip-subtree-if
  6806. 'regexp ":WAITING:"))
  6807. (org-agenda-overriding-header "Projects waiting for something: "))))
  6808. @end lisp
  6809. @node Using the property API, , Special agenda views, Extensions and Hacking
  6810. @section Using the property API
  6811. @cindex API, for properties
  6812. @cindex properties, API
  6813. Here is a description of the functions that can be used to work with
  6814. properties.
  6815. @defun org-entry-properties &optional pom which
  6816. Get all properties of the entry at point-or-marker POM.
  6817. This includes the TODO keyword, the tags, time strings for deadline,
  6818. scheduled, and clocking, and any additional properties defined in the
  6819. entry. The return value is an alist, keys may occur multiple times
  6820. if the property key was used several times.
  6821. POM may also be nil, in which case the current entry is used.
  6822. If WHICH is nil or `all', get all properties. If WHICH is
  6823. `special' or `standard', only get that subclass.
  6824. @end defun
  6825. @defun org-entry-get pom property &optional inherit
  6826. Get value of PROPERTY for entry at point-or-marker POM.
  6827. If INHERIT is non-nil and the entry does not have the property,
  6828. then also check higher levels of the hierarchy.
  6829. @end defun
  6830. @defun org-entry-delete pom property
  6831. Delete the property PROPERTY from entry at point-or-marker POM.
  6832. @end defun
  6833. @defun org-entry-put pom property value
  6834. Set PROPERTY to VALUE for entry at point-or-marker POM.
  6835. @end defun
  6836. @defun org-buffer-property-keys &optional include-specials
  6837. Get all property keys in the current buffer.
  6838. @end defun
  6839. @defun org-insert-property-drawer
  6840. Insert a property drawer at point.
  6841. @end defun
  6842. @node History and Acknowledgments, Index, Extensions and Hacking, Top
  6843. @appendix History and Acknowledgments
  6844. @cindex acknowledgments
  6845. @cindex history
  6846. @cindex thanks
  6847. Org-mode was borne in 2003, out of frustration over the user interface
  6848. of the Emacs outline-mode. I was trying to organize my notes and
  6849. projects, and using Emacs seemed to be the natural way to go. However,
  6850. having to remember eleven different commands with two or three keys per
  6851. command, only to hide and unhide parts of the outline tree, that seemed
  6852. entirely unacceptable to me. Also, when using outlines to take notes, I
  6853. constantly want to restructure the tree, organizing it parallel to my
  6854. thoughts and plans. @emph{Visibility cycling} and @emph{structure
  6855. editing} were originally implemented in the package
  6856. @file{outline-magic.el}, but quickly moved to the more general
  6857. @file{org.el}. As this environment became comfortable for project
  6858. planning, the next step was adding @emph{TODO entries}, basic @emph{time
  6859. stamps}, and @emph{table support}. These areas highlight the two main
  6860. goals that Org-mode still has today: To create a new, outline-based,
  6861. plain text mode with innovative and intuitive editing features, and to
  6862. incorporate project planning functionality directly into a notes file.
  6863. Since the first release, literally thousands of emails to me or on
  6864. @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
  6865. reports, feedback, new ideas, and sometimes patches and add-on code.
  6866. Many thanks to everyone who has helped to improve this package. I am
  6867. trying to keep here a list of the people who had significant influence
  6868. in shaping one or more aspects of Org-mode. The list may not be
  6869. complete, if I have forgotten someone, please accept my apologies and
  6870. let me know.
  6871. @itemize @bullet
  6872. @item
  6873. @i{Russel Adams} came up with the idea for drawers.
  6874. @item
  6875. @i{Thomas Baumann} contributed the code for links to the MH-E email
  6876. system.
  6877. @item
  6878. @i{Alex Bochannek} provided a patch for rounding time stamps.
  6879. @item
  6880. @i{Charles Cave}'s suggestion sparked the implementation of templates
  6881. for Remember.
  6882. @item
  6883. @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
  6884. specified time.
  6885. @item
  6886. @i{Gregory Chernov} patched support for lisp forms into table
  6887. calculations and improved XEmacs compatibility, in particular by porting
  6888. @file{nouline.el} to XEmacs.
  6889. @item
  6890. @i{Sacha Chua} suggested to copy some linking code from Planner.
  6891. @item
  6892. @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
  6893. came up with the idea of properties, and that there should be an API for
  6894. them.
  6895. @item
  6896. @i{Kees Dullemond} used to edit projects lists directly in HTML and so
  6897. inspired some of the early development, including HTML export. He also
  6898. asked for a way to narrow wide table columns.
  6899. @item
  6900. @i{Christian Egli} converted the documentation into TeXInfo format,
  6901. patched CSS formatting into the HTML exporter, and inspired the agenda.
  6902. @item
  6903. @i{David Emery} provided a patch for custom CSS support in exported
  6904. HTML agendas.
  6905. @item
  6906. @i{Nic Ferrier} contributed mailcap and XOXO support.
  6907. @item
  6908. @i{John Foerch} figured out how to make incremental search show context
  6909. around a match in a hidden outline tree.
  6910. @item
  6911. @i{Niels Giessen} had the idea to automatically archive DONE trees.
  6912. @item
  6913. @i{Bastien Guerry} wrote the La@TeX{} exporter and has been prolific
  6914. with patches, ideas, and bug reports.
  6915. to Org-mode.
  6916. @item
  6917. @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
  6918. @item
  6919. @i{Scott Jaderholm} proposed footnotes, control over whitespace between
  6920. folded entries, and column view for properties.
  6921. @item
  6922. @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
  6923. provided frequent feedback and some patches.
  6924. @item
  6925. @i{Jason F. McBrayer} suggested agenda export to CSV format.
  6926. @item
  6927. @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
  6928. basis.
  6929. @item
  6930. @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
  6931. happy.
  6932. @item
  6933. @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file.
  6934. @item
  6935. @i{Todd Neal} provided patches for links to Info files and elisp forms.
  6936. @item
  6937. @i{Tim O'Callaghan} suggested in-file links, search options for general
  6938. file links, and TAGS.
  6939. @item
  6940. @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
  6941. into Japanese.
  6942. @item
  6943. @i{Oliver Oppitz} suggested multi-state TODO items.
  6944. @item
  6945. @i{Scott Otterson} sparked the introduction of descriptive text for
  6946. links, among other things.
  6947. @item
  6948. @i{Pete Phillips} helped during the development of the TAGS feature, and
  6949. provided frequent feedback.
  6950. @item
  6951. @i{T.V. Raman} reported bugs and suggested improvements.
  6952. @item
  6953. @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
  6954. control.
  6955. @item
  6956. @i{Kevin Rogers} contributed code to access VM files on remote hosts.
  6957. @item
  6958. @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
  6959. conflict with @file{allout.el}.
  6960. @item
  6961. @i{Jason Riedy} sent a patch to fix a bug with export of TODO keywords.
  6962. @item
  6963. @i{Philip Rooke} created the Org-mode reference card and provided lots
  6964. of feedback.
  6965. @item
  6966. @i{Christian Schlauer} proposed angular brackets around links, among
  6967. other things.
  6968. @item
  6969. Linking to VM/BBDB/GNUS was inspired by @i{Tom Shannon}'s
  6970. @file{organizer-mode.el}.
  6971. @item
  6972. @i{Daniel Sinder} came up with the idea of internal archiving by locking
  6973. subtrees.
  6974. @item
  6975. @i{Dale Smith} proposed link abbreviations.
  6976. @item
  6977. @i{Adam Spiers} asked for global linking commands and inspired the link
  6978. extension system. support mairix.
  6979. @item
  6980. @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
  6981. chapter about publishing.
  6982. @item
  6983. @i{J@"urgen Vollmer} contributed code generating the table of contents
  6984. in HTML output.
  6985. @item
  6986. @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
  6987. keyword.
  6988. @item
  6989. @i{David Wainberg} suggested archiving, and improvements to the linking
  6990. system.
  6991. @item
  6992. @i{John Wiegley} wrote @file{emacs-wiki.el} and @file{planner.el}. The
  6993. development of Org-mode was fully independent, and both systems are
  6994. really different beasts in their basic ideas and implementation details.
  6995. I later looked at John's code, however, and learned from his
  6996. implementation of (i) links where the link itself is hidden and only a
  6997. description is shown, and (ii) popping up a calendar to select a date.
  6998. John has also contributed a number of great ideas directly to Org-mode.
  6999. @item
  7000. @i{Carsten Wimmer} suggested some changes and helped fix a bug in
  7001. linking to GNUS.
  7002. @item
  7003. @i{Roland Winkler} requested additional keybindings to make Org-mode
  7004. work on a tty.
  7005. @item
  7006. @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
  7007. and contributed various ideas and code snippets.
  7008. @end itemize
  7009. @node Index, Key Index, History and Acknowledgments, Top
  7010. @unnumbered Index
  7011. @printindex cp
  7012. @node Key Index, , Index, Top
  7013. @unnumbered Key Index
  7014. @printindex ky
  7015. @bye
  7016. @ignore
  7017. arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
  7018. @end ignore