org.texi 314 KB

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