org.texi 405 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167
  1. \input texinfo
  2. @c %**start of header
  3. @setfilename ../../info/org
  4. @settitle The Org Manual
  5. @set VERSION 6.15
  6. @set DATE December 2008
  7. @dircategory Emacs
  8. @direntry
  9. * Org Mode: (org). Outline-based notes management and organizer
  10. @end direntry
  11. @c Version and Contact Info
  12. @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
  13. @set AUTHOR Carsten Dominik
  14. @set MAINTAINER Carsten Dominik
  15. @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
  16. @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
  17. @c %**end of header
  18. @finalout
  19. @c Macro definitions
  20. @c Subheadings inside a table.
  21. @macro tsubheading{text}
  22. @ifinfo
  23. @subsubheading \text\
  24. @end ifinfo
  25. @ifnotinfo
  26. @item @b{\text\}
  27. @end ifnotinfo
  28. @end macro
  29. @copying
  30. This manual is for Org (version @value{VERSION}).
  31. Copyright @copyright{} 2004, 2005, 2006, 2007, 2008 Free Software Foundation
  32. @quotation
  33. Permission is granted to copy, distribute and/or modify this document
  34. under the terms of the GNU Free Documentation License, Version 1.3 or
  35. any later version published by the Free Software Foundation; with no
  36. Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
  37. and with the Back-Cover Texts as in (a) below. A copy of the license
  38. is included in the section entitled ``GNU Free Documentation License.''
  39. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  40. modify this GNU manual. Buying copies from the FSF supports it in
  41. developing GNU and promoting software freedom.''
  42. This document is part of a collection distributed under the GNU Free
  43. Documentation License. If you want to distribute this document
  44. separately from the collection, you can do so by adding a copy of the
  45. license to the document, as described in section 6 of the license.
  46. @end quotation
  47. @end copying
  48. @titlepage
  49. @title The Org Manual
  50. @subtitle Release @value{VERSION}
  51. @author by Carsten Dominik
  52. @c The following two commands start the copyright page.
  53. @page
  54. @vskip 0pt plus 1filll
  55. @insertcopying
  56. @end titlepage
  57. @c Output the table of contents at the beginning.
  58. @contents
  59. @ifnottex
  60. @node Top, Introduction, (dir), (dir)
  61. @top Org Mode Manual
  62. @insertcopying
  63. @end ifnottex
  64. @menu
  65. * Introduction:: Getting started
  66. * Document Structure:: A tree works like your brain
  67. * Tables:: Pure magic for quick formatting
  68. * Hyperlinks:: Notes in context
  69. * TODO Items:: Every tree branch can be a TODO item
  70. * Tags:: Tagging headlines and matching sets of tags
  71. * Properties and Columns:: Storing information about an entry
  72. * Dates and Times:: Making items useful for planning
  73. * Capture:: Creating tasks and attaching files
  74. * Agenda Views:: Collecting information into views
  75. * Embedded LaTeX:: LaTeX fragments and formulas
  76. * Exporting:: Sharing and publishing of notes
  77. * Publishing:: Create a web site of linked Org files
  78. * Miscellaneous:: All the rest which did not fit elsewhere
  79. * Extensions:: Add-ons for Org mode
  80. * Hacking:: How hack your way around
  81. * History and Acknowledgments:: How Org came into being
  82. * Main Index:: An index of Org's concepts and features
  83. * Key Index:: Key bindings and where they are described
  84. @detailmenu
  85. --- The Detailed Node Listing ---
  86. Introduction
  87. * Summary:: Brief summary of what Org does
  88. * Installation:: How to install a downloaded version of Org
  89. * Activation:: How to activate Org for certain buffers
  90. * Feedback:: Bug reports, ideas, patches etc.
  91. * Conventions:: Type-setting conventions in the manual
  92. Document Structure
  93. * Outlines:: Org is based on Outline mode
  94. * Headlines:: How to typeset Org tree headlines
  95. * Visibility cycling:: Show and hide, much simplified
  96. * Motion:: Jumping to other headlines
  97. * Structure editing:: Changing sequence and level of headlines
  98. * Archiving:: Move done task trees to a different place
  99. * Sparse trees:: Matches embedded in context
  100. * Plain lists:: Additional structure within an entry
  101. * Drawers:: Tucking stuff away
  102. * Orgstruct mode:: Structure editing outside Org
  103. Archiving
  104. * ARCHIVE tag:: Marking a tree as inactive
  105. * Moving subtrees:: Moving a tree to an archive file
  106. Tables
  107. * Built-in table editor:: Simple tables
  108. * Narrow columns:: Stop wasting space in tables
  109. * Column groups:: Grouping to trigger vertical lines
  110. * Orgtbl mode:: The table editor as minor mode
  111. * The spreadsheet:: The table editor has spreadsheet capabilities
  112. * Org Plot:: Plotting from org tables
  113. The spreadsheet
  114. * References:: How to refer to another field or range
  115. * Formula syntax for Calc:: Using Calc to compute stuff
  116. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  117. * Field formulas:: Formulas valid for a single field
  118. * Column formulas:: Formulas valid for an entire column
  119. * Editing and debugging formulas:: Fixing formulas
  120. * Updating the table:: Recomputing all dependent fields
  121. * Advanced features:: Field names, parameters and automatic recalc
  122. Hyperlinks
  123. * Link format:: How links in Org are formatted
  124. * Internal links:: Links to other places in the current file
  125. * External links:: URL-like links to the world
  126. * Handling links:: Creating, inserting and following
  127. * Using links outside Org:: Linking from my C source code?
  128. * Link abbreviations:: Shortcuts for writing complex links
  129. * Search options:: Linking to a specific location
  130. * Custom searches:: When the default search is not enough
  131. Internal links
  132. * Radio targets:: Make targets trigger links in plain text
  133. TODO Items
  134. * TODO basics:: Marking and displaying TODO entries
  135. * TODO extensions:: Workflow and assignments
  136. * Progress logging:: Dates and notes for progress
  137. * Priorities:: Some things are more important than others
  138. * Breaking down tasks:: Splitting a task into manageable pieces
  139. * Checkboxes:: Tick-off lists
  140. Extended use of TODO keywords
  141. * Workflow states:: From TODO to DONE in steps
  142. * TODO types:: I do this, Fred does the rest
  143. * Multiple sets in one file:: Mixing it all, and still finding your way
  144. * Fast access to TODO states:: Single letter selection of a state
  145. * Per-file keywords:: Different files, different requirements
  146. * Faces for TODO keywords:: Highlighting states
  147. Progress logging
  148. * Closing items:: When was this entry marked DONE?
  149. * Tracking TODO state changes:: When did the status change?
  150. Tags
  151. * Tag inheritance:: Tags use the tree structure of the outline
  152. * Setting tags:: How to assign tags to a headline
  153. * Tag searches:: Searching for combinations of tags
  154. Properties and Columns
  155. * Property syntax:: How properties are spelled out
  156. * Special properties:: Access to other Org mode features
  157. * Property searches:: Matching property values
  158. * Property inheritance:: Passing values down the tree
  159. * Column view:: Tabular viewing and editing
  160. * Property API:: Properties for Lisp programmers
  161. Column view
  162. * Defining columns:: The COLUMNS format property
  163. * Using column view:: How to create and use column view
  164. * Capturing column view:: A dynamic block for column view
  165. Defining columns
  166. * Scope of column definitions:: Where defined, where valid?
  167. * Column attributes:: Appearance and content of a column
  168. Dates and Times
  169. * Timestamps:: Assigning a time to a tree entry
  170. * Creating timestamps:: Commands which insert timestamps
  171. * Deadlines and scheduling:: Planning your work
  172. * Clocking work time:: Tracking how long you spend on a task
  173. * Effort estimates:: Planning work effort in advance
  174. * Relative timer:: Notes with a running timer
  175. Creating timestamps
  176. * The date/time prompt:: How Org mode helps you entering date and time
  177. * Custom time format:: Making dates look different
  178. Deadlines and scheduling
  179. * Inserting deadline/schedule:: Planning items
  180. * Repeated tasks:: Items that show up again and again
  181. Capture
  182. * Remember:: Capture new tasks/ideas with little interruption
  183. * Attachments:: Add files to tasks.
  184. Remember
  185. * Setting up Remember:: Some code for .emacs to get things going
  186. * Remember templates:: Define the outline of different note types
  187. * Storing notes:: Directly get the note to where it belongs
  188. * Refiling notes:: Moving a note or task to a project
  189. Agenda Views
  190. * Agenda files:: Files being searched for agenda information
  191. * Agenda dispatcher:: Keyboard access to agenda views
  192. * Built-in agenda views:: What is available out of the box?
  193. * Presentation and sorting:: How agenda items are prepared for display
  194. * Agenda commands:: Remote editing of Org trees
  195. * Custom agenda views:: Defining special searches and views
  196. * Agenda column view:: Using column view for collected entries
  197. The built-in agenda views
  198. * Weekly/daily agenda:: The calendar page with current tasks
  199. * Global TODO list:: All unfinished action items
  200. * Matching tags and properties:: Structured information with fine-tuned search
  201. * Timeline:: Time-sorted view for single file
  202. * Keyword search:: Finding entries by keyword
  203. * Stuck projects:: Find projects you need to review
  204. Presentation and sorting
  205. * Categories:: Not all tasks are equal
  206. * Time-of-day specifications:: How the agenda knows the time
  207. * Sorting of agenda items:: The order of things
  208. Custom agenda views
  209. * Storing searches:: Type once, use often
  210. * Block agenda:: All the stuff you need in a single buffer
  211. * Setting Options:: Changing the rules
  212. * Exporting Agenda Views:: Writing agendas to files
  213. * Using the agenda elsewhere:: Using agenda information in other programs
  214. Embedded LaTeX
  215. * Math symbols:: TeX macros for symbols and Greek letters
  216. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  217. * LaTeX fragments:: Complex formulas made easy
  218. * Processing LaTeX fragments:: Previewing LaTeX processing
  219. * CDLaTeX mode:: Speed up entering of formulas
  220. Exporting
  221. * Markup rules:: Which structures are recognized?
  222. * Selective export:: Using tags to select and exclude trees
  223. * Export options:: Per-file export settings
  224. * The export dispatcher:: How to access exporter commands
  225. * ASCII export:: Exporting to plain ASCII
  226. * HTML export:: Exporting to HTML
  227. * LaTeX and PDF export:: Exporting to LaTeX, and processing to PDF
  228. * XOXO export:: Exporting to XOXO
  229. * iCalendar export:: Exporting in iCalendar format
  230. Markup rules
  231. * Document title:: How the document title is determined
  232. * Headings and sections:: The main structure of the exported document
  233. * Table of contents:: If, where, how to create a table of contents
  234. * Initial text:: Text before the first headline
  235. * Lists:: Plain lists are exported
  236. * Paragraphs:: What determines beginning and ending
  237. * Literal examples:: Source code and other examples
  238. * Include files:: Include the contents of a file during export
  239. * Tables exported:: Tables are exported richly
  240. * Inlined images:: How to inline images during export
  241. * Footnotes:: Numbers like [1]
  242. * Emphasis and monospace:: To bold or not to bold
  243. * TeX macros and LaTeX fragments:: Create special, rich export.
  244. * Horizontal rules:: A line across the page
  245. * Comment lines:: Some lines will not be exported
  246. HTML export
  247. * HTML Export commands:: How to invoke HTML export
  248. * Quoting HTML tags:: Using direct HTML in Org mode
  249. * Links:: Transformation of links for HTML
  250. * Images in HTML export::
  251. * CSS support:: Changing the appearance of the output
  252. * Javascript support:: Info and Folding in a web browser
  253. LaTeX and PDF export
  254. * LaTeX/PDF export commands:: Which key invode which commands
  255. * Quoting LaTeX code:: Incorporating literal LaTeX code
  256. * Sectioning structure:: Changing sectioning in LaTeX output
  257. * Tables in LaTeX export:: Options for exporting tables to LaTeX
  258. * Images in LaTeX export:: How to insert figures into LaTeX output
  259. Publishing
  260. * Configuration:: Defining projects
  261. * Sample configuration:: Example projects
  262. * Triggering publication:: Publication commands
  263. Configuration
  264. * Project alist:: The central configuration variable
  265. * Sources and destinations:: From here to there
  266. * Selecting files:: What files are part of the project?
  267. * Publishing action:: Setting the function doing the publishing
  268. * Publishing options:: Tweaking HTML export
  269. * Publishing links:: Which links keep working after publishing?
  270. * Project page index:: Publishing a list of project files
  271. Sample configuration
  272. * Simple example:: One-component publishing
  273. * Complex example:: A multi-component publishing example
  274. Miscellaneous
  275. * Completion:: M-TAB knows what you need
  276. * Customization:: Adapting Org to your taste
  277. * In-buffer settings:: Overview of the #+KEYWORDS
  278. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  279. * Clean view:: Getting rid of leading stars in the outline
  280. * TTY keys:: Using Org on a tty
  281. * Interaction:: Other Emacs packages
  282. * Bugs:: Things which do not work perfectly
  283. Interaction with other packages
  284. * Cooperation:: Packages Org cooperates with
  285. * Conflicts:: Packages that lead to conflicts
  286. Extensions
  287. * Extensions in the contrib directory:: These come with the Org distro
  288. * Other extensions:: These you have to find on the web.
  289. Hacking
  290. * Adding hyperlink types:: New custom link types
  291. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  292. * Dynamic blocks:: Automatically filled blocks
  293. * Special agenda views:: Customized views
  294. * Using the property API:: Writing programs that use entry properties
  295. * Using the mapping API:: Mapping over all or selected entries
  296. Tables and lists in arbitrary syntax
  297. * Radio tables:: Sending and receiving
  298. * A LaTeX example:: Step by step, almost a tutorial
  299. * Translator functions:: Copy and modify
  300. * Radio lists:: Doing the same for lists
  301. @end detailmenu
  302. @end menu
  303. @node Introduction, Document Structure, Top, Top
  304. @chapter Introduction
  305. @cindex introduction
  306. @menu
  307. * Summary:: Brief summary of what Org does
  308. * Installation:: How to install a downloaded version of Org
  309. * Activation:: How to activate Org for certain buffers
  310. * Feedback:: Bug reports, ideas, patches etc.
  311. * Conventions:: Type-setting conventions in the manual
  312. @end menu
  313. @node Summary, Installation, Introduction, Introduction
  314. @section Summary
  315. @cindex summary
  316. Org is a mode for keeping notes, maintaining TODO lists, and doing
  317. project planning with a fast and effective plain-text system.
  318. Org develops organizational tasks around NOTES files that contain
  319. lists or information about projects as plain text. Org is
  320. implemented on top of Outline mode, which makes it possible to keep the
  321. content of large files well structured. Visibility cycling and
  322. structure editing help to work with the tree. Tables are easily created
  323. with a built-in table editor. Org supports TODO items, deadlines,
  324. time stamps, and scheduling. It dynamically compiles entries into an
  325. agenda that utilizes and smoothly integrates much of the Emacs calendar
  326. and diary. Plain text URL-like links connect to websites, emails,
  327. Usenet messages, BBDB entries, and any files related to the projects.
  328. For printing and sharing of notes, an Org file can be exported as a
  329. structured ASCII file, as HTML, or (TODO and agenda items only) as an
  330. iCalendar file. It can also serve as a publishing tool for a set of
  331. linked web pages.
  332. An important design aspect that distinguishes Org from for example
  333. Planner/Muse is that it encourages to store every piece of information
  334. only once. In Planner, you have project pages, day pages and possibly
  335. other files, duplicating some information such as tasks. In Org,
  336. you only have notes files. In your notes you mark entries as tasks,
  337. label them with tags and timestamps. All necessary lists like a
  338. schedule for the day, the agenda for a meeting, tasks lists selected by
  339. tags etc are created dynamically when you need them.
  340. Org keeps simple things simple. When first fired up, it should
  341. feel like a straightforward, easy to use outliner. Complexity is not
  342. imposed, but a large amount of functionality is available when you need
  343. it. Org is a toolbox and can be used in different ways, for
  344. example as:
  345. @example
  346. @r{@bullet{} outline extension with visibility cycling and structure editing}
  347. @r{@bullet{} ASCII system and table editor for taking structured notes}
  348. @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
  349. @r{@bullet{} TODO list editor}
  350. @r{@bullet{} full agenda and planner with deadlines and work scheduling}
  351. @r{@bullet{} environment to implement David Allen's GTD system}
  352. @r{@bullet{} a basic database application}
  353. @r{@bullet{} simple hypertext system, with HTML and LaTeX export}
  354. @r{@bullet{} publishing tool to create a set of interlinked webpages}
  355. @end example
  356. Org's automatic, context sensitive table editor with spreadsheet
  357. capabilities can be integrated into any major mode by activating the
  358. minor Orgtbl mode. Using a translation step, it can be used to maintain
  359. tables in arbitrary file types, for example in La@TeX{}. The structure
  360. editing and list creation capabilities can be used outside Org with
  361. the minor Orgstruct mode.
  362. @cindex FAQ
  363. There is a website for Org which provides links to the newest
  364. version of Org, as well as additional information, frequently asked
  365. questions (FAQ), links to tutorials etc. This page is located at
  366. @uref{http://orgmode.org}.
  367. @page
  368. @node Installation, Activation, Summary, Introduction
  369. @section Installation
  370. @cindex installation
  371. @cindex XEmacs
  372. @b{Important:} @i{If Org is part of the Emacs distribution or an
  373. XEmacs package, please skip this section and go directly to
  374. @ref{Activation}.}
  375. If you have downloaded Org from the Web, either as a distribution @file{.zip}
  376. or @file{.tar} file, or as a GIT archive, you must take the following steps
  377. to install it: Go into the unpacked Org distribution directory and edit the
  378. top section of the file @file{Makefile}. You must set the name of the Emacs
  379. binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
  380. directories where local Lisp and Info files are kept. If you don't have
  381. access to the system-wide directories, you can simply run Org directly from
  382. the distribution directory by adding the @file{lisp} subdirectory to the
  383. Emacs load path. To do this, add the following line to @file{.emacs}:
  384. @example
  385. (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
  386. @end example
  387. @noindent
  388. If you plan to use code from the @file{contrib} subdirectory, do a similar
  389. step for this directory:
  390. @example
  391. (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
  392. @end example
  393. @b{XEmacs users now need to install the file @file{noutline.el} from
  394. the @file{xemacs} sub-directory of the Org distribution. Use the
  395. command:}
  396. @example
  397. @b{make install-noutline}
  398. @end example
  399. @noindent Now byte-compile the Lisp files with the shell command:
  400. @example
  401. make
  402. @end example
  403. @noindent If you are running Org from the distribution directory, this is
  404. all. If you want to install into the system directories, use
  405. @example
  406. make install
  407. make install-info
  408. @end example
  409. @noindent Then add to @file{.emacs}:
  410. @lisp
  411. ;; This line only if Org is not part of the X/Emacs distribution.
  412. (require 'org-install)
  413. @end lisp
  414. @node Activation, Feedback, Installation, Introduction
  415. @section Activation
  416. @cindex activation
  417. @cindex autoload
  418. @cindex global key bindings
  419. @cindex key bindings, global
  420. @iftex
  421. @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
  422. PDF documentation as viewed by some PDF viewers to your .emacs file, the
  423. single quote character comes out incorrectly and the code will not work.
  424. You need to fix the single quotes by hand, or copy from Info
  425. documentation.}
  426. @end iftex
  427. Add the following lines to your @file{.emacs} file. The last three lines
  428. define @emph{global} keys for the commands @command{org-store-link},
  429. @command{org-agenda}, and @command{org-iswitchb} - please choose suitable
  430. keys yourself.
  431. @lisp
  432. ;; The following lines are always needed. Choose your own keys.
  433. (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  434. (global-set-key "\C-cl" 'org-store-link)
  435. (global-set-key "\C-ca" 'org-agenda)
  436. (global-set-key "\C-cb" 'org-iswitchb)
  437. @end lisp
  438. Furthermore, you must activate @code{font-lock-mode} in Org
  439. buffers, because significant functionality depends on font-locking being
  440. active. You can do this with either one of the following two lines
  441. (XEmacs user must use the second option):
  442. @lisp
  443. (global-font-lock-mode 1) ; for all buffers
  444. (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
  445. @end lisp
  446. @cindex Org mode, turning on
  447. With this setup, all files with extension @samp{.org} will be put
  448. into Org mode. As an alternative, make the first line of a file look
  449. like this:
  450. @example
  451. MY PROJECTS -*- mode: org; -*-
  452. @end example
  453. @noindent which will select Org mode for this buffer no matter what
  454. the file's name is. See also the variable
  455. @code{org-insert-mode-line-in-empty-file}.
  456. @node Feedback, Conventions, Activation, Introduction
  457. @section Feedback
  458. @cindex feedback
  459. @cindex bug reports
  460. @cindex maintainer
  461. @cindex author
  462. If you find problems with Org, or if you have questions, remarks, or ideas
  463. about it, please mail to the Org mailing list @code{emacs-orgmode@@gnu.org}.
  464. If you are not a member of the mailing list, your mail will be reviewed by a
  465. moderator and then passed through to the list.
  466. For bug reports, please provide as much information as possible,
  467. including the version information of Emacs (@kbd{C-h v emacs-version
  468. @key{RET}}) and Org (@kbd{C-h v org-version @key{RET}}), as well as
  469. the Org related setup in @file{.emacs}. If an error occurs, a
  470. backtrace can be very useful (see below on how to create one). Often a
  471. small example file helps, along with clear information about:
  472. @enumerate
  473. @item What exactly did you do?
  474. @item What did you expect to happen?
  475. @item What happened instead?
  476. @end enumerate
  477. @noindent Thank you for helping to improve this mode.
  478. @subsubheading How to create a useful backtrace
  479. @cindex backtrace of an error
  480. If working with Org produces an error with a message you don't
  481. understand, you may have hit a bug. The best way to report this is by
  482. providing, in addition to what was mentioned above, a @emph{Backtrace}.
  483. This is information from the built-in debugger about where and how the
  484. error occurred. Here is how to produce a useful backtrace:
  485. @enumerate
  486. @item
  487. Start a fresh Emacs or XEmacs, and make sure that it will load the
  488. original Lisp code in @file{org.el} instead of the compiled version in
  489. @file{org.elc}. The backtrace contains much more information if it is
  490. produced with uncompiled code. To do this, either rename @file{org.elc}
  491. to something else before starting Emacs, or ask Emacs explicitly to load
  492. @file{org.el} by using the command line
  493. @example
  494. emacs -l /path/to/org.el
  495. @end example
  496. @item
  497. Go to the @code{Options} menu and select @code{Enter Debugger on Error}
  498. (XEmacs has this option in the @code{Troubleshooting} sub-menu).
  499. @item
  500. Do whatever you have to do to hit the error. Don't forget to
  501. document the steps you take.
  502. @item
  503. When you hit the error, a @file{*Backtrace*} buffer will appear on the
  504. screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
  505. attach it to your bug report.
  506. @end enumerate
  507. @node Conventions, , Feedback, Introduction
  508. @section Typesetting conventions used in this manual
  509. Org uses three types of keywords: TODO keywords, tags, and property
  510. names. In this manual we use the following conventions:
  511. @table @code
  512. @item TODO
  513. @itemx WAITING
  514. TODO keywords are written with all capitals, even if they are
  515. user-defined.
  516. @item boss
  517. @itemx ARCHIVE
  518. User-defined tags are written in lowercase; built-in tags with special
  519. meaning are written with all capitals.
  520. @item Release
  521. @itemx PRIORITY
  522. User-defined properties are capitalized; built-in properties with
  523. special meaning are written with all capitals.
  524. @end table
  525. @node Document Structure, Tables, Introduction, Top
  526. @chapter Document Structure
  527. @cindex document structure
  528. @cindex structure of document
  529. Org is based on outline mode and provides flexible commands to
  530. edit the structure of the document.
  531. @menu
  532. * Outlines:: Org is based on Outline mode
  533. * Headlines:: How to typeset Org tree headlines
  534. * Visibility cycling:: Show and hide, much simplified
  535. * Motion:: Jumping to other headlines
  536. * Structure editing:: Changing sequence and level of headlines
  537. * Archiving:: Move done task trees to a different place
  538. * Sparse trees:: Matches embedded in context
  539. * Plain lists:: Additional structure within an entry
  540. * Drawers:: Tucking stuff away
  541. * Orgstruct mode:: Structure editing outside Org
  542. @end menu
  543. @node Outlines, Headlines, Document Structure, Document Structure
  544. @section Outlines
  545. @cindex outlines
  546. @cindex Outline mode
  547. Org is implemented on top of Outline mode. Outlines allow a
  548. document to be organized in a hierarchical structure, which (at least
  549. for me) is the best representation of notes and thoughts. An overview
  550. of this structure is achieved by folding (hiding) large parts of the
  551. document to show only the general document structure and the parts
  552. currently being worked on. Org greatly simplifies the use of
  553. outlines by compressing the entire show/hide functionality into a single
  554. command @command{org-cycle}, which is bound to the @key{TAB} key.
  555. @node Headlines, Visibility cycling, Outlines, Document Structure
  556. @section Headlines
  557. @cindex headlines
  558. @cindex outline tree
  559. Headlines define the structure of an outline tree. The headlines in
  560. Org start with one or more stars, on the left margin@footnote{See
  561. the variable @code{org-special-ctrl-a/e} to configure special behavior
  562. of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
  563. @example
  564. * Top level headline
  565. ** Second level
  566. *** 3rd level
  567. some text
  568. *** 3rd level
  569. more text
  570. * Another top level headline
  571. @end example
  572. @noindent Some people find the many stars too noisy and would prefer an
  573. outline that has whitespace followed by a single star as headline
  574. starters. @ref{Clean view} describes a setup to realize this.
  575. An empty line after the end of a subtree is considered part of it and
  576. will be hidden when the subtree is folded. However, if you leave at
  577. least two empty lines, one empty line will remain visible after folding
  578. the subtree, in order to structure the collapsed view. See the
  579. variable @code{org-cycle-separator-lines} to modify this behavior.
  580. @node Visibility cycling, Motion, Headlines, Document Structure
  581. @section Visibility cycling
  582. @cindex cycling, visibility
  583. @cindex visibility cycling
  584. @cindex trees, visibility
  585. @cindex show hidden text
  586. @cindex hide text
  587. Outlines make it possible to hide parts of the text in the buffer.
  588. Org uses just two commands, bound to @key{TAB} and
  589. @kbd{S-@key{TAB}} to change the visibility in the buffer.
  590. @cindex subtree visibility states
  591. @cindex subtree cycling
  592. @cindex folded, subtree visibility state
  593. @cindex children, subtree visibility state
  594. @cindex subtree, subtree visibility state
  595. @table @kbd
  596. @kindex @key{TAB}
  597. @item @key{TAB}
  598. @emph{Subtree cycling}: Rotate current subtree among the states
  599. @example
  600. ,-> FOLDED -> CHILDREN -> SUBTREE --.
  601. '-----------------------------------'
  602. @end example
  603. The cursor must be on a headline for this to work@footnote{see, however,
  604. the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
  605. beginning of the buffer and the first line is not a headline, then
  606. @key{TAB} actually runs global cycling (see below)@footnote{see the
  607. option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
  608. argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
  609. @cindex global visibility states
  610. @cindex global cycling
  611. @cindex overview, global visibility state
  612. @cindex contents, global visibility state
  613. @cindex show all, global visibility state
  614. @kindex S-@key{TAB}
  615. @item S-@key{TAB}
  616. @itemx C-u @key{TAB}
  617. @emph{Global cycling}: Rotate the entire buffer among the states
  618. @example
  619. ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
  620. '--------------------------------------'
  621. @end example
  622. When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
  623. CONTENTS view up to headlines of level N will be shown. Note that inside
  624. tables, @kbd{S-@key{TAB}} jumps to the previous field.
  625. @cindex show all, command
  626. @kindex C-u C-u C-u @key{TAB}
  627. @item C-u C-u C-u @key{TAB}
  628. Show all, including drawers.
  629. @kindex C-c C-r
  630. @item C-c C-r
  631. Reveal context around point, showing the current entry, the following heading
  632. and the hierarchy above. Useful for working near a location that has been
  633. exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
  634. (@pxref{Agenda commands}). With a prefix argument show, on each
  635. level, all sibling headings.
  636. @kindex C-c C-x b
  637. @item C-c C-x b
  638. Show the current subtree in an indirect buffer@footnote{The indirect
  639. buffer
  640. @ifinfo
  641. (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
  642. @end ifinfo
  643. @ifnotinfo
  644. (see the Emacs manual for more information about indirect buffers)
  645. @end ifnotinfo
  646. will contain the entire buffer, but will be narrowed to the current
  647. tree. Editing the indirect buffer will also change the original buffer,
  648. but without affecting visibility in that buffer.}. With a numeric
  649. prefix argument N, go up to level N and then take that tree. If N is
  650. negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
  651. the previously used indirect buffer.
  652. @end table
  653. When Emacs first visits an Org file, the global state is set to
  654. OVERVIEW, i.e. only the top level headlines are visible. This can be
  655. configured through the variable @code{org-startup-folded}, or on a
  656. per-file basis by adding one of the following lines anywhere in the
  657. buffer:
  658. @example
  659. #+STARTUP: overview
  660. #+STARTUP: content
  661. #+STARTUP: showall
  662. @end example
  663. @noindent
  664. Forthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties
  665. and Columns}) will get their visibility adapted accordingly. Allowed values
  666. for this property are @code{folded}, @code{children}, @code{content}, and
  667. @code{all}.
  668. @table @kbd
  669. @kindex C-u C-u @key{TAB}
  670. @item C-u C-u @key{TAB}
  671. Switch back to the startup visibility of the buffer, i.e. whatever is
  672. requested by startup options and @samp{VISIBILITY} properties in individual
  673. entries.
  674. @end table
  675. @node Motion, Structure editing, Visibility cycling, Document Structure
  676. @section Motion
  677. @cindex motion, between headlines
  678. @cindex jumping, to headlines
  679. @cindex headline navigation
  680. The following commands jump to other headlines in the buffer.
  681. @table @kbd
  682. @kindex C-c C-n
  683. @item C-c C-n
  684. Next heading.
  685. @kindex C-c C-p
  686. @item C-c C-p
  687. Previous heading.
  688. @kindex C-c C-f
  689. @item C-c C-f
  690. Next heading same level.
  691. @kindex C-c C-b
  692. @item C-c C-b
  693. Previous heading same level.
  694. @kindex C-c C-u
  695. @item C-c C-u
  696. Backward to higher level heading.
  697. @kindex C-c C-j
  698. @item C-c C-j
  699. Jump to a different place without changing the current outline
  700. visibility. Shows the document structure in a temporary buffer, where
  701. you can use the following keys to find your destination:
  702. @example
  703. @key{TAB} @r{Cycle visibility.}
  704. @key{down} / @key{up} @r{Next/previous visible headline.}
  705. @key{RET} @r{Select this location.}
  706. @kbd{/} @r{Do a Sparse-tree search}
  707. @r{The following keys work if you turn off @code{org-goto-auto-isearch}}
  708. n / p @r{Next/previous visible headline.}
  709. f / b @r{Next/previous headline same level.}
  710. u @r{One level up.}
  711. 0-9 @r{Digit argument.}
  712. q @r{Quit}
  713. @end example
  714. See also the variable@code{org-goto-interface}.
  715. @end table
  716. @node Structure editing, Archiving, Motion, Document Structure
  717. @section Structure editing
  718. @cindex structure editing
  719. @cindex headline, promotion and demotion
  720. @cindex promotion, of subtrees
  721. @cindex demotion, of subtrees
  722. @cindex subtree, cut and paste
  723. @cindex pasting, of subtrees
  724. @cindex cutting, of subtrees
  725. @cindex copying, of subtrees
  726. @cindex subtrees, cut and paste
  727. @table @kbd
  728. @kindex M-@key{RET}
  729. @item M-@key{RET}
  730. Insert new heading with same level as current. If the cursor is in a
  731. plain list item, a new item is created (@pxref{Plain lists}). To force
  732. creation of a new headline, use a prefix argument, or first press @key{RET}
  733. to get to the beginning of the next line. When this command is used in
  734. the middle of a line, the line is split and the rest of the line becomes
  735. the new headline@footnote{If you do not want the line to be split,
  736. customize the variable @code{org-M-RET-may-split-line}.}. If the
  737. command is used at the beginning of a headline, the new headline is
  738. created before the current line. If at the beginning of any other line,
  739. the content of that line is made the new heading. If the command is
  740. used at the end of a folded subtree (i.e. behind the ellipses at the end
  741. of a headline), then a headline like the current one will be inserted
  742. after the end of the subtree.
  743. @kindex C-@key{RET}
  744. @item C-@key{RET}
  745. Just like @kbd{M-@key{RET}}, except when adding a new heading below the
  746. current heading, the new heading is placed after the body instead of before
  747. it. This command works from anywhere in the entry.
  748. @kindex M-S-@key{RET}
  749. @item M-S-@key{RET}
  750. Insert new TODO entry with same level as current heading.
  751. @kindex C-S-@key{RET}
  752. @item C-S-@key{RET}
  753. Insert new TODO entry with same level as current heading. Like
  754. @kbd{C-@key{RET}}, the new headline will be inserted after the current
  755. subtree.
  756. @kindex M-@key{left}
  757. @item M-@key{left}
  758. Promote current heading by one level.
  759. @kindex M-@key{right}
  760. @item M-@key{right}
  761. Demote current heading by one level.
  762. @kindex M-S-@key{left}
  763. @item M-S-@key{left}
  764. Promote the current subtree by one level.
  765. @kindex M-S-@key{right}
  766. @item M-S-@key{right}
  767. Demote the current subtree by one level.
  768. @kindex M-S-@key{up}
  769. @item M-S-@key{up}
  770. Move subtree up (swap with previous subtree of same
  771. level).
  772. @kindex M-S-@key{down}
  773. @item M-S-@key{down}
  774. Move subtree down (swap with next subtree of same level).
  775. @kindex C-c C-x C-w
  776. @item C-c C-x C-w
  777. Kill subtree, i.e. remove it from buffer but save in kill ring.
  778. With a numeric prefix argument N, kill N sequential subtrees.
  779. @kindex C-c C-x M-w
  780. @item C-c C-x M-w
  781. Copy subtree to kill ring. With a numeric prefix argument N, copy the N
  782. sequential subtrees.
  783. @kindex C-c C-x C-y
  784. @item C-c C-x C-y
  785. Yank subtree from kill ring. This does modify the level of the subtree to
  786. make sure the tree fits in nicely at the yank position. The yank level can
  787. also be specified with a numeric prefix argument, or by yanking after a
  788. headline marker like @samp{****}.
  789. @kindex C-y
  790. @item C-y
  791. Depending on the variables @code{org-yank-adjusted-subtrees} and
  792. @code{org-yank-folded-subtrees}, Org's internal @code{yank} command will
  793. paste subtrees folded and in a clever way, using the same command as @kbd{C-c
  794. C-x C-y}. With the default settings, level adjustment will take place and
  795. yanked trees will be folded unless doing so would swallow text previously
  796. visible. Any prefix argument to this command will force a normal @code{yank}
  797. to be executed, with the prefix passed along. A good way to force a normal
  798. yank is @kbd{C-u C-y}. If you use @code{yank-pop} after a yank, it will yank
  799. previous kill items plainly, without adjustment and folding.
  800. @kindex C-c C-w
  801. @item C-c C-w
  802. Refile entry or region to a different location. @xref{Refiling notes}.
  803. @kindex C-c ^
  804. @item C-c ^
  805. Sort same-level entries. When there is an active region, all entries in the
  806. region will be sorted. Otherwise the children of the current headline are
  807. sorted. The command prompts for the sorting method, which can be
  808. alphabetically, numerically, by time (using the first time stamp in each
  809. entry), by priority, or by TODO keyword (in the sequence the keywords have
  810. been defined in the setup). Reverse sorting is possible as well. You can
  811. also supply your own function to extract the sorting key. With a @kbd{C-u}
  812. prefix, sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes,
  813. duplicate entries will also be removed.
  814. @kindex C-x n s
  815. @item C-x n s
  816. Narrow buffer to current subtree.
  817. @kindex C-x n w
  818. @item C-x n w
  819. Widen buffer to remove a narrowing.
  820. @kindex C-c *
  821. @item C-c *
  822. Turn a normal line or plain list item into a headline (so that it
  823. becomes a subheading at its location). Also turn a headline into a
  824. normal line by removing the stars. If there is an active region, turn
  825. all lines in the region into headlines. Or, if the first line is a
  826. headline, remove the stars from all headlines in the region.
  827. @end table
  828. @cindex region, active
  829. @cindex active region
  830. @cindex Transient mark mode
  831. When there is an active region (Transient mark mode), promotion and
  832. demotion work on all headlines in the region. To select a region of
  833. headlines, it is best to place both point and mark at the beginning of a
  834. line, mark at the beginning of the first headline, and point at the line
  835. just after the last headline to change. Note that when the cursor is
  836. inside a table (@pxref{Tables}), the Meta-Cursor keys have different
  837. functionality.
  838. @node Archiving, Sparse trees, Structure editing, Document Structure
  839. @section Archiving
  840. @cindex archiving
  841. When a project represented by a (sub)tree is finished, you may want
  842. to move the tree out of the way and to stop it from contributing to the
  843. agenda. Org mode knows two ways of archiving. You can mark a tree with
  844. the ARCHIVE tag, or you can move an entire (sub)tree to a different
  845. location.
  846. @menu
  847. * ARCHIVE tag:: Marking a tree as inactive
  848. * Moving subtrees:: Moving a tree to an archive file
  849. @end menu
  850. @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
  851. @subsection The ARCHIVE tag
  852. @cindex internal archiving
  853. A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
  854. its location in the outline tree, but behaves in the following way:
  855. @itemize @minus
  856. @item
  857. It does not open when you attempt to do so with a visibility cycling
  858. command (@pxref{Visibility cycling}). You can force cycling archived
  859. subtrees with @kbd{C-@key{TAB}}, or by setting the option
  860. @code{org-cycle-open-archived-trees}. Also normal outline commands like
  861. @code{show-all} will open archived subtrees.
  862. @item
  863. During sparse tree construction (@pxref{Sparse trees}), matches in
  864. archived subtrees are not exposed, unless you configure the option
  865. @code{org-sparse-tree-open-archived-trees}.
  866. @item
  867. During agenda view construction (@pxref{Agenda Views}), the content of
  868. archived trees is ignored unless you configure the option
  869. @code{org-agenda-skip-archived-trees}, in which case these trees will always
  870. be included. In the agenda you can press the @kbd{v} key to get archives
  871. temporarily included.
  872. @item
  873. Archived trees are not exported (@pxref{Exporting}), only the headline
  874. is. Configure the details using the variable
  875. @code{org-export-with-archived-trees}.
  876. @end itemize
  877. The following commands help managing the ARCHIVE tag:
  878. @table @kbd
  879. @kindex C-c C-x a
  880. @item C-c C-x a
  881. Toggle the ARCHIVE tag for the current headline. When the tag is set,
  882. the headline changes to a shadowed face, and the subtree below it is
  883. hidden.
  884. @kindex C-u C-c C-x a
  885. @item C-u C-c C-x a
  886. Check if any direct children of the current headline should be archived.
  887. To do this, each subtree is checked for open TODO entries. If none are
  888. found, the command offers to set the ARCHIVE tag for the child. If the
  889. cursor is @emph{not} on a headline when this command is invoked, the
  890. level 1 trees will be checked.
  891. @kindex C-@kbd{TAB}
  892. @item C-@kbd{TAB}
  893. Cycle a tree even if it is tagged with ARCHIVE.
  894. @end table
  895. @node Moving subtrees, , ARCHIVE tag, Archiving
  896. @subsection Moving subtrees
  897. @cindex external archiving
  898. Once an entire project is finished, you may want to move it to a different
  899. location. Org can move it to an @emph{Archive Sibling} in the same tree, to a
  900. different tree in the current file, or to a different file, the archive file.
  901. @table @kbd
  902. @kindex C-c C-x A
  903. @item C-c C-x A
  904. Move the current entry to the @emph{Archive Sibling}. This is a sibling of
  905. the entry with the heading @samp{Archive} and the tag @samp{ARCHIVE}
  906. (@pxref{ARCHIVE tag}). The entry becomes a child of that sibling and in this
  907. way retains a lot of its original context, including inherited tags and
  908. approximate position in the outline.
  909. @kindex C-c C-x C-s
  910. @item C-c C-x C-s
  911. Archive the subtree starting at the cursor position to the location
  912. given by @code{org-archive-location}. Context information that could be
  913. lost like the file name, the category, inherited tags, and the TODO
  914. state will be store as properties in the entry.
  915. @kindex C-u C-c C-x C-s
  916. @item C-u C-c C-x C-s
  917. Check if any direct children of the current headline could be moved to
  918. the archive. To do this, each subtree is checked for open TODO entries.
  919. If none are found, the command offers to move it to the archive
  920. location. If the cursor is @emph{not} on a headline when this command
  921. is invoked, the level 1 trees will be checked.
  922. @end table
  923. @cindex archive locations
  924. The default archive location is a file in the same directory as the
  925. current file, with the name derived by appending @file{_archive} to the
  926. current file name. For information and examples on how to change this,
  927. see the documentation string of the variable
  928. @code{org-archive-location}. There is also an in-buffer option for
  929. setting this variable, for example@footnote{For backward compatibility,
  930. the following also works: If there are several such lines in a file,
  931. each specifies the archive location for the text below it. The first
  932. such line also applies to any text before its definition. However,
  933. using this method is @emph{strongly} deprecated as it is incompatible
  934. with the outline structure of the document. The correct method for
  935. setting multiple archive locations in a buffer is using a property.}:
  936. @example
  937. #+ARCHIVE: %s_done::
  938. @end example
  939. @noindent
  940. If you would like to have a special ARCHIVE location for a single entry
  941. or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
  942. location as the value (@pxref{Properties and Columns}).
  943. When a subtree is moved, it receives a number of special properties that
  944. record context information like the file from where the entry came, it's
  945. outline path the archiving time etc. Configure the variable
  946. @code{org-archive-save-context-info} to adjust the amount of information
  947. added.
  948. @node Sparse trees, Plain lists, Archiving, Document Structure
  949. @section Sparse trees
  950. @cindex sparse trees
  951. @cindex trees, sparse
  952. @cindex folding, sparse trees
  953. @cindex occur, command
  954. An important feature of Org mode is the ability to construct @emph{sparse
  955. trees} for selected information in an outline tree, so that the entire
  956. document is folded as much as possible, but the selected information is made
  957. visible along with the headline structure above it@footnote{See also the
  958. variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
  959. @code{org-show-siblings}, and @code{org-show-entry-below} for detailed
  960. control on how much context is shown around each match.}. Just try it out
  961. and you will see immediately how it works.
  962. Org mode contains several commands creating such trees, all these
  963. commands can be accessed through a dispatcher:
  964. @table @kbd
  965. @kindex C-c /
  966. @item C-c /
  967. This prompts for an extra key to select a sparse-tree creating command.
  968. @kindex C-c / r
  969. @item C-c / r
  970. Occur. Prompts for a regexp and shows a sparse tree with all matches. If
  971. the match is in a headline, the headline is made visible. If the match is in
  972. the body of an entry, headline and body are made visible. In order to
  973. provide minimal context, also the full hierarchy of headlines above the match
  974. is shown, as well as the headline following the match. Each match is also
  975. highlighted; the highlights disappear when the buffer is changed by an
  976. editing command@footnote{depending on the option
  977. @code{org-remove-highlights-with-change}}, or by pressing @kbd{C-c C-c}.
  978. When called with a @kbd{C-u} prefix argument, previous highlights are kept,
  979. so several calls to this command can be stacked.
  980. @end table
  981. @noindent
  982. For frequently used sparse trees of specific search strings, you can
  983. use the variable @code{org-agenda-custom-commands} to define fast
  984. keyboard access to specific sparse trees. These commands will then be
  985. accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
  986. For example:
  987. @lisp
  988. (setq org-agenda-custom-commands
  989. '(("f" occur-tree "FIXME")))
  990. @end lisp
  991. @noindent will define the key @kbd{C-c a f} as a shortcut for creating
  992. a sparse tree matching the string @samp{FIXME}.
  993. The other sparse tree commands select headings based on TODO keywords,
  994. tags, or properties and will be discussed later in this manual.
  995. @kindex C-c C-e v
  996. @cindex printing sparse trees
  997. @cindex visible text, printing
  998. To print a sparse tree, you can use the Emacs command
  999. @code{ps-print-buffer-with-faces} which does not print invisible parts
  1000. of the document @footnote{This does not work under XEmacs, because
  1001. XEmacs uses selective display for outlining, not text properties.}.
  1002. Or you can use the command @kbd{C-c C-e v} to export only the visible
  1003. part of the document and print the resulting file.
  1004. @node Plain lists, Drawers, Sparse trees, Document Structure
  1005. @section Plain lists
  1006. @cindex plain lists
  1007. @cindex lists, plain
  1008. @cindex lists, ordered
  1009. @cindex ordered lists
  1010. Within an entry of the outline tree, hand-formatted lists can provide
  1011. additional structure. They also provide a way to create lists of
  1012. checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
  1013. and the HTML exporter (@pxref{Exporting}) parses and formats them.
  1014. Org knows ordered lists, unordered lists, and description lists.
  1015. @itemize @bullet
  1016. @item
  1017. @emph{Unordered} list items start with @samp{-}, @samp{+}, or
  1018. @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
  1019. they will be seen as top-level headlines. Also, when you are hiding leading
  1020. stars to get a clean outline view, plain list items starting with a star are
  1021. visually indistinguishable from true headlines. In short: even though
  1022. @samp{*} is supported, it may be better to not use it for plain list items.}
  1023. as bullets.
  1024. @item
  1025. @emph{Ordered} list items start with a numeral followed by either a period or
  1026. a right parenthesis, such as @samp{1.} or @samp{1)}.
  1027. @item
  1028. @emph{Description} list items are like unordered list items, but contain the
  1029. separator @samp{ :: } to separate the description @emph{term} from the
  1030. desciption.
  1031. @end itemize
  1032. Items belonging to the same list must have the same indentation on the first
  1033. line. In particular, if an ordered list reaches number @samp{10.}, then the
  1034. 2--digit numbers must be written left-aligned with the other numbers in the
  1035. list. Indentation also determines the end of a list item. It ends before
  1036. the next line that is indented like the bullet/number, or less. Empty lines
  1037. are part of the previous item, so you can have several paragraphs in one
  1038. item. If you would like an empty line to terminate all currently open plain
  1039. lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
  1040. Here is an example:
  1041. @example
  1042. @group
  1043. ** Lord of the Rings
  1044. My favorite scenes are (in this order)
  1045. 1. The attack of the Rohirrim
  1046. 2. Eowyns fight with the witch king
  1047. + this was already my favorite scene in the book
  1048. + I really like Miranda Otto.
  1049. 3. Peter Jackson being shot by Legolas
  1050. - on DVD only
  1051. He makes a really funny face when it happens.
  1052. But in the end, not individual scenes matter but the film as a whole.
  1053. Important actors in this film are:
  1054. - @b{Elijah Wood} :: He plays the Frodo
  1055. - @b{Sean Austin} :: He plays the Sam, Frodos friend. I still remember
  1056. him very well from his role as Mikey Walsh a in the Goonies.
  1057. @end group
  1058. @end example
  1059. Org supports these lists by tuning filling and wrapping commands to
  1060. deal with them correctly@footnote{Org only changes the filling
  1061. settings for Emacs. For XEmacs, you should use Kyle E. Jones'
  1062. @file{filladapt.el}. To turn this on, put into @file{.emacs}:
  1063. @code{(require 'filladapt)}}, and by exporting them properly
  1064. (@pxref{Exporting}).
  1065. The following commands act on items when the cursor is in the first line
  1066. of an item (the line with the bullet or number).
  1067. @table @kbd
  1068. @kindex @key{TAB}
  1069. @item @key{TAB}
  1070. Items can be folded just like headline levels if you set the variable
  1071. @code{org-cycle-include-plain-lists}. The level of an item is then
  1072. given by the indentation of the bullet/number. Items are always
  1073. subordinate to real headlines, however; the hierarchies remain
  1074. completely separated.
  1075. If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
  1076. fixes the indentation of the current line in a heuristic way.
  1077. @kindex M-@key{RET}
  1078. @item M-@key{RET}
  1079. Insert new item at current level. With a prefix argument, force a new
  1080. heading (@pxref{Structure editing}). If this command is used in the middle
  1081. of a line, the line is @emph{split} and the rest of the line becomes the new
  1082. item@footnote{If you do not want the line to be split, customize the variable
  1083. @code{org-M-RET-may-split-line}.}. If this command is executed in the
  1084. @emph{whitespace before a bullet or number}, the new item is created
  1085. @emph{before} the current item. If the command is executed in the white
  1086. space before the text that is part of an item but does not contain the
  1087. bullet, a bullet is added to the current line.
  1088. @kindex M-S-@key{RET}
  1089. @item M-S-@key{RET}
  1090. Insert a new item with a checkbox (@pxref{Checkboxes}).
  1091. @kindex S-@key{up}
  1092. @kindex S-@key{down}
  1093. @item S-@key{up}
  1094. @itemx S-@key{down}
  1095. Jump to the previous/next item in the current list.
  1096. @kindex M-S-@key{up}
  1097. @kindex M-S-@key{down}
  1098. @item M-S-@key{up}
  1099. @itemx M-S-@key{down}
  1100. Move the item including subitems up/down (swap with previous/next item
  1101. of same indentation). If the list is ordered, renumbering is
  1102. automatic.
  1103. @kindex M-S-@key{left}
  1104. @kindex M-S-@key{right}
  1105. @item M-S-@key{left}
  1106. @itemx M-S-@key{right}
  1107. Decrease/increase the indentation of the item, including subitems.
  1108. Initially, the item tree is selected based on current indentation.
  1109. When these commands are executed several times in direct succession,
  1110. the initially selected region is used, even if the new indentation
  1111. would imply a different hierarchy. To use the new hierarchy, break
  1112. the command chain with a cursor motion or so.
  1113. @kindex C-c C-c
  1114. @item C-c C-c
  1115. If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
  1116. state of the checkbox. If not, this command makes sure that all the
  1117. items on this list level use the same bullet. Furthermore, if this is
  1118. an ordered list, make sure the numbering is OK.
  1119. @kindex C-c -
  1120. @item C-c -
  1121. Cycle the entire list level through the different itemize/enumerate bullets
  1122. (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}). With a numeric prefix
  1123. argument N, select the Nth bullet from this list. If there is an active
  1124. region when calling this, all lines will be converted to list items. If the
  1125. first line already was a list item, any item markers will be removed from the
  1126. list. Finally, even without an active region, a normal line will be
  1127. converted into a list item.
  1128. @kindex S-@key{left}
  1129. @kindex S-@key{right}
  1130. @item S-@key{left}/@key{right}
  1131. Also cycle bullet styles when in the first line of an item.
  1132. @end table
  1133. @node Drawers, Orgstruct mode, Plain lists, Document Structure
  1134. @section Drawers
  1135. @cindex drawers
  1136. @cindex visibility cycling, drawers
  1137. Sometimes you want to keep information associated with an entry, but you
  1138. normally don't want to see it. For this, Org mode has @emph{drawers}.
  1139. Drawers need to be configured with the variable
  1140. @code{org-drawers}@footnote{You can define drawers on a per-file basis
  1141. with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
  1142. look like this:
  1143. @example
  1144. ** This is a headline
  1145. Still outside the drawer
  1146. :DRAWERNAME:
  1147. This is inside the drawer.
  1148. :END:
  1149. After the drawer.
  1150. @end example
  1151. Visibility cycling (@pxref{Visibility cycling}) on the headline will
  1152. hide and show the entry, but keep the drawer collapsed to a single line.
  1153. In order to look inside the drawer, you need to move the cursor to the
  1154. drawer line and press @key{TAB} there. Org mode uses a drawer for
  1155. storing properties (@pxref{Properties and Columns}), and another one for
  1156. storing clock times (@pxref{Clocking work time}).
  1157. @node Orgstruct mode, , Drawers, Document Structure
  1158. @section The Orgstruct minor mode
  1159. @cindex Orgstruct mode
  1160. @cindex minor mode for structure editing
  1161. If you like the intuitive way the Org mode structure editing and list
  1162. formatting works, you might want to use these commands in other modes
  1163. like Text mode or Mail mode as well. The minor mode Orgstruct mode
  1164. makes this possible. You can always toggle the mode with @kbd{M-x
  1165. orgstruct-mode}. To turn it on by default, for example in Mail mode,
  1166. use
  1167. @lisp
  1168. (add-hook 'mail-mode-hook 'turn-on-orgstruct)
  1169. @end lisp
  1170. When this mode is active and the cursor is on a line that looks to
  1171. Org like a headline of the first line of a list item, most
  1172. structure editing commands will work, even if the same keys normally
  1173. have different functionality in the major mode you are using. If the
  1174. cursor is not in one of those special lines, Orgstruct mode lurks
  1175. silently in the shadow.
  1176. @node Tables, Hyperlinks, Document Structure, Top
  1177. @chapter Tables
  1178. @cindex tables
  1179. @cindex editing tables
  1180. Org comes with a fast and intuitive table editor. Spreadsheet-like
  1181. calculations are supported in connection with the Emacs @file{calc}
  1182. package
  1183. @ifinfo
  1184. (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
  1185. @end ifinfo
  1186. @ifnotinfo
  1187. (see the Emacs Calculator manual for more information about the Emacs
  1188. calculator).
  1189. @end ifnotinfo
  1190. @menu
  1191. * Built-in table editor:: Simple tables
  1192. * Narrow columns:: Stop wasting space in tables
  1193. * Column groups:: Grouping to trigger vertical lines
  1194. * Orgtbl mode:: The table editor as minor mode
  1195. * The spreadsheet:: The table editor has spreadsheet capabilities
  1196. * Org Plot:: Plotting from org tables
  1197. @end menu
  1198. @node Built-in table editor, Narrow columns, Tables, Tables
  1199. @section The built-in table editor
  1200. @cindex table editor, built-in
  1201. Org makes it easy to format tables in plain ASCII. Any line with
  1202. @samp{|} as the first non-whitespace character is considered part of a
  1203. table. @samp{|} is also the column separator. A table might look like
  1204. this:
  1205. @example
  1206. | Name | Phone | Age |
  1207. |-------+-------+-----|
  1208. | Peter | 1234 | 17 |
  1209. | Anna | 4321 | 25 |
  1210. @end example
  1211. A table is re-aligned automatically each time you press @key{TAB} or
  1212. @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
  1213. the next field (@key{RET} to the next row) and creates new table rows
  1214. at the end of the table or before horizontal lines. The indentation
  1215. of the table is set by the first line. Any line starting with
  1216. @samp{|-} is considered as a horizontal separator line and will be
  1217. expanded on the next re-align to span the whole table width. So, to
  1218. create the above table, you would only type
  1219. @example
  1220. |Name|Phone|Age|
  1221. |-
  1222. @end example
  1223. @noindent and then press @key{TAB} to align the table and start filling in
  1224. fields.
  1225. When typing text into a field, Org treats @key{DEL},
  1226. @key{Backspace}, and all character keys in a special way, so that
  1227. inserting and deleting avoids shifting other fields. Also, when
  1228. typing @emph{immediately after the cursor was moved into a new field
  1229. with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
  1230. field is automatically made blank. If this behavior is too
  1231. unpredictable for you, configure the variables
  1232. @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
  1233. @table @kbd
  1234. @tsubheading{Creation and conversion}
  1235. @kindex C-c |
  1236. @item C-c |
  1237. Convert the active region to table. If every line contains at least one
  1238. TAB character, the function assumes that the material is tab separated.
  1239. If every line contains a comma, comma-separated values (CSV) are assumed.
  1240. If not, lines are split at whitespace into fields. You can use a prefix
  1241. argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
  1242. C-u} forces TAB, and a numeric argument N indicates that at least N
  1243. consecutive spaces, or alternatively a TAB will be the separator.
  1244. @*
  1245. If there is no active region, this command creates an empty Org
  1246. table. But it's easier just to start typing, like
  1247. @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
  1248. @tsubheading{Re-aligning and field motion}
  1249. @kindex C-c C-c
  1250. @item C-c C-c
  1251. Re-align the table without moving the cursor.
  1252. @c
  1253. @kindex @key{TAB}
  1254. @item @key{TAB}
  1255. Re-align the table, move to the next field. Creates a new row if
  1256. necessary.
  1257. @c
  1258. @kindex S-@key{TAB}
  1259. @item S-@key{TAB}
  1260. Re-align, move to previous field.
  1261. @c
  1262. @kindex @key{RET}
  1263. @item @key{RET}
  1264. Re-align the table and move down to next row. Creates a new row if
  1265. necessary. At the beginning or end of a line, @key{RET} still does
  1266. NEWLINE, so it can be used to split a table.
  1267. @tsubheading{Column and row editing}
  1268. @kindex M-@key{left}
  1269. @kindex M-@key{right}
  1270. @item M-@key{left}
  1271. @itemx M-@key{right}
  1272. Move the current column left/right.
  1273. @c
  1274. @kindex M-S-@key{left}
  1275. @item M-S-@key{left}
  1276. Kill the current column.
  1277. @c
  1278. @kindex M-S-@key{right}
  1279. @item M-S-@key{right}
  1280. Insert a new column to the left of the cursor position.
  1281. @c
  1282. @kindex M-@key{up}
  1283. @kindex M-@key{down}
  1284. @item M-@key{up}
  1285. @itemx M-@key{down}
  1286. Move the current row up/down.
  1287. @c
  1288. @kindex M-S-@key{up}
  1289. @item M-S-@key{up}
  1290. Kill the current row or horizontal line.
  1291. @c
  1292. @kindex M-S-@key{down}
  1293. @item M-S-@key{down}
  1294. Insert a new row above the current row. With a prefix argument, the line is
  1295. created below the current one.
  1296. @c
  1297. @kindex C-c -
  1298. @item C-c -
  1299. Insert a horizontal line below current row. With a prefix argument, the line
  1300. is created above the current line.
  1301. @c
  1302. @kindex C-c ^
  1303. @item C-c ^
  1304. Sort the table lines in the region. The position of point indicates the
  1305. column to be used for sorting, and the range of lines is the range
  1306. between the nearest horizontal separator lines, or the entire table. If
  1307. point is before the first column, you will be prompted for the sorting
  1308. column. If there is an active region, the mark specifies the first line
  1309. and the sorting column, while point should be in the last line to be
  1310. included into the sorting. The command prompts for the sorting type
  1311. (alphabetically, numerically, or by time). When called with a prefix
  1312. argument, alphabetic sorting will be case-sensitive.
  1313. @tsubheading{Regions}
  1314. @kindex C-c C-x M-w
  1315. @item C-c C-x M-w
  1316. Copy a rectangular region from a table to a special clipboard. Point
  1317. and mark determine edge fields of the rectangle. The process ignores
  1318. horizontal separator lines.
  1319. @c
  1320. @kindex C-c C-x C-w
  1321. @item C-c C-x C-w
  1322. Copy a rectangular region from a table to a special clipboard, and
  1323. blank all fields in the rectangle. So this is the ``cut'' operation.
  1324. @c
  1325. @kindex C-c C-x C-y
  1326. @item C-c C-x C-y
  1327. Paste a rectangular region into a table.
  1328. The upper left corner ends up in the current field. All involved fields
  1329. will be overwritten. If the rectangle does not fit into the present table,
  1330. the table is enlarged as needed. The process ignores horizontal separator
  1331. lines.
  1332. @c
  1333. @kindex C-c C-q
  1334. @kindex M-@key{RET}
  1335. @item C-c C-q
  1336. @itemx M-@kbd{RET}
  1337. Wrap several fields in a column like a paragraph. If there is an active
  1338. region, and both point and mark are in the same column, the text in the
  1339. column is wrapped to minimum width for the given number of lines. A numeric
  1340. prefix argument may be used to change the number of desired lines. If there
  1341. is no region, the current field is split at the cursor position and the text
  1342. fragment to the right of the cursor is prepended to the field one line
  1343. down. If there is no region, but you specify a prefix argument, the current
  1344. field is made blank, and the content is appended to the field above.
  1345. @tsubheading{Calculations}
  1346. @cindex formula, in tables
  1347. @cindex calculations, in tables
  1348. @cindex region, active
  1349. @cindex active region
  1350. @cindex Transient mark mode
  1351. @kindex C-c +
  1352. @item C-c +
  1353. Sum the numbers in the current column, or in the rectangle defined by
  1354. the active region. The result is shown in the echo area and can
  1355. be inserted with @kbd{C-y}.
  1356. @c
  1357. @kindex S-@key{RET}
  1358. @item S-@key{RET}
  1359. When current field is empty, copy from first non-empty field above. When not
  1360. empty, copy current field down to next row and move cursor along with it.
  1361. Depending on the variable @code{org-table-copy-increment}, integer field
  1362. values will be incremented during copy. Integers that are too large will not
  1363. be incremented. Also, a @code{0} prefix argument temporarily dispables the
  1364. increment. This key is also used by CUA mode (@pxref{Cooperation}).
  1365. @tsubheading{Miscellaneous}
  1366. @kindex C-c `
  1367. @item C-c `
  1368. Edit the current field in a separate window. This is useful for fields
  1369. that are not fully visible (@pxref{Narrow columns}). When called with a
  1370. @kbd{C-u} prefix, just make the full field visible, so that it can be
  1371. edited in place.
  1372. @c
  1373. @item M-x org-table-import
  1374. Import a file as a table. The table should be TAB- or whitespace
  1375. separated. Useful, for example, to import a spreadsheet table or data
  1376. from a database, because these programs generally can write
  1377. TAB-separated text files. This command works by inserting the file into
  1378. the buffer and then converting the region to a table. Any prefix
  1379. argument is passed on to the converter, which uses it to determine the
  1380. separator.
  1381. @item C-c |
  1382. Tables can also be imported by pasting tabular text into the Org
  1383. buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
  1384. @kbd{C-c |} command (see above under @i{Creation and conversion}).
  1385. @c
  1386. @item M-x org-table-export
  1387. Export the table, by default as a TAB-separated file. Useful for data
  1388. exchange with, for example, spreadsheet or database programs. The format
  1389. used to export the file can be configured in the variable
  1390. @code{org-table-export-default-format}. You may also use properties
  1391. @code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
  1392. name and the format for table export in a subtree. Org supports quite
  1393. general formats for exported tables. The exporter format is the same as the
  1394. format used by Orgtbl radio tables, see @ref{Translator functions} for a
  1395. detailed description.
  1396. @end table
  1397. If you don't like the automatic table editor because it gets in your
  1398. way on lines which you would like to start with @samp{|}, you can turn
  1399. it off with
  1400. @lisp
  1401. (setq org-enable-table-editor nil)
  1402. @end lisp
  1403. @noindent Then the only table command that still works is
  1404. @kbd{C-c C-c} to do a manual re-align.
  1405. @node Narrow columns, Column groups, Built-in table editor, Tables
  1406. @section Narrow columns
  1407. @cindex narrow columns in tables
  1408. The width of columns is automatically determined by the table editor.
  1409. Sometimes a single field or a few fields need to carry more text,
  1410. leading to inconveniently wide columns. To limit@footnote{This feature
  1411. does not work on XEmacs.} the width of a column, one field anywhere in
  1412. the column may contain just the string @samp{<N>} where @samp{N} is an
  1413. integer specifying the width of the column in characters. The next
  1414. re-align will then set the width of this column to no more than this
  1415. value.
  1416. @example
  1417. @group
  1418. |---+------------------------------| |---+--------|
  1419. | | | | | <6> |
  1420. | 1 | one | | 1 | one |
  1421. | 2 | two | ----\ | 2 | two |
  1422. | 3 | This is a long chunk of text | ----/ | 3 | This=> |
  1423. | 4 | four | | 4 | four |
  1424. |---+------------------------------| |---+--------|
  1425. @end group
  1426. @end example
  1427. @noindent
  1428. Fields that are wider become clipped and end in the string @samp{=>}.
  1429. Note that the full text is still in the buffer, it is only invisible.
  1430. To see the full text, hold the mouse over the field - a tool-tip window
  1431. will show the full content. To edit such a field, use the command
  1432. @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
  1433. open a new window with the full field. Edit it and finish with @kbd{C-c
  1434. C-c}.
  1435. When visiting a file containing a table with narrowed columns, the
  1436. necessary character hiding has not yet happened, and the table needs to
  1437. be aligned before it looks nice. Setting the option
  1438. @code{org-startup-align-all-tables} will realign all tables in a file
  1439. upon visiting, but also slow down startup. You can also set this option
  1440. on a per-file basis with:
  1441. @example
  1442. #+STARTUP: align
  1443. #+STARTUP: noalign
  1444. @end example
  1445. @node Column groups, Orgtbl mode, Narrow columns, Tables
  1446. @section Column groups
  1447. @cindex grouping columns in tables
  1448. When Org exports tables, it does so by default without vertical
  1449. lines because that is visually more satisfying in general. Occasionally
  1450. however, vertical lines can be useful to structure a table into groups
  1451. of columns, much like horizontal lines can do for groups of rows. In
  1452. order to specify column groups, you can use a special row where the
  1453. first field contains only @samp{/}. The further fields can either
  1454. contain @samp{<} to indicate that this column should start a group,
  1455. @samp{>} to indicate the end of a column, or @samp{<>} to make a column
  1456. a group of its own. Boundaries between column groups will upon export be
  1457. marked with vertical lines. Here is an example:
  1458. @example
  1459. | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1460. |---+----+-----+-----+-----+---------+------------|
  1461. | / | <> | < | | > | < | > |
  1462. | # | 1 | 1 | 1 | 1 | 1 | 1 |
  1463. | # | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
  1464. | # | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
  1465. |---+----+-----+-----+-----+---------+------------|
  1466. #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2)))
  1467. @end example
  1468. It is also sufficient to just insert the column group starters after
  1469. every vertical line you'd like to have:
  1470. @example
  1471. | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1472. |----+-----+-----+-----+---------+------------|
  1473. | / | < | | | < | |
  1474. @end example
  1475. @node Orgtbl mode, The spreadsheet, Column groups, Tables
  1476. @section The Orgtbl minor mode
  1477. @cindex Orgtbl mode
  1478. @cindex minor mode for tables
  1479. If you like the intuitive way the Org table editor works, you
  1480. might also want to use it in other modes like Text mode or Mail mode.
  1481. The minor mode Orgtbl mode makes this possible. You can always toggle
  1482. the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
  1483. example in mail mode, use
  1484. @lisp
  1485. (add-hook 'mail-mode-hook 'turn-on-orgtbl)
  1486. @end lisp
  1487. Furthermore, with some special setup, it is possible to maintain tables
  1488. in arbitrary syntax with Orgtbl mode. For example, it is possible to
  1489. construct La@TeX{} tables with the underlying ease and power of
  1490. Orgtbl mode, including spreadsheet capabilities. For details, see
  1491. @ref{Tables in arbitrary syntax}.
  1492. @node The spreadsheet, Org Plot, Orgtbl mode, Tables
  1493. @section The spreadsheet
  1494. @cindex calculations, in tables
  1495. @cindex spreadsheet capabilities
  1496. @cindex @file{calc} package
  1497. The table editor makes use of the Emacs @file{calc} package to implement
  1498. spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
  1499. derive fields from other fields. While fully featured, Org's
  1500. implementation is not identical to other spreadsheets. For example,
  1501. Org knows the concept of a @emph{column formula} that will be
  1502. applied to all non-header fields in a column without having to copy the
  1503. formula to each relevant field.
  1504. @menu
  1505. * References:: How to refer to another field or range
  1506. * Formula syntax for Calc:: Using Calc to compute stuff
  1507. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  1508. * Field formulas:: Formulas valid for a single field
  1509. * Column formulas:: Formulas valid for an entire column
  1510. * Editing and debugging formulas:: Fixing formulas
  1511. * Updating the table:: Recomputing all dependent fields
  1512. * Advanced features:: Field names, parameters and automatic recalc
  1513. @end menu
  1514. @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
  1515. @subsection References
  1516. @cindex references
  1517. To compute fields in the table from other fields, formulas must
  1518. reference other fields or ranges. In Org, fields can be referenced
  1519. by name, by absolute coordinates, and by relative coordinates. To find
  1520. out what the coordinates of a field are, press @kbd{C-c ?} in that
  1521. field, or press @kbd{C-c @}} to toggle the display of a grid.
  1522. @subsubheading Field references
  1523. @cindex field references
  1524. @cindex references, to fields
  1525. Formulas can reference the value of another field in two ways. Like in
  1526. any other spreadsheet, you may reference fields with a letter/number
  1527. combination like @code{B3}, meaning the 2nd field in the 3rd row.
  1528. @c Such references are always fixed to that field, they don't change
  1529. @c when you copy and paste a formula to a different field. So
  1530. @c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
  1531. @noindent
  1532. Org also uses another, more general operator that looks like this:
  1533. @example
  1534. @@row$column
  1535. @end example
  1536. @noindent
  1537. Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
  1538. or relative to the current column like @samp{+1} or @samp{-2}. As a special
  1539. case, @samp{@@0} references the last data line in the table.
  1540. The row specification only counts data lines and ignores horizontal
  1541. separator lines (hlines). You can use absolute row numbers
  1542. @samp{1}...@samp{N}, and row numbers relative to the current row like
  1543. @samp{+3} or @samp{-1}. Or specify the row relative to one of the
  1544. hlines: @samp{I} refers to the first hline@footnote{Note that only
  1545. hlines are counted that @emph{separate} table lines. If the table
  1546. starts with a hline above the header, it does not count.}, @samp{II} to
  1547. the second etc. @samp{-I} refers to the first such line above the
  1548. current line, @samp{+I} to the first such line below the current line.
  1549. You can also write @samp{III+2} which is the second data line after the
  1550. third hline in the table. Relative row numbers like @samp{-3} will not
  1551. cross hlines if the current line is too close to the hline. Instead,
  1552. the value directly at the hline is used.
  1553. @samp{0} refers to the current row and column. Also, if you omit
  1554. either the column or the row part of the reference, the current
  1555. row/column is implied.
  1556. Org's references with @emph{unsigned} numbers are fixed references
  1557. in the sense that if you use the same reference in the formula for two
  1558. different fields, the same field will be referenced each time.
  1559. Org's references with @emph{signed} numbers are floating
  1560. references because the same reference operator can reference different
  1561. fields depending on the field being calculated by the formula.
  1562. Here are a few examples:
  1563. @example
  1564. @@2$3 @r{2nd row, 3rd column}
  1565. C2 @r{same as previous}
  1566. $5 @r{column 5 in the current row}
  1567. E& @r{same as previous}
  1568. @@2 @r{current column, row 2}
  1569. @@-1$-3 @r{the field one row up, three columns to the left}
  1570. @@-I$2 @r{field just under hline above current row, column 2}
  1571. @end example
  1572. @subsubheading Range references
  1573. @cindex range references
  1574. @cindex references, to ranges
  1575. You may reference a rectangular range of fields by specifying two field
  1576. references connected by two dots @samp{..}. If both fields are in the
  1577. current row, you may simply use @samp{$2..$7}, but if at least one field
  1578. is in a different row, you need to use the general @code{@@row$column}
  1579. format at least for the first field (i.e the reference must start with
  1580. @samp{@@} in order to be interpreted correctly). Examples:
  1581. @example
  1582. $1..$3 @r{First three fields in the current row.}
  1583. $P..$Q @r{Range, using column names (see under Advanced)}
  1584. @@2$1..@@4$3 @r{6 fields between these two fields.}
  1585. A2..C4 @r{Same as above.}
  1586. @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
  1587. @end example
  1588. @noindent Range references return a vector of values that can be fed
  1589. into Calc vector functions. Empty fields in ranges are normally
  1590. suppressed, so that the vector contains only the non-empty fields (but
  1591. see the @samp{E} mode switch below). If there are no non-empty fields,
  1592. @samp{[0]} is returned to avoid syntax errors in formulas.
  1593. @subsubheading Named references
  1594. @cindex named references
  1595. @cindex references, named
  1596. @cindex name, of column or field
  1597. @cindex constants, in calculations
  1598. @samp{$name} is interpreted as the name of a column, parameter or
  1599. constant. Constants are defined globally through the variable
  1600. @code{org-table-formula-constants}, and locally (for the file) through a
  1601. line like
  1602. @example
  1603. #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
  1604. @end example
  1605. @noindent
  1606. Also properties (@pxref{Properties and Columns}) can be used as
  1607. constants in table formulas: For a property @samp{:Xyz:} use the name
  1608. @samp{$PROP_Xyz}, and the property will be searched in the current
  1609. outline entry and in the hierarchy above it. If you have the
  1610. @file{constants.el} package, it will also be used to resolve constants,
  1611. including natural constants like @samp{$h} for Planck's constant, and
  1612. units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
  1613. supply the values of constants in two different unit systems, @code{SI}
  1614. and @code{cgs}. Which one is used depends on the value of the variable
  1615. @code{constants-unit-system}. You can use the @code{#+STARTUP} options
  1616. @code{constSI} and @code{constcgs} to set this value for the current
  1617. buffer.}. Column names and parameters can be specified in special table
  1618. lines. These are described below, see @ref{Advanced features}. All
  1619. names must start with a letter, and further consist of letters and
  1620. numbers.
  1621. @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
  1622. @subsection Formula syntax for Calc
  1623. @cindex formula syntax, Calc
  1624. @cindex syntax, of formulas
  1625. A formula can be any algebraic expression understood by the Emacs
  1626. @file{Calc} package. @b{Note that @file{calc} has the
  1627. non-standard convention that @samp{/} has lower precedence than
  1628. @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
  1629. evaluation by @code{calc-eval} (@pxref{Calling Calc from
  1630. Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
  1631. Emacs Calc Manual}),
  1632. @c FIXME: The link to the Calc manual in HTML does not work.
  1633. variable substitution takes place according to the rules described above.
  1634. @cindex vectors, in table calculations
  1635. The range vectors can be directly fed into the Calc vector functions
  1636. like @samp{vmean} and @samp{vsum}.
  1637. @cindex format specifier
  1638. @cindex mode, for @file{calc}
  1639. A formula can contain an optional mode string after a semicolon. This
  1640. string consists of flags to influence Calc and other modes during
  1641. execution. By default, Org uses the standard Calc modes (precision
  1642. 12, angular units degrees, fraction and symbolic modes off). The display
  1643. format, however, has been changed to @code{(float 5)} to keep tables
  1644. compact. The default settings can be configured using the variable
  1645. @code{org-calc-default-modes}.
  1646. @example
  1647. p20 @r{switch the internal precision to 20 digits}
  1648. n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
  1649. D R @r{angle modes: degrees, radians}
  1650. F S @r{fraction and symbolic modes}
  1651. N @r{interpret all fields as numbers, use 0 for non-numbers}
  1652. T @r{force text interpretation}
  1653. E @r{keep empty fields in ranges}
  1654. @end example
  1655. @noindent
  1656. In addition, you may provide a @code{printf} format specifier to
  1657. reformat the final result. A few examples:
  1658. @example
  1659. $1+$2 @r{Sum of first and second field}
  1660. $1+$2;%.2f @r{Same, format result to two decimals}
  1661. exp($2)+exp($1) @r{Math functions can be used}
  1662. $0;%.1f @r{Reformat current cell to 1 decimal}
  1663. ($3-32)*5/9 @r{Degrees F -> C conversion}
  1664. $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
  1665. tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
  1666. sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
  1667. vmean($2..$7) @r{Compute column range mean, using vector function}
  1668. vmean($2..$7);EN @r{Same, but treat empty fields as 0}
  1669. taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
  1670. @end example
  1671. Calc also contains a complete set of logical operations. For example
  1672. @example
  1673. if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
  1674. @end example
  1675. @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
  1676. @subsection Emacs Lisp forms as formulas
  1677. @cindex Lisp forms, as table formulas
  1678. It is also possible to write a formula in Emacs Lisp; this can be useful
  1679. for string manipulation and control structures, if the Calc's
  1680. functionality is not enough. If a formula starts with a single quote
  1681. followed by an opening parenthesis, then it is evaluated as a lisp form.
  1682. The evaluation should return either a string or a number. Just as with
  1683. @file{calc} formulas, you can specify modes and a printf format after a
  1684. semicolon. With Emacs Lisp forms, you need to be conscious about the way
  1685. field references are interpolated into the form. By default, a
  1686. reference will be interpolated as a Lisp string (in double quotes)
  1687. containing the field. If you provide the @samp{N} mode switch, all
  1688. referenced elements will be numbers (non-number fields will be zero) and
  1689. interpolated as Lisp numbers, without quotes. If you provide the
  1690. @samp{L} flag, all fields will be interpolated literally, without quotes.
  1691. I.e., if you want a reference to be interpreted as a string by the Lisp
  1692. form, enclose the reference operator itself in double quotes, like
  1693. @code{"$3"}. Ranges are inserted as space-separated fields, so you can
  1694. embed them in list or vector syntax. A few examples, note how the
  1695. @samp{N} mode is used when we do computations in lisp.
  1696. @example
  1697. @r{Swap the first two characters of the content of column 1}
  1698. '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
  1699. @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
  1700. '(+ $1 $2);N
  1701. @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
  1702. '(apply '+ '($1..$4));N
  1703. @end example
  1704. @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
  1705. @subsection Field formulas
  1706. @cindex field formula
  1707. @cindex formula, for individual table field
  1708. To assign a formula to a particular field, type it directly into the
  1709. field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
  1710. press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
  1711. the field, the formula will be stored as the formula for this field,
  1712. evaluated, and the current field replaced with the result.
  1713. Formulas are stored in a special line starting with @samp{#+TBLFM:}
  1714. directly below the table. If you typed the equation in the 4th field of
  1715. the 3rd data line in the table, the formula will look like
  1716. @samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
  1717. with the appropriate commands, @i{absolute references} (but not relative
  1718. ones) in stored formulas are modified in order to still reference the
  1719. same field. Of cause this is not true if you edit the table structure
  1720. with normal editing commands - then you must fix the equations yourself.
  1721. Instead of typing an equation into the field, you may also use the
  1722. following command
  1723. @table @kbd
  1724. @kindex C-u C-c =
  1725. @item C-u C-c =
  1726. Install a new formula for the current field. The command prompts for a
  1727. formula, with default taken from the @samp{#+TBLFM:} line, applies
  1728. it to the current field and stores it.
  1729. @end table
  1730. @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
  1731. @subsection Column formulas
  1732. @cindex column formula
  1733. @cindex formula, for table column
  1734. Often in a table, the same formula should be used for all fields in a
  1735. particular column. Instead of having to copy the formula to all fields
  1736. in that column, Org allows to assign a single formula to an entire
  1737. column. If the table contains horizontal separator hlines, everything
  1738. before the first such line is considered part of the table @emph{header}
  1739. and will not be modified by column formulas.
  1740. To assign a formula to a column, type it directly into any field in the
  1741. column, preceded by an equal sign, like @samp{=$1+$2}. When you press
  1742. @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
  1743. field, the formula will be stored as the formula for the current column,
  1744. evaluated and the current field replaced with the result. If the field
  1745. contains only @samp{=}, the previously stored formula for this column is
  1746. used. For each column, Org will only remember the most recently
  1747. used formula. In the @samp{TBLFM:} line, column formulas will look like
  1748. @samp{$4=$1+$2}.
  1749. Instead of typing an equation into the field, you may also use the
  1750. following command:
  1751. @table @kbd
  1752. @kindex C-c =
  1753. @item C-c =
  1754. Install a new formula for the current column and replace current field with
  1755. the result of the formula. The command prompts for a formula, with default
  1756. taken from the @samp{#+TBLFM} line, applies it to the current field and
  1757. stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
  1758. will apply it to that many consecutive fields in the current column.
  1759. @end table
  1760. @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
  1761. @subsection Editing and debugging formulas
  1762. @cindex formula editing
  1763. @cindex editing, of table formulas
  1764. You can edit individual formulas in the minibuffer or directly in the
  1765. field. Org can also prepare a special buffer with all active
  1766. formulas of a table. When offering a formula for editing, Org
  1767. converts references to the standard format (like @code{B3} or @code{D&})
  1768. if possible. If you prefer to only work with the internal format (like
  1769. @code{@@3$2} or @code{$4}), configure the variable
  1770. @code{org-table-use-standard-references}.
  1771. @table @kbd
  1772. @kindex C-c =
  1773. @kindex C-u C-c =
  1774. @item C-c =
  1775. @itemx C-u C-c =
  1776. Edit the formula associated with the current column/field in the
  1777. minibuffer. See @ref{Column formulas} and @ref{Field formulas}.
  1778. @kindex C-u C-u C-c =
  1779. @item C-u C-u C-c =
  1780. Re-insert the active formula (either a
  1781. field formula, or a column formula) into the current field, so that you
  1782. can edit it directly in the field. The advantage over editing in the
  1783. minibuffer is that you can use the command @kbd{C-c ?}.
  1784. @kindex C-c ?
  1785. @item C-c ?
  1786. While editing a formula in a table field, highlight the field(s)
  1787. referenced by the reference at the cursor position in the formula.
  1788. @kindex C-c @}
  1789. @item C-c @}
  1790. Toggle the display of row and column numbers for a table, using
  1791. overlays. These are updated each time the table is aligned, you can
  1792. force it with @kbd{C-c C-c}.
  1793. @kindex C-c @{
  1794. @item C-c @{
  1795. Toggle the formula debugger on and off. See below.
  1796. @kindex C-c '
  1797. @item C-c '
  1798. Edit all formulas for the current table in a special buffer, where the
  1799. formulas will be displayed one per line. If the current field has an
  1800. active formula, the cursor in the formula editor will mark it.
  1801. While inside the special buffer, Org will automatically highlight
  1802. any field or range reference at the cursor position. You may edit,
  1803. remove and add formulas, and use the following commands:
  1804. @table @kbd
  1805. @kindex C-c C-c
  1806. @kindex C-x C-s
  1807. @item C-c C-c
  1808. @itemx C-x C-s
  1809. Exit the formula editor and store the modified formulas. With @kbd{C-u}
  1810. prefix, also apply the new formulas to the entire table.
  1811. @kindex C-c C-q
  1812. @item C-c C-q
  1813. Exit the formula editor without installing changes.
  1814. @kindex C-c C-r
  1815. @item C-c C-r
  1816. Toggle all references in the formula editor between standard (like
  1817. @code{B3}) and internal (like @code{@@3$2}).
  1818. @kindex @key{TAB}
  1819. @item @key{TAB}
  1820. Pretty-print or indent lisp formula at point. When in a line containing
  1821. a lisp formula, format the formula according to Emacs Lisp rules.
  1822. Another @key{TAB} collapses the formula back again. In the open
  1823. formula, @key{TAB} re-indents just like in Emacs lisp mode.
  1824. @kindex M-@key{TAB}
  1825. @item M-@key{TAB}
  1826. Complete Lisp symbols, just like in Emacs lisp mode.
  1827. @kindex S-@key{up}
  1828. @kindex S-@key{down}
  1829. @kindex S-@key{left}
  1830. @kindex S-@key{right}
  1831. @item S-@key{up}/@key{down}/@key{left}/@key{right}
  1832. Shift the reference at point. For example, if the reference is
  1833. @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
  1834. This also works for relative references, and for hline references.
  1835. @kindex M-S-@key{up}
  1836. @kindex M-S-@key{down}
  1837. @item M-S-@key{up}/@key{down}
  1838. Move the test line for column formulas in the Org buffer up and
  1839. down.
  1840. @kindex M-@key{up}
  1841. @kindex M-@key{down}
  1842. @item M-@key{up}/@key{down}
  1843. Scroll the window displaying the table.
  1844. @kindex C-c @}
  1845. @item C-c @}
  1846. Turn the coordinate grid in the table on and off.
  1847. @end table
  1848. @end table
  1849. Making a table field blank does not remove the formula associated with
  1850. the field, because that is stored in a different line (the @samp{TBLFM}
  1851. line) - during the next recalculation the field will be filled again.
  1852. To remove a formula from a field, you have to give an empty reply when
  1853. prompted for the formula, or to edit the @samp{#+TBLFM} line.
  1854. @kindex C-c C-c
  1855. You may edit the @samp{#+TBLFM} directly and re-apply the changed
  1856. equations with @kbd{C-c C-c} in that line, or with the normal
  1857. recalculation commands in the table.
  1858. @subsubheading Debugging formulas
  1859. @cindex formula debugging
  1860. @cindex debugging, of table formulas
  1861. When the evaluation of a formula leads to an error, the field content
  1862. becomes the string @samp{#ERROR}. If you would like see what is going
  1863. on during variable substitution and calculation in order to find a bug,
  1864. turn on formula debugging in the @code{Tbl} menu and repeat the
  1865. calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
  1866. field. Detailed information will be displayed.
  1867. @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
  1868. @subsection Updating the table
  1869. @cindex recomputing table fields
  1870. @cindex updating, table
  1871. Recalculation of a table is normally not automatic, but needs to be
  1872. triggered by a command. See @ref{Advanced features} for a way to make
  1873. recalculation at least semi-automatically.
  1874. In order to recalculate a line of a table or the entire table, use the
  1875. following commands:
  1876. @table @kbd
  1877. @kindex C-c *
  1878. @item C-c *
  1879. Recalculate the current row by first applying the stored column formulas
  1880. from left to right, and all field formulas in the current row.
  1881. @c
  1882. @kindex C-u C-c *
  1883. @item C-u C-c *
  1884. @kindex C-u C-c C-c
  1885. @itemx C-u C-c C-c
  1886. Recompute the entire table, line by line. Any lines before the first
  1887. hline are left alone, assuming that these are part of the table header.
  1888. @c
  1889. @kindex C-u C-u C-c *
  1890. @kindex C-u C-u C-c C-c
  1891. @item C-u C-u C-c *
  1892. @itemx C-u C-u C-c C-c
  1893. Iterate the table by recomputing it until no further changes occur.
  1894. This may be necessary if some computed fields use the value of other
  1895. fields that are computed @i{later} in the calculation sequence.
  1896. @end table
  1897. @node Advanced features, , Updating the table, The spreadsheet
  1898. @subsection Advanced features
  1899. If you want the recalculation of fields to happen automatically, or if
  1900. you want to be able to assign @i{names} to fields and columns, you need
  1901. to reserve the first column of the table for special marking characters.
  1902. @table @kbd
  1903. @kindex C-#
  1904. @item C-#
  1905. Rotate the calculation mark in first column through the states @samp{},
  1906. @samp{#}, @samp{*}, @samp{!}, @samp{$}. When there is an active region,
  1907. change all marks in the region.
  1908. @end table
  1909. Here is an example of a table that collects exam results of students and
  1910. makes use of these features:
  1911. @example
  1912. @group
  1913. |---+---------+--------+--------+--------+-------+------|
  1914. | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
  1915. |---+---------+--------+--------+--------+-------+------|
  1916. | ! | | P1 | P2 | P3 | Tot | |
  1917. | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
  1918. | ^ | | m1 | m2 | m3 | mt | |
  1919. |---+---------+--------+--------+--------+-------+------|
  1920. | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
  1921. | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
  1922. |---+---------+--------+--------+--------+-------+------|
  1923. | | Average | | | | 29.7 | |
  1924. | ^ | | | | | at | |
  1925. | $ | max=50 | | | | | |
  1926. |---+---------+--------+--------+--------+-------+------|
  1927. #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
  1928. @end group
  1929. @end example
  1930. @noindent @b{Important}: Please note that for these special tables,
  1931. recalculating the table with @kbd{C-u C-c *} will only affect rows that
  1932. are marked @samp{#} or @samp{*}, and fields that have a formula assigned
  1933. to the field itself. The column formulas are not applied in rows with
  1934. empty first field.
  1935. @cindex marking characters, tables
  1936. The marking characters have the following meaning:
  1937. @table @samp
  1938. @item !
  1939. The fields in this line define names for the columns, so that you may
  1940. refer to a column as @samp{$Tot} instead of @samp{$6}.
  1941. @item ^
  1942. This row defines names for the fields @emph{above} the row. With such
  1943. a definition, any formula in the table may use @samp{$m1} to refer to
  1944. the value @samp{10}. Also, if you assign a formula to a names field, it
  1945. will be stored as @samp{$name=...}.
  1946. @item _
  1947. Similar to @samp{^}, but defines names for the fields in the row
  1948. @emph{below}.
  1949. @item $
  1950. Fields in this row can define @emph{parameters} for formulas. For
  1951. example, if a field in a @samp{$} row contains @samp{max=50}, then
  1952. formulas in this table can refer to the value 50 using @samp{$max}.
  1953. Parameters work exactly like constants, only that they can be defined on
  1954. a per-table basis.
  1955. @item #
  1956. Fields in this row are automatically recalculated when pressing
  1957. @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
  1958. is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
  1959. lines will be left alone by this command.
  1960. @item *
  1961. Selects this line for global recalculation with @kbd{C-u C-c *}, but
  1962. not for automatic recalculation. Use this when automatic
  1963. recalculation slows down editing too much.
  1964. @item
  1965. Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
  1966. All lines that should be recalculated should be marked with @samp{#}
  1967. or @samp{*}.
  1968. @item /
  1969. Do not export this line. Useful for lines that contain the narrowing
  1970. @samp{<N>} markers.
  1971. @end table
  1972. Finally, just to whet your appetite on what can be done with the
  1973. fantastic @file{calc} package, here is a table that computes the Taylor
  1974. series of degree @code{n} at location @code{x} for a couple of
  1975. functions.
  1976. @example
  1977. @group
  1978. |---+-------------+---+-----+--------------------------------------|
  1979. | | Func | n | x | Result |
  1980. |---+-------------+---+-----+--------------------------------------|
  1981. | # | exp(x) | 1 | x | 1 + x |
  1982. | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
  1983. | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
  1984. | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
  1985. | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
  1986. | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
  1987. |---+-------------+---+-----+--------------------------------------|
  1988. #+TBLFM: $5=taylor($2,$4,$3);n3
  1989. @end group
  1990. @end example
  1991. @page
  1992. @node Org Plot, , The spreadsheet, Tables
  1993. @section Org Plot
  1994. @cindex graph, in tables
  1995. @cindex plot tables using gnuplot
  1996. Org Plot can produce 2D and 3D graphs of information stored in org tables
  1997. using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
  1998. @uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html}. To see
  1999. this in action ensure that you have both Gnuplot and Gnuplot-mode installed
  2000. on your system, then call @code{org-plot/gnuplot} on the following table.
  2001. @example
  2002. @group
  2003. #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
  2004. | Sede | Max cites | H-index |
  2005. |-----------+-----------+---------|
  2006. | Chile | 257.72 | 21.39 |
  2007. | Leeds | 165.77 | 19.68 |
  2008. | Sao Paolo | 71.00 | 11.50 |
  2009. | Stockholm | 134.19 | 14.33 |
  2010. | Morelia | 257.56 | 17.67 |
  2011. @end group
  2012. @end example
  2013. Notice that Org Plot is smart enough to apply the tables headers as labels.
  2014. Further control over the labels, type, content, and appearance of plots can
  2015. be exercised through the @code{#+Plot:} lines preceding a table. See below
  2016. for a complete list of Org plot options. For more information and examples
  2017. see the org-plot tutorial at
  2018. @uref{http://legito.org/worg/org-tutorials/org-plot.php}.
  2019. @subsubheading Plot Options
  2020. @table @code
  2021. @item set
  2022. Specify any @file{gnuplot} option to be set when graphing.
  2023. @item title
  2024. Specify the title of the plot.
  2025. @item ind
  2026. Specify which column of the table to use as the @code{x} axis.
  2027. @item deps
  2028. Specify the columns to graph as a lisp style list, surrounded by parenthesis
  2029. and separated by spaces for example @code{dep:(3 4)} to graph the third and
  2030. fourth columns (defaults to graphing all other columns aside from the ind
  2031. column).
  2032. @item type
  2033. Specify whether the plot will be @code{2d}, @code{3d}, or @code{grid}.
  2034. @item with
  2035. Specify a @code{with} option to be inserted for every col being plotted
  2036. (e.g. @code{lines}, @code{points}, @code{boxes}, @code{impulses}, etc...).
  2037. Defaults to 'lines'.
  2038. @item file
  2039. If you want to plot to a file specify the @code{"path/to/desired/output-file"}.
  2040. @item labels
  2041. List of labels to be used for the deps (defaults to column headers if they
  2042. exist).
  2043. @item line
  2044. Specify an entire line to be inserted in the gnuplot script.
  2045. @item map
  2046. When plotting @code{3d} or @code{grid} types, set this to @code{t} to graph a
  2047. flat mapping rather than a @code{3d} slope.
  2048. @item timefmt
  2049. Specify format of org-mode timestamps as they will be parsed by gnuplot.
  2050. Defaults to '%Y-%m-%d-%H:%M:%S'.
  2051. @item script
  2052. If you want total control you can specify a script file (place the file name
  2053. between double quotes) which will be used to plot. Before plotting, every
  2054. instance of @code{$datafile} in the specified script will be replaced with
  2055. the path to the generated data file. Note even if you set this option you
  2056. may still want to specify the plot type, as that can impact the content of
  2057. the data file.
  2058. @end table
  2059. @node Hyperlinks, TODO Items, Tables, Top
  2060. @chapter Hyperlinks
  2061. @cindex hyperlinks
  2062. Like HTML, Org provides links inside a file, external links to
  2063. other files, Usenet articles, emails, and much more.
  2064. @menu
  2065. * Link format:: How links in Org are formatted
  2066. * Internal links:: Links to other places in the current file
  2067. * External links:: URL-like links to the world
  2068. * Handling links:: Creating, inserting and following
  2069. * Using links outside Org:: Linking from my C source code?
  2070. * Link abbreviations:: Shortcuts for writing complex links
  2071. * Search options:: Linking to a specific location
  2072. * Custom searches:: When the default search is not enough
  2073. @end menu
  2074. @node Link format, Internal links, Hyperlinks, Hyperlinks
  2075. @section Link format
  2076. @cindex link format
  2077. @cindex format, of links
  2078. Org will recognize plain URL-like links and activate them as
  2079. clickable links. The general link format, however, looks like this:
  2080. @example
  2081. [[link][description]] @r{or alternatively} [[link]]
  2082. @end example
  2083. Once a link in the buffer is complete (all brackets present), Org
  2084. will change the display so that @samp{description} is displayed instead
  2085. of @samp{[[link][description]]} and @samp{link} is displayed instead of
  2086. @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
  2087. which by default is an underlined face. You can directly edit the
  2088. visible part of a link. Note that this can be either the @samp{link}
  2089. part (if there is no description) or the @samp{description} part. To
  2090. edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
  2091. cursor on the link.
  2092. If you place the cursor at the beginning or just behind the end of the
  2093. displayed text and press @key{BACKSPACE}, you will remove the
  2094. (invisible) bracket at that location. This makes the link incomplete
  2095. and the internals are again displayed as plain text. Inserting the
  2096. missing bracket hides the link internals again. To show the
  2097. internal structure of all links, use the menu entry
  2098. @code{Org->Hyperlinks->Literal links}.
  2099. @node Internal links, External links, Link format, Hyperlinks
  2100. @section Internal links
  2101. @cindex internal links
  2102. @cindex links, internal
  2103. @cindex targets, for links
  2104. If the link does not look like a URL, it is considered to be internal in
  2105. the current file. Links such as @samp{[[My Target]]} or @samp{[[My
  2106. Target][Find my target]]} lead to a text search in the current file.
  2107. The link can be followed with @kbd{C-c C-o} when the cursor is on the
  2108. link, or with a mouse click (@pxref{Handling links}). The preferred
  2109. match for such a link is a dedicated target: the same string in double
  2110. angular brackets. Targets may be located anywhere; sometimes it is
  2111. convenient to put them into a comment line. For example
  2112. @example
  2113. # <<My Target>>
  2114. @end example
  2115. @noindent In HTML export (@pxref{HTML export}), such targets will become
  2116. named anchors for direct access through @samp{http} links@footnote{Note that
  2117. text before the first headline is usually not exported, so the first such
  2118. target should be after the first headline, or in the line directly before the
  2119. first headline.}.
  2120. If no dedicated target exists, Org will search for the words in the
  2121. link. In the above example the search would be for @samp{my target}.
  2122. Links starting with a star like @samp{*My Target} restrict the search to
  2123. headlines. When searching, Org mode will first try an exact match, but
  2124. then move on to more and more lenient searches. For example, the link
  2125. @samp{[[*My Targets]]} will find any of the following:
  2126. @example
  2127. ** My targets
  2128. ** TODO my targets are bright
  2129. ** my 20 targets are
  2130. @end example
  2131. To insert a link targeting a headline, in-buffer completion can be used.
  2132. Just type a star followed by a few optional letters into the buffer and
  2133. press @kbd{M-@key{TAB}}. All headlines in the current buffer will be
  2134. offered as completions. @xref{Handling links}, for more commands
  2135. creating links.
  2136. Following a link pushes a mark onto Org's own mark ring. You can
  2137. return to the previous position with @kbd{C-c &}. Using this command
  2138. several times in direct succession goes back to positions recorded
  2139. earlier.
  2140. @menu
  2141. * Radio targets:: Make targets trigger links in plain text
  2142. @end menu
  2143. @node Radio targets, , Internal links, Internal links
  2144. @subsection Radio targets
  2145. @cindex radio targets
  2146. @cindex targets, radio
  2147. @cindex links, radio targets
  2148. Org can automatically turn any occurrences of certain target names
  2149. in normal text into a link. So without explicitly creating a link, the
  2150. text connects to the target radioing its position. Radio targets are
  2151. enclosed by triple angular brackets. For example, a target @samp{<<<My
  2152. Target>>>} causes each occurrence of @samp{my target} in normal text to
  2153. become activated as a link. The Org file is scanned automatically
  2154. for radio targets only when the file is first loaded into Emacs. To
  2155. update the target list during editing, press @kbd{C-c C-c} with the
  2156. cursor on or at a target.
  2157. @node External links, Handling links, Internal links, Hyperlinks
  2158. @section External links
  2159. @cindex links, external
  2160. @cindex external links
  2161. @cindex links, external
  2162. @cindex Gnus links
  2163. @cindex BBDB links
  2164. @cindex IRC links
  2165. @cindex URL links
  2166. @cindex file links
  2167. @cindex VM links
  2168. @cindex RMAIL links
  2169. @cindex WANDERLUST links
  2170. @cindex MH-E links
  2171. @cindex USENET links
  2172. @cindex SHELL links
  2173. @cindex Info links
  2174. @cindex elisp links
  2175. Org supports links to files, websites, Usenet and email messages,
  2176. BBDB database entries and links to both IRC conversations and their
  2177. logs. External links are URL-like locators. They start with a short
  2178. identifying string followed by a colon. There can be no space after
  2179. the colon. The following list shows examples for each link type.
  2180. @example
  2181. http://www.astro.uva.nl/~dominik @r{on the web}
  2182. file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
  2183. /home/dominik/images/jupiter.jpg @r{same as above}
  2184. file:papers/last.pdf @r{file, relative path}
  2185. ./papers/last.pdf @r{same as above}
  2186. news:comp.emacs @r{Usenet link}
  2187. mailto:adent@@galaxy.net @r{Mail link}
  2188. vm:folder @r{VM folder link}
  2189. vm:folder#id @r{VM message link}
  2190. vm://myself@@some.where.org/folder#id @r{VM on remote machine}
  2191. wl:folder @r{WANDERLUST folder link}
  2192. wl:folder#id @r{WANDERLUST message link}
  2193. mhe:folder @r{MH-E folder link}
  2194. mhe:folder#id @r{MH-E message link}
  2195. rmail:folder @r{RMAIL folder link}
  2196. rmail:folder#id @r{RMAIL message link}
  2197. gnus:group @r{Gnus group link}
  2198. gnus:group#id @r{Gnus article link}
  2199. bbdb:R.*Stallman @r{BBDB link (with regexp)}
  2200. irc:/irc.com/#emacs/bob @r{IRC link}
  2201. shell:ls *.org @r{A shell command}
  2202. elisp:org-agenda @r{Interactive elisp command}
  2203. elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate}
  2204. @end example
  2205. A link should be enclosed in double brackets and may contain a
  2206. descriptive text to be displayed instead of the URL (@pxref{Link
  2207. format}), for example:
  2208. @example
  2209. [[http://www.gnu.org/software/emacs/][GNU Emacs]]
  2210. @end example
  2211. @noindent
  2212. If the description is a file name or URL that points to an image, HTML
  2213. export (@pxref{HTML export}) will inline the image as a clickable
  2214. button. If there is no description at all and the link points to an
  2215. image,
  2216. that image will be inlined into the exported HTML file.
  2217. @cindex angular brackets, around links
  2218. @cindex plain text external links
  2219. Org also finds external links in the normal text and activates them
  2220. as links. If spaces must be part of the link (for example in
  2221. @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
  2222. about the end of the link, enclose them in angular brackets.
  2223. @node Handling links, Using links outside Org, External links, Hyperlinks
  2224. @section Handling links
  2225. @cindex links, handling
  2226. Org provides methods to create a link in the correct syntax, to
  2227. insert it into an Org file, and to follow the link.
  2228. @table @kbd
  2229. @kindex C-c l
  2230. @cindex storing links
  2231. @item C-c l
  2232. Store a link to the current location. This is a @emph{global} command which
  2233. can be used in any buffer to create a link. The link will be stored for
  2234. later insertion into an Org buffer (see below). For Org files, if there is a
  2235. @samp{<<target>>} at the cursor, the link points to the target. Otherwise it
  2236. points to the current headline, either by text, or, if @file{org-id.el} is
  2237. loaded, by ID property. For VM, Rmail, Wanderlust, MH-E, Gnus and BBDB
  2238. buffers, the link will indicate the current article/entry. For W3 and W3M
  2239. buffers, the link goes to the current URL. For IRC links, if you set the
  2240. variable @code{org-irc-link-to-logs} to non-nil then @kbd{C-c l} will store a
  2241. @samp{file:/} style link to the relevant point in the logs for the current
  2242. conversation. Otherwise an @samp{irc:/} style link to the user/channel/server
  2243. under the point will be stored. For any other files, the link will point to
  2244. the file, with a search string (@pxref{Search options}) pointing to the
  2245. contents of the current line. If there is an active region, the selected
  2246. words will form the basis of the search string. If the automatically created
  2247. link is not working correctly or accurately enough, you can write custom
  2248. functions to select the search string and to do the search for particular
  2249. file types - see @ref{Custom searches}. The key binding @kbd{C-c l} is only
  2250. a suggestion - see @ref{Installation}.
  2251. @c
  2252. @kindex C-c C-l
  2253. @cindex link completion
  2254. @cindex completion, of links
  2255. @cindex inserting links
  2256. @item C-c C-l
  2257. Insert a link. This prompts for a link to be inserted into the buffer. You
  2258. can just type a link, using text for an internal link, or one of the link
  2259. type prefixes mentioned in the examples above. All links stored during the
  2260. current session are part of the history for this prompt, so you can access
  2261. them with @key{up} and @key{down} (or @kbd{M-p/n}). Completion, on the other
  2262. hand, will help you to insert valid link prefixes like @samp{http:} or
  2263. @samp{ftp:}, including the prefixes defined through link abbreviations
  2264. (@pxref{Link abbreviations}). The link will be inserted into the
  2265. buffer@footnote{After insertion of a stored link, the link will be removed
  2266. from the list of stored links. To keep it in the list later use, use a
  2267. triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
  2268. @code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
  2269. If some text was selected when this command is called, the selected text
  2270. becomes the default description.@* Note that you don't have to use this
  2271. command to insert a link. Links in Org are plain text, and you can type
  2272. or paste them straight into the buffer. By using this command, the links are
  2273. automatically enclosed in double brackets, and you will be asked for the
  2274. optional descriptive text.
  2275. @c
  2276. @c If the link is a @samp{file:} link and
  2277. @c the linked file is located in the same directory as the current file or
  2278. @c a subdirectory of it, the path of the file will be inserted relative to
  2279. @c the current directory.
  2280. @c
  2281. @kindex C-u C-c C-l
  2282. @cindex file name completion
  2283. @cindex completion, of file names
  2284. @item C-u C-c C-l
  2285. When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
  2286. a file will be inserted and you may use file name completion to select
  2287. the name of the file. The path to the file is inserted relative to the
  2288. directory of the current org file, if the linked file is in the current
  2289. directory or in a sub-directory of it, or if the path is written relative
  2290. to the current directory using @samp{../}. Otherwise an absolute path
  2291. is used, if possible with @samp{~/} for your home directory. You can
  2292. force an absolute path with two @kbd{C-u} prefixes.
  2293. @c
  2294. @item C-c C-l @r{(with cursor on existing link)}
  2295. When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
  2296. link and description parts of the link.
  2297. @c
  2298. @cindex following links
  2299. @kindex C-c C-o
  2300. @item C-c C-o
  2301. Open link at point. This will launch a web browser for URLs (using
  2302. @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
  2303. the corresponding links, and execute the command in a shell link. When the
  2304. cursor is on an internal link, this commands runs the corresponding search.
  2305. When the cursor is on a TAG list in a headline, it creates the corresponding
  2306. TAGS view. If the cursor is on a time stamp, it compiles the agenda for that
  2307. date. Furthermore, it will visit text and remote files in @samp{file:} links
  2308. with Emacs and select a suitable application for local non-text files.
  2309. Classification of files is based on file extension only. See option
  2310. @code{org-file-apps}. If you want to override the default application and
  2311. visit the file with Emacs, use a @kbd{C-u} prefix. If you want to avoid
  2312. opening in Emacs, use a @kbd{C-u C-u} prefix.
  2313. @c
  2314. @kindex mouse-2
  2315. @kindex mouse-1
  2316. @item mouse-2
  2317. @itemx mouse-1
  2318. On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
  2319. would. Under Emacs 22, also @kbd{mouse-1} will follow a link.
  2320. @c
  2321. @kindex mouse-3
  2322. @item mouse-3
  2323. Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
  2324. internal links to be displayed in another window@footnote{See the
  2325. variable @code{org-display-internal-link-with-indirect-buffer}}.
  2326. @c
  2327. @cindex mark ring
  2328. @kindex C-c %
  2329. @item C-c %
  2330. Push the current position onto the mark ring, to be able to return
  2331. easily. Commands following an internal link do this automatically.
  2332. @c
  2333. @cindex links, returning to
  2334. @kindex C-c &
  2335. @item C-c &
  2336. Jump back to a recorded position. A position is recorded by the
  2337. commands following internal links, and by @kbd{C-c %}. Using this
  2338. command several times in direct succession moves through a ring of
  2339. previously recorded positions.
  2340. @c
  2341. @kindex C-c C-x C-n
  2342. @kindex C-c C-x C-p
  2343. @cindex links, finding next/previous
  2344. @item C-c C-x C-n
  2345. @itemx C-c C-x C-p
  2346. Move forward/backward to the next link in the buffer. At the limit of
  2347. the buffer, the search fails once, and then wraps around. The key
  2348. bindings for this are really too long, you might want to bind this also
  2349. to @kbd{C-n} and @kbd{C-p}
  2350. @lisp
  2351. (add-hook 'org-load-hook
  2352. (lambda ()
  2353. (define-key 'org-mode-map "\C-n" 'org-next-link)
  2354. (define-key 'org-mode-map "\C-p" 'org-previous-link)))
  2355. @end lisp
  2356. @end table
  2357. @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
  2358. @section Using links outside Org
  2359. You can insert and follow links that have Org syntax not only in
  2360. Org, but in any Emacs buffer. For this, you should create two
  2361. global commands, like this (please select suitable global keys
  2362. yourself):
  2363. @lisp
  2364. (global-set-key "\C-c L" 'org-insert-link-global)
  2365. (global-set-key "\C-c o" 'org-open-at-point-global)
  2366. @end lisp
  2367. @node Link abbreviations, Search options, Using links outside Org, Hyperlinks
  2368. @section Link abbreviations
  2369. @cindex link abbreviations
  2370. @cindex abbreviation, links
  2371. Long URLs can be cumbersome to type, and often many similar links are
  2372. needed in a document. For this you can use link abbreviations. An
  2373. abbreviated link looks like this
  2374. @example
  2375. [[linkword:tag][description]]
  2376. @end example
  2377. @noindent
  2378. where the tag is optional. Such abbreviations are resolved according to
  2379. the information in the variable @code{org-link-abbrev-alist} that
  2380. relates the linkwords to replacement text. Here is an example:
  2381. @lisp
  2382. @group
  2383. (setq org-link-abbrev-alist
  2384. '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
  2385. ("google" . "http://www.google.com/search?q=")
  2386. ("ads" . "http://adsabs.harvard.edu/cgi-bin/
  2387. nph-abs_connect?author=%s&db_key=AST")))
  2388. @end group
  2389. @end lisp
  2390. If the replacement text contains the string @samp{%s}, it will be
  2391. replaced with the tag. Otherwise the tag will be appended to the string
  2392. in order to create the link. You may also specify a function that will
  2393. be called with the tag as the only argument to create the link.
  2394. With the above setting, you could link to a specific bug with
  2395. @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
  2396. @code{[[google:OrgMode]]} and find out what the Org author is
  2397. doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
  2398. If you need special abbreviations just for a single Org buffer, you
  2399. can define them in the file with
  2400. @example
  2401. #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
  2402. #+LINK: google http://www.google.com/search?q=%s
  2403. @end example
  2404. @noindent
  2405. In-buffer completion @pxref{Completion} can be used after @samp{[} to
  2406. complete link abbreviations.
  2407. @node Search options, Custom searches, Link abbreviations, Hyperlinks
  2408. @section Search options in file links
  2409. @cindex search option in file links
  2410. @cindex file links, searching
  2411. File links can contain additional information to make Emacs jump to a
  2412. particular location in the file when following a link. This can be a
  2413. line number or a search option after a double@footnote{For backward
  2414. compatibility, line numbers can also follow a single colon.} colon. For
  2415. example, when the command @kbd{C-c l} creates a link (@pxref{Handling
  2416. links}) to a file, it encodes the words in the current line as a search
  2417. string that can be used to find this line back later when following the
  2418. link with @kbd{C-c C-o}.
  2419. Here is the syntax of the different ways to attach a search to a file
  2420. link, together with an explanation:
  2421. @example
  2422. [[file:~/code/main.c::255]]
  2423. [[file:~/xx.org::My Target]]
  2424. [[file:~/xx.org::*My Target]]
  2425. [[file:~/xx.org::/regexp/]]
  2426. @end example
  2427. @table @code
  2428. @item 255
  2429. Jump to line 255.
  2430. @item My Target
  2431. Search for a link target @samp{<<My Target>>}, or do a text search for
  2432. @samp{my target}, similar to the search in internal links, see
  2433. @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
  2434. link will become an HTML reference to the corresponding named anchor in
  2435. the linked file.
  2436. @item *My Target
  2437. In an Org file, restrict search to headlines.
  2438. @item /regexp/
  2439. Do a regular expression search for @code{regexp}. This uses the Emacs
  2440. command @code{occur} to list all matches in a separate window. If the
  2441. target file is in Org mode, @code{org-occur} is used to create a
  2442. sparse tree with the matches.
  2443. @c If the target file is a directory,
  2444. @c @code{grep} will be used to search all files in the directory.
  2445. @end table
  2446. As a degenerate case, a file link with an empty file name can be used
  2447. to search the current file. For example, @code{[[file:::find me]]} does
  2448. a search for @samp{find me} in the current file, just as
  2449. @samp{[[find me]]} would.
  2450. @node Custom searches, , Search options, Hyperlinks
  2451. @section Custom Searches
  2452. @cindex custom search strings
  2453. @cindex search strings, custom
  2454. The default mechanism for creating search strings and for doing the
  2455. actual search related to a file link may not work correctly in all
  2456. cases. For example, BibTeX database files have many entries like
  2457. @samp{year="1993"} which would not result in good search strings,
  2458. because the only unique identification for a BibTeX entry is the
  2459. citation key.
  2460. If you come across such a problem, you can write custom functions to set
  2461. the right search string for a particular file type, and to do the search
  2462. for the string in the file. Using @code{add-hook}, these functions need
  2463. to be added to the hook variables
  2464. @code{org-create-file-search-functions} and
  2465. @code{org-execute-file-search-functions}. See the docstring for these
  2466. variables for more information. Org actually uses this mechanism
  2467. for Bib@TeX{} database files, and you can use the corresponding code as
  2468. an implementation example. See the file @file{org-bibtex.el}.
  2469. @node TODO Items, Tags, Hyperlinks, Top
  2470. @chapter TODO Items
  2471. @cindex TODO items
  2472. Org mode does not maintain TODO lists as separate documents@footnote{Of
  2473. course, you can make a document that contains inly long lists of TODO items,
  2474. but this is not required.}. Instead, TODO items are an integral part of the
  2475. notes file, because TODO items usually come up while taking notes! With Org
  2476. mode, simply mark any entry in a tree as being a TODO item. In this way,
  2477. information is not duplicated, and the entire context from which the TODO
  2478. item emerged is always present.
  2479. Of course, this technique for managing TODO items scatters them
  2480. throughout your notes file. Org mode compensates for this by providing
  2481. methods to give you an overview of all the things that you have to do.
  2482. @menu
  2483. * TODO basics:: Marking and displaying TODO entries
  2484. * TODO extensions:: Workflow and assignments
  2485. * Progress logging:: Dates and notes for progress
  2486. * Priorities:: Some things are more important than others
  2487. * Breaking down tasks:: Splitting a task into manageable pieces
  2488. * Checkboxes:: Tick-off lists
  2489. @end menu
  2490. @node TODO basics, TODO extensions, TODO Items, TODO Items
  2491. @section Basic TODO functionality
  2492. Any headline becomes a TODO item when it starts with the word
  2493. @samp{TODO}, for example:
  2494. @example
  2495. *** TODO Write letter to Sam Fortune
  2496. @end example
  2497. @noindent
  2498. The most important commands to work with TODO entries are:
  2499. @table @kbd
  2500. @kindex C-c C-t
  2501. @cindex cycling, of TODO states
  2502. @item C-c C-t
  2503. Rotate the TODO state of the current item among
  2504. @example
  2505. ,-> (unmarked) -> TODO -> DONE --.
  2506. '--------------------------------'
  2507. @end example
  2508. The same rotation can also be done ``remotely'' from the timeline and
  2509. agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
  2510. @kindex C-u C-c C-t
  2511. @item C-u C-c C-t
  2512. Select a specific keyword using completion or (if it has been set up)
  2513. the fast selection interface. For the latter, you need to assign keys
  2514. to TODO states, see @ref{Per-file keywords} and @ref{Setting tags} for
  2515. more information.
  2516. @kindex S-@key{right}
  2517. @kindex S-@key{left}
  2518. @item S-@key{right}
  2519. @itemx S-@key{left}
  2520. Select the following/preceding TODO state, similar to cycling. Useful
  2521. mostly if more than two TODO states are possible (@pxref{TODO
  2522. extensions}).
  2523. @kindex C-c C-v
  2524. @kindex C-c / t
  2525. @cindex sparse tree, for TODO
  2526. @item C-c C-v
  2527. @itemx C-c / t
  2528. View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
  2529. the entire buffer, but shows all TODO items and the headings hierarchy
  2530. above them. With a prefix argument, search for a specific TODO. You will be
  2531. prompted for the keyword, and you can also give a list of keywords like
  2532. @code{KWD1|KWD2|...}. With numeric prefix argument N, show the tree for the
  2533. Nth keyword in the variable @code{org-todo-keywords}. With two prefix
  2534. arguments, find all TODO and DONE entries.
  2535. @kindex C-c a t
  2536. @item C-c a t
  2537. Show the global TODO list. Collects the TODO items from all agenda
  2538. files (@pxref{Agenda Views}) into a single buffer. The new buffer will
  2539. be in @code{agenda-mode}, which provides commands to examine and
  2540. manipulate the TODO entries from the new buffer (@pxref{Agenda
  2541. commands}). @xref{Global TODO list}, for more information.
  2542. @kindex S-M-@key{RET}
  2543. @item S-M-@key{RET}
  2544. Insert a new TODO entry below the current one.
  2545. @end table
  2546. @noindent
  2547. Changing a TODO state can also trigger tag changes. See the docstring of the
  2548. option @code{org-todo-state-tags-triggers} for details.
  2549. @node TODO extensions, Progress logging, TODO basics, TODO Items
  2550. @section Extended use of TODO keywords
  2551. @cindex extended TODO keywords
  2552. By default, marked TODO entries have one of only two states: TODO and
  2553. DONE. Org mode allows you to classify TODO items in more complex ways
  2554. with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
  2555. special setup, the TODO keyword system can work differently in different
  2556. files.
  2557. Note that @i{tags} are another way to classify headlines in general and
  2558. TODO items in particular (@pxref{Tags}).
  2559. @menu
  2560. * Workflow states:: From TODO to DONE in steps
  2561. * TODO types:: I do this, Fred does the rest
  2562. * Multiple sets in one file:: Mixing it all, and still finding your way
  2563. * Fast access to TODO states:: Single letter selection of a state
  2564. * Per-file keywords:: Different files, different requirements
  2565. * Faces for TODO keywords:: Highlighting states
  2566. @end menu
  2567. @node Workflow states, TODO types, TODO extensions, TODO extensions
  2568. @subsection TODO keywords as workflow states
  2569. @cindex TODO workflow
  2570. @cindex workflow states as TODO keywords
  2571. You can use TODO keywords to indicate different @emph{sequential} states
  2572. in the process of working on an item, for example@footnote{Changing
  2573. this variable only becomes effective after restarting Org mode in a
  2574. buffer.}:
  2575. @lisp
  2576. (setq org-todo-keywords
  2577. '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
  2578. @end lisp
  2579. The vertical bar separates the TODO keywords (states that @emph{need
  2580. action}) from the DONE states (which need @emph{no further action}). If
  2581. you don't provide the separator bar, the last state is used as the DONE
  2582. state.
  2583. @cindex completion, of TODO keywords
  2584. With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
  2585. to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
  2586. also use a numeric prefix argument to quickly select a specific state. For
  2587. example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
  2588. Or you can use @kbd{S-left} to go backward through the sequence. If you
  2589. define many keywords, you can use in-buffer completion
  2590. (@pxref{Completion}) or even a special one-key selection scheme
  2591. (@pxref{Fast access to TODO states}) to insert these words into the
  2592. buffer. Changing a TODO state can be logged with a timestamp, see
  2593. @ref{Tracking TODO state changes} for more information.
  2594. @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
  2595. @subsection TODO keywords as types
  2596. @cindex TODO types
  2597. @cindex names as TODO keywords
  2598. @cindex types as TODO keywords
  2599. The second possibility is to use TODO keywords to indicate different
  2600. @emph{types} of action items. For example, you might want to indicate
  2601. that items are for ``work'' or ``home''. Or, when you work with several
  2602. people on a single project, you might want to assign action items
  2603. directly to persons, by using their names as TODO keywords. This would
  2604. be set up like this:
  2605. @lisp
  2606. (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
  2607. @end lisp
  2608. In this case, different keywords do not indicate a sequence, but rather
  2609. different types. So the normal work flow would be to assign a task to a
  2610. person, and later to mark it DONE. Org mode supports this style by adapting
  2611. the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
  2612. @kbd{t} command in the timeline and agenda buffers.}. When used several
  2613. times in succession, it will still cycle through all names, in order to first
  2614. select the right type for a task. But when you return to the item after some
  2615. time and execute @kbd{C-c C-t} again, it will switch from any name directly
  2616. to DONE. Use prefix arguments or completion to quickly select a specific
  2617. name. You can also review the items of a specific TODO type in a sparse tree
  2618. by using a numeric prefix to @kbd{C-c C-v}. For example, to see all things
  2619. Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect Lucy's items
  2620. from all agenda files into a single buffer, you would use the numeric prefix
  2621. argument as well when creating the global TODO list: @kbd{C-3 C-c t}.
  2622. @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
  2623. @subsection Multiple keyword sets in one file
  2624. @cindex TODO keyword sets
  2625. Sometimes you may want to use different sets of TODO keywords in
  2626. parallel. For example, you may want to have the basic
  2627. @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
  2628. separate state indicating that an item has been canceled (so it is not
  2629. DONE, but also does not require action). Your setup would then look
  2630. like this:
  2631. @lisp
  2632. (setq org-todo-keywords
  2633. '((sequence "TODO" "|" "DONE")
  2634. (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
  2635. (sequence "|" "CANCELED")))
  2636. @end lisp
  2637. The keywords should all be different, this helps Org mode to keep track
  2638. of which subsequence should be used for a given entry. In this setup,
  2639. @kbd{C-c C-t} only operates within a subsequence, so it switches from
  2640. @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
  2641. (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
  2642. select the correct sequence. Besides the obvious ways like typing a
  2643. keyword or using completion, you may also apply the following commands:
  2644. @table @kbd
  2645. @kindex C-S-@key{right}
  2646. @kindex C-S-@key{left}
  2647. @item C-S-@key{right}
  2648. @itemx C-S-@key{left}
  2649. These keys jump from one TODO subset to the next. In the above example,
  2650. @kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
  2651. @code{REPORT}, and any of the words in the second row to @code{CANCELED}.
  2652. @kindex S-@key{right}
  2653. @kindex S-@key{left}
  2654. @item S-@key{right}
  2655. @itemx S-@key{left}
  2656. @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
  2657. @emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
  2658. would switch from @code{DONE} to @code{REPORT} in the example above.
  2659. @end table
  2660. @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
  2661. @subsection Fast access to TODO states
  2662. If you would like to quickly change an entry to an arbitrary TODO state
  2663. instead of cycling through the states, you can set up keys for
  2664. single-letter access to the states. This is done by adding the section
  2665. key after each keyword, in parenthesis. For example:
  2666. @lisp
  2667. (setq org-todo-keywords
  2668. '((sequence "TODO(t)" "|" "DONE(d)")
  2669. (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
  2670. (sequence "|" "CANCELED(c)")))
  2671. @end lisp
  2672. If you then press @code{C-u C-c C-t} followed by the selection key, the
  2673. entry will be switched to this state. @key{SPC} can be used to remove
  2674. any TODO keyword from an entry. Should you like this way of selecting
  2675. TODO states a lot, you might want to set the variable
  2676. @code{org-use-fast-todo-selection} to @code{t} and make this behavior
  2677. the default. Check also the variable
  2678. @code{org-fast-tag-selection-include-todo}, it allows to change the TODO
  2679. state through the tags interface (@pxref{Setting tags}), in case you
  2680. like to mingle the two concepts.
  2681. @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
  2682. @subsection Setting up keywords for individual files
  2683. @cindex keyword options
  2684. @cindex per-file keywords
  2685. It can be very useful to use different aspects of the TODO mechanism in
  2686. different files. For file-local settings, you need to add special lines
  2687. to the file which set the keywords and interpretation for that file
  2688. only. For example, to set one of the two examples discussed above, you
  2689. need one of the following lines, starting in column zero anywhere in the
  2690. file:
  2691. @example
  2692. #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
  2693. @end example
  2694. or
  2695. @example
  2696. #+TYP_TODO: Fred Sara Lucy Mike | DONE
  2697. @end example
  2698. A setup for using several sets in parallel would be:
  2699. @example
  2700. #+SEQ_TODO: TODO | DONE
  2701. #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
  2702. #+SEQ_TODO: | CANCELED
  2703. @end example
  2704. @cindex completion, of option keywords
  2705. @kindex M-@key{TAB}
  2706. @noindent To make sure you are using the correct keyword, type
  2707. @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
  2708. @cindex DONE, final TODO keyword
  2709. Remember that the keywords after the vertical bar (or the last keyword
  2710. if no bar is there) must always mean that the item is DONE (although you
  2711. may use a different word). After changing one of these lines, use
  2712. @kbd{C-c C-c} with the cursor still in the line to make the changes
  2713. known to Org mode@footnote{Org mode parses these lines only when
  2714. Org mode is activated after visiting a file. @kbd{C-c C-c} with the
  2715. cursor in a line starting with @samp{#+} is simply restarting Org mode
  2716. for the current buffer.}.
  2717. @node Faces for TODO keywords, , Per-file keywords, TODO extensions
  2718. @subsection Faces for TODO keywords
  2719. @cindex faces, for TODO keywords
  2720. Org mode highlights TODO keywords with special faces: @code{org-todo}
  2721. for keywords indicating that an item still has to be acted upon, and
  2722. @code{org-done} for keywords indicating that an item is finished. If
  2723. you are using more than 2 different states, you might want to use
  2724. special faces for some of them. This can be done using the variable
  2725. @code{org-todo-keyword-faces}. For example:
  2726. @lisp
  2727. @group
  2728. (setq org-todo-keyword-faces
  2729. '(("TODO" . org-warning)
  2730. ("DEFERRED" . shadow)
  2731. ("CANCELED" . (:foreground "blue" :weight bold))))
  2732. @end group
  2733. @end lisp
  2734. While using a list with face properties as shown for CANCELED
  2735. @emph{should} work, this does not aways seem to be the case. If
  2736. necessary, define a special face and use that.
  2737. @page
  2738. @node Progress logging, Priorities, TODO extensions, TODO Items
  2739. @section Progress logging
  2740. @cindex progress logging
  2741. @cindex logging, of progress
  2742. Org mode can automatically record a time stamp and possibly a note when
  2743. you mark a TODO item as DONE, or even each time you change the state of
  2744. a TODO item. This system is highly configurable, settings can be on a
  2745. per-keyword basis and can be localized to a file or even a subtree. For
  2746. information on how to clock working time for a task, see @ref{Clocking
  2747. work time}.
  2748. @menu
  2749. * Closing items:: When was this entry marked DONE?
  2750. * Tracking TODO state changes:: When did the status change?
  2751. @end menu
  2752. @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
  2753. @subsection Closing items
  2754. The most basic logging is to keep track of @emph{when} a certain TODO
  2755. item was finished. This is achieved with@footnote{The corresponding
  2756. in-buffer setting is: @code{#+STARTUP: logdone}}.
  2757. @lisp
  2758. (setq org-log-done 'time)
  2759. @end lisp
  2760. @noindent
  2761. Then each time you turn an entry from a TODO (not-done) state into any
  2762. of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
  2763. just after the headline. If you turn the entry back into a TODO item
  2764. through further state cycling, that line will be removed again. If you
  2765. want to record a note along with the timestamp, use@footnote{The
  2766. corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
  2767. @lisp
  2768. (setq org-log-done 'note)
  2769. @end lisp
  2770. @noindent
  2771. You will then be prompted for a note, and that note will be stored below
  2772. the entry with a @samp{Closing Note} heading.
  2773. In the timeline (@pxref{Timeline}) and in the agenda
  2774. (@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
  2775. display the TODO items with a @samp{CLOSED} timestamp on each day,
  2776. giving you an overview of what has been done.
  2777. @node Tracking TODO state changes, , Closing items, Progress logging
  2778. @subsection Tracking TODO state changes
  2779. When TODO keywords are used as workflow states (@pxref{Workflow
  2780. states}), you might want to keep track of when a state change occurred
  2781. and maybe take a note about this change. Since it is normally too much
  2782. to record a note for every state, Org mode expects configuration on a
  2783. per-keyword basis for this. This is achieved by adding special markers
  2784. @samp{!} (for a time stamp) and @samp{@@} (for a note) in parenthesis
  2785. after each keyword. For example, with the setting
  2786. @lisp
  2787. (setq org-todo-keywords
  2788. '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
  2789. @end lisp
  2790. @noindent
  2791. you not only define global TODO keywords and fast access keys, but also
  2792. request that a time is recorded when the entry is turned into
  2793. DONE@footnote{It is possible that Org mode will record two time stamps
  2794. when you are using both @code{org-log-done} and state change logging.
  2795. However, it will never prompt for two notes - if you have configured
  2796. both, the state change recording note will take precedence and cancel
  2797. the @samp{Closing Note}.}, and that a note is recorded when switching to
  2798. WAIT or CANCELED. The setting for WAIT is even more special: The
  2799. @samp{!} after the slash means that in addition to the note taken when
  2800. entering the state, a time stamp should be recorded when @i{leaving} the
  2801. WAIT state, if and only if the @i{target} state does not configure
  2802. logging for entering it. So it has no effect when switching from WAIT
  2803. to DONE, because DONE is configured to record a timestamp only. But
  2804. when switching from WAIT back to TODO, the @samp{/!} in the WAIT
  2805. setting now triggers a timestamp even though TODO has no logging
  2806. configured.
  2807. You can use the exact same syntax for setting logging preferences local
  2808. to a buffer:
  2809. @example
  2810. #+SEQ_TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
  2811. @end example
  2812. In order to define logging settings that are local to a subtree or a
  2813. single item, define a LOGGING property in this entry. Any non-empty
  2814. LOGGING property resets all logging settings to nil. You may then turn
  2815. on logging for this specific tree using STARTUP keywords like
  2816. @code{lognotedone} or @code{logrepeat}, as well as adding state specific
  2817. settings like @code{TODO(!)}. For example
  2818. @example
  2819. * TODO Log each state with only a time
  2820. :PROPERTIES:
  2821. :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
  2822. :END:
  2823. * TODO Only log when switching to WAIT, and when repeating
  2824. :PROPERTIES:
  2825. :LOGGING: WAIT(@@) logrepeat
  2826. :END:
  2827. * TODO No logging at all
  2828. :PROPERTIES:
  2829. :LOGGING: nil
  2830. :END:
  2831. @end example
  2832. @node Priorities, Breaking down tasks, Progress logging, TODO Items
  2833. @section Priorities
  2834. @cindex priorities
  2835. If you use Org mode extensively, you may end up enough TODO items that
  2836. it starts to make sense to prioritize them. Prioritizing can be done by
  2837. placing a @emph{priority cookie} into the headline of a TODO item, like
  2838. this
  2839. @example
  2840. *** TODO [#A] Write letter to Sam Fortune
  2841. @end example
  2842. @noindent
  2843. By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
  2844. @samp{C}. @samp{A} is the highest priority. An entry without a cookie
  2845. is treated as priority @samp{B}. Priorities make a difference only in
  2846. the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have
  2847. no inherent meaning to Org mode.
  2848. Priorities can be attached to any outline tree entries; they do not need
  2849. to be TODO items.
  2850. @table @kbd
  2851. @kindex @kbd{C-c ,}
  2852. @item @kbd{C-c ,}
  2853. Set the priority of the current headline. The command prompts for a
  2854. priority character @samp{A}, @samp{B} or @samp{C}. When you press
  2855. @key{SPC} instead, the priority cookie is removed from the headline.
  2856. The priorities can also be changed ``remotely'' from the timeline and
  2857. agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
  2858. @c
  2859. @kindex S-@key{up}
  2860. @kindex S-@key{down}
  2861. @item S-@key{up}
  2862. @itemx S-@key{down}
  2863. Increase/decrease priority of current headline@footnote{See also the
  2864. option @code{org-priority-start-cycle-with-default'}.}. Note that these
  2865. keys are also used to modify time stamps (@pxref{Creating timestamps}).
  2866. Furthermore, these keys are also used by CUA mode (@pxref{Conflicts}).
  2867. @end table
  2868. You can change the range of allowed priorities by setting the variables
  2869. @code{org-highest-priority}, @code{org-lowest-priority}, and
  2870. @code{org-default-priority}. For an individual buffer, you may set
  2871. these values (highest, lowest, default) like this (please make sure that
  2872. the highest priority is earlier in the alphabet than the lowest
  2873. priority):
  2874. @example
  2875. #+PRIORITIES: A C B
  2876. @end example
  2877. @node Breaking down tasks, Checkboxes, Priorities, TODO Items
  2878. @section Breaking tasks down into subtasks
  2879. @cindex tasks, breaking down
  2880. It is often advisable to break down large tasks into smaller, manageable
  2881. subtasks. You can do this by creating an outline tree below a TODO item,
  2882. with detailed subtasks on the tree@footnote{To keep subtasks out of the
  2883. global TODO list, see the @code{org-agenda-todo-list-sublevels}.}. To keep
  2884. the overview over the fraction of subtasks that are already completed, insert
  2885. either @samp{[/]} or @samp{[%]} anywhere in the headline. These cookies will
  2886. be updates each time the todo status of a child changes. For example:
  2887. @example
  2888. * Organize Party [33%]
  2889. ** TODO Call people [1/2]
  2890. *** TODO Peter
  2891. *** DONE Sarah
  2892. ** TODO Buy food
  2893. ** DONE Talk to neighbor
  2894. @end example
  2895. If you would like a TODO entry to automatically change to DONE when all
  2896. chilrden are done, you can use the following setup:
  2897. @example
  2898. (defun org-summary-todo (n-done n-not-done)
  2899. "Switch entry to DONE when all subentries are done, to TODO otherwise."
  2900. (let (org-log-done org-log-states) ; turn off logging
  2901. (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
  2902. (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
  2903. @end example
  2904. Another possibility is the use of checkboxes to identify (a hierarchy of) a
  2905. large number of subtasks (@pxref{Checkboxes}).
  2906. @node Checkboxes, , Breaking down tasks, TODO Items
  2907. @section Checkboxes
  2908. @cindex checkboxes
  2909. Every item in a plain list (@pxref{Plain lists}) can be made into a
  2910. checkbox by starting it with the string @samp{[ ]}. This feature is
  2911. similar to TODO items (@pxref{TODO Items}), but is more lightweight.
  2912. Checkboxes are not included into the global TODO list, so they are often
  2913. great to split a task into a number of simple steps. Or you can use
  2914. them in a shopping list. To toggle a checkbox, use @kbd{C-c C-c}, or
  2915. use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}).
  2916. Here is an example of a checkbox list.
  2917. @example
  2918. * TODO Organize party [2/4]
  2919. - [-] call people [1/3]
  2920. - [ ] Peter
  2921. - [X] Sarah
  2922. - [ ] Sam
  2923. - [X] order food
  2924. - [ ] think about what music to play
  2925. - [X] talk to the neighbors
  2926. @end example
  2927. Checkboxes work hierarchically, so if a checkbox item has children that
  2928. are checkboxes, toggling one of the children checkboxes will make the
  2929. parent checkbox reflect if none, some, or all of the children are
  2930. checked.
  2931. @cindex statistics, for checkboxes
  2932. @cindex checkbox statistics
  2933. The @samp{[2/4]} and @samp{[1/3]} in the first and second line are
  2934. cookies indicating how many checkboxes present in this entry have been
  2935. checked off, and the total number of checkboxes are present. This can
  2936. give you an idea on how many checkboxes remain, even without opening a
  2937. folded entry. The cookies can be placed into a headline or into (the
  2938. first line of) a plain list item. Each cookie covers all checkboxes
  2939. structurally below the headline/item on which the cookie appear. You
  2940. have to insert the cookie yourself by typing either @samp{[/]} or
  2941. @samp{[%]}. With @samp{[/]} you get an @samp{n out of m} result, as in
  2942. the examples above. With @samp{[%]} you get information about the
  2943. percentage of checkboxes checked (in the above example, this would be
  2944. @samp{[50%]} and @samp{[33%]}, respectively).
  2945. @noindent The following commands work with checkboxes:
  2946. @table @kbd
  2947. @kindex C-c C-c
  2948. @item C-c C-c
  2949. Toggle checkbox at point. With a prefix argument, set it to @samp{[-]},
  2950. which is considered to be an intermediate state.
  2951. @kindex C-c C-x C-b
  2952. @item C-c C-x C-b
  2953. Toggle checkbox at point.
  2954. @itemize @minus
  2955. @item
  2956. If there is an active region, toggle the first checkbox in the region
  2957. and set all remaining boxes to the same status as the first. If you
  2958. want to toggle all boxes in the region independently, use a prefix
  2959. argument.
  2960. @item
  2961. If the cursor is in a headline, toggle checkboxes in the region between
  2962. this headline and the next (so @emph{not} the entire subtree).
  2963. @item
  2964. If there is no active region, just toggle the checkbox at point.
  2965. @end itemize
  2966. @kindex M-S-@key{RET}
  2967. @item M-S-@key{RET}
  2968. Insert a new item with a checkbox.
  2969. This works only if the cursor is already in a plain list item
  2970. (@pxref{Plain lists}).
  2971. @kindex C-c #
  2972. @item C-c #
  2973. Update the checkbox statistics in the current outline entry. When
  2974. called with a @kbd{C-u} prefix, update the entire file. Checkbox
  2975. statistic cookies are updated automatically if you toggle checkboxes
  2976. with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}. If you
  2977. delete boxes or add/change them by hand, use this command to get things
  2978. back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
  2979. @end table
  2980. @node Tags, Properties and Columns, TODO Items, Top
  2981. @chapter Tags
  2982. @cindex tags
  2983. @cindex headline tagging
  2984. @cindex matching, tags
  2985. @cindex sparse tree, tag based
  2986. An excellent way to implement labels and contexts for cross-correlating
  2987. information is to assign @i{tags} to headlines. Org mode has extensive
  2988. support for tags.
  2989. Every headline can contain a list of tags; they occur at the end of the
  2990. headline. Tags are normal words containing letters, numbers, @samp{_}, and
  2991. @samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
  2992. @samp{:work:}. Several tags can be specified, as in @samp{:work:urgent:}.
  2993. Tags will by default get a bold face with the same color as the headline.
  2994. You may specify special faces for specific tags using the variable
  2995. @code{org-tag-faces}, much in the same way as you can do for TODO keywords
  2996. (@pxref{Faces for TODO keywords}).
  2997. @menu
  2998. * Tag inheritance:: Tags use the tree structure of the outline
  2999. * Setting tags:: How to assign tags to a headline
  3000. * Tag searches:: Searching for combinations of tags
  3001. @end menu
  3002. @node Tag inheritance, Setting tags, Tags, Tags
  3003. @section Tag inheritance
  3004. @cindex tag inheritance
  3005. @cindex inheritance, of tags
  3006. @cindex sublevels, inclusion into tags match
  3007. @i{Tags} make use of the hierarchical structure of outline trees. If a
  3008. heading has a certain tag, all subheadings will inherit the tag as
  3009. well. For example, in the list
  3010. @example
  3011. * Meeting with the French group :work:
  3012. ** Summary by Frank :boss:notes:
  3013. *** TODO Prepare slides for him :action:
  3014. @end example
  3015. @noindent
  3016. the final heading will have the tags @samp{:work:}, @samp{:boss:},
  3017. @samp{:notes:}, and @samp{:action:} even though the final heading is not
  3018. explicitly marked with those tags. You can also set tags that all entries in
  3019. a file should inherit as if these tags would be defined in a hypothetical
  3020. level zero that surounds the entire file.
  3021. @example
  3022. #+FILETAGS: :Peter:Boss:Secret:
  3023. @end example
  3024. @noindent
  3025. To limit tag inheritance to specific tags, or to turn it off entirely, use
  3026. the variables @code{org-use-tag-inheritance} and
  3027. @code{org-tags-exclude-from-inheritance}.
  3028. When a headline matches during a tags search while tag inheritance is turned
  3029. on, all the sublevels in the same tree will (for a simple match form) match
  3030. as well@footnote{This is only true if the the search does not involve more
  3031. complex tests including properties (@pxref{Property searches}).}. The list
  3032. of matches may then become very long. If you only want to see the first tags
  3033. match in a subtree, configure the variable
  3034. @code{org-tags-match-list-sublevels} (not recommended).
  3035. @node Setting tags, Tag searches, Tag inheritance, Tags
  3036. @section Setting tags
  3037. @cindex setting tags
  3038. @cindex tags, setting
  3039. @kindex M-@key{TAB}
  3040. Tags can simply be typed into the buffer at the end of a headline.
  3041. After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
  3042. also a special command for inserting tags:
  3043. @table @kbd
  3044. @kindex C-c C-q
  3045. @item C-c C-q
  3046. @cindex completion, of tags
  3047. Enter new tags for the current headline. Org mode will either offer
  3048. completion or a special single-key interface for setting tags, see
  3049. below. After pressing @key{RET}, the tags will be inserted and aligned
  3050. to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
  3051. tags in the current buffer will be aligned to that column, just to make
  3052. things look nice. TAGS are automatically realigned after promotion,
  3053. demotion, and TODO state changes (@pxref{TODO basics}).
  3054. @kindex C-c C-c
  3055. @item C-c C-c
  3056. When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
  3057. @end table
  3058. Org will support tag insertion based on a @emph{list of tags}. By
  3059. default this list is constructed dynamically, containing all tags
  3060. currently used in the buffer. You may also globally specify a hard list
  3061. of tags with the variable @code{org-tag-alist}. Finally you can set
  3062. the default tags for a given file with lines like
  3063. @example
  3064. #+TAGS: @@work @@home @@tennisclub
  3065. #+TAGS: laptop car pc sailboat
  3066. @end example
  3067. If you have globally defined your preferred set of tags using the
  3068. variable @code{org-tag-alist}, but would like to use a dynamic tag list
  3069. in a specific file, add an empty TAGS option line to that file:
  3070. @example
  3071. #+TAGS:
  3072. @end example
  3073. By default Org mode uses the standard minibuffer completion facilities for
  3074. entering tags. However, it also implements another, quicker, tag selection
  3075. method called @emph{fast tag selection}. This allows you to select and
  3076. deselect tags with just a single key press. For this to work well you should
  3077. assign unique letters to most of your commonly used tags. You can do this
  3078. globally by configuring the variable @code{org-tag-alist} in your
  3079. @file{.emacs} file. For example, you may find the need to tag many items in
  3080. different files with @samp{:@@home:}. In this case you can set something
  3081. like:
  3082. @lisp
  3083. (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
  3084. @end lisp
  3085. @noindent If the tag is only relevant to the file you are working on then you
  3086. can, instead, set the TAGS option line as:
  3087. @example
  3088. #+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
  3089. @end example
  3090. @noindent
  3091. You can also group together tags that are mutually exclusive. By using
  3092. braces, as in:
  3093. @example
  3094. #+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
  3095. @end example
  3096. @noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
  3097. and @samp{@@tennisclub} should be selected. Multiple such groups are allowed.
  3098. @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
  3099. these lines to activate any changes.
  3100. @noindent
  3101. To set these mutually exclusive groups in the variable @code{org-mode-alist}
  3102. you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
  3103. of the braces. The previous example would be set globally by the following
  3104. configuration:
  3105. @lisp
  3106. (setq org-tag-alist '((:startgroup . nil)
  3107. ("@@work" . ?w) ("@@home" . ?h)
  3108. ("@@tennisclub" . ?t)
  3109. (:endgroup . nil)
  3110. ("laptop" . ?l) ("pc" . ?p)))
  3111. @end lisp
  3112. If at least one tag has a selection key then pressing @kbd{C-c C-c} will
  3113. automatically present you with a special interface, listing inherited tags,
  3114. the tags of the current headline, and a list of all valid tags with
  3115. corresponding keys@footnote{Keys will automatically be assigned to tags which
  3116. have no configured keys.}. In this interface, you can use the following
  3117. keys:
  3118. @table @kbd
  3119. @item a-z...
  3120. Pressing keys assigned to tags will add or remove them from the list of
  3121. tags in the current line. Selecting a tag in a group of mutually
  3122. exclusive tags will turn off any other tags from that group.
  3123. @kindex @key{TAB}
  3124. @item @key{TAB}
  3125. Enter a tag in the minibuffer, even if the tag is not in the predefined
  3126. list. You will be able to complete on all tags present in the buffer.
  3127. @kindex @key{SPC}
  3128. @item @key{SPC}
  3129. Clear all tags for this line.
  3130. @kindex @key{RET}
  3131. @item @key{RET}
  3132. Accept the modified set.
  3133. @item C-g
  3134. Abort without installing changes.
  3135. @item q
  3136. If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
  3137. @item !
  3138. Turn off groups of mutually exclusive tags. Use this to (as an
  3139. exception) assign several tags from such a group.
  3140. @item C-c
  3141. Toggle auto-exit after the next change (see below).
  3142. If you are using expert mode, the first @kbd{C-c} will display the
  3143. selection window.
  3144. @end table
  3145. @noindent
  3146. This method lets you assign tags to a headline with very few keys. With
  3147. the above setup, you could clear the current tags and set @samp{@@home},
  3148. @samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
  3149. C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to
  3150. @samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
  3151. alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
  3152. @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
  3153. @key{RET} @key{RET}}.
  3154. If you find that most of the time, you need only a single key press to
  3155. modify your list of tags, set the variable
  3156. @code{org-fast-tag-selection-single-key}. Then you no longer have to
  3157. press @key{RET} to exit fast tag selection - it will immediately exit
  3158. after the first change. If you then occasionally need more keys, press
  3159. @kbd{C-c} to turn off auto-exit for the current tag selection process
  3160. (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
  3161. C-c}). If you set the variable to the value @code{expert}, the special
  3162. window is not even shown for single-key tag selection, it comes up only
  3163. when you press an extra @kbd{C-c}.
  3164. @node Tag searches, , Setting tags, Tags
  3165. @section Tag searches
  3166. @cindex tag searches
  3167. @cindex searching for tags
  3168. Once a system of tags has been set up, it can be used to collect related
  3169. information into special lists.
  3170. @table @kbd
  3171. @kindex C-c \
  3172. @kindex C-c / T
  3173. @item C-c \
  3174. @itemx C-c / T
  3175. Create a sparse tree with all headlines matching a tags search. With a
  3176. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  3177. @kindex C-c a m
  3178. @item C-c a m
  3179. Create a global list of tag matches from all agenda files.
  3180. @xref{Matching tags and properties}.
  3181. @kindex C-c a M
  3182. @item C-c a M
  3183. Create a global list of tag matches from all agenda files, but check
  3184. only TODO items and force checking subitems (see variable
  3185. @code{org-tags-match-list-sublevels}).
  3186. @end table
  3187. @cindex Boolean logic, for tag searches
  3188. A @i{tags} search string can use Boolean operators @samp{&} for AND and
  3189. @samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
  3190. Parenthesis are currently not implemented. A tag may also be preceded
  3191. by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
  3192. positive selection. The AND operator @samp{&} is optional when @samp{+}
  3193. or @samp{-} is present. Examples:
  3194. @table @samp
  3195. @item +work-boss
  3196. Select headlines tagged @samp{:work:}, but discard those also tagged
  3197. @samp{:boss:}.
  3198. @item work|laptop
  3199. Selects lines tagged @samp{:work:} or @samp{:laptop:}.
  3200. @item work|laptop&night
  3201. Like before, but require the @samp{:laptop:} lines to be tagged also
  3202. @samp{:night:}.
  3203. @end table
  3204. @cindex TODO keyword matching, with tags search
  3205. You may also test for TODO keywords (@pxref{TODO extensions}) and properties
  3206. (@pxref{Properties and Columns}) at the same time as matching tags. For a
  3207. guide on how to match properties, see @ref{Property searches}. To match a
  3208. specific TODO keyword, include an expression like @samp{+TODO="NEXT"} as one
  3209. of the terms in a tags search.
  3210. There is also the possibility to end the tags part of the match (which may
  3211. include several terms connected with @samp{|}) with a @samp{/} and then
  3212. specify a Boolean expression just for TODO keywords. The syntax is then
  3213. similar to the tag matches, but should be applied with consideration: For
  3214. example, a positive selection on several TODO keywords can not meaningfully
  3215. be combined with boolean AND. However, @emph{negative selection} combined
  3216. with AND can be meaningful. To make sure that only lines are checked that
  3217. actually have any TODO keyword (resulting in a speed-up), use @kbd{C-c a M},
  3218. or equivalently start the TODO part after the slash with @samp{!}. Examples:
  3219. @table @samp
  3220. @item work+TODO="WAITING"
  3221. Select @samp{:work:}-tagged TODO lines with the specific TODO
  3222. keyword @samp{WAITING}.
  3223. @item work+TODO="WAITING"|home+TODO="WAITING"
  3224. Waiting tasks both at work and at home.
  3225. @item work/WAITING
  3226. Same as the first example.
  3227. @item work/!-WAITING-NEXT
  3228. Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
  3229. nor @samp{NEXT}
  3230. @item work/!+WAITING|+NEXT
  3231. Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
  3232. @samp{NEXT}.
  3233. @end table
  3234. @cindex regular expressions, with tags search
  3235. Any element of the tag/todo match can be a regular expression - in this
  3236. case it must be enclosed in curly braces. For example,
  3237. @samp{work+@{^boss.*@}} matches headlines that contain the tag
  3238. @samp{:work:} and any tag @i{starting} with @samp{boss}. You may also use a
  3239. regular expression in @samp{TODO=@{^W@}} which would match TODO keywords
  3240. starting with the letter @samp{W}.
  3241. @cindex level, require for tags/property match
  3242. @cindex category, require for tags/property match
  3243. You can also require a headline to be of a certain level or category, by
  3244. writing instead of any TAG an expression like @samp{LEVEL=3} or
  3245. @samp{CATEGORY="work"}, respectively. For example, a search
  3246. @samp{+LEVEL=3+boss/-DONE} lists all level three headlines that have the
  3247. tag @samp{boss} and are @emph{not} marked with the TODO keyword DONE.
  3248. Accessing TODO, LEVEL, and CATEGORY during a search is fast. Accessing any
  3249. other properties will slow down the search.
  3250. @node Properties and Columns, Dates and Times, Tags, Top
  3251. @chapter Properties and Columns
  3252. @cindex properties
  3253. Properties are a set of key-value pairs associated with an entry. There
  3254. are two main applications for properties in Org mode. First, properties
  3255. are like tags, but with a value. Second, you can use properties to
  3256. implement (very basic) database capabilities in an Org buffer. For
  3257. an example of the first application, imagine maintaining a file where
  3258. you document bugs and plan releases of a piece of software. Instead of
  3259. using tags like @code{:release_1:}, @code{:release_2:}, one can use a
  3260. property, say @code{:Release:}, that in different subtrees has different
  3261. values, such as @code{1.0} or @code{2.0}. For an example of the second
  3262. application of properties, imagine keeping track of your music CD's,
  3263. where properties could be things such as the album artist, date of
  3264. release, number of tracks, and so on.
  3265. Properties can be conveniently edited and viewed in column view
  3266. (@pxref{Column view}).
  3267. @menu
  3268. * Property syntax:: How properties are spelled out
  3269. * Special properties:: Access to other Org mode features
  3270. * Property searches:: Matching property values
  3271. * Property inheritance:: Passing values down the tree
  3272. * Column view:: Tabular viewing and editing
  3273. * Property API:: Properties for Lisp programmers
  3274. @end menu
  3275. @node Property syntax, Special properties, Properties and Columns, Properties and Columns
  3276. @section Property syntax
  3277. @cindex property syntax
  3278. @cindex drawer, for properties
  3279. Properties are key-value pairs. They need to be inserted into a special
  3280. drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
  3281. is specified on a single line, with the key (surrounded by colons)
  3282. first, and the value after it. Here is an example:
  3283. @example
  3284. * CD collection
  3285. ** Classic
  3286. *** Goldberg Variations
  3287. :PROPERTIES:
  3288. :Title: Goldberg Variations
  3289. :Composer: J.S. Bach
  3290. :Artist: Glen Gould
  3291. :Publisher: Deutsche Grammphon
  3292. :NDisks: 1
  3293. :END:
  3294. @end example
  3295. You may define the allowed values for a particular property @samp{:Xyz:}
  3296. by setting a property @samp{:Xyz_ALL:}. This special property is
  3297. @emph{inherited}, so if you set it in a level 1 entry, it will apply to
  3298. the entire tree. When allowed values are defined, setting the
  3299. corresponding property becomes easier and is less prone to typing
  3300. errors. For the example with the CD collection, we can predefine
  3301. publishers and the number of disks in a box like this:
  3302. @example
  3303. * CD collection
  3304. :PROPERTIES:
  3305. :NDisks_ALL: 1 2 3 4
  3306. :Publisher_ALL: "Deutsche Grammophon" Philips EMI
  3307. :END:
  3308. @end example
  3309. If you want to set properties that can be inherited by any entry in a
  3310. file, use a line like
  3311. @example
  3312. #+PROPERTY: NDisks_ALL 1 2 3 4
  3313. @end example
  3314. Property values set with the global variable
  3315. @code{org-global-properties} can be inherited by all entries in all
  3316. Org files.
  3317. @noindent
  3318. The following commands help to work with properties:
  3319. @table @kbd
  3320. @kindex M-@key{TAB}
  3321. @item M-@key{TAB}
  3322. After an initial colon in a line, complete property keys. All keys used
  3323. in the current file will be offered as possible completions.
  3324. @kindex C-c C-x p
  3325. @item C-c C-x p
  3326. Set a property. This prompts for a property name and a value. If
  3327. necessary, the property drawer is created as well.
  3328. @item M-x org-insert-property-drawer
  3329. Insert a property drawer into the current entry. The drawer will be
  3330. inserted early in the entry, but after the lines with planning
  3331. information like deadlines.
  3332. @kindex C-c C-c
  3333. @item C-c C-c
  3334. With the cursor in a property drawer, this executes property commands.
  3335. @item C-c C-c s
  3336. Set a property in the current entry. Both the property and the value
  3337. can be inserted using completion.
  3338. @kindex S-@key{right}
  3339. @kindex S-@key{left}
  3340. @item S-@key{left}/@key{right}
  3341. Switch property at point to the next/previous allowed value.
  3342. @item C-c C-c d
  3343. Remove a property from the current entry.
  3344. @item C-c C-c D
  3345. Globally remove a property, from all entries in the current file.
  3346. @item C-c C-c c
  3347. Compute the property at point, using the operator and scope from the
  3348. nearest column format definition.
  3349. @end table
  3350. @node Special properties, Property searches, Property syntax, Properties and Columns
  3351. @section Special properties
  3352. @cindex properties, special
  3353. Special properties provide alternative access method to Org mode
  3354. features discussed in the previous chapters, like the TODO state or the
  3355. priority of an entry. This interface exists so that you can include
  3356. these states into columns view (@pxref{Column view}), or to use them in
  3357. queries. The following property names are special and should not be
  3358. used as keys in the properties drawer:
  3359. @example
  3360. TODO @r{The TODO keyword of the entry.}
  3361. TAGS @r{The tags defined directly in the headline.}
  3362. ALLTAGS @r{All tags, including inherited ones.}
  3363. PRIORITY @r{The priority of the entry, a string with a single letter.}
  3364. DEADLINE @r{The deadline time string, without the angular brackets.}
  3365. SCHEDULED @r{The scheduling time stamp, without the angular brackets.}
  3366. TIMESTAMP @r{The first keyword-less time stamp in the entry.}
  3367. TIMESTAMP_IA @r{The first inactive time stamp in the entry.}
  3368. CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
  3369. @r{must be run first to compute the values.}
  3370. @end example
  3371. @node Property searches, Property inheritance, Special properties, Properties and Columns
  3372. @section Property searches
  3373. @cindex properties, searching
  3374. @cindex searching, of properties
  3375. To create sparse trees and special lists with selection based on properties,
  3376. the same commands are used as for tag searches (@pxref{Tag searches}), and
  3377. the same logic applies. For example, here is a search string:
  3378. @example
  3379. +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \
  3380. +With=@{Sarah\|Denny@}+SCHEDULED>="<2008-10-11>"
  3381. @end example
  3382. @noindent
  3383. The type of comparison will depend on how the comparison value is written:
  3384. @itemize @minus
  3385. @item
  3386. If the comparison value is a plain number, a numerical comparison is done,
  3387. and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
  3388. @samp{>=}, and @samp{<>}.
  3389. @item
  3390. If the comparison value is enclosed in double
  3391. quotes, a string comparison is done, and the same operators are allowed.
  3392. @item
  3393. If the comparison value is enclosed in double quotes @emph{and} angular
  3394. brackets (like @samp{DEADLINE<="<2008-12-24 18:30>"}), both values are
  3395. assumed to be date/time specifications in the standard Org way, and the
  3396. comparison will be done accordingly. Special values that will be recognized
  3397. are @code{"<now>"} for now (including time), and @code{"<today>"}, and
  3398. @code{"<tomorrow>"} for these days at 0:00 hours, i.e. without a time
  3399. specification. Also strings like @code{"<+5d>"} or @code{"<-2m>"} with units
  3400. @code{d}, @code{w}, @code{m}, and @code{y} for day, week, month, and year,
  3401. respectively, can be used.
  3402. @item
  3403. If the comparison value is enclosed
  3404. in curly braces, a regexp match is performed, with @samp{=} meaning that the
  3405. regexp matches the property value, and @samp{<>} meaning that it does not
  3406. match.
  3407. @end itemize
  3408. So the search string in the example finds entries tagged @samp{:work:} but
  3409. not @samp{:boss:}, which also have a priority value @samp{A}, a
  3410. @samp{:Coffee:} property with the value @samp{unlimited}, an @samp{Effort}
  3411. property that is numerically smaller than 2, a @samp{:With:} property that is
  3412. matched by the regular expression @samp{Sarah\|Denny}, and that are scheduled
  3413. on or after October 11, 2008.
  3414. You can configure Org mode to use property inheritance during a search, but
  3415. beware that this can slow down searches considerably. See @ref{Property
  3416. inheritance} for details.
  3417. There is also a special command for creating sparse trees based on a
  3418. single property:
  3419. @table @kbd
  3420. @kindex C-c / p
  3421. @item C-c / p
  3422. Create a sparse tree based on the value of a property. This first
  3423. prompts for the name of a property, and then for a value. A sparse tree
  3424. is created with all entries that define this property with the given
  3425. value. If you enclose the value into curly braces, it is interpreted as
  3426. a regular expression and matched against the property values.
  3427. @end table
  3428. @node Property inheritance, Column view, Property searches, Properties and Columns
  3429. @section Property Inheritance
  3430. @cindex properties, inheritance
  3431. @cindex inheritance, of properties
  3432. The outline structure of Org mode documents lends itself for an
  3433. inheritance model of properties: If the parent in a tree has a certain
  3434. property, the children can inherit this property. Org mode does not
  3435. turn this on by default, because it can slow down property searches
  3436. significantly and is often not needed. However, if you find inheritance
  3437. useful, you can turn it on by setting the variable
  3438. @code{org-use-property-inheritance}. It may be set to @code{t}, to make
  3439. all properties inherited from the parent, to a list of properties
  3440. that should be inherited, or to a regular expression that matches
  3441. inherited properties.
  3442. Org mode has a few properties for which inheritance is hard-coded, at
  3443. least for the special applications for which they are used:
  3444. @table @code
  3445. @item COLUMNS
  3446. The @code{:COLUMNS:} property defines the format of column view
  3447. (@pxref{Column view}). It is inherited in the sense that the level
  3448. where a @code{:COLUMNS:} property is defined is used as the starting
  3449. point for a column view table, independently of the location in the
  3450. subtree from where columns view is turned on.
  3451. @item CATEGORY
  3452. For agenda view, a category set through a @code{:CATEGORY:} property
  3453. applies to the entire subtree.
  3454. @item ARCHIVE
  3455. For archiving, the @code{:ARCHIVE:} property may define the archive
  3456. location for the entire subtree (@pxref{Moving subtrees}).
  3457. @item LOGGING
  3458. The LOGGING property may define logging settings for an entry or a
  3459. subtree (@pxref{Tracking TODO state changes}).
  3460. @end table
  3461. @node Column view, Property API, Property inheritance, Properties and Columns
  3462. @section Column view
  3463. A great way to view and edit properties in an outline tree is
  3464. @emph{column view}. In column view, each outline item is turned into a
  3465. table row. Columns in this table provide access to properties of the
  3466. entries. Org mode implements columns by overlaying a tabular structure
  3467. over the headline of each item. While the headlines have been turned
  3468. into a table row, you can still change the visibility of the outline
  3469. tree. For example, you get a compact table by switching to CONTENTS
  3470. view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
  3471. is active), but you can still open, read, and edit the entry below each
  3472. headline. Or, you can switch to column view after executing a sparse
  3473. tree command and in this way get a table only for the selected items.
  3474. Column view also works in agenda buffers (@pxref{Agenda Views}) where
  3475. queries have collected selected items, possibly from a number of files.
  3476. @menu
  3477. * Defining columns:: The COLUMNS format property
  3478. * Using column view:: How to create and use column view
  3479. * Capturing column view:: A dynamic block for column view
  3480. @end menu
  3481. @node Defining columns, Using column view, Column view, Column view
  3482. @subsection Defining columns
  3483. @cindex column view, for properties
  3484. @cindex properties, column view
  3485. Setting up a column view first requires defining the columns. This is
  3486. done by defining a column format line.
  3487. @menu
  3488. * Scope of column definitions:: Where defined, where valid?
  3489. * Column attributes:: Appearance and content of a column
  3490. @end menu
  3491. @node Scope of column definitions, Column attributes, Defining columns, Defining columns
  3492. @subsubsection Scope of column definitions
  3493. To define a column format for an entire file, use a line like
  3494. @example
  3495. #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3496. @end example
  3497. To specify a format that only applies to a specific tree, add a
  3498. @code{:COLUMNS:} property to the top node of that tree, for example:
  3499. @example
  3500. ** Top node for columns view
  3501. :PROPERTIES:
  3502. :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3503. :END:
  3504. @end example
  3505. If a @code{:COLUMNS:} property is present in an entry, it defines columns
  3506. for the entry itself, and for the entire subtree below it. Since the
  3507. column definition is part of the hierarchical structure of the document,
  3508. you can define columns on level 1 that are general enough for all
  3509. sublevels, and more specific columns further down, when you edit a
  3510. deeper part of the tree.
  3511. @node Column attributes, , Scope of column definitions, Defining columns
  3512. @subsubsection Column attributes
  3513. A column definition sets the attributes of a column. The general
  3514. definition looks like this:
  3515. @example
  3516. %[width]property[(title)][@{summary-type@}]
  3517. @end example
  3518. @noindent
  3519. Except for the percent sign and the property name, all items are
  3520. optional. The individual parts have the following meaning:
  3521. @example
  3522. width @r{An integer specifying the width of the column in characters.}
  3523. @r{If omitted, the width will be determined automatically.}
  3524. property @r{The property that should be edited in this column.}
  3525. (title) @r{The header text for the column. If omitted, the}
  3526. @r{property name is used.}
  3527. @{summary-type@} @r{The summary type. If specified, the column values for}
  3528. @r{parent nodes are computed from the children.}
  3529. @r{Supported summary types are:}
  3530. @{+@} @r{Sum numbers in this column.}
  3531. @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.}
  3532. @{$@} @r{Currency, short for @samp{+;%.2f}.}
  3533. @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
  3534. @{X@} @r{Checkbox status, [X] if all children are [X].}
  3535. @{X/@} @r{Checkbox status, [n/m].}
  3536. @{X%@} @r{Checkbox status, [n%].}
  3537. @end example
  3538. @noindent
  3539. Here is an example for a complete columns definition, along with allowed
  3540. values.
  3541. @example
  3542. :COLUMNS: %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status \@footnote{Please note that the COLUMNS definition must be on a single line - it is wrapped here only because of formatting constraints.}
  3543. %10Time_Estimate@{:@} %CLOCKSUM
  3544. :Owner_ALL: Tammy Mark Karl Lisa Don
  3545. :Status_ALL: "In progress" "Not started yet" "Finished" ""
  3546. :Approved_ALL: "[ ]" "[X]"
  3547. @end example
  3548. The first column, @samp{%25ITEM}, means the first 25 characters of the
  3549. item itself, i.e. of the headline. You probably always should start the
  3550. column definition with the @samp{ITEM} specifier. The other specifiers
  3551. create columns @samp{Owner} with a list of names as allowed values, for
  3552. @samp{Status} with four different possible values, and for a checkbox
  3553. field @samp{Approved}. When no width is given after the @samp{%}
  3554. character, the column will be exactly as wide as it needs to be in order
  3555. to fully display all values. The @samp{Approved} column does have a
  3556. modified title (@samp{Approved?}, with a question mark). Summaries will
  3557. be created for the @samp{Time_Estimate} column by adding time duration
  3558. expressions like HH:MM, and for the @samp{Approved} column, by providing
  3559. an @samp{[X]} status if all children have been checked. The
  3560. @samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
  3561. in the subtree.
  3562. @node Using column view, Capturing column view, Defining columns, Column view
  3563. @subsection Using column view
  3564. @table @kbd
  3565. @tsubheading{Turning column view on and off}
  3566. @kindex C-c C-x C-c
  3567. @item C-c C-x C-c
  3568. Create the column view for the local environment. This command searches
  3569. the hierarchy, up from point, for a @code{:COLUMNS:} property that defines
  3570. a format. When one is found, the column view table is established for
  3571. the entire tree, starting from the entry that contains the @code{:COLUMNS:}
  3572. property. If none is found, the format is taken from the @code{#+COLUMNS}
  3573. line or from the variable @code{org-columns-default-format}, and column
  3574. view is established for the current entry and its subtree.
  3575. @kindex r
  3576. @item r
  3577. Recreate the column view, to include recent changes made in the buffer.
  3578. @kindex g
  3579. @item g
  3580. Same as @kbd{r}.
  3581. @kindex q
  3582. @item q
  3583. Exit column view.
  3584. @tsubheading{Editing values}
  3585. @item @key{left} @key{right} @key{up} @key{down}
  3586. Move through the column view from field to field.
  3587. @kindex S-@key{left}
  3588. @kindex S-@key{right}
  3589. @item S-@key{left}/@key{right}
  3590. Switch to the next/previous allowed value of the field. For this, you
  3591. have to have specified allowed values for a property.
  3592. @item 1..9,0
  3593. Directly select the nth allowed value, @kbd{0} selects the 10th value.
  3594. @kindex n
  3595. @kindex p
  3596. @itemx n / p
  3597. Same as @kbd{S-@key{left}/@key{right}}
  3598. @kindex e
  3599. @item e
  3600. Edit the property at point. For the special properties, this will
  3601. invoke the same interface that you normally use to change that
  3602. property. For example, when editing a TAGS property, the tag completion
  3603. or fast selection interface will pop up.
  3604. @kindex C-c C-c
  3605. @item C-c C-c
  3606. When there is a checkbox at point, toggle it.
  3607. @kindex v
  3608. @item v
  3609. View the full value of this property. This is useful if the width of
  3610. the column is smaller than that of the value.
  3611. @kindex a
  3612. @item a
  3613. Edit the list of allowed values for this property. If the list is found
  3614. in the hierarchy, the modified values is stored there. If no list is
  3615. found, the new value is stored in the first entry that is part of the
  3616. current column view.
  3617. @tsubheading{Modifying the table structure}
  3618. @kindex <
  3619. @kindex >
  3620. @item < / >
  3621. Make the column narrower/wider by one character.
  3622. @kindex S-M-@key{right}
  3623. @item S-M-@key{right}
  3624. Insert a new column, to the left of the current column.
  3625. @kindex S-M-@key{left}
  3626. @item S-M-@key{left}
  3627. Delete the current column.
  3628. @end table
  3629. @node Capturing column view, , Using column view, Column view
  3630. @subsection Capturing column view
  3631. Since column view is just an overlay over a buffer, it cannot be
  3632. exported or printed directly. If you want to capture a column view, use
  3633. this @code{columnview} dynamic block (@pxref{Dynamic blocks}). The frame
  3634. of this block looks like this:
  3635. @cindex #+BEGIN: columnview
  3636. @example
  3637. * The column view
  3638. #+BEGIN: columnview :hlines 1 :id "label"
  3639. #+END:
  3640. @end example
  3641. @noindent This dynamic block has the following parameters:
  3642. @table @code
  3643. @item :id
  3644. This is most important parameter. Column view is a feature that is
  3645. often localized to a certain (sub)tree, and the capture block might be
  3646. in a different location in the file. To identify the tree whose view to
  3647. capture, you can use 3 values:
  3648. @example
  3649. local @r{use the tree in which the capture block is located}
  3650. global @r{make a global view, including all headings in the file}
  3651. "label" @r{call column view in the tree that has an @code{:ID:}}
  3652. @r{property with the value @i{label}. You can use}
  3653. @r{@kbd{M-x org-id-copy} to create a globally unique ID for}
  3654. @r{the current entry and copy it to the kill-ring.}
  3655. @end example
  3656. @item :hlines
  3657. When @code{t}, insert a hline after every line. When a number N, insert
  3658. a hline before each headline with level @code{<= N}.
  3659. @item :vlines
  3660. When set to @code{t}, enforce column groups to get vertical lines.
  3661. @item :maxlevel
  3662. When set to a number, don't capture entries below this level.
  3663. @item :skip-empty-rows
  3664. When set to @code{t}, skip row where the only non-empty specifier of the
  3665. column view is @code{ITEM}.
  3666. @end table
  3667. @noindent
  3668. The following commands insert or update the dynamic block:
  3669. @table @kbd
  3670. @kindex C-c C-x i
  3671. @item C-c C-x i
  3672. Insert a dynamic block capturing a column view. You will be prompted
  3673. for the scope or id of the view.
  3674. @kindex C-c C-c
  3675. @item C-c C-c
  3676. @kindex C-c C-x C-u
  3677. @itemx C-c C-x C-u
  3678. Update dynamical block at point. The cursor needs to be in the
  3679. @code{#+BEGIN} line of the dynamic block.
  3680. @kindex C-u C-c C-x C-u
  3681. @item C-u C-c C-x C-u
  3682. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  3683. you have several clock table blocks in a buffer.
  3684. @end table
  3685. You can add formulas to the column view table and you may add plotting
  3686. instructions in front of the table - these will survive an update of the
  3687. block. If there is a @code{#+TBLFM:} after the table, the table will
  3688. actually be recalculated automatically after an update.
  3689. @node Property API, , Column view, Properties and Columns
  3690. @section The Property API
  3691. @cindex properties, API
  3692. @cindex API, for properties
  3693. There is a full API for accessing and changing properties. This API can
  3694. be used by Emacs Lisp programs to work with properties and to implement
  3695. features based on them. For more information see @ref{Using the
  3696. property API}.
  3697. @node Dates and Times, Capture, Properties and Columns, Top
  3698. @chapter Dates and Times
  3699. @cindex dates
  3700. @cindex times
  3701. @cindex time stamps
  3702. @cindex date stamps
  3703. To assist project planning, TODO items can be labeled with a date and/or
  3704. a time. The specially formatted string carrying the date and time
  3705. information is called a @emph{timestamp} in Org mode. This may be a
  3706. little confusing because timestamp is often used as indicating when
  3707. something was created or last changed. However, in Org mode this term
  3708. is used in a much wider sense.
  3709. @menu
  3710. * Timestamps:: Assigning a time to a tree entry
  3711. * Creating timestamps:: Commands which insert timestamps
  3712. * Deadlines and scheduling:: Planning your work
  3713. * Clocking work time:: Tracking how long you spend on a task
  3714. * Effort estimates:: Planning work effort in advance
  3715. * Relative timer:: Notes with a running timer
  3716. @end menu
  3717. @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
  3718. @section Timestamps, deadlines and scheduling
  3719. @cindex time stamps
  3720. @cindex ranges, time
  3721. @cindex date stamps
  3722. @cindex deadlines
  3723. @cindex scheduling
  3724. A time stamp is a specification of a date (possibly with time or a range
  3725. of times) in a special format, either @samp{<2003-09-16 Tue>} or
  3726. @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
  3727. 12:00-12:30>}@footnote{This is the standard ISO date/time format. To
  3728. use an alternative format, see @ref{Custom time format}.}. A time stamp
  3729. can appear anywhere in the headline or body of an Org tree entry. Its
  3730. presence causes entries to be shown on specific dates in the agenda
  3731. (@pxref{Weekly/daily agenda}). We distinguish:
  3732. @table @var
  3733. @item Plain time stamp; Event; Appointment
  3734. @cindex timestamp
  3735. A simple time stamp just assigns a date/time to an item. This is just
  3736. like writing down an appointment or event in a paper agenda. In the
  3737. timeline and agenda displays, the headline of an entry associated with a
  3738. plain time stamp will be shown exactly on that date.
  3739. @example
  3740. * Meet Peter at the movies <2006-11-01 Wed 19:15>
  3741. * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
  3742. @end example
  3743. @item Time stamp with repeater interval
  3744. @cindex timestamp, with repeater interval
  3745. A time stamp may contain a @emph{repeater interval}, indicating that it
  3746. applies not only on the given date, but again and again after a certain
  3747. interval of N days (d), weeks (w), months(m), or years(y). The
  3748. following will show up in the agenda every Wednesday:
  3749. @example
  3750. * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
  3751. @end example
  3752. @item Diary-style sexp entries
  3753. For more complex date specifications, Org mode supports using the
  3754. special sexp diary entries implemented in the Emacs calendar/diary
  3755. package. For example
  3756. @example
  3757. * The nerd meeting on every 2nd Thursday of the month
  3758. <%%(diary-float t 4 2)>
  3759. @end example
  3760. @item Time/Date range
  3761. @cindex timerange
  3762. @cindex date range
  3763. Two time stamps connected by @samp{--} denote a range. The headline
  3764. will be shown on the first and last day of the range, and on any dates
  3765. that are displayed and fall in the range. Here is an example:
  3766. @example
  3767. ** Meeting in Amsterdam
  3768. <2004-08-23 Mon>--<2004-08-26 Thu>
  3769. @end example
  3770. @item Inactive time stamp
  3771. @cindex timestamp, inactive
  3772. @cindex inactive timestamp
  3773. Just like a plain time stamp, but with square brackets instead of
  3774. angular ones. These time stamps are inactive in the sense that they do
  3775. @emph{not} trigger an entry to show up in the agenda.
  3776. @example
  3777. * Gillian comes late for the fifth time [2006-11-01 Wed]
  3778. @end example
  3779. @end table
  3780. @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
  3781. @section Creating timestamps
  3782. @cindex creating timestamps
  3783. @cindex timestamps, creating
  3784. For Org mode to recognize time stamps, they need to be in the specific
  3785. format. All commands listed below produce time stamps in the correct
  3786. format.
  3787. @table @kbd
  3788. @kindex C-c .
  3789. @item C-c .
  3790. Prompt for a date and insert a corresponding time stamp. When the cursor is
  3791. at an existing time stamp in the buffer, the command is used to modify this
  3792. timestamp instead of inserting a new one. When this command is used twice in
  3793. succession, a time range is inserted.
  3794. @c
  3795. @kindex C-u C-c .
  3796. @item C-u C-c .
  3797. Like @kbd{C-c .}, but use the alternative format which contains date
  3798. and time. The default time can be rounded to multiples of 5 minutes,
  3799. see the option @code{org-time-stamp-rounding-minutes}.
  3800. @c
  3801. @kindex C-c !
  3802. @item C-c !
  3803. Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
  3804. an agenda entry.
  3805. @c
  3806. @kindex C-c <
  3807. @item C-c <
  3808. Insert a time stamp corresponding to the cursor date in the Calendar.
  3809. @c
  3810. @kindex C-c >
  3811. @item C-c >
  3812. Access the Emacs calendar for the current date. If there is a
  3813. timestamp in the current line, go to the corresponding date
  3814. instead.
  3815. @c
  3816. @kindex C-c C-o
  3817. @item C-c C-o
  3818. Access the agenda for the date given by the time stamp or -range at
  3819. point (@pxref{Weekly/daily agenda}).
  3820. @c
  3821. @kindex S-@key{left}
  3822. @kindex S-@key{right}
  3823. @item S-@key{left}
  3824. @itemx S-@key{right}
  3825. Change date at cursor by one day. These key bindings conflict with
  3826. CUA mode (@pxref{Conflicts}).
  3827. @c
  3828. @kindex S-@key{up}
  3829. @kindex S-@key{down}
  3830. @item S-@key{up}
  3831. @itemx S-@key{down}
  3832. Change the item under the cursor in a timestamp. The cursor can be on a
  3833. year, month, day, hour or minute. Note that if the cursor is in a
  3834. headline and not at a time stamp, these same keys modify the priority of
  3835. an item. (@pxref{Priorities}). The key bindings also conflict with
  3836. CUA mode (@pxref{Conflicts}).
  3837. @c
  3838. @kindex C-c C-y
  3839. @cindex evaluate time range
  3840. @item C-c C-y
  3841. Evaluate a time range by computing the difference between start and end.
  3842. With a prefix argument, insert result after the time range (in a table: into
  3843. the following column).
  3844. @end table
  3845. @menu
  3846. * The date/time prompt:: How Org mode helps you entering date and time
  3847. * Custom time format:: Making dates look different
  3848. @end menu
  3849. @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
  3850. @subsection The date/time prompt
  3851. @cindex date, reading in minibuffer
  3852. @cindex time, reading in minibuffer
  3853. When Org mode prompts for a date/time, the default is shown as an ISO
  3854. date, and the prompt therefore seems to ask for an ISO date. But it
  3855. will in fact accept any string containing some date and/or time
  3856. information, and it is really smart about interpreting your input. You
  3857. can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
  3858. copied from an email message. Org mode will find whatever information
  3859. is in there and derive anything you have not specified from the
  3860. @emph{default date and time}. The default is usually the current date
  3861. and time, but when modifying an existing time stamp, or when entering
  3862. the second stamp of a range, it is taken from the stamp in the buffer.
  3863. When filling in information, Org mode assumes that most of the time you
  3864. will want to enter a date in the future: If you omit the month/year and
  3865. the given day/month is @i{before} today, it will assume that you mean a
  3866. future date@footnote{See the variable
  3867. @code{org-read-date-prefer-future}.}.
  3868. For example, lets assume that today is @b{June 13, 2006}. Here is how
  3869. various inputs will be interpreted, the items filled in by Org mode are
  3870. in @b{bold}.
  3871. @example
  3872. 3-2-5 --> 2003-02-05
  3873. 14 --> @b{2006}-@b{06}-14
  3874. 12 --> @b{2006}-@b{07}-12
  3875. Fri --> nearest Friday (defaultdate or later)
  3876. sep 15 --> @b{2006}-11-15
  3877. feb 15 --> @b{2007}-02-15
  3878. sep 12 9 --> 2009-09-12
  3879. 12:45 --> @b{2006}-@b{06}-@b{13} 12:45
  3880. 22 sept 0:34 --> @b{2006}-09-22 0:34
  3881. w4 --> ISO week for of the current year @b{2006}
  3882. 2012 w4 fri --> Friday of ISO week 4 in 2012
  3883. 2012-w04-5 --> Same as above
  3884. @end example
  3885. Furthermore you can specify a relative date by giving, as the
  3886. @emph{first} thing in the input: a plus/minus sign, a number and a
  3887. letter [dwmy] to indicate change in days weeks, months, years. With a
  3888. single plus or minus, the date is always relative to today. With a
  3889. double plus or minus, it is relative to the default date. If instead of
  3890. a single letter, you use the abbreviation of day name, the date will be
  3891. the nth such day. E.g.
  3892. @example
  3893. +0 --> today
  3894. . --> today
  3895. +4d --> four days from today
  3896. +4 --> same as above
  3897. +2w --> two weeks from today
  3898. ++5 --> five days from default date
  3899. +2tue --> second tuesday from now.
  3900. @end example
  3901. The function understands English month and weekday abbreviations. If
  3902. you want to use unabbreviated names and/or other languages, configure
  3903. the variables @code{parse-time-months} and @code{parse-time-weekdays}.
  3904. @cindex calendar, for selecting date
  3905. Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
  3906. you don't need/want the calendar, configure the variable
  3907. @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
  3908. prompt, either by clicking on a date in the calendar, or by pressing
  3909. @key{RET}, the date selected in the calendar will be combined with the
  3910. information entered at the prompt. You can control the calendar fully
  3911. from the minibuffer:
  3912. @kindex <
  3913. @kindex >
  3914. @kindex mouse-1
  3915. @kindex S-@key{right}
  3916. @kindex S-@key{left}
  3917. @kindex S-@key{down}
  3918. @kindex S-@key{up}
  3919. @kindex M-S-@key{right}
  3920. @kindex M-S-@key{left}
  3921. @kindex @key{RET}
  3922. @example
  3923. > / < @r{Scroll calendar forward/backward by one month.}
  3924. mouse-1 @r{Select date by clicking on it.}
  3925. S-@key{right}/@key{left} @r{One day forward/backward.}
  3926. S-@key{down}/@key{up} @r{One week forward/backward.}
  3927. M-S-@key{right}/@key{left} @r{One month forward/backward.}
  3928. @key{RET} @r{Choose date in calendar.}
  3929. @end example
  3930. The actions of the date/time prompt may seem complex, but I assure you they
  3931. will grow on you, and you will start getting annoyed by pretty much any other
  3932. way of entering a date/time out there. To help you understand what is going
  3933. on, the current interpretation of your input will be displayed live in the
  3934. minibuffer@footnote{If you find this distracting, turn the display of with
  3935. @code{org-read-date-display-live}.}.
  3936. @node Custom time format, , The date/time prompt, Creating timestamps
  3937. @subsection Custom time format
  3938. @cindex custom date/time format
  3939. @cindex time format, custom
  3940. @cindex date format, custom
  3941. Org mode uses the standard ISO notation for dates and times as it is
  3942. defined in ISO 8601. If you cannot get used to this and require another
  3943. representation of date and time to keep you happy, you can get it by
  3944. customizing the variables @code{org-display-custom-times} and
  3945. @code{org-time-stamp-custom-formats}.
  3946. @table @kbd
  3947. @kindex C-c C-x C-t
  3948. @item C-c C-x C-t
  3949. Toggle the display of custom formats for dates and times.
  3950. @end table
  3951. @noindent
  3952. Org mode needs the default format for scanning, so the custom date/time
  3953. format does not @emph{replace} the default format - instead it is put
  3954. @emph{over} the default format using text properties. This has the
  3955. following consequences:
  3956. @itemize @bullet
  3957. @item
  3958. You cannot place the cursor onto a time stamp anymore, only before or
  3959. after.
  3960. @item
  3961. The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
  3962. each component of a time stamp. If the cursor is at the beginning of
  3963. the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
  3964. just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
  3965. time will be changed by one minute.
  3966. @item
  3967. If the time stamp contains a range of clock times or a repeater, these
  3968. will not be overlayed, but remain in the buffer as they were.
  3969. @item
  3970. When you delete a time stamp character-by-character, it will only
  3971. disappear from the buffer after @emph{all} (invisible) characters
  3972. belonging to the ISO timestamp have been removed.
  3973. @item
  3974. If the custom time stamp format is longer than the default and you are
  3975. using dates in tables, table alignment will be messed up. If the custom
  3976. format is shorter, things do work as expected.
  3977. @end itemize
  3978. @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
  3979. @section Deadlines and scheduling
  3980. A time stamp may be preceded by special keywords to facilitate planning:
  3981. @table @var
  3982. @item DEADLINE
  3983. @cindex DEADLINE keyword
  3984. Meaning: the task (most likely a TODO item, though not necessarily) is supposed
  3985. to be finished on that date.
  3986. On the deadline date, the task will be listed in the agenda. In
  3987. addition, the agenda for @emph{today} will carry a warning about the
  3988. approaching or missed deadline, starting
  3989. @code{org-deadline-warning-days} before the due date, and continuing
  3990. until the entry is marked DONE. An example:
  3991. @example
  3992. *** TODO write article about the Earth for the Guide
  3993. The editor in charge is [[bbdb:Ford Prefect]]
  3994. DEADLINE: <2004-02-29 Sun>
  3995. @end example
  3996. You can specify a different lead time for warnings for a specific
  3997. deadlines using the following syntax. Here is an example with a warning
  3998. period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
  3999. @item SCHEDULED
  4000. @cindex SCHEDULED keyword
  4001. Meaning: you are planning to start working on that task on the given
  4002. date.
  4003. The headline will be listed under the given date@footnote{It will still
  4004. be listed on that date after it has been marked DONE. If you don't like
  4005. this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
  4006. addition, a reminder that the scheduled date has passed will be present
  4007. in the compilation for @emph{today}, until the entry is marked DONE.
  4008. I.e., the task will automatically be forwarded until completed.
  4009. @example
  4010. *** TODO Call Trillian for a date on New Years Eve.
  4011. SCHEDULED: <2004-12-25 Sat>
  4012. @end example
  4013. @noindent
  4014. @b{Important:} Scheduling an item in Org mode should @i{not} be
  4015. understood in the same way that we understand @i{scheduling a meeting}.
  4016. Setting a date for a meeting is just a simple appointment, you should
  4017. mark this entry with a simple plain time stamp, to get this item shown
  4018. on the date where it applies. This is a frequent mis-understanding from
  4019. Org-users. In Org mode, @i{scheduling} means setting a date when you
  4020. want to start working on an action item.
  4021. @end table
  4022. You may use time stamps with repeaters in scheduling and deadline
  4023. entries. Org mode will issue early and late warnings based on the
  4024. assumption that the time stamp represents the @i{nearest instance} of
  4025. the repeater. However, the use of diary sexp entries like
  4026. @c
  4027. @code{<%%(diary-float t 42)>}
  4028. @c
  4029. in scheduling and deadline timestamps is limited. Org mode does not
  4030. know enough about the internals of each sexp function to issue early and
  4031. late warnings. However, it will show the item on each day where the
  4032. sexp entry matches.
  4033. @menu
  4034. * Inserting deadline/schedule:: Planning items
  4035. * Repeated tasks:: Items that show up again and again
  4036. @end menu
  4037. @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
  4038. @subsection Inserting deadlines or schedules
  4039. The following commands allow to quickly insert a deadline or to schedule
  4040. an item:
  4041. @table @kbd
  4042. @c
  4043. @kindex C-c C-d
  4044. @item C-c C-d
  4045. Insert @samp{DEADLINE} keyword along with a stamp. The insertion will
  4046. happen in the line directly following the headline. When called with a
  4047. prefix arg, an existing deadline will be removed from the entry.
  4048. @c FIXME Any CLOSED timestamp will be removed.????????
  4049. @c
  4050. @kindex C-c / d
  4051. @cindex sparse tree, for deadlines
  4052. @item C-c / d
  4053. Create a sparse tree with all deadlines that are either past-due, or
  4054. which will become due within @code{org-deadline-warning-days}.
  4055. With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
  4056. prefix, check that many days. For example, @kbd{C-1 C-c / d} shows
  4057. all deadlines due tomorrow.
  4058. @c
  4059. @kindex C-c C-s
  4060. @item C-c C-s
  4061. Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
  4062. happen in the line directly following the headline. Any CLOSED
  4063. timestamp will be removed. When called with a prefix argument, remove
  4064. the scheduling date from the entry.
  4065. @c
  4066. @kindex C-c C-x C-k
  4067. @kindex k a
  4068. @kindex k s
  4069. @item C-c C-x C-k
  4070. Mark the current entry for agenda action. After you have marked the entry
  4071. like this, you can open the agenda or the calendar to find an appropriate
  4072. date. With the cursor on the selected date, press @kbd{k s} or @kbd{k d} to
  4073. schedule the marked item.
  4074. @end table
  4075. @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
  4076. @subsection Repeated tasks
  4077. Some tasks need to be repeated again and again. Org mode helps to
  4078. organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
  4079. or plain time stamp. In the following example
  4080. @example
  4081. ** TODO Pay the rent
  4082. DEADLINE: <2005-10-01 Sat +1m>
  4083. @end example
  4084. the @code{+1m} is a repeater; the intended interpretation is that the
  4085. task has a deadline on <2005-10-01> and repeats itself every (one) month
  4086. starting from that time. If you need both a repeater and a special
  4087. warning period in a deadline entry, the repeater comes first and the
  4088. warning period last: @code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
  4089. Deadlines and scheduled items produce entries in the agenda when they
  4090. are over-due, so it is important to be able to mark such an entry as
  4091. completed once you have done so. When you mark a DEADLINE or a SCHEDULE
  4092. with the TODO keyword DONE, it will no longer produce entries in the
  4093. agenda. The problem with this is, however, that then also the
  4094. @emph{next} instance of the repeated entry will not be active. Org mode
  4095. deals with this in the following way: When you try to mark such an entry
  4096. DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
  4097. time stamp by the repeater interval, and immediately set the entry state
  4098. back to TODO. In the example above, setting the state to DONE would
  4099. actually switch the date like this:
  4100. @example
  4101. ** TODO Pay the rent
  4102. DEADLINE: <2005-11-01 Tue +1m>
  4103. @end example
  4104. A timestamp@footnote{You can change this using the option
  4105. @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
  4106. @code{lognoterepeat}, and @code{nologrepeat}. With @code{lognoterepeat}, you
  4107. will aslo be prompted for a note.} will be added under the deadline, to keep
  4108. a record that you actually acted on the previous instance of this deadline.
  4109. As a consequence of shifting the base date, this entry will no longer be
  4110. visible in the agenda when checking past dates, but all future instances
  4111. will be visible.
  4112. With the @samp{+1m} cookie, the date shift will always be exactly one
  4113. month. So if you have not payed the rent for three months, marking this
  4114. entry DONE will still keep it as an overdue deadline. Depending on the
  4115. task, this may not be the best way to handle it. For example, if you
  4116. forgot to call you father for 3 weeks, it does not make sense to call
  4117. him 3 times in a single day to make up for it. Finally, there are tasks
  4118. like changing batteries which should always repeat a certain time
  4119. @i{after} the last time you did it. For these tasks, Org mode has
  4120. special repeaters markers with @samp{++} and @samp{.+}. For example:
  4121. @example
  4122. ** TODO Call Father
  4123. DEADLINE: <2008-02-10 Sun ++1w>
  4124. Marking this DONE will shift the date by at least one week,
  4125. but also by as many weeks as it takes to get this date into
  4126. the future. However, it stays on a Sunday, even if you called
  4127. and marked it done on Saturday.
  4128. ** TODO Check the batteries in the smoke detectors
  4129. DEADLINE: <2005-11-01 Tue .+1m>
  4130. Marking this DONE will shift the date to one month after
  4131. today.
  4132. @end example
  4133. You may have both scheduling and deadline information for a specific
  4134. task - just make sure that the repeater intervals on both are the same.
  4135. @node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times
  4136. @section Clocking work time
  4137. Org mode allows you to clock the time you spent on specific tasks in a
  4138. project. When you start working on an item, you can start the clock.
  4139. When you stop working on that task, or when you mark the task done, the
  4140. clock is stopped and the corresponding time interval is recorded. It
  4141. also computes the total time spent on each subtree of a project.
  4142. @table @kbd
  4143. @kindex C-c C-x C-i
  4144. @item C-c C-x C-i
  4145. Start the clock on the current item (clock-in). This inserts the CLOCK
  4146. keyword together with a timestamp. If this is not the first clocking of
  4147. this item, the multiple CLOCK lines will be wrapped into a
  4148. @code{:CLOCK:} drawer (see also the variable
  4149. @code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument,
  4150. select the task from a list of recently clocked tasks. With two @kbd{C-u
  4151. C-u} prefixes, clock into the task at point and mark it as the default task.
  4152. The default task will always be available when selecting a clocking task,
  4153. with letter @kbd{d}.
  4154. @kindex C-c C-x C-o
  4155. @item C-c C-x C-o
  4156. Stop the clock (clock-out). The inserts another timestamp at the same
  4157. location where the clock was last started. It also directly computes
  4158. the resulting time in inserts it after the time range as @samp{=>
  4159. HH:MM}. See the variable @code{org-log-note-clock-out} for the
  4160. possibility to record an additional note together with the clock-out
  4161. time stamp@footnote{The corresponding in-buffer setting is:
  4162. @code{#+STARTUP: lognoteclock-out}}.
  4163. @kindex C-c C-y
  4164. @item C-c C-y
  4165. Recompute the time interval after changing one of the time stamps. This
  4166. is only necessary if you edit the time stamps directly. If you change
  4167. them with @kbd{S-@key{cursor}} keys, the update is automatic.
  4168. @kindex C-c C-t
  4169. @item C-c C-t
  4170. Changing the TODO state of an item to DONE automatically stops the clock
  4171. if it is running in this same item.
  4172. @kindex C-c C-x C-x
  4173. @item C-c C-x C-x
  4174. Cancel the current clock. This is useful if a clock was started by
  4175. mistake, or if you ended up working on something else.
  4176. @kindex C-c C-x C-j
  4177. @item C-c C-x C-j
  4178. Jump to the entry that contains the currently running clock. With a
  4179. @kbd{C-u} prefix arg, select the target task from a list of recently clocked
  4180. tasks.
  4181. @kindex C-c C-x C-d
  4182. @item C-c C-x C-d
  4183. Display time summaries for each subtree in the current buffer. This
  4184. puts overlays at the end of each headline, showing the total time
  4185. recorded under that heading, including the time of any subheadings. You
  4186. can use visibility cycling to study the tree, but the overlays disappear
  4187. when you change the buffer (see variable
  4188. @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
  4189. @kindex C-c C-x C-r
  4190. @item C-c C-x C-r
  4191. Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
  4192. report as an Org mode table into the current file. When the cursor is
  4193. at an existing clock table, just update it. When called with a prefix
  4194. argument, jump to the first clock report in the current document and
  4195. update it.
  4196. @cindex #+BEGIN: clocktable
  4197. @example
  4198. #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
  4199. #+END: clocktable
  4200. @end example
  4201. @noindent
  4202. If such a block already exists at point, its content is replaced by the
  4203. new table. The @samp{BEGIN} line can specify options:
  4204. @example
  4205. :maxlevel @r{Maximum level depth to which times are listed in the table.}
  4206. :emphasize @r{When @code{t}, emphasize level one and level two items}
  4207. :scope @r{The scope to consider. This can be any of the following:}
  4208. nil @r{the current buffer or narrowed region}
  4209. file @r{the full current buffer}
  4210. subtree @r{the subtree where the clocktable is located}
  4211. treeN @r{the surrounding level N tree, for example @code{tree3}}
  4212. tree @r{the surrounding level 1 tree}
  4213. agenda @r{all agenda files}
  4214. ("file"..) @r{scan these files}
  4215. file-with-archives @r{current file and its archives}
  4216. agenda-with-archives @r{all agenda files, including archives}
  4217. :block @r{The time block to consider. This block is specified either}
  4218. @r{absolute, or relative to the current time and may be any of}
  4219. @r{these formats:}
  4220. 2007-12-31 @r{New year eve 2007}
  4221. 2007-12 @r{December 2007}
  4222. 2007-W50 @r{ISO-week 50 in 2007}
  4223. 2007 @r{the year 2007}
  4224. today, yesterday, today-N @r{a relative day}
  4225. thisweek, lastweek, thisweek-N @r{a relative week}
  4226. thismonth, lastmonth, thismonth-N @r{a relative month}
  4227. thisyear, lastyear, thisyear-N @r{a relative year}
  4228. @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
  4229. :tstart @r{A time string specifying when to start considering times}
  4230. :tend @r{A time string specifying when to stop considering times}
  4231. :step @r{@code{week} or @code{day}, to split the table into chunks.}
  4232. @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
  4233. :link @r{Link the item headlines in the table to their origins}
  4234. :formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
  4235. @r{As a special case, @samp{:formula %} adds column with % time.}
  4236. @r{If you do not specify a formula here, any existing formula}
  4237. @r{below the clock table will survive updates and be evaluated.}
  4238. @end example
  4239. So to get a clock summary of the current level 1 tree, for the current
  4240. day, you could write
  4241. @example
  4242. #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
  4243. #+END: clocktable
  4244. @end example
  4245. and to use a specific time range you could write@footnote{Note that all
  4246. parameters must be specified in a single line - the line is broken here
  4247. only to fit it onto the manual.}
  4248. @example
  4249. #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
  4250. :tend "<2006-08-10 Thu 12:00>"
  4251. #+END: clocktable
  4252. @end example
  4253. A summary of the current subtree with % times would be
  4254. @example
  4255. #+BEGIN: clocktable :scope subtree :link t :formula %
  4256. #+END: clocktable
  4257. @end example
  4258. @kindex C-c C-c
  4259. @item C-c C-c
  4260. @kindex C-c C-x C-u
  4261. @itemx C-c C-x C-u
  4262. Update dynamical block at point. The cursor needs to be in the
  4263. @code{#+BEGIN} line of the dynamic block.
  4264. @kindex C-u C-c C-x C-u
  4265. @item C-u C-c C-x C-u
  4266. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  4267. you have several clock table blocks in a buffer.
  4268. @kindex S-@key{left}
  4269. @kindex S-@key{right}
  4270. @item S-@key{left}
  4271. @itemx S-@key{right}
  4272. Shift the current @code{:block} interval and update the table. The cursor
  4273. needs to be in the @code{#+BEGIN: clocktable} line for this command. If
  4274. @code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
  4275. @end table
  4276. The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
  4277. the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
  4278. worked on or closed during a day.
  4279. @node Effort estimates, Relative timer, Clocking work time, Dates and Times
  4280. @section Effort estimates
  4281. @cindex effort estimates
  4282. If you want to plan your work in a very detailed way, or if you need to
  4283. produce offers with quotations of the estimated work effort, you may want to
  4284. assign effort estimates to entries. If you are also clocking your work, you
  4285. may later want to compare the planned effort with the actual working time, a
  4286. great way to improve planning estimates. Effort estimates are stored in a
  4287. special property @samp{Effort}@footnote{You may change the property being
  4288. used with the variable @code{org-effort-property}.}. Clearly the best way to
  4289. work with effort estimates is through column view (@pxref{Column view}). You
  4290. should start by setting up discrete values for effort estimates, and a
  4291. @code{COLUMNS} format that displays these values together with clock sums (if
  4292. you want to clock your time). For a specific buffer you can use
  4293. @example
  4294. #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
  4295. #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
  4296. @end example
  4297. @noindent
  4298. or, even better, you can set up these values globally by customizing the
  4299. variables @code{org-global-properties} and @code{org-columns-default-format}.
  4300. In particular if you want to use this setup also in the agenda, a global
  4301. setup may be advised.
  4302. The way to assign estimates to individual items is then to switch to column
  4303. mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
  4304. value. The values you enter will immediately be summed up in the hierarchy.
  4305. In the column next to it, any clocked time will be displayed.
  4306. If you switch to column view in the daily/weekly agenda, the effort column
  4307. will summarize the estimated work effort for each day@footnote{Please note
  4308. the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
  4309. column view}).}, and you can use this to find space in your schedule. To get
  4310. an overview of the entire part of the day that is committed, you can set the
  4311. option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
  4312. appointments on a day that take place over a specified time interval will
  4313. then also be added to the load estimate of the day.
  4314. Effort estimates can be used in secondary agenda filtering that is triggered
  4315. with the @kbd{/} key in the agenda (@pxref{Agenda commands}). If you have
  4316. these estimates defined consistently, two or three key presses will narrow
  4317. down the list to stuff that fits into an available time slot.
  4318. @node Relative timer, , Effort estimates, Dates and Times
  4319. @section Taking notes with a relative timer
  4320. @cindex relative timer
  4321. When taking notes during, for example, a meeting or a video viewing, it can
  4322. be useful to have access to times relative to a starting time. Org provides
  4323. such a relative timer and make it easy to create timed notes.
  4324. @table @kbd
  4325. @kindex C-c C-x .
  4326. @item C-c C-x .
  4327. Insert a relative time into the buffer. The first time you use this, the
  4328. timer will be started. When called with a prefix argument, the timer is
  4329. restarted.
  4330. @kindex C-c C-x -
  4331. @item C-c C-x -
  4332. Insert a description list item with the current relative time. With a prefix
  4333. argument, first reset the timer to 0.
  4334. @kindex M-@key{RET}
  4335. @item M-@key{RET}
  4336. One the timer list is started, you can also use @kbd{M-@key{RET}} to insert
  4337. new timer items.
  4338. @kindex C-c C-x 0
  4339. @item C-c C-x 0
  4340. Reset the timer without inserting anything into the buffer. By default, the
  4341. timer is reset to 0. When called with a @kbd{C-u} prefix, reset the timer to
  4342. specific starting offset. The user is prompted for the offset, with a
  4343. default taken from a timer string at point, if any, So this can be used to
  4344. restart taking notes after a break in the process. When called with a double
  4345. prefix argument @kbd{C-c C-u}, change all timer strings in the active region
  4346. by a certain amount. This can be used to fix timer strings if the timer was
  4347. not started at exactly the right moment.
  4348. @end table
  4349. @node Capture, Agenda Views, Dates and Times, Top
  4350. @chapter Capture
  4351. @cindex capture
  4352. An important part of any organization system is the ability to quickly
  4353. capture new ideas and tasks, and to associate reference material with them.
  4354. Org uses the @file{remember} package to create tasks, and stores files
  4355. related to a task (@i{attachments}) in a special directory.
  4356. @menu
  4357. * Remember:: Capture new tasks/ideas with little interruption
  4358. * Attachments:: Add files to tasks.
  4359. @end menu
  4360. @node Remember, Attachments, Capture, Capture
  4361. @section Remember
  4362. @cindex @file{remember.el}
  4363. The @i{Remember} package by John Wiegley lets you store quick notes with
  4364. little interruption of your work flow. See
  4365. @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
  4366. information. It is an excellent way to add new notes and tasks to
  4367. Org files. Org significantly expands the possibilities of
  4368. @i{remember}: You may define templates for different note types, and
  4369. associate target files and headlines with specific templates. It also
  4370. allows you to select the location where a note should be stored
  4371. interactively, on the fly.
  4372. @menu
  4373. * Setting up Remember:: Some code for .emacs to get things going
  4374. * Remember templates:: Define the outline of different note types
  4375. * Storing notes:: Directly get the note to where it belongs
  4376. * Refiling notes:: Moving a note or task to a project
  4377. @end menu
  4378. @node Setting up Remember, Remember templates, Remember, Remember
  4379. @subsection Setting up Remember
  4380. The following customization will tell @i{remember} to use org files as
  4381. target, and to create annotations compatible with Org links.
  4382. @example
  4383. (org-remember-insinuate)
  4384. (setq org-directory "~/path/to/my/orgfiles/")
  4385. (setq org-default-notes-file (concat org-directory "/notes.org"))
  4386. (define-key global-map "\C-cr" 'org-remember)
  4387. @end example
  4388. The last line binds the command @code{org-remember} to a global
  4389. key@footnote{Please select your own key, @kbd{C-c r} is only a
  4390. suggestion.}. @code{org-remember} basically just calls @code{remember},
  4391. but it makes a few things easier: If there is an active region, it will
  4392. automatically copy the region into the remember buffer. It also allows
  4393. to jump to the buffer and location where remember notes are being
  4394. stored: Just call @code{org-remember} with a prefix argument. If you
  4395. use two prefix arguments, Org jumps to the location where the last
  4396. remember note was stored.
  4397. The remember buffer will actually use @code{org-mode} as its major mode, so
  4398. that all editing features of Org-mode are available. In addition to this, a
  4399. minor mode @code{org-remember-mode} is turned on, for the single purpose that
  4400. you can use its keymap @code{org-remember-mode-map} to overwrite some of
  4401. Org-mode's key bindings.
  4402. You can also call @code{org-remember} in a special way from the agenda,
  4403. using the @kbd{k r} key combination. With this access, any time stamps
  4404. inserted by the selected remember template (see below) will default to
  4405. the cursor date in the agenda, rather than to the current date.
  4406. @node Remember templates, Storing notes, Setting up Remember, Remember
  4407. @subsection Remember templates
  4408. @cindex templates, for remember
  4409. In combination with Org, you can use templates to generate
  4410. different types of @i{remember} notes. For example, if you would like
  4411. to use one template to create general TODO entries, another one for
  4412. journal entries, and a third one for collecting random ideas, you could
  4413. use:
  4414. @example
  4415. (setq org-remember-templates
  4416. '(("Todo" ?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
  4417. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
  4418. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  4419. @end example
  4420. @noindent In these entries, the first string is just a name, and the
  4421. character specifies how to select the template. It is useful if the
  4422. character is also the first letter of the name. The next string specifies
  4423. the template. Two more (optional) strings give the file in which, and the
  4424. headline under which the new note should be stored. The file (if not present
  4425. or @code{nil}) defaults to @code{org-default-notes-file}, the heading to
  4426. @code{org-remember-default-headline}. If the file name is not an absolute
  4427. path, it will be interpreted relative to @code{org-directory}. The heading
  4428. can also be the symbols @code{top} or @code{bottom} to send note as level 1
  4429. entries to the beginning or end of the file, respectively.
  4430. An optional sixth element specifies the contexts in which the user can select
  4431. the template. This element can be a list of major modes or a function.
  4432. @code{org-remember} will first check whether the function returns @code{t} or
  4433. if we are in any of the listed major mode, and exclude templates fo which
  4434. this condition is not fulfilled. Templates that do not specify this element
  4435. at all, or that use @code{nil} or @code{t} as a value will always be
  4436. selectable.
  4437. So for example:
  4438. @example
  4439. (setq org-remember-templates
  4440. '(("Bug" ?b "* BUG %?\n %i\n %a" "~/org/BUGS.org" "Bugs" (emacs-lisp-mode))
  4441. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org" "X" my-check)
  4442. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  4443. @end example
  4444. The first template will only be available when invoking @code{org-remember}
  4445. from an buffer in @code{emacs-lisp-mode}. The second template will only be
  4446. available when the function @code{my-check} returns @code{t}. The third
  4447. template will be proposed in any context.
  4448. When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
  4449. something, Org will prompt for a key to select the template (if you have
  4450. more than one template) and then prepare the buffer like
  4451. @example
  4452. * TODO
  4453. [[file:link to where you called remember]]
  4454. @end example
  4455. @noindent
  4456. During expansion of the template, special @kbd{%}-escapes allow dynamic
  4457. insertion of content:
  4458. @example
  4459. %^@{prompt@} @r{prompt the user for a string and replace this sequence with it.}
  4460. @r{You may specify a default value and a completion table with}
  4461. @r{%^@{prompt|default|completion2|completion3...@}}
  4462. @r{The arrow keys access a prompt-specific history.}
  4463. %a @r{annotation, normally the link created with @code{org-store-link}}
  4464. %A @r{like @code{%a}, but prompt for the description part}
  4465. %i @r{initial content, the region when remember is called with C-u.}
  4466. @r{The entire text will be indented like @code{%i} itself.}
  4467. %t @r{time stamp, date only}
  4468. %T @r{time stamp with date and time}
  4469. %u, %U @r{like the above, but inactive time stamps}
  4470. %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
  4471. @r{You may define a prompt like @code{%^@{Birthday@}t}}
  4472. %n @r{user name (taken from @code{user-full-name})}
  4473. %c @r{Current kill ring head.}
  4474. %x @r{Content of the X clipboard.}
  4475. %^C @r{Interactive selection of which kill or clip to use.}
  4476. %^L @r{Like @code{%^C}, but insert as link.}
  4477. %^g @r{prompt for tags, with completion on tags in target file.}
  4478. %k @r{title of currently clocked task}
  4479. %K @r{link to currently clocked task}
  4480. %^G @r{prompt for tags, with completion all tags in all agenda files.}
  4481. %^@{prop@}p @r{Prompt the user for a value for property @code{prop}}
  4482. %:keyword @r{specific information for certain link types, see below}
  4483. %[pathname] @r{insert the contents of the file given by @code{pathname}}
  4484. %(sexp) @r{evaluate elisp @code{(sexp)} and replace with the result}
  4485. %! @r{immediately store note after completing the template}
  4486. @r{(skipping the @kbd{C-c C-c} that normally triggers storing)}
  4487. %& @r{jump to target location immediately after storing note}
  4488. @end example
  4489. @noindent
  4490. For specific link types, the following keywords will be
  4491. defined@footnote{If you define your own link types (@pxref{Adding
  4492. hyperlink types}), any property you store with
  4493. @code{org-store-link-props} can be accessed in remember templates in a
  4494. similar way.}:
  4495. @example
  4496. Link type | Available keywords
  4497. -------------------+----------------------------------------------
  4498. bbdb | %:name %:company
  4499. bbdb | %::server %:port %:nick
  4500. vm, wl, mh, rmail | %:type %:subject %:message-id
  4501. | %:from %:fromname %:fromaddress
  4502. | %:to %:toname %:toaddress
  4503. | %: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}.}}
  4504. gnus | %:group, @r{for messages also all email fields}
  4505. w3, w3m | %:url
  4506. info | %:file %:node
  4507. calendar | %:date"
  4508. @end example
  4509. @noindent
  4510. To place the cursor after template expansion use:
  4511. @example
  4512. %? @r{After completing the template, position cursor here.}
  4513. @end example
  4514. @noindent
  4515. If you change your mind about which template to use, call
  4516. @code{org-remember} in the remember buffer. You may then select a new
  4517. template that will be filled with the previous context information.
  4518. @node Storing notes, Refiling notes, Remember templates, Remember
  4519. @subsection Storing notes
  4520. When you are finished preparing a note with @i{remember}, you have to press
  4521. @kbd{C-c C-c} to file the note away. If you have started the clock in the
  4522. remember buffer, you will first be asked if you want to clock out
  4523. now@footnote{To avoid this query, configure the variable
  4524. @code{org-remember-clock-out-on-exit}.}. If you answer @kbd{n}, the clock
  4525. will continue to run after the note was filed away.
  4526. The handler will then store the note in the file and under the headline
  4527. specified in the template, or it will use the default file and headlines.
  4528. The window configuration will be restored, sending you back to the working
  4529. context before the call to @code{remember}. To re-use the location found
  4530. during the last call to @code{remember}, exit the remember buffer with
  4531. @kbd{C-0 C-c C-c}, i.e. specify a zero prefix argument to @kbd{C-c C-c}.
  4532. Another special case is @kbd{C-2 C-c C-c} which files the note as a child of
  4533. the currently clocked item.
  4534. If you want to store the note directly to a different place, use
  4535. @kbd{C-1 C-c C-c} instead to exit remember@footnote{Configure the
  4536. variable @code{org-remember-store-without-prompt} to make this behavior
  4537. the default.}. The handler will then first prompt for a target file -
  4538. if you press @key{RET}, the value specified for the template is used.
  4539. Then the command offers the headings tree of the selected file, with the
  4540. cursor position at the default headline (if you had specified one in the
  4541. template). You can either immediately press @key{RET} to get the note
  4542. placed there. Or you can use the following keys to find a different
  4543. location:
  4544. @example
  4545. @key{TAB} @r{Cycle visibility.}
  4546. @key{down} / @key{up} @r{Next/previous visible headline.}
  4547. n / p @r{Next/previous visible headline.}
  4548. f / b @r{Next/previous headline same level.}
  4549. u @r{One level up.}
  4550. @c 0-9 @r{Digit argument.}
  4551. @end example
  4552. @noindent
  4553. Pressing @key{RET} or @key{left} or @key{right}
  4554. then leads to the following result.
  4555. @multitable @columnfractions 0.2 0.15 0.65
  4556. @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
  4557. @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
  4558. @item @tab @tab depending on @code{org-reverse-note-order}.
  4559. @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
  4560. @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
  4561. @item @tab @tab depending on @code{org-reverse-note-order}.
  4562. @item not on headline @tab @key{RET}
  4563. @tab at cursor position, level taken from context.
  4564. @end multitable
  4565. Before inserting the text into a tree, the function ensures that the text has
  4566. a headline, i.e. a first line that starts with a @samp{*}. If not, a
  4567. headline is constructed from the current date. If you have indented the text
  4568. of the note below the headline, the indentation will be adapted if inserting
  4569. the note into the tree requires demotion from level 1.
  4570. @node Refiling notes, , Storing notes, Remember
  4571. @subsection Refiling notes
  4572. @cindex refiling notes
  4573. Remember is usually used to quickly capture notes and tasks into one or
  4574. a few capture lists. When reviewing the captured data, you may want to
  4575. refile some of the entries into a different list, for example into a
  4576. project. Cutting, finding the right location and then pasting the note
  4577. is cumbersome. To simplify this process, you can use the following
  4578. special command:
  4579. @table @kbd
  4580. @kindex C-c C-w
  4581. @item C-c C-w
  4582. Refile the entry or region at point. This command offers possible locations
  4583. for refiling the entry and lets you select one with completion. The item (or
  4584. all items in the region) is filed below the target heading as a subitem.
  4585. Depending on @code{org-reverse-note-order}, it will be either the first or
  4586. last subitem.@*
  4587. By default, all level 1 headlines in the current buffer are considered to be
  4588. targets, but you can have more complex definitions across a number of files.
  4589. See the variable @code{org-refile-targets} for details. If you would like to
  4590. select a location via a file-path-like completion along the outline path, see
  4591. the variables @code{org-refile-use-outline-path} and
  4592. @code{org-outline-path-complete-in-steps}.
  4593. @kindex C-u C-c C-w
  4594. @item C-u C-c C-w
  4595. Use the refile interface to jump to a heading.
  4596. @kindex C-u C-u C-c C-w
  4597. @item C-u C-u C-c C-w
  4598. Jump to the location where @code{org-refile} last moved a tree to.
  4599. @end table
  4600. @node Attachments, , Remember, Capture
  4601. @section Attachments
  4602. @cindex attachments
  4603. It is often useful to associate reference material with an outline node/task.
  4604. Small chunks of plain text can simply be stored in the subtree of a project.
  4605. Hyperlinks (@pxref{Hyperlinks}) can be used to establish associations with
  4606. files that live elsewhere on your computer or in the cloud, like emails or
  4607. source code files belonging to a project. Another method is @i{attachments},
  4608. which are files located in a directory belonging to an outline node. Org
  4609. uses directories named by the unique ID of each entry. These directories are
  4610. located in the @file{data} directory which lives in the same directory where
  4611. your org-file lives@footnote{If you move entries or Org-files from one
  4612. directory to the next, you may want to configure @code{org-attach-directory}
  4613. to contain an absolute path.}. If you initialize this directory with
  4614. @code{git-init}, Org will automatically commit changes when it sees them.
  4615. The attachment system has been contributed to Org by John Wiegley.
  4616. @noindent The following commands deal with attachments.
  4617. @table @kbd
  4618. @kindex C-c C-a
  4619. @item C-c C-a
  4620. The dispatcher for commands related to the attachment system. After these
  4621. keys, a list of commands is displayed and you need to press an additional key
  4622. to select a command:
  4623. @table @kbd
  4624. @kindex C-c C-a a
  4625. @item a
  4626. Select a file and move it into the task's attachment directory. The file
  4627. will be copied, moved, or linked, depending on @code{org-attach-method}.
  4628. Note that hard links are not supported on all systems.
  4629. @kindex C-c C-a c
  4630. @kindex C-c C-a m
  4631. @kindex C-c C-a l
  4632. @item c/m/l
  4633. Attach a file using the copy/move/link method.
  4634. Note that hard links are not supported on all systems.
  4635. @kindex C-c C-a n
  4636. @item n
  4637. Create a new attachment as an Emacs buffer.
  4638. @kindex C-c C-a z
  4639. @item z
  4640. Synchronize the current task with its attachment directory, in case you added
  4641. attachments yourself.
  4642. @kindex C-c C-a o
  4643. @item o
  4644. Open current task's attachment. If there are more than one, prompt for a
  4645. file name first. Opening will follow the rules set by @code{org-file-apps}.
  4646. For more details, see the information on following hyperlings
  4647. (@pxref{Handling links}).
  4648. @kindex C-c C-a O
  4649. @item O
  4650. Also open the attachment, but force opening the file in Emacs.
  4651. @kindex C-c C-a f
  4652. @item f
  4653. Open the current task's attachment directory.
  4654. @kindex C-c C-a F
  4655. @item F
  4656. Also open the directory, but force using @code{dired} in Emacs.
  4657. @kindex C-c C-a d
  4658. @item d
  4659. Select and delete a single attachment.
  4660. @kindex C-c C-a D
  4661. @item D
  4662. Delete all of a task's attachments. A safer way is to open the directory in
  4663. dired and delete from there.
  4664. @end table
  4665. @end table
  4666. @node Agenda Views, Embedded LaTeX, Capture, Top
  4667. @chapter Agenda Views
  4668. @cindex agenda views
  4669. Due to the way Org works, TODO items, time-stamped items, and
  4670. tagged headlines can be scattered throughout a file or even a number of
  4671. files. To get an overview of open action items, or of events that are
  4672. important for a particular date, this information must be collected,
  4673. sorted and displayed in an organized way.
  4674. Org can select items based on various criteria, and display them
  4675. in a separate buffer. Seven different view types are provided:
  4676. @itemize @bullet
  4677. @item
  4678. an @emph{agenda} that is like a calendar and shows information
  4679. for specific dates,
  4680. @item
  4681. a @emph{TODO list} that covers all unfinished
  4682. action items,
  4683. @item
  4684. a @emph{match view}, showings headlines based on the tags, properties and
  4685. TODO state associated with them,
  4686. @item
  4687. a @emph{timeline view} that shows all events in a single Org file,
  4688. in time-sorted view,
  4689. @item
  4690. a @emph{keyword search view} that shows all entries from multiple files
  4691. that contain specified keywords.
  4692. @item
  4693. a @emph{stuck projects view} showing projects that currently don't move
  4694. along, and
  4695. @item
  4696. @emph{custom views} that are special tag/keyword searches and
  4697. combinations of different views.
  4698. @end itemize
  4699. @noindent
  4700. The extracted information is displayed in a special @emph{agenda
  4701. buffer}. This buffer is read-only, but provides commands to visit the
  4702. corresponding locations in the original Org files, and even to
  4703. edit these files remotely.
  4704. Two variables control how the agenda buffer is displayed and whether the
  4705. window configuration is restored when the agenda exits:
  4706. @code{org-agenda-window-setup} and
  4707. @code{org-agenda-restore-windows-after-quit}.
  4708. @menu
  4709. * Agenda files:: Files being searched for agenda information
  4710. * Agenda dispatcher:: Keyboard access to agenda views
  4711. * Built-in agenda views:: What is available out of the box?
  4712. * Presentation and sorting:: How agenda items are prepared for display
  4713. * Agenda commands:: Remote editing of Org trees
  4714. * Custom agenda views:: Defining special searches and views
  4715. * Agenda column view:: Using column view for collected entries
  4716. @end menu
  4717. @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
  4718. @section Agenda files
  4719. @cindex agenda files
  4720. @cindex files for agenda
  4721. The information to be shown is normally collected from all @emph{agenda
  4722. files}, the files listed in the variable
  4723. @code{org-agenda-files}@footnote{If the value of that variable is not a
  4724. list, but a single file name, then the list of agenda files will be
  4725. maintained in that external file.}. If a directory is part of this list,
  4726. all files with the extension @file{.org} in this directory will be part
  4727. of the list.
  4728. Thus even if you only work with a single Org file, this file should
  4729. be put into that list@footnote{When using the dispatcher, pressing
  4730. @kbd{<} before selecting a command will actually limit the command to
  4731. the current file, and ignore @code{org-agenda-files} until the next
  4732. dispatcher command.}. You can customize @code{org-agenda-files}, but
  4733. the easiest way to maintain it is through the following commands
  4734. @cindex files, adding to agenda list
  4735. @table @kbd
  4736. @kindex C-c [
  4737. @item C-c [
  4738. Add current file to the list of agenda files. The file is added to
  4739. the front of the list. If it was already in the list, it is moved to
  4740. the front. With a prefix argument, file is added/moved to the end.
  4741. @kindex C-c ]
  4742. @item C-c ]
  4743. Remove current file from the list of agenda files.
  4744. @kindex C-,
  4745. @kindex C-'
  4746. @item C-,
  4747. @itemx C-'
  4748. Cycle through agenda file list, visiting one file after the other.
  4749. @kindex M-x org-iswitchb
  4750. @item M-x org-iswitchb
  4751. Command to use an @code{iswitchb}-like interface to switch to and between Org
  4752. buffers.
  4753. @end table
  4754. @noindent
  4755. The Org menu contains the current list of files and can be used
  4756. to visit any of them.
  4757. If you would like to focus the agenda temporarily onto a file not in
  4758. this list, or onto just one file in the list or even only a subtree in a
  4759. file, this can be done in different ways. For a single agenda command,
  4760. you may press @kbd{<} once or several times in the dispatcher
  4761. (@pxref{Agenda dispatcher}). To restrict the agenda scope for an
  4762. extended period, use the following commands:
  4763. @table @kbd
  4764. @kindex C-c C-x <
  4765. @item C-c C-x <
  4766. Permanently restrict the agenda to the current subtree. When with a
  4767. prefix argument, or with the cursor before the first headline in a file,
  4768. the agenda scope is set to the entire file. This restriction remains in
  4769. effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
  4770. or @kbd{>} in the agenda dispatcher. If there is a window displaying an
  4771. agenda view, the new restriction takes effect immediately.
  4772. @kindex C-c C-x >
  4773. @item C-c C-x >
  4774. Remove the permanent restriction created by @kbd{C-c C-x <}.
  4775. @end table
  4776. @noindent
  4777. When working with @file{Speedbar}, you can use the following commands in
  4778. the Speedbar frame:
  4779. @table @kbd
  4780. @kindex <
  4781. @item < @r{in the speedbar frame}
  4782. Permanently restrict the agenda to the item at the cursor in the
  4783. Speedbar frame, either an Org file or a subtree in such a file.
  4784. If there is a window displaying an agenda view, the new restriction takes
  4785. effect immediately.
  4786. @kindex >
  4787. @item > @r{in the speedbar frame}
  4788. Lift the restriction again.
  4789. @end table
  4790. @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
  4791. @section The agenda dispatcher
  4792. @cindex agenda dispatcher
  4793. @cindex dispatching agenda commands
  4794. The views are created through a dispatcher that should be bound to a
  4795. global key, for example @kbd{C-c a} (@pxref{Installation}). In the
  4796. following we will assume that @kbd{C-c a} is indeed how the dispatcher
  4797. is accessed and list keyboard access to commands accordingly. After
  4798. pressing @kbd{C-c a}, an additional letter is required to execute a
  4799. command. The dispatcher offers the following default commands:
  4800. @table @kbd
  4801. @item a
  4802. Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
  4803. @item t @r{/} T
  4804. Create a list of all TODO items (@pxref{Global TODO list}).
  4805. @item m @r{/} M
  4806. Create a list of headlines matching a TAGS expression (@pxref{Matching
  4807. tags and properties}).
  4808. @item L
  4809. Create the timeline view for the current buffer (@pxref{Timeline}).
  4810. @item s
  4811. Create a list of entries selected by a boolean expression of keywords
  4812. and/or regular expressions that must or must not occur in the entry.
  4813. @item /
  4814. Search for a regular expression in all agenda files and additionally in
  4815. the files listed in @code{org-agenda-multi-occur-extra-files}. This
  4816. uses the Emacs command @code{multi-occur}. A prefix argument can be
  4817. used to specify the number of context lines for each match, default is
  4818. 1.
  4819. @item # @r{/} !
  4820. Create a list of stuck projects (@pxref{Stuck projects}).
  4821. @item <
  4822. Restrict an agenda command to the current buffer@footnote{For backward
  4823. compatibility, you can also press @kbd{1} to restrict to the current
  4824. buffer.}. After pressing @kbd{<}, you still need to press the character
  4825. selecting the command.
  4826. @item < <
  4827. If there is an active region, restrict the following agenda command to
  4828. the region. Otherwise, restrict it to the current subtree@footnote{For
  4829. backward compatibility, you can also press @kbd{0} to restrict to the
  4830. current buffer.}. After pressing @kbd{< <}, you still need to press the
  4831. character selecting the command.
  4832. @end table
  4833. You can also define custom commands that will be accessible through the
  4834. dispatcher, just like the default commands. This includes the
  4835. possibility to create extended agenda buffers that contain several
  4836. blocks together, for example the weekly agenda, the global TODO list and
  4837. a number of special tags matches. @xref{Custom agenda views}.
  4838. @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
  4839. @section The built-in agenda views
  4840. In this section we describe the built-in views.
  4841. @menu
  4842. * Weekly/daily agenda:: The calendar page with current tasks
  4843. * Global TODO list:: All unfinished action items
  4844. * Matching tags and properties:: Structured information with fine-tuned search
  4845. * Timeline:: Time-sorted view for single file
  4846. * Keyword search:: Finding entries by keyword
  4847. * Stuck projects:: Find projects you need to review
  4848. @end menu
  4849. @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
  4850. @subsection The weekly/daily agenda
  4851. @cindex agenda
  4852. @cindex weekly agenda
  4853. @cindex daily agenda
  4854. The purpose of the weekly/daily @emph{agenda} is to act like a page of a
  4855. paper agenda, showing all the tasks for the current week or day.
  4856. @table @kbd
  4857. @cindex org-agenda, command
  4858. @kindex C-c a a
  4859. @item C-c a a
  4860. Compile an agenda for the current week from a list of org files. The agenda
  4861. shows the entries for each day. With a numeric prefix@footnote{For backward
  4862. compatibility, the universal prefix @kbd{C-u} causes all TODO entries to be
  4863. listed before the agenda. This feature is deprecated, use the dedicated TODO
  4864. list, or a block agenda instead (@pxref{Block agenda}).} (like @kbd{C-u 2 1
  4865. C-c a a}) you may set the number of days to be displayed (see also the
  4866. variable @code{org-agenda-ndays})
  4867. @end table
  4868. Remote editing from the agenda buffer means, for example, that you can
  4869. change the dates of deadlines and appointments from the agenda buffer.
  4870. The commands available in the Agenda buffer are listed in @ref{Agenda
  4871. commands}.
  4872. @subsubheading Calendar/Diary integration
  4873. @cindex calendar integration
  4874. @cindex diary integration
  4875. Emacs contains the calendar and diary by Edward M. Reingold. The
  4876. calendar displays a three-month calendar with holidays from different
  4877. countries and cultures. The diary allows you to keep track of
  4878. anniversaries, lunar phases, sunrise/set, recurrent appointments
  4879. (weekly, monthly) and more. In this way, it is quite complementary to
  4880. Org. It can be very useful to combine output from Org with
  4881. the diary.
  4882. In order to include entries from the Emacs diary into Org mode's
  4883. agenda, you only need to customize the variable
  4884. @lisp
  4885. (setq org-agenda-include-diary t)
  4886. @end lisp
  4887. @noindent After that, everything will happen automatically. All diary
  4888. entries including holidays, anniversaries etc will be included in the
  4889. agenda buffer created by Org mode. @key{SPC}, @key{TAB}, and
  4890. @key{RET} can be used from the agenda buffer to jump to the diary
  4891. file in order to edit existing diary entries. The @kbd{i} command to
  4892. insert new entries for the current date works in the agenda buffer, as
  4893. well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
  4894. Sunrise/Sunset times, show lunar phases and to convert to other
  4895. calendars, respectively. @kbd{c} can be used to switch back and forth
  4896. between calendar and agenda.
  4897. If you are using the diary only for sexp entries and holidays, it is
  4898. faster to not use the above setting, but instead to copy or even move
  4899. the entries into an Org file. Org mode evaluates diary-style sexp
  4900. entries, and does it faster because there is no overhead for first
  4901. creating the diary display. Note that the sexp entries must start at
  4902. the left margin, no white space is allowed before them. For example,
  4903. the following segment of an Org file will be processed and entries
  4904. will be made in the agenda:
  4905. @example
  4906. * Birthdays and similar stuff
  4907. #+CATEGORY: Holiday
  4908. %%(org-calendar-holiday) ; special function for holiday names
  4909. #+CATEGORY: Ann
  4910. %%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
  4911. %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
  4912. @end example
  4913. @subsubheading Appointment reminders
  4914. @cindex @file{appt.el}
  4915. @cindex appointment reminders
  4916. Org can interact with Emacs appointments notification facility.
  4917. To add all the appointments of your agenda files, use the command
  4918. @code{org-agenda-to-appt}. This commands also lets you filter through
  4919. the list of your appointments and add only those belonging to a specific
  4920. category or matching a regular expression. See the docstring for
  4921. details.
  4922. @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
  4923. @subsection The global TODO list
  4924. @cindex global TODO list
  4925. @cindex TODO list, global
  4926. The global TODO list contains all unfinished TODO items, formatted and
  4927. collected into a single place.
  4928. @table @kbd
  4929. @kindex C-c a t
  4930. @item C-c a t
  4931. Show the global TODO list. This collects the TODO items from all
  4932. agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
  4933. @code{agenda-mode}, so there are commands to examine and manipulate
  4934. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  4935. @kindex C-c a T
  4936. @item C-c a T
  4937. @cindex TODO keyword matching
  4938. Like the above, but allows selection of a specific TODO keyword. You
  4939. can also do this by specifying a prefix argument to @kbd{C-c a t}. With
  4940. a @kbd{C-u} prefix you are prompted for a keyword, and you may also
  4941. specify several keywords by separating them with @samp{|} as boolean OR
  4942. operator. With a numeric prefix, the Nth keyword in
  4943. @code{org-todo-keywords} is selected.
  4944. @kindex r
  4945. The @kbd{r} key in the agenda buffer regenerates it, and you can give
  4946. a prefix argument to this command to change the selected TODO keyword,
  4947. for example @kbd{3 r}. If you often need a search for a specific
  4948. keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
  4949. Matching specific TODO keywords can also be done as part of a tags
  4950. search (@pxref{Tag searches}).
  4951. @end table
  4952. Remote editing of TODO items means that you can change the state of a
  4953. TODO entry with a single key press. The commands available in the
  4954. TODO list are described in @ref{Agenda commands}.
  4955. @cindex sublevels, inclusion into TODO list
  4956. Normally the global TODO list simply shows all headlines with TODO
  4957. keywords. This list can become very long. There are two ways to keep
  4958. it more compact:
  4959. @itemize @minus
  4960. @item
  4961. Some people view a TODO item that has been @emph{scheduled} for
  4962. execution (@pxref{Timestamps}) as no longer @emph{open}. Configure the
  4963. variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
  4964. items from the global TODO list.
  4965. @item
  4966. TODO items may have sublevels to break up the task into subtasks. In
  4967. such cases it may be enough to list only the highest level TODO headline
  4968. and omit the sublevels from the global list. Configure the variable
  4969. @code{org-agenda-todo-list-sublevels} to get this behavior.
  4970. @end itemize
  4971. @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
  4972. @subsection Matching tags and properties
  4973. @cindex matching, of tags
  4974. @cindex matching, of properties
  4975. @cindex tags view
  4976. @cindex match view
  4977. If headlines in the agenda files are marked with @emph{tags}
  4978. (@pxref{Tags}), you can select headlines based on the tags that apply
  4979. to them and collect them into an agenda buffer.
  4980. @table @kbd
  4981. @kindex C-c a m
  4982. @item C-c a m
  4983. Produce a list of all headlines that match a given set of tags. The
  4984. command prompts for a selection criterion, which is a boolean logic
  4985. expression with tags, like @samp{+work+urgent-withboss} or
  4986. @samp{work|home} (@pxref{Tags}). If you often need a specific search,
  4987. define a custom command for it (@pxref{Agenda dispatcher}).
  4988. @kindex C-c a M
  4989. @item C-c a M
  4990. Like @kbd{C-c a m}, but only select headlines that are also TODO items
  4991. and force checking subitems (see variable
  4992. @code{org-tags-match-list-sublevels}). Matching specific TODO keywords
  4993. together with a tags match is also possible, see @ref{Tag searches}.
  4994. @end table
  4995. The commands available in the tags list are described in @ref{Agenda
  4996. commands}.
  4997. @node Timeline, Keyword search, Matching tags and properties, Built-in agenda views
  4998. @subsection Timeline for a single file
  4999. @cindex timeline, single file
  5000. @cindex time-sorted view
  5001. The timeline summarizes all time-stamped items from a single Org mode
  5002. file in a @emph{time-sorted view}. The main purpose of this command is
  5003. to give an overview over events in a project.
  5004. @table @kbd
  5005. @kindex C-c a L
  5006. @item C-c a L
  5007. Show a time-sorted view of the org file, with all time-stamped items.
  5008. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  5009. (scheduled or not) are also listed under the current date.
  5010. @end table
  5011. @noindent
  5012. The commands available in the timeline buffer are listed in
  5013. @ref{Agenda commands}.
  5014. @node Keyword search, Stuck projects, Timeline, Built-in agenda views
  5015. @subsection Keyword search
  5016. @cindex keyword search
  5017. @cindex searching, for keywords
  5018. This agenda view is a general text search facility for Org mode entries.
  5019. It is particularly useful to find notes.
  5020. @table @kbd
  5021. @kindex C-c a s
  5022. @item C-c a s
  5023. This is a special search that lets you select entries by keywords or
  5024. regular expression, using a boolean logic. For example, the search
  5025. string
  5026. @example
  5027. +computer +wifi -ethernet -@{8\.11[bg]@}
  5028. @end example
  5029. @noindent
  5030. will search for note entries that contain the keywords @code{computer}
  5031. and @code{wifi}, but not the keyword @code{ethernet}, and which are also
  5032. not matched by the regular expression @code{8\.11[bg]}, meaning to
  5033. exclude both 8.11b and 8.11g.
  5034. Note that in addition to the agenda files, this command will also search
  5035. the files listed in @code{org-agenda-text-search-extra-files}.
  5036. @end table
  5037. @node Stuck projects, , Keyword search, Built-in agenda views
  5038. @subsection Stuck projects
  5039. If you are following a system like David Allen's GTD to organize your
  5040. work, one of the ``duties'' you have is a regular review to make sure
  5041. that all projects move along. A @emph{stuck} project is a project that
  5042. has no defined next actions, so it will never show up in the TODO lists
  5043. Org mode produces. During the review, you need to identify such
  5044. projects and define next actions for them.
  5045. @table @kbd
  5046. @kindex C-c a #
  5047. @item C-c a #
  5048. List projects that are stuck.
  5049. @kindex C-c a !
  5050. @item C-c a !
  5051. Customize the variable @code{org-stuck-projects} to define what a stuck
  5052. project is and how to find it.
  5053. @end table
  5054. You almost certainly will have to configure this view before it will
  5055. work for you. The built-in default assumes that all your projects are
  5056. level-2 headlines, and that a project is not stuck if it has at least
  5057. one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
  5058. Let's assume that you, in your own way of using Org mode, identify
  5059. projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
  5060. indicate a project that should not be considered yet. Let's further
  5061. assume that the TODO keyword DONE marks finished projects, and that NEXT
  5062. and TODO indicate next actions. The tag @@SHOP indicates shopping and
  5063. is a next action even without the NEXT tag. Finally, if the project
  5064. contains the special word IGNORE anywhere, it should not be listed
  5065. either. In this case you would start by identifying eligible projects
  5066. with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
  5067. TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
  5068. are not stuck. The correct customization for this is
  5069. @lisp
  5070. (setq org-stuck-projects
  5071. '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
  5072. "\\<IGNORE\\>"))
  5073. @end lisp
  5074. @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
  5075. @section Presentation and sorting
  5076. @cindex presentation, of agenda items
  5077. Before displaying items in an agenda view, Org mode visually prepares
  5078. the items and sorts them. Each item occupies a single line. The line
  5079. starts with a @emph{prefix} that contains the @emph{category}
  5080. (@pxref{Categories}) of the item and other important information. You can
  5081. customize the prefix using the option @code{org-agenda-prefix-format}.
  5082. The prefix is followed by a cleaned-up version of the outline headline
  5083. associated with the item.
  5084. @menu
  5085. * Categories:: Not all tasks are equal
  5086. * Time-of-day specifications:: How the agenda knows the time
  5087. * Sorting of agenda items:: The order of things
  5088. @end menu
  5089. @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
  5090. @subsection Categories
  5091. @cindex category
  5092. The category is a broad label assigned to each agenda item. By default,
  5093. the category is simply derived from the file name, but you can also
  5094. specify it with a special line in the buffer, like this@footnote{For
  5095. backward compatibility, the following also works: If there are several
  5096. such lines in a file, each specifies the category for the text below it.
  5097. The first category also applies to any text before the first CATEGORY
  5098. line. However, using this method is @emph{strongly} deprecated as it is
  5099. incompatible with the outline structure of the document. The correct
  5100. method for setting multiple categories in a buffer is using a
  5101. property.}:
  5102. @example
  5103. #+CATEGORY: Thesis
  5104. @end example
  5105. @noindent
  5106. If you would like to have a special CATEGORY for a single entry or a
  5107. (sub)tree, give the entry a @code{:CATEGORY:} property with the location
  5108. as the value (@pxref{Properties and Columns}).
  5109. @noindent
  5110. The display in the agenda buffer looks best if the category is not
  5111. longer than 10 characters.
  5112. @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
  5113. @subsection Time-of-day specifications
  5114. @cindex time-of-day specification
  5115. Org mode checks each agenda item for a time-of-day specification. The
  5116. time can be part of the time stamp that triggered inclusion into the
  5117. agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
  5118. ranges can be specified with two time stamps, like
  5119. @c
  5120. @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
  5121. In the headline of the entry itself, a time(range) may also appear as
  5122. plain text (like @samp{12:45} or a @samp{8:30-1pm}). If the agenda
  5123. integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
  5124. specifications in diary entries are recognized as well.
  5125. For agenda display, Org mode extracts the time and displays it in a
  5126. standard 24 hour format as part of the prefix. The example times in
  5127. the previous paragraphs would end up in the agenda like this:
  5128. @example
  5129. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  5130. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  5131. 19:00...... The Vogon reads his poem
  5132. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  5133. @end example
  5134. @cindex time grid
  5135. If the agenda is in single-day mode, or for the display of today, the
  5136. timed entries are embedded in a time grid, like
  5137. @example
  5138. 8:00...... ------------------
  5139. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  5140. 10:00...... ------------------
  5141. 12:00...... ------------------
  5142. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  5143. 14:00...... ------------------
  5144. 16:00...... ------------------
  5145. 18:00...... ------------------
  5146. 19:00...... The Vogon reads his poem
  5147. 20:00...... ------------------
  5148. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  5149. @end example
  5150. The time grid can be turned on and off with the variable
  5151. @code{org-agenda-use-time-grid}, and can be configured with
  5152. @code{org-agenda-time-grid}.
  5153. @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
  5154. @subsection Sorting of agenda items
  5155. @cindex sorting, of agenda items
  5156. @cindex priorities, of agenda items
  5157. Before being inserted into a view, the items are sorted. How this is
  5158. done depends on the type of view.
  5159. @itemize @bullet
  5160. @item
  5161. For the daily/weekly agenda, the items for each day are sorted. The
  5162. default order is to first collect all items containing an explicit
  5163. time-of-day specification. These entries will be shown at the beginning
  5164. of the list, as a @emph{schedule} for the day. After that, items remain
  5165. grouped in categories, in the sequence given by @code{org-agenda-files}.
  5166. Within each category, items are sorted by priority (@pxref{Priorities}),
  5167. which is composed of the base priority (2000 for priority @samp{A}, 1000
  5168. for @samp{B}, and 0 for @samp{C}), plus additional increments for
  5169. overdue scheduled or deadline items.
  5170. @item
  5171. For the TODO list, items remain in the order of categories, but within
  5172. each category, sorting takes place according to priority
  5173. (@pxref{Priorities}).
  5174. @item
  5175. For tags matches, items are not sorted at all, but just appear in the
  5176. sequence in which they are found in the agenda files.
  5177. @end itemize
  5178. Sorting can be customized using the variable
  5179. @code{org-agenda-sorting-strategy}, and may also include criteria based on
  5180. the estimated effort of an entry (@pxref{Effort estimates}).
  5181. @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
  5182. @section Commands in the agenda buffer
  5183. @cindex commands, in agenda buffer
  5184. Entries in the agenda buffer are linked back to the org file or diary
  5185. file where they originate. You are not allowed to edit the agenda
  5186. buffer itself, but commands are provided to show and jump to the
  5187. original entry location, and to edit the org-files ``remotely'' from
  5188. the agenda buffer. In this way, all information is stored only once,
  5189. removing the risk that your agenda and note files may diverge.
  5190. Some commands can be executed with mouse clicks on agenda lines. For
  5191. the other commands, the cursor needs to be in the desired line.
  5192. @table @kbd
  5193. @tsubheading{Motion}
  5194. @cindex motion commands in agenda
  5195. @kindex n
  5196. @item n
  5197. Next line (same as @key{up} and @kbd{C-p}).
  5198. @kindex p
  5199. @item p
  5200. Previous line (same as @key{down} and @kbd{C-n}).
  5201. @tsubheading{View/Go to org file}
  5202. @kindex mouse-3
  5203. @kindex @key{SPC}
  5204. @item mouse-3
  5205. @itemx @key{SPC}
  5206. Display the original location of the item in another window.
  5207. @c
  5208. @kindex L
  5209. @item L
  5210. Display original location and recenter that window.
  5211. @c
  5212. @kindex mouse-2
  5213. @kindex mouse-1
  5214. @kindex @key{TAB}
  5215. @item mouse-2
  5216. @itemx mouse-1
  5217. @itemx @key{TAB}
  5218. Go to the original location of the item in another window. Under Emacs
  5219. 22, @kbd{mouse-1} will also works for this.
  5220. @c
  5221. @kindex @key{RET}
  5222. @itemx @key{RET}
  5223. Go to the original location of the item and delete other windows.
  5224. @c
  5225. @kindex f
  5226. @item f
  5227. Toggle Follow mode. In Follow mode, as you move the cursor through
  5228. the agenda buffer, the other window always shows the corresponding
  5229. location in the org file. The initial setting for this mode in new
  5230. agenda buffers can be set with the variable
  5231. @code{org-agenda-start-with-follow-mode}.
  5232. @c
  5233. @kindex b
  5234. @item b
  5235. Display the entire subtree of the current item in an indirect buffer. With a
  5236. numeric prefix argument N, go up to level N and then take that tree. If N is
  5237. negative, go up that many levels. With a @kbd{C-u} prefix, do not remove the
  5238. previously used indirect buffer.
  5239. @c
  5240. @kindex l
  5241. @item l
  5242. Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
  5243. logging was on (variable @code{org-log-done}) are shown in the agenda, as are
  5244. entries that have been clocked on that day. You can configure the entry
  5245. types that should be included in log mode using the variable
  5246. @code{org-agenda-log-mode-items}. When called with a @kbd{C-u} prefix, show
  5247. all possible logbook entries, including state changes. When called with two
  5248. prefix args @kbd{C-u C-u}, show only logging information, nothing else.
  5249. @c
  5250. @kindex v
  5251. @item v
  5252. Toggle Archives mode. In archives mode, trees that are marked are also
  5253. scanned when producing the agenda. When you call this command with a
  5254. @kbd{C-u} prefix argument, even all archive files are included. To exit
  5255. archives mode, press @kbd{v} again.
  5256. @c
  5257. @kindex R
  5258. @item R
  5259. Toggle Clockreport mode. In clockreport mode, the daily/weekly agenda will
  5260. always show a table with the clocked times for the timespan and file scope
  5261. covered by the current agenda view. The initial setting for this mode in new
  5262. agenda buffers can be set with the variable
  5263. @code{org-agenda-start-with-clockreport-mode}.
  5264. @tsubheading{Change display}
  5265. @cindex display changing, in agenda
  5266. @kindex o
  5267. @item o
  5268. Delete other windows.
  5269. @c
  5270. @kindex d
  5271. @kindex w
  5272. @kindex m
  5273. @kindex y
  5274. @item d w m y
  5275. Switch to day/week/month/year view. When switching to day or week view,
  5276. this setting becomes the default for subsequent agenda commands. Since
  5277. month and year views are slow to create, they do not become the default.
  5278. A numeric prefix argument may be used to jump directly to a specific day
  5279. of the year, ISO week, month, or year, respectively. For example,
  5280. @kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When
  5281. setting day, week, or month view, a year may be encoded in the prefix
  5282. argument as well. For example, @kbd{200712 w} will jump to week 12 in
  5283. 2007. If such a year specification has only one or two digits, it will
  5284. be mapped to the interval 1938-2037.
  5285. @c
  5286. @kindex D
  5287. @item D
  5288. Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
  5289. @c
  5290. @kindex G
  5291. @item G
  5292. Toggle the time grid on and off. See also the variables
  5293. @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
  5294. @c
  5295. @kindex r
  5296. @item r
  5297. Recreate the agenda buffer, for example to reflect the changes
  5298. after modification of the time stamps of items with S-@key{left} and
  5299. S-@key{right}. When the buffer is the global TODO list, a prefix
  5300. argument is interpreted to create a selective list for a specific TODO
  5301. keyword.
  5302. @kindex g
  5303. @item g
  5304. Same as @kbd{r}.
  5305. @c
  5306. @kindex s
  5307. @kindex C-x C-s
  5308. @item s
  5309. @itemx C-x C-s
  5310. Save all Org buffers in the current Emacs session.
  5311. @c
  5312. @kindex @key{right}
  5313. @item @key{right}
  5314. Display the following @code{org-agenda-ndays} days. For example, if
  5315. the display covers a week, switch to the following week. With prefix
  5316. arg, go forward that many times @code{org-agenda-ndays} days.
  5317. @c
  5318. @kindex @key{left}
  5319. @item @key{left}
  5320. Display the previous dates.
  5321. @c
  5322. @kindex .
  5323. @item .
  5324. Go to today.
  5325. @c
  5326. @kindex C-c C-x C-c
  5327. @item C-c C-x C-c
  5328. Invoke column view (@pxref{Column view}) in the agenda buffer. The column
  5329. view format is taken from the entry at point, or (if there is no entry at
  5330. point), from the first entry in the agenda view. So whatever the format for
  5331. that entry would be in the original buffer (taken from a property, from a
  5332. @code{#+COLUMNS} line, or from the default variable
  5333. @code{org-columns-default-format}), will be used in the agenda.
  5334. @tsubheading{Secondary filtering and query editing}
  5335. @cindex filtering, by tag and effort, in agenda
  5336. @cindex tag filtering, in agenda
  5337. @cindex effort filtering, in agenda
  5338. @cindex query editing, in agenda
  5339. @kindex /
  5340. @item /
  5341. Filter the current agenda view with respect to a tag and/or effort estimates.
  5342. The difference between this and a custom agenda commands is that filtering is
  5343. very fast, so that you can switch quickly between different filters without
  5344. having to recreate the agenda.
  5345. You will be prompted for a tag selection letter. Pressing @key{TAB} at that
  5346. prompt will offer use completion to select a tag (including any tags that do
  5347. not have a selection character). The command then hides all entries that do
  5348. not contain or inherit this tag. When called with prefix arg, remove the
  5349. entries that @emph{do} have the tag. A second @kbd{/} at the prompt will
  5350. turn off the filter and unhide any hidden entries. If the first key you
  5351. press is either @kbd{+} or @kbd{-}, the previous filter will be narrowed by
  5352. requiring or forbidding the selected additional tag. Instead of pressing
  5353. @kbd{+} or @kbd{-} after @kbd{/}, you can also immediately use the @kbd{\}
  5354. command.
  5355. In order to filter for effort estimates, you should set-up allowed
  5356. efforts globally, for example
  5357. @lisp
  5358. (setq org-global-properties
  5359. '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
  5360. @end lisp
  5361. You can then filter for an effort by first typing an operator, one of @kbd{<},
  5362. @kbd{>}, and @kbd{=}, and then the one-digit index of an effort estimate in
  5363. your array of allowed values, where @kbd{0} means the 10th value. The filter
  5364. will then restrict to entries with effort smaller-or-equal, equal, or
  5365. larger-or-equal than the selected value. If the digits 0-9 are not used as
  5366. fast access keys to tags, you can also simply press the index digit directly
  5367. without an operator. In this case, @kbd{<} will be assumed.
  5368. @kindex \
  5369. @item \
  5370. Narrow the current agenda filter by an additional condition. When called with
  5371. prefix arg, remove the entries that @emph{do} have the tag, or that do match
  5372. the effort criterion. You can achieve the same effect by pressing @kbd{+} or
  5373. @kbd{-} as the first key after the @kbd{/} command.
  5374. @kindex [
  5375. @kindex ]
  5376. @kindex @{
  5377. @kindex @}
  5378. @item [ ] @{ @}
  5379. In the @i{search view} (@pxref{Keyword search}), these keys add new search
  5380. words (@kbd{[} and @kbd{]}) or new regular expressions (@kbd{@{} and
  5381. @kbd{@}}) to the query string. The opening bracket/brace will add a positive
  5382. search term prefixed by @samp{+}, indicating that this search term @i{must}
  5383. occur/match in the entry. The closing bracket/brace will add a negative
  5384. search term which @i{must not} occur/match in the entry for it to be
  5385. selected.
  5386. @tsubheading{Remote editing}
  5387. @cindex remote editing, from agenda
  5388. @item 0-9
  5389. Digit argument.
  5390. @c
  5391. @cindex undoing remote-editing events
  5392. @cindex remote editing, undo
  5393. @kindex C-_
  5394. @item C-_
  5395. Undo a change due to a remote editing command. The change is undone
  5396. both in the agenda buffer and in the remote buffer.
  5397. @c
  5398. @kindex t
  5399. @item t
  5400. Change the TODO state of the item, both in the agenda and in the
  5401. original org file.
  5402. @c
  5403. @kindex C-k
  5404. @item C-k
  5405. Delete the current agenda item along with the entire subtree belonging
  5406. to it in the original Org file. If the text to be deleted remotely
  5407. is longer than one line, the kill needs to be confirmed by the user. See
  5408. variable @code{org-agenda-confirm-kill}.
  5409. @c
  5410. @kindex a
  5411. @item a
  5412. Toggle the ARCHIVE tag for the current headline.
  5413. @c
  5414. @kindex A
  5415. @item A
  5416. Move the subtree corresponding to the current entry to its @emph{Archive
  5417. Sibling}.
  5418. @c
  5419. @kindex $
  5420. @item $
  5421. Archive the subtree corresponding to the current headline. This means the
  5422. entry will be moved to the configured archive location, most likely a
  5423. different file.
  5424. @c
  5425. @kindex T
  5426. @item T
  5427. Show all tags associated with the current item. This is useful if you have
  5428. turned off @code{org-agenda-show-inherited-tags}, but still want to see all
  5429. tags of a headline occasionally.
  5430. @c
  5431. @kindex :
  5432. @item :
  5433. Set tags for the current headline. If there is an active region in the
  5434. agenda, change a tag for all headings in the region.
  5435. @c
  5436. @kindex ,
  5437. @item ,
  5438. Set the priority for the current item. Org mode prompts for the
  5439. priority character. If you reply with @key{SPC}, the priority cookie
  5440. is removed from the entry.
  5441. @c
  5442. @kindex P
  5443. @item P
  5444. Display weighted priority of current item.
  5445. @c
  5446. @kindex +
  5447. @kindex S-@key{up}
  5448. @item +
  5449. @itemx S-@key{up}
  5450. Increase the priority of the current item. The priority is changed in
  5451. the original buffer, but the agenda is not resorted. Use the @kbd{r}
  5452. key for this.
  5453. @c
  5454. @kindex -
  5455. @kindex S-@key{down}
  5456. @item -
  5457. @itemx S-@key{down}
  5458. Decrease the priority of the current item.
  5459. @c
  5460. @kindex C-c C-a
  5461. @item C-c C-a
  5462. Dispatcher for all command related to attachments.
  5463. @c
  5464. @kindex C-c C-s
  5465. @item C-c C-s
  5466. Schedule this item
  5467. @c
  5468. @kindex C-c C-d
  5469. @item C-c C-d
  5470. Set a deadline for this item.
  5471. @c
  5472. @kindex k
  5473. @item k
  5474. Agenda actions, to set dates for selected items to the cursor date.
  5475. This command also works in the calendar! The command prompts for an
  5476. additonal key:
  5477. @example
  5478. m @r{Mark the entry at point for action. You can also make entries}
  5479. @r{in Org files with @kbd{C-c C-x C-k}.}
  5480. d @r{Set the deadline of the marked entry to the date at point.}
  5481. s @r{Schedule the marked entry at the date at point.}
  5482. r @r{Call @code{org-remember} with the cursor date as default date.}
  5483. @end example
  5484. Press @kbd{r} afterwards to refresh the agenda and see the effect of the
  5485. command.
  5486. @c
  5487. @kindex S-@key{right}
  5488. @item S-@key{right}
  5489. Change the time stamp associated with the current line by one day into the
  5490. future. With a numeric prefix argument, change it by that many days. For
  5491. example, @kbd{3 6 5 S-@key{right}} will change it by a year. The stamp is
  5492. changed in the original org file, but the change is not directly reflected in
  5493. the agenda buffer. Use the @kbd{r} key to update the buffer.
  5494. @c
  5495. @kindex S-@key{left}
  5496. @item S-@key{left}
  5497. Change the time stamp associated with the current line by one day
  5498. into the past.
  5499. @c
  5500. @kindex >
  5501. @item >
  5502. Change the time stamp associated with the current line to today.
  5503. The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
  5504. on my keyboard.
  5505. @c
  5506. @kindex I
  5507. @item I
  5508. Start the clock on the current item. If a clock is running already, it
  5509. is stopped first.
  5510. @c
  5511. @kindex O
  5512. @item O
  5513. Stop the previously started clock.
  5514. @c
  5515. @kindex X
  5516. @item X
  5517. Cancel the currently running clock.
  5518. @kindex J
  5519. @item J
  5520. Jump to the running clock in another window.
  5521. @tsubheading{Calendar commands}
  5522. @cindex calendar commands, from agenda
  5523. @kindex c
  5524. @item c
  5525. Open the Emacs calendar and move to the date at the agenda cursor.
  5526. @c
  5527. @item c
  5528. When in the calendar, compute and show the Org mode agenda for the
  5529. date at the cursor.
  5530. @c
  5531. @cindex diary entries, creating from agenda
  5532. @kindex i
  5533. @item i
  5534. Insert a new entry into the diary. Prompts for the type of entry
  5535. (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
  5536. entry in the diary, just as @kbd{i d} etc. would do in the calendar.
  5537. The date is taken from the cursor position.
  5538. @c
  5539. @kindex M
  5540. @item M
  5541. Show the phases of the moon for the three months around current date.
  5542. @c
  5543. @kindex S
  5544. @item S
  5545. Show sunrise and sunset times. The geographical location must be set
  5546. with calendar variables, see documentation of the Emacs calendar.
  5547. @c
  5548. @kindex C
  5549. @item C
  5550. Convert the date at cursor into many other cultural and historic
  5551. calendars.
  5552. @c
  5553. @kindex H
  5554. @item H
  5555. Show holidays for three month around the cursor date.
  5556. @item M-x org-export-icalendar-combine-agenda-files
  5557. Export a single iCalendar file containing entries from all agenda files.
  5558. This is a globally available command, and also available in the agenda menu.
  5559. @tsubheading{Exporting to a file}
  5560. @kindex C-x C-w
  5561. @item C-x C-w
  5562. @cindex exporting agenda views
  5563. @cindex agenda views, exporting
  5564. Write the agenda view to a file. Depending on the extension of the
  5565. selected file name, the view will be exported as HTML (extension
  5566. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
  5567. plain text (any other extension). Use the variable
  5568. @code{org-agenda-exporter-settings} to set options for @file{ps-print}
  5569. and for @file{htmlize} to be used during export.
  5570. @tsubheading{Quit and Exit}
  5571. @kindex q
  5572. @item q
  5573. Quit agenda, remove the agenda buffer.
  5574. @c
  5575. @kindex x
  5576. @cindex agenda files, removing buffers
  5577. @item x
  5578. Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
  5579. for the compilation of the agenda. Buffers created by the user to
  5580. visit org files will not be removed.
  5581. @end table
  5582. @node Custom agenda views, Agenda column view, Agenda commands, Agenda Views
  5583. @section Custom agenda views
  5584. @cindex custom agenda views
  5585. @cindex agenda views, custom
  5586. Custom agenda commands serve two purposes: to store and quickly access
  5587. frequently used TODO and tags searches, and to create special composite
  5588. agenda buffers. Custom agenda commands will be accessible through the
  5589. dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
  5590. @menu
  5591. * Storing searches:: Type once, use often
  5592. * Block agenda:: All the stuff you need in a single buffer
  5593. * Setting Options:: Changing the rules
  5594. * Exporting Agenda Views:: Writing agendas to files
  5595. * Using the agenda elsewhere:: Using agenda information in other programs
  5596. @end menu
  5597. @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
  5598. @subsection Storing searches
  5599. The first application of custom searches is the definition of keyboard
  5600. shortcuts for frequently used searches, either creating an agenda
  5601. buffer, or a sparse tree (the latter covering of course only the current
  5602. buffer).
  5603. @kindex C-c a C
  5604. Custom commands are configured in the variable
  5605. @code{org-agenda-custom-commands}. You can customize this variable, for
  5606. example by pressing @kbd{C-c a C}. You can also directly set it with
  5607. Emacs Lisp in @file{.emacs}. The following example contains all valid
  5608. search types:
  5609. @lisp
  5610. @group
  5611. (setq org-agenda-custom-commands
  5612. '(("w" todo "WAITING")
  5613. ("W" todo-tree "WAITING")
  5614. ("u" tags "+boss-urgent")
  5615. ("v" tags-todo "+boss-urgent")
  5616. ("U" tags-tree "+boss-urgent")
  5617. ("f" occur-tree "\\<FIXME\\>")
  5618. ("h" . "HOME+Name tags searches") ; description for "h" prefix
  5619. ("hl" tags "+home+Lisa")
  5620. ("hp" tags "+home+Peter")
  5621. ("hk" tags "+home+Kim")))
  5622. @end group
  5623. @end lisp
  5624. @noindent
  5625. The initial string in each entry defines the keys you have to press
  5626. after the dispatcher command @kbd{C-c a} in order to access the command.
  5627. Usually this will be just a single character, but if you have many
  5628. similar commands, you can also define two-letter combinations where the
  5629. first character is the same in several combinations and serves as a
  5630. prefix key@footnote{You can provide a description for a prefix key by
  5631. inserting a cons cell with the prefix and the description.}. The second
  5632. parameter is the search type, followed by the string or regular
  5633. expression to be used for the matching. The example above will
  5634. therefore define:
  5635. @table @kbd
  5636. @item C-c a w
  5637. as a global search for TODO entries with @samp{WAITING} as the TODO
  5638. keyword
  5639. @item C-c a W
  5640. as the same search, but only in the current buffer and displaying the
  5641. results as a sparse tree
  5642. @item C-c a u
  5643. as a global tags search for headlines marked @samp{:boss:} but not
  5644. @samp{:urgent:}
  5645. @item C-c a v
  5646. as the same search as @kbd{C-c a u}, but limiting the search to
  5647. headlines that are also TODO items
  5648. @item C-c a U
  5649. as the same search as @kbd{C-c a u}, but only in the current buffer and
  5650. displaying the result as a sparse tree
  5651. @item C-c a f
  5652. to create a sparse tree (again: current buffer only) with all entries
  5653. containing the word @samp{FIXME}
  5654. @item C-c a h
  5655. as a prefix command for a HOME tags search where you have to press an
  5656. additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
  5657. Peter, or Kim) as additional tag to match.
  5658. @end table
  5659. @node Block agenda, Setting Options, Storing searches, Custom agenda views
  5660. @subsection Block agenda
  5661. @cindex block agenda
  5662. @cindex agenda, with block views
  5663. Another possibility is the construction of agenda views that comprise
  5664. the results of @emph{several} commands, each of which creates a block in
  5665. the agenda buffer. The available commands include @code{agenda} for the
  5666. daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
  5667. for the global TODO list (as constructed with @kbd{C-c a t}), and the
  5668. matching commands discussed above: @code{todo}, @code{tags}, and
  5669. @code{tags-todo}. Here are two examples:
  5670. @lisp
  5671. @group
  5672. (setq org-agenda-custom-commands
  5673. '(("h" "Agenda and Home-related tasks"
  5674. ((agenda "")
  5675. (tags-todo "home")
  5676. (tags "garden")))
  5677. ("o" "Agenda and Office-related tasks"
  5678. ((agenda "")
  5679. (tags-todo "work")
  5680. (tags "office")))))
  5681. @end group
  5682. @end lisp
  5683. @noindent
  5684. This will define @kbd{C-c a h} to create a multi-block view for stuff
  5685. you need to attend to at home. The resulting agenda buffer will contain
  5686. your agenda for the current week, all TODO items that carry the tag
  5687. @samp{home}, and also all lines tagged with @samp{garden}. Finally the
  5688. command @kbd{C-c a o} provides a similar view for office tasks.
  5689. @node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
  5690. @subsection Setting options for custom commands
  5691. @cindex options, for custom agenda views
  5692. Org mode contains a number of variables regulating agenda construction
  5693. and display. The global variables define the behavior for all agenda
  5694. commands, including the custom commands. However, if you want to change
  5695. some settings just for a single custom view, you can do so. Setting
  5696. options requires inserting a list of variable names and values at the
  5697. right spot in @code{org-agenda-custom-commands}. For example:
  5698. @lisp
  5699. @group
  5700. (setq org-agenda-custom-commands
  5701. '(("w" todo "WAITING"
  5702. ((org-agenda-sorting-strategy '(priority-down))
  5703. (org-agenda-prefix-format " Mixed: ")))
  5704. ("U" tags-tree "+boss-urgent"
  5705. ((org-show-following-heading nil)
  5706. (org-show-hierarchy-above nil)))
  5707. ("N" search ""
  5708. ((org-agenda-files '("~org/notes.org"))
  5709. (org-agenda-text-search-extra-files nil)))))
  5710. @end group
  5711. @end lisp
  5712. @noindent
  5713. Now the @kbd{C-c a w} command will sort the collected entries only by
  5714. priority, and the prefix format is modified to just say @samp{ Mixed: }
  5715. instead of giving the category of the entry. The sparse tags tree of
  5716. @kbd{C-c a U} will now turn out ultra-compact, because neither the
  5717. headline hierarchy above the match, nor the headline following the match
  5718. will be shown. The command @kbd{C-c a N} will do a text search limited
  5719. to only a single file.
  5720. For command sets creating a block agenda,
  5721. @code{org-agenda-custom-commands} has two separate spots for setting
  5722. options. You can add options that should be valid for just a single
  5723. command in the set, and options that should be valid for all commands in
  5724. the set. The former are just added to the command entry, the latter
  5725. must come after the list of command entries. Going back to the block
  5726. agenda example (@pxref{Block agenda}), let's change the sorting strategy
  5727. for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
  5728. the results for GARDEN tags query in the opposite order,
  5729. @code{priority-up}. This would look like this:
  5730. @lisp
  5731. @group
  5732. (setq org-agenda-custom-commands
  5733. '(("h" "Agenda and Home-related tasks"
  5734. ((agenda)
  5735. (tags-todo "home")
  5736. (tags "garden"
  5737. ((org-agenda-sorting-strategy '(priority-up)))))
  5738. ((org-agenda-sorting-strategy '(priority-down))))
  5739. ("o" "Agenda and Office-related tasks"
  5740. ((agenda)
  5741. (tags-todo "work")
  5742. (tags "office")))))
  5743. @end group
  5744. @end lisp
  5745. As you see, the values and parenthesis setting is a little complex.
  5746. When in doubt, use the customize interface to set this variable - it
  5747. fully supports its structure. Just one caveat: When setting options in
  5748. this interface, the @emph{values} are just lisp expressions. So if the
  5749. value is a string, you need to add the double quotes around the value
  5750. yourself.
  5751. @node Exporting Agenda Views, Using the agenda elsewhere, Setting Options, Custom agenda views
  5752. @subsection Exporting Agenda Views
  5753. @cindex agenda views, exporting
  5754. If you are away from your computer, it can be very useful to have a
  5755. printed version of some agenda views to carry around. Org mode can
  5756. export custom agenda views as plain text, HTML@footnote{You need to
  5757. install Hrvoje Niksic' @file{htmlize.el}.} postscript, and iCalendar
  5758. files. If you want to do this only occasionally, use the command
  5759. @table @kbd
  5760. @kindex C-x C-w
  5761. @item C-x C-w
  5762. @cindex exporting agenda views
  5763. @cindex agenda views, exporting
  5764. Write the agenda view to a file. Depending on the extension of the
  5765. selected file name, the view will be exported as HTML (extension
  5766. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}),
  5767. iCalendar (extension @file{.ics}), or plain text (any other extension).
  5768. Use the variable @code{org-agenda-exporter-settings} to
  5769. set options for @file{ps-print} and for @file{htmlize} to be used during
  5770. export, for example
  5771. @lisp
  5772. (setq org-agenda-exporter-settings
  5773. '((ps-number-of-columns 2)
  5774. (ps-landscape-mode t)
  5775. (htmlize-output-type 'css)))
  5776. @end lisp
  5777. @end table
  5778. If you need to export certain agenda views frequently, you can associate
  5779. any custom agenda command with a list of output file names
  5780. @footnote{If you want to store standard views like the weekly agenda
  5781. or the global TODO list as well, you need to define custom commands for
  5782. them in order to be able to specify file names.}. Here is an example
  5783. that first does define custom commands for the agenda and the global
  5784. todo list, together with a number of files to which to export them.
  5785. Then we define two block agenda commands and specify file names for them
  5786. as well. File names can be relative to the current working directory,
  5787. or absolute.
  5788. @lisp
  5789. @group
  5790. (setq org-agenda-custom-commands
  5791. '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
  5792. ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
  5793. ("h" "Agenda and Home-related tasks"
  5794. ((agenda "")
  5795. (tags-todo "home")
  5796. (tags "garden"))
  5797. nil
  5798. ("~/views/home.html"))
  5799. ("o" "Agenda and Office-related tasks"
  5800. ((agenda)
  5801. (tags-todo "work")
  5802. (tags "office"))
  5803. nil
  5804. ("~/views/office.ps" "~/calendars/office.ics"))))
  5805. @end group
  5806. @end lisp
  5807. The extension of the file name determines the type of export. If it is
  5808. @file{.html}, Org mode will use the @file{htmlize.el} package to convert
  5809. the buffer to HTML and save it to this file name. If the extension is
  5810. @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
  5811. postscript output. If the extension is @file{.ics}, iCalendar export is
  5812. run export over all files that were used to construct the agenda, and
  5813. limit the export to entries listed in the agenda now. Any other
  5814. extension produces a plain ASCII file.
  5815. The export files are @emph{not} created when you use one of those
  5816. commands interactively because this might use too much overhead.
  5817. Instead, there is a special command to produce @emph{all} specified
  5818. files in one step:
  5819. @table @kbd
  5820. @kindex C-c a e
  5821. @item C-c a e
  5822. Export all agenda views that have export file names associated with
  5823. them.
  5824. @end table
  5825. You can use the options section of the custom agenda commands to also
  5826. set options for the export commands. For example:
  5827. @lisp
  5828. (setq org-agenda-custom-commands
  5829. '(("X" agenda ""
  5830. ((ps-number-of-columns 2)
  5831. (ps-landscape-mode t)
  5832. (org-agenda-prefix-format " [ ] ")
  5833. (org-agenda-with-colors nil)
  5834. (org-agenda-remove-tags t))
  5835. ("theagenda.ps"))))
  5836. @end lisp
  5837. @noindent
  5838. This command sets two options for the postscript exporter, to make it
  5839. print in two columns in landscape format - the resulting page can be cut
  5840. in two and then used in a paper agenda. The remaining settings modify
  5841. the agenda prefix to omit category and scheduling information, and
  5842. instead include a checkbox to check off items. We also remove the tags
  5843. to make the lines compact, and we don't want to use colors for the
  5844. black-and-white printer. Settings specified in
  5845. @code{org-agenda-exporter-settings} will also apply, but the settings
  5846. in @code{org-agenda-custom-commands} take precedence.
  5847. @noindent
  5848. From the command line you may also use
  5849. @example
  5850. emacs -f org-batch-store-agenda-views -kill
  5851. @end example
  5852. @noindent
  5853. or, if you need to modify some parameters@footnote{Quoting may depend on the
  5854. system you use, please check th FAQ for examples.}
  5855. @example
  5856. emacs -eval '(org-batch-store-agenda-views \
  5857. org-agenda-ndays 30 \
  5858. org-agenda-start-day "2007-11-01" \
  5859. org-agenda-include-diary nil \
  5860. org-agenda-files (quote ("~/org/project.org")))' \
  5861. -kill
  5862. @end example
  5863. @noindent
  5864. which will create the agenda views restricted to the file
  5865. @file{~/org/project.org}, without diary entries and with 30 days
  5866. extent.
  5867. @node Using the agenda elsewhere, , Exporting Agenda Views, Custom agenda views
  5868. @subsection Using agenda information outside of Org
  5869. @cindex agenda, pipe
  5870. @cindex Scripts, for agenda processing
  5871. Org provides commands to access agenda information for the command
  5872. line in emacs batch mode. This extracted information can be sent
  5873. directly to a printer, or it can be read by a program that does further
  5874. processing of the data. The first of these commands is the function
  5875. @code{org-batch-agenda}, that produces an agenda view and sends it as
  5876. ASCII text to STDOUT. The command takes a single string as parameter.
  5877. If the string has length 1, it is used as a key to one of the commands
  5878. you have configured in @code{org-agenda-custom-commands}, basically any
  5879. key you can use after @kbd{C-c a}. For example, to directly print the
  5880. current TODO list, you could use
  5881. @example
  5882. emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
  5883. @end example
  5884. If the parameter is a string with 2 or more characters, it is used as a
  5885. tags/todo match string. For example, to print your local shopping list
  5886. (all items with the tag @samp{shop}, but excluding the tag
  5887. @samp{NewYork}), you could use
  5888. @example
  5889. emacs -batch -l ~/.emacs \
  5890. -eval '(org-batch-agenda "+shop-NewYork")' | lpr
  5891. @end example
  5892. @noindent
  5893. You may also modify parameters on the fly like this:
  5894. @example
  5895. emacs -batch -l ~/.emacs \
  5896. -eval '(org-batch-agenda "a" \
  5897. org-agenda-ndays 30 \
  5898. org-agenda-include-diary nil \
  5899. org-agenda-files (quote ("~/org/project.org")))' \
  5900. | lpr
  5901. @end example
  5902. @noindent
  5903. which will produce a 30 day agenda, fully restricted to the Org file
  5904. @file{~/org/projects.org}, not even including the diary.
  5905. If you want to process the agenda data in more sophisticated ways, you
  5906. can use the command @code{org-batch-agenda-csv} to get a comma-separated
  5907. list of values for each agenda item. Each line in the output will
  5908. contain a number of fields separated by commas. The fields in a line
  5909. are:
  5910. @example
  5911. category @r{The category of the item}
  5912. head @r{The headline, without TODO kwd, TAGS and PRIORITY}
  5913. type @r{The type of the agenda entry, can be}
  5914. todo @r{selected in TODO match}
  5915. tagsmatch @r{selected in tags match}
  5916. diary @r{imported from diary}
  5917. deadline @r{a deadline}
  5918. scheduled @r{scheduled}
  5919. timestamp @r{appointment, selected by timestamp}
  5920. closed @r{entry was closed on date}
  5921. upcoming-deadline @r{warning about nearing deadline}
  5922. past-scheduled @r{forwarded scheduled item}
  5923. block @r{entry has date block including date}
  5924. todo @r{The TODO keyword, if any}
  5925. tags @r{All tags including inherited ones, separated by colons}
  5926. date @r{The relevant date, like 2007-2-14}
  5927. time @r{The time, like 15:00-16:50}
  5928. extra @r{String with extra planning info}
  5929. priority-l @r{The priority letter if any was given}
  5930. priority-n @r{The computed numerical priority}
  5931. @end example
  5932. @noindent
  5933. Time and date will only be given if a timestamp (or deadline/scheduled)
  5934. lead to the selection of the item.
  5935. A CSV list like this is very easy to use in a post processing script.
  5936. For example, here is a Perl program that gets the TODO list from
  5937. Emacs/Org and prints all the items, preceded by a checkbox:
  5938. @example
  5939. @group
  5940. #!/usr/bin/perl
  5941. # define the Emacs command to run
  5942. $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
  5943. # run it and capture the output
  5944. $agenda = qx@{$cmd 2>/dev/null@};
  5945. # loop over all lines
  5946. foreach $line (split(/\n/,$agenda)) @{
  5947. # get the individual values
  5948. ($category,$head,$type,$todo,$tags,$date,$time,$extra,
  5949. $priority_l,$priority_n) = split(/,/,$line);
  5950. # proccess and print
  5951. print "[ ] $head\n";
  5952. @}
  5953. @end group
  5954. @end example
  5955. @node Agenda column view, , Custom agenda views, Agenda Views
  5956. @section Using column view in the agenda
  5957. @cindex column view, in agenda
  5958. @cindex agenda, column view
  5959. Column view (@pxref{Column view}) is normally used to view and edit
  5960. properties embedded in the hierarchical structure of an Org file. It can be
  5961. quite useful to use column view also from the agenda, where entries are
  5962. collected by certain criteria.
  5963. @table @kbd
  5964. @kindex C-c C-x C-c
  5965. @item C-c C-x C-c
  5966. Turn on column view in the agenda.
  5967. @end table
  5968. To understand how to use this properly, it is important to realize that the
  5969. entries in the agenda are no longer in their proper outline environment.
  5970. This causes the following issues:
  5971. @enumerate
  5972. @item
  5973. Org needs to make a decision which @code{COLUMNS} format to use. Since the
  5974. entries in the agenda are collected from different files, and different files
  5975. may have different @code{COLUMNS} formats, this is a non-trivial problem.
  5976. Org first checks if the variable @code{org-overriding-columns-format} is
  5977. currently set, and if yes takes the format from there. Otherwise it takes
  5978. the format associated with the first item in the agenda, or, if that item
  5979. does not have a specific format (defined in a property, or in it's file), it
  5980. uses @code{org-columns-default-format}.
  5981. @item
  5982. If any of the columns has a summary type defined (@pxref{Column attributes}),
  5983. turning on column view in the agenda will visit all relevant agenda files and
  5984. make sure that the computations of this property are up to date. This is
  5985. also true for the special @code{CLOCKSUM} property. Org will then sum the
  5986. values displayed in the agenda. In the daily/weekly agenda, the sums will
  5987. cover a single day, in all other views they cover the entire block. It is
  5988. vital to realize that the agenda may show the same entry @emph{twice} (for
  5989. example as scheduled and as a deadline), and it may show two entries from the
  5990. same hierarchy (for example a @emph{parent} and it's @emph{child}). In these
  5991. cases, the summation in the agenda will lead to incorrect results because
  5992. some values will count double.
  5993. @item
  5994. When the column view in the agenda shows the @code{CLOCKSUM}, that is always
  5995. the entire clocked time for this item. So even in the daily/weekly agenda,
  5996. the clocksum listed in column view may originate from times outside the
  5997. current view. This has the advantage that you can compare these values with
  5998. a column listing the planned total effort for a task - one of the major
  5999. applications for column view in the agenda. If you want information about
  6000. clocked time in the displayed period use clock table mode (press @kbd{R} in
  6001. the agenda).
  6002. @end enumerate
  6003. @node Embedded LaTeX, Exporting, Agenda Views, Top
  6004. @chapter Embedded LaTeX
  6005. @cindex @TeX{} interpretation
  6006. @cindex La@TeX{} interpretation
  6007. Plain ASCII is normally sufficient for almost all note taking. One
  6008. exception, however, are scientific notes which need to be able to contain
  6009. mathematical symbols and the occasional formula. La@TeX{}@footnote{La@TeX{}
  6010. is a macro system based on Donald E. Knuth's @TeX{} system. Many of the
  6011. features described here as ``La@TeX{}'' are really from @TeX{}, but for
  6012. simplicity I am blurring this distinction.} is widely used to typeset
  6013. scientific documents. Org mode supports embedding La@TeX{} code into its
  6014. files, because many academics are used to reading La@TeX{} source code, and
  6015. because it can be readily processed into images for HTML production.
  6016. It is not necessary to mark La@TeX{} macros and code in any special way.
  6017. If you observe a few conventions, Org mode knows how to find it and what
  6018. to do with it.
  6019. @menu
  6020. * Math symbols:: TeX macros for symbols and Greek letters
  6021. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  6022. * LaTeX fragments:: Complex formulas made easy
  6023. * Processing LaTeX fragments:: Previewing LaTeX processing
  6024. * CDLaTeX mode:: Speed up entering of formulas
  6025. @end menu
  6026. @node Math symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
  6027. @section Math symbols
  6028. @cindex math symbols
  6029. @cindex TeX macros
  6030. You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
  6031. to indicate the Greek letter, or @samp{\to} to indicate an arrow.
  6032. Completion for these macros is available, just type @samp{\} and maybe a
  6033. few letters, and press @kbd{M-@key{TAB}} to see possible completions.
  6034. Unlike La@TeX{} code, Org mode allows these macros to be present
  6035. without surrounding math delimiters, for example:
  6036. @example
  6037. Angles are written as Greek letters \alpha, \beta and \gamma.
  6038. @end example
  6039. During HTML export (@pxref{HTML export}), these symbols are translated
  6040. into the proper syntax for HTML, for the above examples this is
  6041. @samp{&alpha;} and @samp{&rarr;}, respectively. If you need such a symbol
  6042. inside a word, terminate it like this: @samp{\Aacute@{@}stor}.
  6043. @node Subscripts and superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
  6044. @section Subscripts and superscripts
  6045. @cindex subscript
  6046. @cindex superscript
  6047. Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
  6048. and subscripts. Again, these can be used without embedding them in
  6049. math-mode delimiters. To increase the readability of ASCII text, it is
  6050. not necessary (but OK) to surround multi-character sub- and superscripts
  6051. with curly braces. For example
  6052. @example
  6053. The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
  6054. the sun is R_@{sun@} = 6.96 x 10^8 m.
  6055. @end example
  6056. To avoid interpretation as raised or lowered text, you can quote
  6057. @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
  6058. During HTML export (@pxref{HTML export}), subscript and superscripts
  6059. are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
  6060. @node LaTeX fragments, Processing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
  6061. @section LaTeX fragments
  6062. @cindex LaTeX fragments
  6063. With symbols, sub- and superscripts, HTML is pretty much at its end when
  6064. it comes to representing mathematical formulas@footnote{Yes, there is
  6065. MathML, but that is not yet fully supported by many browsers, and there
  6066. is no decent converter for turning La@TeX{} or ASCII representations of
  6067. formulas into MathML. So for the time being, converting formulas into
  6068. images seems the way to go.}. More complex expressions need a dedicated
  6069. formula processor. To this end, Org mode can contain arbitrary La@TeX{}
  6070. fragments. It provides commands to preview the typeset result of these
  6071. fragments, and upon export to HTML, all fragments will be converted to
  6072. images and inlined into the HTML document@footnote{The La@TeX{} export
  6073. will not use images for displaying La@TeX{} fragments but include these
  6074. fragments directly into the La@TeX{} code.}. For this to work you
  6075. need to be on a system with a working La@TeX{} installation. You also
  6076. need the @file{dvipng} program, available at
  6077. @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
  6078. will be used when processing a fragment can be configured with the
  6079. variable @code{org-format-latex-header}.
  6080. La@TeX{} fragments don't need any special marking at all. The following
  6081. snippets will be identified as La@TeX{} source code:
  6082. @itemize @bullet
  6083. @item
  6084. Environments of any kind. The only requirement is that the
  6085. @code{\begin} statement appears on a new line, preceded by only
  6086. whitespace.
  6087. @item
  6088. Text within the usual La@TeX{} math delimiters. To avoid conflicts with
  6089. currency specifications, single @samp{$} characters are only recognized
  6090. as math delimiters if the enclosed text contains at most two line breaks,
  6091. is directly attached to the @samp{$} characters with no whitespace in
  6092. between, and if the closing @samp{$} is followed by whitespace or
  6093. punctuation. For the other delimiters, there is no such restriction, so
  6094. when in doubt, use @samp{\(...\)} as inline math delimiters.
  6095. @end itemize
  6096. @noindent For example:
  6097. @example
  6098. \begin@{equation@} % arbitrary environments,
  6099. x=\sqrt@{b@} % even tables, figures
  6100. \end@{equation@} % etc
  6101. If $a^2=b$ and \( b=2 \), then the solution must be
  6102. either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
  6103. @end example
  6104. @noindent
  6105. If you need any of the delimiter ASCII sequences for other purposes, you
  6106. can configure the option @code{org-format-latex-options} to deselect the
  6107. ones you do not wish to have interpreted by the La@TeX{} converter.
  6108. @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
  6109. @section Processing LaTeX fragments
  6110. @cindex LaTeX fragments, preview
  6111. La@TeX{} fragments can be processed to produce a preview images of the
  6112. typeset expressions:
  6113. @table @kbd
  6114. @kindex C-c C-x C-l
  6115. @item C-c C-x C-l
  6116. Produce a preview image of the La@TeX{} fragment at point and overlay it
  6117. over the source code. If there is no fragment at point, process all
  6118. fragments in the current entry (between two headlines). When called
  6119. with a prefix argument, process the entire subtree. When called with
  6120. two prefix arguments, or when the cursor is before the first headline,
  6121. process the entire buffer.
  6122. @kindex C-c C-c
  6123. @item C-c C-c
  6124. Remove the overlay preview images.
  6125. @end table
  6126. During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
  6127. converted into images and inlined into the document if the following
  6128. setting is active:
  6129. @lisp
  6130. (setq org-export-with-LaTeX-fragments t)
  6131. @end lisp
  6132. @node CDLaTeX mode, , Processing LaTeX fragments, Embedded LaTeX
  6133. @section Using CDLaTeX to enter math
  6134. @cindex CDLaTeX
  6135. CDLaTeX mode is a minor mode that is normally used in combination with a
  6136. major La@TeX{} mode like AUCTeX in order to speed-up insertion of
  6137. environments and math templates. Inside Org mode, you can make use of
  6138. some of the features of CDLaTeX mode. You need to install
  6139. @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
  6140. AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
  6141. Don't use CDLaTeX mode itself under Org mode, but use the light
  6142. version @code{org-cdlatex-mode} that comes as part of Org mode. Turn it
  6143. on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
  6144. Org files with
  6145. @lisp
  6146. (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
  6147. @end lisp
  6148. When this mode is enabled, the following features are present (for more
  6149. details see the documentation of CDLaTeX mode):
  6150. @itemize @bullet
  6151. @kindex C-c @{
  6152. @item
  6153. Environment templates can be inserted with @kbd{C-c @{}.
  6154. @item
  6155. @kindex @key{TAB}
  6156. The @key{TAB} key will do template expansion if the cursor is inside a
  6157. La@TeX{} fragment@footnote{Org mode has a method to test if the cursor is
  6158. inside such a fragment, see the documentation of the function
  6159. @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
  6160. expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
  6161. correctly inside the first brace. Another @key{TAB} will get you into
  6162. the second brace. Even outside fragments, @key{TAB} will expand
  6163. environment abbreviations at the beginning of a line. For example, if
  6164. you write @samp{equ} at the beginning of a line and press @key{TAB},
  6165. this abbreviation will be expanded to an @code{equation} environment.
  6166. To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
  6167. @item
  6168. @kindex _
  6169. @kindex ^
  6170. Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
  6171. characters together with a pair of braces. If you use @key{TAB} to move
  6172. out of the braces, and if the braces surround only a single character or
  6173. macro, they are removed again (depending on the variable
  6174. @code{cdlatex-simplify-sub-super-scripts}).
  6175. @item
  6176. @kindex `
  6177. Pressing the backquote @kbd{`} followed by a character inserts math
  6178. macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
  6179. after the backquote, a help window will pop up.
  6180. @item
  6181. @kindex '
  6182. Pressing the normal quote @kbd{'} followed by another character modifies
  6183. the symbol before point with an accent or a font. If you wait more than
  6184. 1.5 seconds after the backquote, a help window will pop up. Character
  6185. modification will work only inside La@TeX{} fragments, outside the quote
  6186. is normal.
  6187. @end itemize
  6188. @node Exporting, Publishing, Embedded LaTeX, Top
  6189. @chapter Exporting
  6190. @cindex exporting
  6191. Org mode documents can be exported into a variety of other formats. For
  6192. printing and sharing of notes, ASCII export produces a readable and
  6193. simple version of an Org file. HTML export allows you to publish a
  6194. notes file on the web, while the XOXO format provides a solid base for
  6195. exchange with a broad range of other applications. La@TeX{} export lets
  6196. you use Org mode and its structured editing functions to easily create
  6197. La@TeX{} files. To incorporate entries with associated times like
  6198. deadlines or appointments into a desktop calendar program like iCal,
  6199. Org mode can also produce extracts in the iCalendar format. Currently
  6200. Org mode only supports export, not import of these different formats.
  6201. @menu
  6202. * Markup rules:: Which structures are recognized?
  6203. * Selective export:: Using tags to select and exclude trees
  6204. * Export options:: Per-file export settings
  6205. * The export dispatcher:: How to access exporter commands
  6206. * ASCII export:: Exporting to plain ASCII
  6207. * HTML export:: Exporting to HTML
  6208. * LaTeX and PDF export:: Exporting to LaTeX, and processing to PDF
  6209. * XOXO export:: Exporting to XOXO
  6210. * iCalendar export:: Exporting in iCalendar format
  6211. @end menu
  6212. @node Markup rules, Selective export, Exporting, Exporting
  6213. @section Markup rules
  6214. When exporting Org mode documents, the exporter tries to reflect the
  6215. structure of the document as accurately as possible in the back-end. Since
  6216. export targets like HTML or La@TeX{} allow much richer formatting, Org mode
  6217. has rules how to prepare text for rich export. This section summarizes the
  6218. markup rule used in an Org mode buffer.
  6219. @menu
  6220. * Document title:: How the document title is determined
  6221. * Headings and sections:: The main structure of the exported document
  6222. * Table of contents:: If, where, how to create a table of contents
  6223. * Initial text:: Text before the first headline
  6224. * Lists:: Plain lists are exported
  6225. * Paragraphs:: What determines beginning and ending
  6226. * Literal examples:: Source code and other examples
  6227. * Include files:: Include the contents of a file during export
  6228. * Tables exported:: Tables are exported richly
  6229. * Inlined images:: How to inline images during export
  6230. * Footnotes:: Numbers like [1]
  6231. * Emphasis and monospace:: To bold or not to bold
  6232. * TeX macros and LaTeX fragments:: Create special, rich export.
  6233. * Horizontal rules:: A line across the page
  6234. * Comment lines:: Some lines will not be exported
  6235. @end menu
  6236. @node Document title, Headings and sections, Markup rules, Markup rules
  6237. @subheading Document title
  6238. @cindex document title, markup rules
  6239. @noindent
  6240. The title of the exported document is taken from the special line
  6241. @example
  6242. #+TITLE: This is the title of the document
  6243. @end example
  6244. @noindent
  6245. If this line does not exist, the title is derived from the first non-empty,
  6246. non-comment line in the buffer. If no such line exists, or if you have
  6247. turned off exporting of the text before the first headline (see below), the
  6248. title will be the file name without extension.
  6249. If you are exporting only a subtree by marking is as the region, the heading
  6250. of the subtree will become the title of the document. If the subtree has a
  6251. property @code{EXPORT_TITLE}, that will take precedence.
  6252. @node Headings and sections, Table of contents, Document title, Markup rules
  6253. @subheading Headings and sections
  6254. @cindex headings and sections, markup rules
  6255. The outline structure of the document as described in @ref{Document
  6256. Structure} forms the basis for defining sections of the exported document.
  6257. However, since the outline structure is also used for (for example) lists of
  6258. tasks, only the first three outline levels will be used as headings. Deeper
  6259. levels will become itemized lists. You can change the location of this
  6260. switch, globally by setting the variable @code{org-headline-levels}, or on a
  6261. per file basis with a line
  6262. @example
  6263. #+OPTIONS: H:4
  6264. @end example
  6265. @node Table of contents, Initial text, Headings and sections, Markup rules
  6266. @subheading Table of contents
  6267. @cindex table of contents, markup rules
  6268. The table of contents is normally inserted directly before the first headline
  6269. of the file. If you would like to get it to a different location, insert the
  6270. string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
  6271. location. The depth of the table of contents is by default the same as the
  6272. number of headline levels, but you can choose a smaller number or turn off
  6273. the table of contents entirely by configuring the variable
  6274. @code{org-export-with-toc}, or on a per-file basis with a line like
  6275. @example
  6276. #+OPTIONS: toc:2 (only to two levels in TOC)
  6277. #+OPTIONS: toc:nil (no TOC at all)
  6278. @end example
  6279. @node Initial text, Lists, Table of contents, Markup rules
  6280. @subheading Text before the first headline
  6281. @cindex text before first headline, markup rules
  6282. @cindex #+TEXT
  6283. Org mode normally exports the text before the first headline, and even uses
  6284. the first line as the document title. The text will be fully marked up. If
  6285. you need to include literal HTML or La@TeX{} code, use the special constructs
  6286. described below in the sections for the individual exporters.
  6287. Some people like to use the space before the first headline for setup and
  6288. internal links and therefore would like to control the exported text before
  6289. the first headline in a different way. You can do so by setting the variable
  6290. @code{org-export-skip-text-before-1st-heading} to @code{t}. On a per-file
  6291. basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
  6292. @noindent
  6293. If you still want to have some text before the first headline, use the
  6294. @code{#+TEXT} construct:
  6295. @example
  6296. #+OPTIONS: skip:t
  6297. #+TEXT: This text will go before the *first* headline.
  6298. #+TEXT: [TABLE-OF-CONTENTS]
  6299. #+TEXT: This goes between the table of contents and the first headline
  6300. @end example
  6301. @node Lists, Paragraphs, Initial text, Markup rules
  6302. @subheading Lists
  6303. @cindex lists, markup rules
  6304. Plain lists as described in @ref{Plain lists} are translated to the back-ends
  6305. syntax for such lists. Most back-ends support unordered, ordered, and
  6306. description lists.
  6307. @node Paragraphs, Literal examples, Lists, Markup rules
  6308. @subheading Paragraphs, line breaks, and quoting
  6309. @cindex paragraphs, markup rules
  6310. Paragraphs are separated by at least one empty line. If you need to enforce
  6311. a line break within a paragraph, use @samp{\\} at the end of a line.
  6312. To keep the line breaks in a region, but otherwise use normal formatting, you
  6313. can use this construct, which can also be used to format poetry.
  6314. @example
  6315. #+BEGIN_VERSE
  6316. Great clouds overhead
  6317. Tiny black birds rise and fall
  6318. Snow covers Emacs
  6319. -- AlexSchroeder
  6320. #+END_VERSE
  6321. @end example
  6322. When quoting a passage from another document, it is customary to format this
  6323. as a paragraph that is indented on both the left and the right margin. You
  6324. can include quotations in Org mode documents like this:
  6325. @example
  6326. #+BEGIN_QUOTE
  6327. Everything should be made as simple as possible,
  6328. but not any simpler -- Albert Einstein
  6329. #+END_QUOTE
  6330. @end example
  6331. @node Literal examples, Include files, Paragraphs, Markup rules
  6332. @subheading Literal examples
  6333. @cindex literal examples, markup rules
  6334. You can include literal examples that should not be subjected to
  6335. markup. Such examples will be typeset in monospace, so this is well suited
  6336. for source code and similar examples.
  6337. @cindex #+BEGIN_EXAMPLE
  6338. @example
  6339. #+BEGIN_EXAMPLE
  6340. Some example from a text file.
  6341. #+END_EXAMPLE
  6342. @end example
  6343. For simplicity when using small examples, you can also start the example
  6344. lines with a colon:
  6345. @example
  6346. : Some example from a text file.
  6347. @end example
  6348. @cindex formatting source code, markup rules
  6349. If the example is source code from a programming language, or any other text
  6350. that can be marked up by font-lock in Emacs, you can ask for the example to
  6351. look like the fontified Emacs buffer@footnote{Currently this works only for
  6352. the HTML back-end, and requires the @file{htmlize.el} package version 1.34 or
  6353. later.}. This is done with the @samp{src} block, where you also need to
  6354. specify the name of the major mode that should be used to fontify the
  6355. example:
  6356. @cindex #+BEGIN_SRC
  6357. @example
  6358. #+BEGIN_SRC emacs-lisp
  6359. (defun org-xor (a b)
  6360. "Exclusive or."
  6361. (if a (not b) b))
  6362. #+END_SRC
  6363. @end example
  6364. @table @kbd
  6365. @kindex C-c '
  6366. @item C-c '
  6367. Edit the source code example at point in its native mode. This works by
  6368. switching to an indirect buffer, narrowing the buffer and switching to the
  6369. other mode. You need to exit by pressing @kbd{C-c '} again@footnote{Upon
  6370. exit, lines starting with @samp{*} or @samp{#} will get a comma prepended, to
  6371. keep them from being interpreted by Org as outline nodes or special
  6372. comments. These commas will be striped for editing with @kbd{C-c '}, and
  6373. also for export.}. Fixed-width
  6374. regions (where each line starts with a colon followed by a space) will be
  6375. edited using @code{artist-mode}@footnote{You may select a different-mode with
  6376. the variable @code{org-edit-fixed-width-region-mode}.} to allow creating
  6377. ASCII drawings easily. Using this command in an empty line will create a new
  6378. fixed-width region.
  6379. @end table
  6380. @node Include files, Tables exported, Literal examples, Markup rules
  6381. @subheading Include files
  6382. @cindex include files, markup rules
  6383. During export, you can include the content of another file. For example, to
  6384. include your .emacs file, you could use:
  6385. @cindex #+INCLUDE
  6386. @example
  6387. #+INCLUDE: "~/.emacs" src emacs-lisp
  6388. @end example
  6389. The optional second and third parameter are the markup (@samp{quote},
  6390. @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
  6391. language for formatting the contents. The markup is optional, if it is not
  6392. given, the text will be assumed to be in Org mode format and will be
  6393. processed normally. The include line will also allow additional keyword
  6394. parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
  6395. first line and for each following line. For example, to include a file as an
  6396. item, use
  6397. @example
  6398. #+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
  6399. @end example
  6400. @table @kbd
  6401. @kindex C-c '
  6402. @item C-c '
  6403. Visit the include file at point.
  6404. @end table
  6405. @node Tables exported, Inlined images, Include files, Markup rules
  6406. @subheading Tables
  6407. @cindex tables, markup rules
  6408. Both the native Org mode tables (@pxref{Tables}) and tables formatted with
  6409. the @file{table.el} package will be exported properly. For Org mode tables,
  6410. the lines before the first horizontal separator line will become table header
  6411. lines. You can use the following lines somewhere before the table to asssign
  6412. a caption and a label for cross references:
  6413. @example
  6414. #+CAPTION: This is the caption for the next table (or link)
  6415. #+LABEL: tbl:basic-data
  6416. @end example
  6417. @node Inlined images, Footnotes, Tables exported, Markup rules
  6418. @subheading Inlined Images
  6419. @cindex inlined images, markup rules
  6420. Some backends (HTML and LaTeX) allow to directly include images into the
  6421. exported document. Org does this, if a link to an image files does not have
  6422. a description part, for example @code{[[./img/a.jpg]]}. If you wish to
  6423. define a caption for the image and maybe a label for internal cross
  6424. references, you can use (before, but close to the link)
  6425. @example
  6426. #+CAPTION: This is the caption for the next figure link (or table)
  6427. #+LABEL: fig:SED-HR4049
  6428. @end example
  6429. You may also define additional attributes for the figure. As this is
  6430. backend-specific, see the sections about the individual backends for more
  6431. information.
  6432. @node Footnotes, Emphasis and monospace, Inlined images, Markup rules
  6433. @subheading Footnotes
  6434. @cindex footnotes, markup rules
  6435. @cindex @file{footnote.el}
  6436. @kindex C-c !
  6437. Numbers in square brackets are treated as footnote markers, and lines
  6438. starting with such a marker are interpreted as the footnote itself. You can
  6439. use the Emacs package @file{footnote.el} to create footnotes@footnote{The
  6440. @file{footnote} package uses @kbd{C-c !} to invoke its commands. This
  6441. binding conflicts with the Org mode command for inserting inactive time
  6442. stamps. You could use the variable @code{footnote-prefix} to switch
  6443. footnotes commands to another key. Or, if you are too used to this binding,
  6444. you could use @code{org-replace-disputed-keys} and @code{org-disputed-keys}
  6445. to change the settings in Org.}. For example:
  6446. @example
  6447. The Org homepage[1] now looks a lot better than it used to.
  6448. [1] The link is: http://orgmode.org
  6449. @end example
  6450. @node Emphasis and monospace, TeX macros and LaTeX fragments, Footnotes, Markup rules
  6451. @subheading Emphasis and monospace
  6452. @cindex underlined text, markup rules
  6453. @cindex bold text, markup rules
  6454. @cindex italic text, markup rules
  6455. @cindex verbatim text, markup rules
  6456. @cindex code text, markup rules
  6457. @cindex strike-through text, markup rules
  6458. You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
  6459. and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
  6460. in the code and verbatim string is not processed for Org mode specific
  6461. syntax, it is exported verbatim.
  6462. @node TeX macros and LaTeX fragments, Horizontal rules, Emphasis and monospace, Markup rules
  6463. @subheading @TeX{} macros and La@TeX{} fragments
  6464. @cindex LaTeX fragments, markup rules
  6465. @cindex TeX macros, markup rules
  6466. @cindex HTML entities
  6467. @cindex LaTeX entities
  6468. A @TeX{}-like syntax is used to specify special characters. Where possible,
  6469. these will be transformed into the native format of the exporter back-end.
  6470. Strings like @code{\alpha} will be exported as @code{&alpha;} in the HTML
  6471. output, and as @code{$\alpha$} in the La@TeX{} output. Similarly,
  6472. @code{\nbsp} will become @code{&nbsp;} in HTML and @code{~} in La@TeX{}.
  6473. This applies for a large number of entities, with names taken from both HTML
  6474. and La@TeX{}, see the variable @code{org-html-entities} for the complete
  6475. list. If you are unsure about a name, use @kbd{M-@key{TAB}} for completion
  6476. after having types the backslash and maybe a few characters
  6477. (@pxref{Completion}).
  6478. La@TeX{} fragments are converted into images for HTML export, and they are
  6479. written literally into the La@TeX{} export. See also @ref{Embedded LaTeX}.
  6480. Finally, @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
  6481. @samp{...} are all converted into special commands creating hyphens of
  6482. different lengths or a compact set of dots.
  6483. @node Horizontal rules, Comment lines, TeX macros and LaTeX fragments, Markup rules
  6484. @subheading Horizontal rules
  6485. @cindex horizontal rules, markup rules
  6486. A line consisting of only dashes, and at least 5 of them, will be
  6487. exported as a horizontal line (@samp{<hr/>} in HTML).
  6488. @node Comment lines, , Horizontal rules, Markup rules
  6489. @subheading Comment lines
  6490. @cindex comment lines
  6491. @cindex exporting, not
  6492. Lines starting with @samp{#} in column zero are treated as comments and will
  6493. never be exported. Also entire subtrees starting with the word
  6494. @samp{COMMENT} will never be exported. Finally, regions surrounded by
  6495. @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
  6496. @table @kbd
  6497. @kindex C-c ;
  6498. @item C-c ;
  6499. Toggle the COMMENT keyword at the beginning of an entry.
  6500. @end table
  6501. @node Selective export, Export options, Markup rules, Exporting
  6502. @section Selective export
  6503. @cindex export, selective by tags
  6504. You may use tags to select the parts of a document that should be exported,
  6505. or to exclude parts from export. This behavior is governed by two variables:
  6506. @code{org-export-select-tags} and @code{org-export-exclude-tags}.
  6507. Org first checks if any of the @emph{select} tags is present in the buffer.
  6508. If yes, all trees that do not carry one of these tags will be excluded. If a
  6509. selected tree is a subtree, the heading hierarchy above it will also be
  6510. selected for export, but not the text below those headings.
  6511. @noindent
  6512. If none of the select tags is found, the whole buffer will be selected for
  6513. export.
  6514. @noindent
  6515. Finally, all subtrees that are marked by any of the @emph{exclude} tags will
  6516. be removed from the export buffer.
  6517. @node Export options, The export dispatcher, Selective export, Exporting
  6518. @section Export options
  6519. @cindex options, for export
  6520. @cindex completion, of option keywords
  6521. The exporter recognizes special lines in the buffer which provide
  6522. additional information. These lines may be put anywhere in the file.
  6523. The whole set of lines can be inserted into the buffer with @kbd{C-c
  6524. C-e t}. For individual lines, a good way to make sure the keyword is
  6525. correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
  6526. (@pxref{Completion}).
  6527. @table @kbd
  6528. @kindex C-c C-e t
  6529. @item C-c C-e t
  6530. Insert template with export options, see example below.
  6531. @end table
  6532. @cindex #+TITLE:
  6533. @cindex #+AUTHOR:
  6534. @cindex #+DATE:
  6535. @cindex #+EMAIL:
  6536. @cindex #+LANGUAGE:
  6537. @cindex #+TEXT:
  6538. @cindex #+OPTIONS:
  6539. @cindex #+LINK_UP:
  6540. @cindex #+LINK_HOME:
  6541. @cindex #+EXPORT_SELECT_TAGS:
  6542. @cindex #+EXPORT_EXCLUDE_TAGS:
  6543. @example
  6544. #+TITLE: the title to be shown (default is the buffer name)
  6545. #+AUTHOR: the author (default taken from @code{user-full-name})
  6546. #+DATE: A date, fixed, of a format string for @code{format-time-string}
  6547. #+EMAIL: his/her email address (default from @code{user-mail-address})
  6548. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  6549. #+TEXT: Some descriptive text to be inserted at the beginning.
  6550. #+TEXT: Several lines may be given.
  6551. #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
  6552. #+LINK_UP: the ``up'' link of an exported page
  6553. #+LINK_HOME: the ``home'' link of an exported page
  6554. #+EXPORT_SELECT_TAGS: Tags that select a tree for export
  6555. #+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
  6556. @end example
  6557. @noindent
  6558. The OPTIONS line is a compact@footnote{If you want to configure many options
  6559. this way, you can use several OPTIONS lines.} form to specify export settings. Here
  6560. you can:
  6561. @cindex headline levels
  6562. @cindex section-numbers
  6563. @cindex table of contents
  6564. @cindex line-break preservation
  6565. @cindex quoted HTML tags
  6566. @cindex fixed-width sections
  6567. @cindex tables
  6568. @cindex @TeX{}-like syntax for sub- and superscripts
  6569. @cindex footnotes
  6570. @cindex special strings
  6571. @cindex emphasized text
  6572. @cindex @TeX{} macros
  6573. @cindex La@TeX{} fragments
  6574. @cindex author info, in export
  6575. @cindex time info, in export
  6576. @example
  6577. H: @r{set the number of headline levels for export}
  6578. num: @r{turn on/off section-numbers}
  6579. toc: @r{turn on/off table of contents, or set level limit (integer)}
  6580. \n: @r{turn on/off line-break-preservation}
  6581. @@: @r{turn on/off quoted HTML tags}
  6582. :: @r{turn on/off fixed-width sections}
  6583. |: @r{turn on/off tables}
  6584. ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
  6585. @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
  6586. @r{the simple @code{a_b} will be left as it is.}
  6587. -: @r{turn on/off conversion of special strings.}
  6588. f: @r{turn on/off footnotes like this[1].}
  6589. todo: @r{turn on/off inclusion of TODO keywords into exported text}
  6590. pri: @r{turn on/off priority cookies}
  6591. tags: @r{turn on/off inclusion of tags, may also be @code{not-in-toc}}
  6592. <: @r{turn on/off inclusion of any time/date stamps like DEADLINES}
  6593. *: @r{turn on/off emphasized text (bold, italic, underlined)}
  6594. TeX: @r{turn on/off simple @TeX{} macros in plain text}
  6595. LaTeX: @r{turn on/off La@TeX{} fragments}
  6596. skip: @r{turn on/off skipping the text before the first heading}
  6597. author: @r{turn on/off inclusion of author name/email into exported file}
  6598. creator: @r{turn on/off inclusion of creator info into exported file}
  6599. timestamp: @r{turn on/off inclusion creation time into exported file}
  6600. d: @r{turn on/off inclusion of drawers}
  6601. @end example
  6602. These options take effect in both the HTML and La@TeX{} export, except
  6603. for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
  6604. @code{nil} for the La@TeX{} export.
  6605. When exporting only a single subtree by selecting it with @kbd{C-c @@} before
  6606. calling an export command, the subtree can overrule some of the file's export
  6607. settings with properties @code{EXPORT_FILE_NAME}, @code{EXPORT_TITLE},
  6608. @code{EXPORT_TEXT}, and @code{EXPORT_OPTIONS}.
  6609. @node The export dispatcher, ASCII export, Export options, Exporting
  6610. @section The export dispatcher
  6611. @cindex dispatcher, for export commands
  6612. All export commands can be reached using the export dispatcher, which is a
  6613. prefix key that prompts for an additional key specifying the command.
  6614. Normally the entire file is exported, but if there is an active region that
  6615. contains one outline tree, the first heading is used as document title and
  6616. the subtrees are exported.
  6617. @table @kbd
  6618. @kindex C-c C-e
  6619. @item C-c C-e
  6620. Dispatcher for export and publishing commands. Displays a help-window
  6621. listing the additional key(s) needed to launch an export or publishing
  6622. command. The prefix arg is passed through to the exporter. A double prefix
  6623. @kbd{C-u C-u} causes most commands to be executed in the background, in a
  6624. separate emacs process@footnote{To make this behavior the default, customize
  6625. the variable @code{org-export-run-in-background}.}.
  6626. @kindex C-c C-e v
  6627. @item C-c C-e v
  6628. Like @kbd{C-c C-e}, but only export the text that is currently visible
  6629. (i.e. not hidden by outline visibility).
  6630. @kindex C-u C-u C-c C-e
  6631. @item C-u C-u C-c C-e
  6632. Call an the exporter, but reverse the setting of
  6633. @code{org-export-run-in-background}, i.e. request background processing if
  6634. not set, or force processing in the current Emacs process if st.
  6635. @end table
  6636. @node ASCII export, HTML export, The export dispatcher, Exporting
  6637. @section ASCII export
  6638. @cindex ASCII export
  6639. ASCII export produces a simple and very readable version of an Org mode
  6640. file.
  6641. @cindex region, active
  6642. @cindex active region
  6643. @cindex Transient mark mode
  6644. @table @kbd
  6645. @kindex C-c C-e a
  6646. @item C-c C-e a
  6647. Export as ASCII file. For an org file @file{myfile.org}, the ASCII file
  6648. will be @file{myfile.txt}. The file will be overwritten without
  6649. warning. If there is an active region, only the region will be
  6650. exported. If the selected region is a single tree@footnote{To select the
  6651. current subtree, use @kbd{C-c @@}.}, the tree head will
  6652. become the document title. If the tree head entry has or inherits an
  6653. @code{EXPORT_FILE_NAME} property, that name will be used for the
  6654. export.
  6655. @kindex C-c C-e v a
  6656. @item C-c C-e v a
  6657. Export only the visible part of the document.
  6658. @end table
  6659. @cindex headline levels, for exporting
  6660. In the exported version, the first 3 outline levels will become
  6661. headlines, defining a general document structure. Additional levels
  6662. will be exported as itemized lists. If you want that transition to occur
  6663. at a different level, specify it with a prefix argument. For example,
  6664. @example
  6665. @kbd{C-1 C-c C-e a}
  6666. @end example
  6667. @noindent
  6668. creates only top level headlines and does the rest as items. When
  6669. headlines are converted to items, the indentation of the text following
  6670. the headline is changed to fit nicely under the item. This is done with
  6671. the assumption that the first body line indicates the base indentation of
  6672. the body text. Any indentation larger than this is adjusted to preserve
  6673. the layout relative to the first line. Should there be lines with less
  6674. indentation than the first, these are left alone.
  6675. @node HTML export, LaTeX and PDF export, ASCII export, Exporting
  6676. @section HTML export
  6677. @cindex HTML export
  6678. Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
  6679. HTML formatting, in ways similar to John Grubers @emph{markdown}
  6680. language, but with additional support for tables.
  6681. @menu
  6682. * HTML Export commands:: How to invoke HTML export
  6683. * Quoting HTML tags:: Using direct HTML in Org mode
  6684. * Links:: Transformation of links for HTML
  6685. * Images in HTML export::
  6686. * CSS support:: Changing the appearance of the output
  6687. * Javascript support:: Info and Folding in a web browser
  6688. @end menu
  6689. @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
  6690. @subsection HTML export commands
  6691. @cindex region, active
  6692. @cindex active region
  6693. @cindex Transient mark mode
  6694. @table @kbd
  6695. @kindex C-c C-e h
  6696. @item C-c C-e h
  6697. Export as HTML file @file{myfile.html}. For an org file @file{myfile.org},
  6698. the ASCII file will be @file{myfile.html}. The file will be overwritten
  6699. without warning. If there is an active region, only the region will be
  6700. exported. If the selected region is a single tree@footnote{To select the
  6701. current subtree, use @kbd{C-c @@}.}, the tree head will become the document
  6702. title. If the tree head entry has or inherits an @code{EXPORT_FILE_NAME}
  6703. property, that name will be used for the export.
  6704. @kindex C-c C-e b
  6705. @item C-c C-e b
  6706. Export as HTML file and immediately open it with a browser.
  6707. @kindex C-c C-e H
  6708. @item C-c C-e H
  6709. Export to a temporary buffer, do not create a file.
  6710. @kindex C-c C-e R
  6711. @item C-c C-e R
  6712. Export the active region to a temporary buffer. With a prefix argument, do
  6713. not produce the file header and footer, but just the plain HTML section for
  6714. the region. This is good for cut-and-paste operations.
  6715. @kindex C-c C-e v h
  6716. @kindex C-c C-e v b
  6717. @kindex C-c C-e v H
  6718. @kindex C-c C-e v R
  6719. @item C-c C-e v h
  6720. @item C-c C-e v b
  6721. @item C-c C-e v H
  6722. @item C-c C-e v R
  6723. Export only the visible part of the document.
  6724. @item M-x org-export-region-as-html
  6725. Convert the region to HTML under the assumption that it was Org mode
  6726. syntax before. This is a global command that can be invoked in any
  6727. buffer.
  6728. @item M-x org-replace-region-by-HTML
  6729. Replace the active region (assumed to be in Org mode syntax) by HTML
  6730. code.
  6731. @end table
  6732. @cindex headline levels, for exporting
  6733. In the exported version, the first 3 outline levels will become headlines,
  6734. defining a general document structure. Additional levels will be exported as
  6735. itemized lists. If you want that transition to occur at a different level,
  6736. specify it with a numeric prefix argument. For example,
  6737. @example
  6738. @kbd{C-2 C-c C-e b}
  6739. @end example
  6740. @noindent
  6741. creates two levels of headings and does the rest as items.
  6742. @node Quoting HTML tags, Links, HTML Export commands, HTML export
  6743. @subsection Quoting HTML tags
  6744. Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
  6745. @samp{&gt;} in HTML export. If you want to include simple HTML tags
  6746. which should be interpreted as such, mark them with @samp{@@} as in
  6747. @samp{@@<b>bold text@@</b>}. Note that this really works only for
  6748. simple tags. For more extensive HTML that should be copied verbatim to
  6749. the exported file use either
  6750. @example
  6751. #+HTML: Literal HTML code for export
  6752. @end example
  6753. @noindent or
  6754. @cindex #+BEGIN_HTML
  6755. @example
  6756. #+BEGIN_HTML
  6757. All lines between these markers are exported literally
  6758. #+END_HTML
  6759. @end example
  6760. @node Links, Images in HTML export, Quoting HTML tags, HTML export
  6761. @subsection Links
  6762. @cindex links, in HTML export
  6763. @cindex internal links, in HTML export
  6764. @cindex external links, in HTML export
  6765. Internal links (@pxref{Internal links}) will continue to work in HTML.
  6766. Automatic links created by radio targets (@pxref{Radio targets}) will also
  6767. work in the HTML file. Links to external files will still work if the HTML
  6768. file is in the same directory as the Org file. Links to other @file{.org}
  6769. files will be translated into HTML links under the assumption that an HTML
  6770. version also exists of the linked file. For information related to linking
  6771. files while publishing them to a publishing directory see @ref{Publishing
  6772. links}.
  6773. If you want to specify attributes for links, you can do so using a special
  6774. @code{#+ATTR_HTML} line to define attributes that wil be added to the
  6775. @code{<a>} or @code{<img>} tags. Here is an example that sets @code{alt} and
  6776. @code{title} attributes for an inlined image:
  6777. @example
  6778. #+ATTR_HTML: alt="This is image A" title="Image with no action"
  6779. [[./img/a.jpg]]
  6780. @end example
  6781. @node Images in HTML export, CSS support, Links, HTML export
  6782. @subsection Images
  6783. @cindex images, inline in HTML
  6784. @cindex inlining images in HTML
  6785. HTML export can inline images given as links in the Org file, and
  6786. it can make an image the clickable part of a link. By
  6787. default@footnote{but see the variable
  6788. @code{org-export-html-inline-images}}, images are inlined if a link does
  6789. not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
  6790. while @samp{[[file:myimg.jpg][the image]]} will just produce a link
  6791. @samp{the image} that points to the image. If the description part
  6792. itself is a @code{file:} link or a @code{http:} URL pointing to an
  6793. image, this image will be inlined and activated so that clicking on the
  6794. image will activate the link. For example, to include a thumbnail that
  6795. will link to a high resolution version of the image, you could use:
  6796. @example
  6797. [[file:highres.jpg][file:thumb.jpg]]
  6798. @end example
  6799. @noindent
  6800. and you could use @code{http} addresses just as well.
  6801. @node CSS support, Javascript support, Images in HTML export, HTML export
  6802. @subsection CSS support
  6803. @cindex CSS, for HTML export
  6804. @cindex HTML export, CSS
  6805. You can also give style information for the exported file. The HTML
  6806. exporter assigns the following CSS classes to appropriate parts of the
  6807. document - your style specifications may change these:
  6808. @example
  6809. .todo @r{TODO keywords}
  6810. .done @r{the DONE keyword}
  6811. .timestamp @r{time stamp}
  6812. .timestamp-kwd @r{keyword associated with a time stamp, like SCHEDULED}
  6813. .tag @r{tag in a headline}
  6814. .target @r{target for links}
  6815. @end example
  6816. Each exported files contains a compact default style that defines these
  6817. classes in a basic way@footnote{This style is defined in the constant
  6818. @code{org-export-html-style-default}, which you should not modify. To turn
  6819. inclusion of these defaults off, customize
  6820. @code{org-export-html-style-include-default}}. You may overwrite these
  6821. settings, or add to them by using the variables @code{org-export-html-style}
  6822. (for Org-wide settings) and @code{org-export-html-style-extra} (for more
  6823. granular settings, like file-local settings). To set the latter variable
  6824. individually for each file, you can use
  6825. @example
  6826. #+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
  6827. @end example
  6828. @noindent
  6829. For longer style definitions, you can use several such lines. You could also
  6830. directly write a @code{<style>} @code{</style>} section in this way, without
  6831. referring to an external file.
  6832. @c FIXME: More about header and footer styles
  6833. @c FIXME: Talk about links and targets.
  6834. @node Javascript support, , CSS support, HTML export
  6835. @subsection Javascript supported display of web pages
  6836. @emph{Sebastian Rose} has written a JavaScript program especially designed to
  6837. enhance the web viewing experience of HTML files created with Org. This
  6838. program allows to view large files in two different ways. The first one is
  6839. an @emph{Info}-like mode where each section is displayed separately and
  6840. navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
  6841. as well, press @kbd{?} for an overview of the available keys). The second
  6842. view type is a @emph{folding} view much like Org provides it inside Emacs.
  6843. The script is available at @url{http://orgmode.org/org-info.js} and you can
  6844. find the documentation for it at
  6845. @url{http://orgmode.org/worg/code/org-info-js/org-info.js.html}. We are
  6846. serving the script from our site, but if you use it a lot, you might not want
  6847. to be dependent on @url{orgmode.org} and prefer to install a local copy on
  6848. your own web server.
  6849. To use the script, you need to make sure that the @file{org-jsinfo.el} module
  6850. gets loaded. It should be loaded by default, try @kbd{M-x customize-variable
  6851. @key{RET} org-modules @key{RET}} to convince yourself that this is indeed the
  6852. case. All it then takes to make use of the program is adding a single line
  6853. to the Org file:
  6854. @example
  6855. #+INFOJS_OPT: view:info toc:nil
  6856. @end example
  6857. @noindent
  6858. If this line is found, the HTML header will automatically contain the code
  6859. needed to invoke the script. Using the line above, you can set the following
  6860. viewing options:
  6861. @example
  6862. path: @r{The path to the script. The default is to grab the script from}
  6863. @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
  6864. @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
  6865. view: @r{Initial view when website is first shown. Possible values are:}
  6866. info @r{Info-like interface with one section per page.}
  6867. overview @r{Folding interface, initially showing only top-level.}
  6868. content @r{Folding interface, starting with all headlines visible.}
  6869. showall @r{Folding interface, all headlines and text visible.}
  6870. sdepth: @r{Maximum headline level that will still become an independent}
  6871. @r{section for info and folding modes. The default is taken from}
  6872. @r{@code{org-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
  6873. @r{If this is smaller than in @code{org-headline-levels}, each}
  6874. @r{info/folding section can still contain children headlines.}
  6875. toc: @r{Should the table of content @emph{initially} be visible?}
  6876. @r{Even when @code{nil}, you can always get to the toc with @kbd{i}.}
  6877. tdepth: @r{The depth of the table of contents. The defaults are taken from}
  6878. @r{the variables @code{org-headline-levels} and @code{org-export-with-toc}.}
  6879. ftoc: @r{Does the css of the page specify a fixed position for the toc?}
  6880. @r{If yes, the toc will never be displayed as a section.}
  6881. ltoc: @r{Should there be short contents (children) in each section?}
  6882. mouse: @r{Headings are highlighted when the mouse is over them. Should be}
  6883. @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
  6884. buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the}
  6885. @r{default), only one such button will be present.}
  6886. @end example
  6887. You can choose default values for these options by customizing the variable
  6888. @code{org-infojs-options}. If you always want to apply the script to your
  6889. pages, configure the variable @code{org-export-html-use-infojs}.
  6890. @node LaTeX and PDF export, XOXO export, HTML export, Exporting
  6891. @section LaTeX and PDF export
  6892. @cindex LaTeX export
  6893. @cindex PDF export
  6894. Org mode contains a La@TeX{} exporter written by Bastien Guerry. With
  6895. further processing, this backend is also used to produce PDF output. Since
  6896. the LaTeX output uses @file{hyperref} to implement links and cross
  6897. references, the PDF output file will be fully linked.
  6898. @menu
  6899. * LaTeX/PDF export commands:: Which key invode which commands
  6900. * Quoting LaTeX code:: Incorporating literal LaTeX code
  6901. * Sectioning structure:: Changing sectioning in LaTeX output
  6902. * Tables in LaTeX export:: Options for exporting tables to LaTeX
  6903. * Images in LaTeX export:: How to insert figures into LaTeX output
  6904. @end menu
  6905. @node LaTeX/PDF export commands, Quoting LaTeX code, LaTeX and PDF export, LaTeX and PDF export
  6906. @subsection LaTeX export commands
  6907. @table @kbd
  6908. @kindex C-c C-e l
  6909. @item C-c C-e l
  6910. Export as La@TeX{} file @file{myfile.tex}. For an org file
  6911. @file{myfile.org}, the ASCII file will be @file{myfile.tex}. The file will
  6912. be overwritten without warning. If there is an active region, only the
  6913. region will be exported. If the selected region is a single tree@footnote{To
  6914. select the current subtree, use @kbd{C-c @@}.}, the tree head will become the
  6915. document title. If the tree head entry has or inherits an
  6916. @code{EXPORT_FILE_NAME} property, that name will be used for the export.
  6917. @kindex C-c C-e L
  6918. @item C-c C-e L
  6919. Export to a temporary buffer, do not create a file.
  6920. @kindex C-c C-e v l
  6921. @kindex C-c C-e v L
  6922. @item C-c C-e v l
  6923. @item C-c C-e v L
  6924. Export only the visible part of the document.
  6925. @item M-x org-export-region-as-latex
  6926. Convert the region to La@TeX{} under the assumption that it was Org mode
  6927. syntax before. This is a global command that can be invoked in any
  6928. buffer.
  6929. @item M-x org-replace-region-by-latex
  6930. Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
  6931. code.
  6932. @kindex C-c C-e p
  6933. @item C-c C-e p
  6934. Export as LaTeX and then process to PDF.
  6935. @kindex C-c C-e d
  6936. @item C-c C-e d
  6937. Export as LaTeX and then process to PDF, then open the resulting PDF file.
  6938. @end table
  6939. @cindex headline levels, for exporting
  6940. In the exported version, the first 3 outline levels will become
  6941. headlines, defining a general document structure. Additional levels
  6942. will be exported as description lists. The exporter can ignore them or
  6943. convert them to a custom string depending on
  6944. @code{org-latex-low-levels}.
  6945. If you want that transition to occur at a different level, specify it
  6946. with a numeric prefix argument. For example,
  6947. @example
  6948. @kbd{C-2 C-c C-e l}
  6949. @end example
  6950. @noindent
  6951. creates two levels of headings and does the rest as items.
  6952. @node Quoting LaTeX code, Sectioning structure, LaTeX/PDF export commands, LaTeX and PDF export
  6953. @subsection Quoting LaTeX code
  6954. Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
  6955. inserted into the La@TeX{} file. Furthermore, you can add special code
  6956. that should only be present in La@TeX{} export with the following
  6957. constructs:
  6958. @example
  6959. #+LaTeX: Literal LaTeX code for export
  6960. @end example
  6961. @noindent or
  6962. @cindex #+BEGIN_LaTeX
  6963. @example
  6964. #+BEGIN_LaTeX
  6965. All lines between these markers are exported literally
  6966. #+END_LaTeX
  6967. @end example
  6968. @node Sectioning structure, Tables in LaTeX export, Quoting LaTeX code, LaTeX and PDF export
  6969. @subsection Sectioning structure
  6970. @cindex LaTeX class
  6971. @cindex LaTeX sectioning structure
  6972. By default, the La@TeX{} output uses the class @code{article}.
  6973. You can change this globally by setting a different value for
  6974. @code{org-export-latex-default-class} or locally by adding an option like
  6975. @code{#+LaTeX_CLASS: myclass} in your file. The class should be listed in
  6976. @code{org-export-latex-classes}, where you can also define the sectioning
  6977. structure for each class, as well as defining additonal classes.
  6978. @node Tables in LaTeX export, Images in LaTeX export, Sectioning structure, LaTeX and PDF export
  6979. @subsection Tables in LaTeX export
  6980. @cindex tables, in LaTeX export
  6981. For LaTeX export of a table, you can specify a label and a caption
  6982. (@pxref{Tables exported}). You can also use the @code{ATTR_LaTeX} line to
  6983. request a longtable environment for the table, so that it may span several
  6984. pages:
  6985. @example
  6986. #+CAPTION: A long table
  6987. #+LABEL: tbl:long
  6988. #+ATTR_LaTeX: longtable
  6989. | ..... | ..... |
  6990. | ..... | ..... |
  6991. @end example
  6992. @node Images in LaTeX export, , Tables in LaTeX export, LaTeX and PDF export
  6993. @subsection Images in LaTeX export
  6994. @cindex images, inline in LaTeX
  6995. @cindex inlining images in LaTeX
  6996. Images that are linked to without a description part in the link, like
  6997. @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]} will be inserted into the PDF
  6998. output files resulting from LaTeX output. Org will use an
  6999. @code{\includegraphics} macro to insert the image. If you have specified a
  7000. caption and/or a label as described in @ref{Markup rules}, the figure will
  7001. be wrappend into a @code{figure} environment and thus become a floating
  7002. element. Finally, you can use an @code{#+ATTR_LaTeX:} line to specify the
  7003. options that can be used in the optional argument of the
  7004. @code{\includegraphics} macro.
  7005. @example
  7006. #+CAPTION: The black-body emission of the disk around HR 4049
  7007. #+LABEL: fig:SED-HR4049
  7008. #+ATTR_LaTeX: width=5cm,angle=90
  7009. [[./img/sed-hr4049.pdf]]
  7010. @end example
  7011. @node XOXO export, iCalendar export, LaTeX and PDF export, Exporting
  7012. @section XOXO export
  7013. @cindex XOXO export
  7014. Org mode contains an exporter that produces XOXO-style output.
  7015. Currently, this exporter only handles the general outline structure and
  7016. does not interpret any additional Org mode features.
  7017. @table @kbd
  7018. @kindex C-c C-e x
  7019. @item C-c C-e x
  7020. Export as XOXO file @file{myfile.html}.
  7021. @kindex C-c C-e v
  7022. @item C-c C-e v x
  7023. Export only the visible part of the document.
  7024. @end table
  7025. @node iCalendar export, , XOXO export, Exporting
  7026. @section iCalendar export
  7027. @cindex iCalendar export
  7028. Some people like to use Org mode for keeping track of projects, but still
  7029. prefer a standard calendar application for anniversaries and appointments.
  7030. In this case it can be useful to have deadlines and other time-stamped items
  7031. in Org files show up in the calendar application. Org mode can export
  7032. calendar information in the standard iCalendar format. If you also want to
  7033. have TODO entries included in the export, configure the variable
  7034. @code{org-icalendar-include-todo}. iCalendar export will export plain time
  7035. stamps as VEVENT, and TODO items as VTODO. It will also create events from
  7036. deadlines that are in non-TODO items. Deadlines and scheduling dates in TODO
  7037. items will be used to set the start and due dates for the todo
  7038. entry@footnote{See the variables @code{org-icalendar-use-deadline} and
  7039. @code{org-icalendar-use-scheduled}.}. As categories, it will use the tags
  7040. locally defined in the heading, and the file/tree category@footnote{To add
  7041. inherited tags or the TODO state, configure the variable
  7042. @code{org-icalendar-categories}.}.
  7043. The iCalendar standard requires each entry to have a globally unique
  7044. identifier (UID). Org creates these identifiers during export. If you set
  7045. the variable @code{org-icalendar-store-UID}, the UID will be stored in the
  7046. @code{:ID:} property of the entry and re-used next time you report this
  7047. entry. Since a single entry can give rise to multiple iCalendar entries (as
  7048. a timestamp, a deadline, a scheduled item, and as a TODO item), Org adds
  7049. prefixes to the UID, depending on what triggered the inclusion of the entry.
  7050. In this way the UID remains unique, but a synchronization program can still
  7051. figure out from which entry all the different instances originate.
  7052. @table @kbd
  7053. @kindex C-c C-e i
  7054. @item C-c C-e i
  7055. Create iCalendar entries for the current file and store them in the same
  7056. directory, using a file extension @file{.ics}.
  7057. @kindex C-c C-e I
  7058. @item C-c C-e I
  7059. Like @kbd{C-c C-e i}, but do this for all files in
  7060. @code{org-agenda-files}. For each of these files, a separate iCalendar
  7061. file will be written.
  7062. @kindex C-c C-e c
  7063. @item C-c C-e c
  7064. Create a single large iCalendar file from all files in
  7065. @code{org-agenda-files} and write it to the file given by
  7066. @code{org-combined-agenda-icalendar-file}.
  7067. @end table
  7068. The export will honor SUMMARY, DESCRIPTION and LOCATION@footnote{The LOCATION
  7069. property can be inherited from higher in the hierarchy if you configure
  7070. @code{org-use-property-inheritance} accordingly.} properties if the selected
  7071. entries have them. If not, the summary will be derived from the headline,
  7072. and the description from the body (limited to
  7073. @code{org-icalendar-include-body} characters).
  7074. How this calendar is best read and updated, that depends on the application
  7075. you are using. The FAQ covers this issue.
  7076. @node Publishing, Miscellaneous, Exporting, Top
  7077. @chapter Publishing
  7078. @cindex publishing
  7079. Org includes@footnote{@file{org-publish.el} is not distributed with
  7080. Emacs 21, if you are still using Emacs 21, you need you need to download
  7081. this file separately.} a publishing management system that allows you to
  7082. configure automatic HTML conversion of @emph{projects} composed of
  7083. interlinked org files. This system is called @emph{org-publish}. You can
  7084. also configure org-publish to automatically upload your exported HTML
  7085. pages and related attachments, such as images and source code files, to
  7086. a web server. Org-publish turns Org into a web-site authoring tool.
  7087. You can also use Org-publish to convert files into La@TeX{}, or even
  7088. combine HTML and La@TeX{} conversion so that files are available in both
  7089. formats on the server@footnote{Since La@TeX{} files on a server are not
  7090. that helpful, you surely want to perform further conversion on them --
  7091. e.g. convert them to @code{PDF} format.}.
  7092. Org-publish has been contributed to Org by David O'Toole.
  7093. @menu
  7094. * Configuration:: Defining projects
  7095. * Sample configuration:: Example projects
  7096. * Triggering publication:: Publication commands
  7097. @end menu
  7098. @node Configuration, Sample configuration, Publishing, Publishing
  7099. @section Configuration
  7100. Publishing needs significant configuration to specify files, destination
  7101. and many other properties of a project.
  7102. @menu
  7103. * Project alist:: The central configuration variable
  7104. * Sources and destinations:: From here to there
  7105. * Selecting files:: What files are part of the project?
  7106. * Publishing action:: Setting the function doing the publishing
  7107. * Publishing options:: Tweaking HTML export
  7108. * Publishing links:: Which links keep working after publishing?
  7109. * Project page index:: Publishing a list of project files
  7110. @end menu
  7111. @node Project alist, Sources and destinations, Configuration, Configuration
  7112. @subsection The variable @code{org-publish-project-alist}
  7113. @cindex org-publish-project-alist
  7114. @cindex projects, for publishing
  7115. Org-publish is configured almost entirely through setting the value of
  7116. one variable, called @code{org-publish-project-alist}.
  7117. Each element of the list configures one project, and may be in one of
  7118. the two following forms:
  7119. @lisp
  7120. ("project-name" :property value :property value ...)
  7121. @r{or}
  7122. ("project-name" :components ("project-name" "project-name" ...))
  7123. @end lisp
  7124. In both cases, projects are configured by specifying property values.
  7125. A project defines the set of files that will be published, as well as
  7126. the publishing configuration to use when publishing those files. When
  7127. a project takes the second form listed above, the individual members
  7128. of the ``components'' property are taken to be components of the
  7129. project, which group together files requiring different publishing
  7130. options. When you publish such a ``meta-project'' all the components
  7131. will also publish. The @code{:components} are published in the sequence
  7132. provided.
  7133. @node Sources and destinations, Selecting files, Project alist, Configuration
  7134. @subsection Sources and destinations for files
  7135. @cindex directories, for publishing
  7136. Most properties are optional, but some should always be set. In
  7137. particular, org-publish needs to know where to look for source files,
  7138. and where to put published files.
  7139. @multitable @columnfractions 0.3 0.7
  7140. @item @code{:base-directory}
  7141. @tab Directory containing publishing source files
  7142. @item @code{:publishing-directory}
  7143. @tab Directory (possibly remote) where output files will be published.
  7144. @item @code{:preparation-function}
  7145. @tab Function called before starting the publishing process, for example to
  7146. run @code{make} for updating files to be published.
  7147. @item @code{:completion-function}
  7148. @tab Function called after finishing the publishing process, for example to
  7149. change permissions of the resulting files.
  7150. @end multitable
  7151. @noindent
  7152. @node Selecting files, Publishing action, Sources and destinations, Configuration
  7153. @subsection Selecting files
  7154. @cindex files, selecting for publishing
  7155. By default, all files with extension @file{.org} in the base directory
  7156. are considered part of the project. This can be modified by setting the
  7157. properties
  7158. @multitable @columnfractions 0.25 0.75
  7159. @item @code{:base-extension}
  7160. @tab Extension (without the dot!) of source files. This actually is a
  7161. regular expression.
  7162. @item @code{:exclude}
  7163. @tab Regular expression to match file names that should not be
  7164. published, even though they have been selected on the basis of their
  7165. extension.
  7166. @item @code{:include}
  7167. @tab List of files to be included regardless of @code{:base-extension}
  7168. and @code{:exclude}.
  7169. @end multitable
  7170. @node Publishing action, Publishing options, Selecting files, Configuration
  7171. @subsection Publishing action
  7172. @cindex action, for publishing
  7173. Publishing means that a file is copied to the destination directory and
  7174. possibly transformed in the process. The default transformation is to export
  7175. Org files as HTML files, and this is done by the function
  7176. @code{org-publish-org-to-html} which calls the HTML exporter (@pxref{HTML
  7177. export}). But you also can publish your files in La@TeX{} by using the
  7178. function @code{org-publish-org-to-latex} instead, or as PDF files using
  7179. @code{org-publish-org-to-pdf}. Other files like images only need to be
  7180. copied to the publishing destination. For non-Org files, you need to provide
  7181. your own publishing function:
  7182. @multitable @columnfractions 0.3 0.7
  7183. @item @code{:publishing-function}
  7184. @tab Function executing the publication of a file. This may also be a
  7185. list of functions, which will all be called in turn.
  7186. @end multitable
  7187. The function must accept two arguments: a property list containing at
  7188. least a @code{:publishing-directory} property, and the name of the file
  7189. to be published. It should take the specified file, make the necessary
  7190. transformation (if any) and place the result into the destination folder.
  7191. You can write your own publishing function, but @code{org-publish}
  7192. provides one for attachments (files that only need to be copied):
  7193. @code{org-publish-attachment}.
  7194. @node Publishing options, Publishing links, Publishing action, Configuration
  7195. @subsection Options for the HTML/LaTeX exporters
  7196. @cindex options, for publishing
  7197. The property list can be used to set many export options for the HTML
  7198. and La@TeX{} exporters. In most cases, these properties correspond to user
  7199. variables in Org. The table below lists these properties along
  7200. with the variable they belong to. See the documentation string for the
  7201. respective variable for details.
  7202. @multitable @columnfractions 0.32 0.68
  7203. @item @code{:link-up} @tab @code{org-export-html-link-up}
  7204. @item @code{:link-home} @tab @code{org-export-html-link-home}
  7205. @item @code{:language} @tab @code{org-export-default-language}
  7206. @item @code{:customtime} @tab @code{org-display-custom-times}
  7207. @item @code{:headline-levels} @tab @code{org-export-headline-levels}
  7208. @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
  7209. @item @code{:section-number-format} @tab @code{org-export-section-number-format}
  7210. @item @code{:table-of-contents} @tab @code{org-export-with-toc}
  7211. @item @code{:preserve-breaks} @tab @code{org-export-preserve-breaks}
  7212. @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
  7213. @item @code{:emphasize} @tab @code{org-export-with-emphasize}
  7214. @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
  7215. @item @code{:special-strings} @tab @code{org-export-with-special-strings}
  7216. @item @code{:footnotes} @tab @code{org-export-with-footnotes}
  7217. @item @code{:drawers} @tab @code{org-export-with-drawers}
  7218. @item @code{:tags} @tab @code{org-export-with-tags}
  7219. @item @code{:todo-keywords} @tab @code{org-export-with-todo-keywords}
  7220. @item @code{:priority} @tab @code{org-export-with-priority}
  7221. @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
  7222. @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
  7223. @item @code{:skip-before-1st-heading} @tab @code{org-export-skip-text-before-1st-heading}
  7224. @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
  7225. @item @code{:timestamps} @tab @code{org-export-with-timestamps}
  7226. @item @code{:author-info} @tab @code{org-export-author-info}
  7227. @item @code{:creator-info} @tab @code{org-export-creator-info}
  7228. @item @code{:tables} @tab @code{org-export-with-tables}
  7229. @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
  7230. @item @code{:style-include-default} @tab @code{org-export-html-style-include-default}
  7231. @item @code{:style} @tab @code{org-export-html-style}
  7232. @item @code{:style-extra} @tab @code{org-export-html-style-extra}
  7233. @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
  7234. @item @code{:inline-images} @tab @code{org-export-html-inline-images}
  7235. @item @code{:html-extension} @tab @code{org-export-html-extension}
  7236. @item @code{:html-table-tag} @tab @code{org-export-html-table-tag}
  7237. @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
  7238. @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
  7239. @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
  7240. @item @code{:preamble} @tab @code{org-export-html-preamble}
  7241. @item @code{:postamble} @tab @code{org-export-html-postamble}
  7242. @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
  7243. @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
  7244. @item @code{:author} @tab @code{user-full-name}
  7245. @item @code{:email} @tab @code{user-mail-address}
  7246. @item @code{:select-tags} @tab @code{org-export-select-tags}
  7247. @item @code{:exclude-tags} @tab @code{org-export-exclude-tags}
  7248. @end multitable
  7249. If you use several email addresses, separate them by a semi-column.
  7250. Most of the @code{org-export-with-*} variables have the same effect in
  7251. both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
  7252. @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
  7253. La@TeX{} export.
  7254. When a property is given a value in @code{org-publish-project-alist},
  7255. its setting overrides the value of the corresponding user variable (if
  7256. any) during publishing. Options set within a file (@pxref{Export
  7257. options}), however, override everything.
  7258. @node Publishing links, Project page index, Publishing options, Configuration
  7259. @subsection Links between published files
  7260. @cindex links, publishing
  7261. To create a link from one Org file to another, you would use
  7262. something like @samp{[[file:foo.org][The foo]]} or simply
  7263. @samp{file:foo.org.} (@pxref{Hyperlinks}). Upon publishing this link
  7264. becomes a link to @file{foo.html}. In this way, you can interlink the
  7265. pages of your "org web" project and the links will work as expected when
  7266. you publish them to HTML.
  7267. You may also link to related files, such as images. Provided you are
  7268. careful with relative pathnames, and provided you have also configured
  7269. @code{org-publish} to upload the related files, these links will work
  7270. too. @ref{Complex example} for an example of this usage.
  7271. Sometime an Org file to be published may contain links that are
  7272. only valid in your production environment, but not in the publishing
  7273. location. In this case, use the property
  7274. @multitable @columnfractions 0.4 0.6
  7275. @item @code{:link-validation-function}
  7276. @tab Function to validate links
  7277. @end multitable
  7278. @noindent
  7279. to define a function for checking link validity. This function must
  7280. accept two arguments, the file name and a directory relative to which
  7281. the file name is interpreted in the production environment. If this
  7282. function returns @code{nil}, then the HTML generator will only insert a
  7283. description into the HTML file, but no link. One option for this
  7284. function is @code{org-publish-validate-link} which checks if the given
  7285. file is part of any project in @code{org-publish-project-alist}.
  7286. @node Project page index, , Publishing links, Configuration
  7287. @subsection Project page index
  7288. @cindex index, of published pages
  7289. The following properties may be used to control publishing of an
  7290. index of files or summary page for a given project.
  7291. @multitable @columnfractions 0.25 0.75
  7292. @item @code{:auto-index}
  7293. @tab When non-nil, publish an index during org-publish-current-project or
  7294. org-publish-all.
  7295. @item @code{:index-filename}
  7296. @tab Filename for output of index. Defaults to @file{index.org} (which
  7297. becomes @file{index.html}).
  7298. @item @code{:index-title}
  7299. @tab Title of index page. Defaults to name of file.
  7300. @item @code{:index-function}
  7301. @tab Plug-in function to use for generation of index.
  7302. Defaults to @code{org-publish-org-index}, which generates a plain list
  7303. of links to all files in the project.
  7304. @end multitable
  7305. @node Sample configuration, Triggering publication, Configuration, Publishing
  7306. @section Sample configuration
  7307. Below we provide two example configurations. The first one is a simple
  7308. project publishing only a set of Org files. The second example is
  7309. more complex, with a multi-component project.
  7310. @menu
  7311. * Simple example:: One-component publishing
  7312. * Complex example:: A multi-component publishing example
  7313. @end menu
  7314. @node Simple example, Complex example, Sample configuration, Sample configuration
  7315. @subsection Example: simple publishing configuration
  7316. This example publishes a set of Org files to the @file{public_html}
  7317. directory on the local machine.
  7318. @lisp
  7319. (setq org-publish-project-alist
  7320. '(("org"
  7321. :base-directory "~/org/"
  7322. :publishing-directory "~/public_html"
  7323. :section-numbers nil
  7324. :table-of-contents nil
  7325. :style "<link rel=\"stylesheet\"
  7326. href=\"../other/mystyle.css\"
  7327. type=\"text/css\">")))
  7328. @end lisp
  7329. @node Complex example, , Simple example, Sample configuration
  7330. @subsection Example: complex publishing configuration
  7331. This more complicated example publishes an entire website, including
  7332. org files converted to HTML, image files, emacs lisp source code, and
  7333. style sheets. The publishing-directory is remote and private files are
  7334. excluded.
  7335. To ensure that links are preserved, care should be taken to replicate
  7336. your directory structure on the web server, and to use relative file
  7337. paths. For example, if your org files are kept in @file{~/org} and your
  7338. publishable images in @file{~/images}, you'd link to an image with
  7339. @c
  7340. @example
  7341. file:../images/myimage.png
  7342. @end example
  7343. @c
  7344. On the web server, the relative path to the image should be the
  7345. same. You can accomplish this by setting up an "images" folder in the
  7346. right place on the web server, and publishing images to it.
  7347. @lisp
  7348. (setq org-publish-project-alist
  7349. '(("orgfiles"
  7350. :base-directory "~/org/"
  7351. :base-extension "org"
  7352. :publishing-directory "/ssh:user@@host:~/html/notebook/"
  7353. :publishing-function org-publish-org-to-html
  7354. :exclude "PrivatePage.org" ;; regexp
  7355. :headline-levels 3
  7356. :section-numbers nil
  7357. :table-of-contents nil
  7358. :style "<link rel=\"stylesheet\"
  7359. href=\"../other/mystyle.css\" type=\"text/css\">"
  7360. :auto-preamble t
  7361. :auto-postamble nil)
  7362. ("images"
  7363. :base-directory "~/images/"
  7364. :base-extension "jpg\\|gif\\|png"
  7365. :publishing-directory "/ssh:user@@host:~/html/images/"
  7366. :publishing-function org-publish-attachment)
  7367. ("other"
  7368. :base-directory "~/other/"
  7369. :base-extension "css\\|el"
  7370. :publishing-directory "/ssh:user@@host:~/html/other/"
  7371. :publishing-function org-publish-attachment)
  7372. ("website" :components ("orgfiles" "images" "other"))))
  7373. @end lisp
  7374. @node Triggering publication, , Sample configuration, Publishing
  7375. @section Triggering publication
  7376. Once org-publish is properly configured, you can publish with the
  7377. following functions:
  7378. @table @kbd
  7379. @item C-c C-e C
  7380. Prompt for a specific project and publish all files that belong to it.
  7381. @item C-c C-e P
  7382. Publish the project containing the current file.
  7383. @item C-c C-e F
  7384. Publish only the current file.
  7385. @item C-c C-e A
  7386. Publish all projects.
  7387. @end table
  7388. Org uses timestamps to track when a file has changed. The above
  7389. functions normally only publish changed files. You can override this and
  7390. force publishing of all files by giving a prefix argument.
  7391. @node Miscellaneous, Extensions, Publishing, Top
  7392. @chapter Miscellaneous
  7393. @menu
  7394. * Completion:: M-TAB knows what you need
  7395. * Customization:: Adapting Org to your taste
  7396. * In-buffer settings:: Overview of the #+KEYWORDS
  7397. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  7398. * Clean view:: Getting rid of leading stars in the outline
  7399. * TTY keys:: Using Org on a tty
  7400. * Interaction:: Other Emacs packages
  7401. * Bugs:: Things which do not work perfectly
  7402. @end menu
  7403. @node Completion, Customization, Miscellaneous, Miscellaneous
  7404. @section Completion
  7405. @cindex completion, of @TeX{} symbols
  7406. @cindex completion, of TODO keywords
  7407. @cindex completion, of dictionary words
  7408. @cindex completion, of option keywords
  7409. @cindex completion, of tags
  7410. @cindex completion, of property keys
  7411. @cindex completion, of link abbreviations
  7412. @cindex @TeX{} symbol completion
  7413. @cindex TODO keywords completion
  7414. @cindex dictionary word completion
  7415. @cindex option keyword completion
  7416. @cindex tag completion
  7417. @cindex link abbreviations, completion of
  7418. Org supports in-buffer completion. This type of completion does
  7419. not make use of the minibuffer. You simply type a few letters into
  7420. the buffer and use the key to complete text right there.
  7421. @table @kbd
  7422. @kindex M-@key{TAB}
  7423. @item M-@key{TAB}
  7424. Complete word at point
  7425. @itemize @bullet
  7426. @item
  7427. At the beginning of a headline, complete TODO keywords.
  7428. @item
  7429. After @samp{\}, complete @TeX{} symbols supported by the exporter.
  7430. @item
  7431. After @samp{*}, complete headlines in the current buffer so that they
  7432. can be used in search links like @samp{[[*find this headline]]}.
  7433. @item
  7434. After @samp{:} in a headline, complete tags. The list of tags is taken
  7435. from the variable @code{org-tag-alist} (possibly set through the
  7436. @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
  7437. dynamically from all tags used in the current buffer.
  7438. @item
  7439. After @samp{:} and not in a headline, complete property keys. The list
  7440. of keys is constructed dynamically from all keys used in the current
  7441. buffer.
  7442. @item
  7443. After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
  7444. @item
  7445. After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
  7446. @samp{OPTIONS} which set file-specific options for Org mode. When the
  7447. option keyword is already complete, pressing @kbd{M-@key{TAB}} again
  7448. will insert example settings for this keyword.
  7449. @item
  7450. In the line after @samp{#+STARTUP: }, complete startup keywords,
  7451. i.e. valid keys for this line.
  7452. @item
  7453. Elsewhere, complete dictionary words using Ispell.
  7454. @end itemize
  7455. @end table
  7456. @node Customization, In-buffer settings, Completion, Miscellaneous
  7457. @section Customization
  7458. @cindex customization
  7459. @cindex options, for customization
  7460. @cindex variables, for customization
  7461. There are more than 180 variables that can be used to customize
  7462. Org. For the sake of compactness of the manual, I am not
  7463. describing the variables here. A structured overview of customization
  7464. variables is available with @kbd{M-x org-customize}. Or select
  7465. @code{Browse Org Group} from the @code{Org->Customization} menu. Many
  7466. settings can also be activated on a per-file basis, by putting special
  7467. lines into the buffer (@pxref{In-buffer settings}).
  7468. @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
  7469. @section Summary of in-buffer settings
  7470. @cindex in-buffer settings
  7471. @cindex special keywords
  7472. Org mode uses special lines in the buffer to define settings on a
  7473. per-file basis. These lines start with a @samp{#+} followed by a
  7474. keyword, a colon, and then individual words defining a setting. Several
  7475. setting words can be in the same line, but you can also have multiple
  7476. lines for the keyword. While these settings are described throughout
  7477. the manual, here is a summary. After changing any of those lines in the
  7478. buffer, press @kbd{C-c C-c} with the cursor still in the line to
  7479. activate the changes immediately. Otherwise they become effective only
  7480. when the file is visited again in a new Emacs session.
  7481. @table @kbd
  7482. @item #+ARCHIVE: %s_done::
  7483. This line sets the archive location for the agenda file. It applies for
  7484. all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
  7485. of the file. The first such line also applies to any entries before it.
  7486. The corresponding variable is @code{org-archive-location}.
  7487. @item #+CATEGORY:
  7488. This line sets the category for the agenda file. The category applies
  7489. for all subsequent lines until the next @samp{#+CATEGORY} line, or the
  7490. end of the file. The first such line also applies to any entries before it.
  7491. @item #+COLUMNS: %25ITEM .....
  7492. Set the default format for columns view. This format applies when
  7493. columns view is invoked in location where no @code{COLUMNS} property
  7494. applies.
  7495. @item #+CONSTANTS: name1=value1 ...
  7496. Set file-local values for constants to be used in table formulas. This
  7497. line set the local variable @code{org-table-formula-constants-local}.
  7498. The global version of this variable is
  7499. @code{org-table-formula-constants}.
  7500. @item #+FILETAGS: :tag1:tag2:tag3:
  7501. Set tags that can be inherited by any entry in the file, including the
  7502. top-level entries.
  7503. @item #+DRAWERS: NAME1 .....
  7504. Set the file-local set of drawers. The corresponding global variable is
  7505. @code{org-drawers}.
  7506. @item #+LINK: linkword replace
  7507. These lines (several are allowed) specify link abbreviations.
  7508. @xref{Link abbreviations}. The corresponding variable is
  7509. @code{org-link-abbrev-alist}.
  7510. @item #+PRIORITIES: highest lowest default
  7511. This line sets the limits and the default for the priorities. All three
  7512. must be either letters A-Z or numbers 0-9. The highest priority must
  7513. have a lower ASCII number that the lowest priority.
  7514. @item #+PROPERTY: Property_Name Value
  7515. This line sets a default inheritance value for entries in the current
  7516. buffer, most useful for specifying the allowed values of a property.
  7517. @item #+SETUPFILE: file
  7518. This line defines a file that holds more in-buffer setup. Normally this is
  7519. entirely ignored. Only when the buffer is parsed for option-setting lines
  7520. (i.e. when starting Org mode for a file, when pressing @kbd{C-c C-c} in a
  7521. settings line, or when exporting), then the contents of this file are parsed
  7522. as if they had been included in the buffer. In particlar, the file can be
  7523. any other Org mode file with internal setup. You can visit the file the
  7524. cursor is in the line with @kbd{C-c '}.
  7525. @item #+STARTUP:
  7526. This line sets options to be used at startup of Org mode, when an
  7527. Org file is being visited. The first set of options deals with the
  7528. initial visibility of the outline tree. The corresponding variable for
  7529. global default settings is @code{org-startup-folded}, with a default
  7530. value @code{t}, which means @code{overview}.
  7531. @cindex @code{overview}, STARTUP keyword
  7532. @cindex @code{content}, STARTUP keyword
  7533. @cindex @code{showall}, STARTUP keyword
  7534. @example
  7535. overview @r{top-level headlines only}
  7536. content @r{all headlines}
  7537. showall @r{no folding at all, show everything}
  7538. @end example
  7539. Then there are options for aligning tables upon visiting a file. This
  7540. is useful in files containing narrowed table columns. The corresponding
  7541. variable is @code{org-startup-align-all-tables}, with a default value
  7542. @code{nil}.
  7543. @cindex @code{align}, STARTUP keyword
  7544. @cindex @code{noalign}, STARTUP keyword
  7545. @example
  7546. align @r{align all tables}
  7547. noalign @r{don't align tables on startup}
  7548. @end example
  7549. Logging closing and reinstating TODO items, and clock intervals
  7550. (variables @code{org-log-done}, @code{org-log-note-clock-out}, and
  7551. @code{org-log-repeat}) can be configured using these options.
  7552. @cindex @code{logdone}, STARTUP keyword
  7553. @cindex @code{lognotedone}, STARTUP keyword
  7554. @cindex @code{nologdone}, STARTUP keyword
  7555. @cindex @code{lognoteclock-out}, STARTUP keyword
  7556. @cindex @code{nolognoteclock-out}, STARTUP keyword
  7557. @cindex @code{logrepeat}, STARTUP keyword
  7558. @cindex @code{lognoterepeat}, STARTUP keyword
  7559. @cindex @code{nologrepeat}, STARTUP keyword
  7560. @example
  7561. logdone @r{record a timestamp when an item is marked DONE}
  7562. lognotedone @r{record timestamp and a note when DONE}
  7563. nologdone @r{don't record when items are marked DONE}
  7564. logrepeat @r{record a time when reinstating a repeating item}
  7565. lognoterepeat @r{record a note when reinstating a repeating item}
  7566. nologrepeat @r{do not record when reinstating repeating item}
  7567. lognoteclock-out @r{record a note when clocking out}
  7568. nolognoteclock-out @r{don't record a note when clocking out}
  7569. @end example
  7570. Here are the options for hiding leading stars in outline headings, and for
  7571. indenting outlines. The corresponding variables are
  7572. @code{org-hide-leading-stars} and @code{org-odd-levels-only}, both with a
  7573. default setting @code{nil} (meaning @code{showstars} and @code{oddeven}).
  7574. @cindex @code{hidestars}, STARTUP keyword
  7575. @cindex @code{showstars}, STARTUP keyword
  7576. @cindex @code{odd}, STARTUP keyword
  7577. @cindex @code{even}, STARTUP keyword
  7578. @example
  7579. hidestars @r{make all but one of the stars starting a headline invisible.}
  7580. showstars @r{show all stars starting a headline}
  7581. indent @r{virtual indentation according to outline level}
  7582. noindent @r{no virtual indentation according to outline level}
  7583. odd @r{allow only odd outline levels (1,3,...)}
  7584. oddeven @r{allow all outline levels}
  7585. @end example
  7586. To turn on custom format overlays over time stamps (variables
  7587. @code{org-put-time-stamp-overlays} and
  7588. @code{org-time-stamp-overlay-formats}), use
  7589. @cindex @code{customtime}, STARTUP keyword
  7590. @example
  7591. customtime @r{overlay custom time format}
  7592. @end example
  7593. The following options influence the table spreadsheet (variable
  7594. @code{constants-unit-system}).
  7595. @cindex @code{constcgs}, STARTUP keyword
  7596. @cindex @code{constSI}, STARTUP keyword
  7597. @example
  7598. constcgs @r{@file{constants.el} should use the c-g-s unit system}
  7599. constSI @r{@file{constants.el} should use the SI unit system}
  7600. @end example
  7601. @item #+TAGS: TAG1(c1) TAG2(c2)
  7602. These lines (several such lines are allowed) specify the valid tags in
  7603. this file, and (potentially) the corresponding @emph{fast tag selection}
  7604. keys. The corresponding variable is @code{org-tag-alist}.
  7605. @item #+TBLFM:
  7606. This line contains the formulas for the table directly above the line.
  7607. @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS, #+DATE:
  7608. These lines provide settings for exporting files. For more details see
  7609. @ref{Export options}.
  7610. @item #+SEQ_TODO: #+TYP_TODO:
  7611. These lines set the TODO keywords and their interpretation in the
  7612. current file. The corresponding variables are @code{org-todo-keywords}
  7613. and @code{org-todo-interpretation}.
  7614. @end table
  7615. @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
  7616. @section The very busy C-c C-c key
  7617. @kindex C-c C-c
  7618. @cindex C-c C-c, overview
  7619. The key @kbd{C-c C-c} has many purposes in Org, which are all
  7620. mentioned scattered throughout this manual. One specific function of
  7621. this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
  7622. other circumstances it means something like @emph{Hey Org, look
  7623. here and update according to what you see here}. Here is a summary of
  7624. what this means in different contexts.
  7625. @itemize @minus
  7626. @item
  7627. If there are highlights in the buffer from the creation of a sparse
  7628. tree, or from clock display, remove these highlights.
  7629. @item
  7630. If the cursor is in one of the special @code{#+KEYWORD} lines, this
  7631. triggers scanning the buffer for these lines and updating the
  7632. information.
  7633. @item
  7634. If the cursor is inside a table, realign the table. This command
  7635. works even if the automatic table editor has been turned off.
  7636. @item
  7637. If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
  7638. the entire table.
  7639. @item
  7640. If the cursor is inside a table created by the @file{table.el} package,
  7641. activate that table.
  7642. @item
  7643. If the current buffer is a remember buffer, close the note and file it.
  7644. With a prefix argument, file it, without further interaction, to the
  7645. default location.
  7646. @item
  7647. If the cursor is on a @code{<<<target>>>}, update radio targets and
  7648. corresponding links in this buffer.
  7649. @item
  7650. If the cursor is in a property line or at the start or end of a property
  7651. drawer, offer property commands.
  7652. @item
  7653. If the cursor is in a plain list item with a checkbox, toggle the status
  7654. of the checkbox.
  7655. @item
  7656. If the cursor is on a numbered item in a plain list, renumber the
  7657. ordered list.
  7658. @item
  7659. If the cursor is on the @code{#+BEGIN} line of a dynamical block, the
  7660. block is updated.
  7661. @end itemize
  7662. @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
  7663. @section A cleaner outline view
  7664. @cindex hiding leading stars
  7665. @cindex dynamic indentation
  7666. @cindex odd-levels-only outlines
  7667. @cindex clean outline view
  7668. Some people find it noisy and distracting that the Org headlines are starting
  7669. with a potentially large number of stars, and that text below the headlines
  7670. is not indented. This is not really a problem when you are writing a book
  7671. where the outline headings are really section headlines. However, in a more
  7672. list-oriented outline, it is clear that an indented structure is a lot
  7673. cleaner, as can be seen by comparing the two columns in the following
  7674. example:
  7675. @example
  7676. @group
  7677. * Top level headline | * Top level headline
  7678. ** Second level | * Second level
  7679. *** 3rd level | * 3rd level
  7680. some text | some text
  7681. *** 3rd level | * 3rd level
  7682. more text | more text
  7683. * Another top level headline | * Another top level headline
  7684. @end group
  7685. @end example
  7686. @noindent
  7687. It is non-trivial to make such a look work in Emacs, but Org contains three
  7688. separate features that, combined, achieve just that.
  7689. @enumerate
  7690. @item
  7691. @emph{Indentation of text below headlines}@*
  7692. You may indent text below each headline to make the left boundary line up
  7693. with the headline, like
  7694. @example
  7695. *** 3rd level
  7696. more text, now indented
  7697. @end example
  7698. A good way to get this indentation is by hand, and Org supports this with
  7699. paragraph filling, line wrapping, and structure editing@footnote{See also the
  7700. variable @code{org-adapt-indentation}.} preserving or adapting the
  7701. indentation appropriate. A different approach would be to have a way to
  7702. automatically indent lines according to outline structure by adding overlays
  7703. or text properties. But I have not yet found a robust and efficient way to
  7704. do this in large files.
  7705. @item
  7706. @emph{Hiding leading stars}@* You can modify the display in such a way that
  7707. all leading stars become invisible. To do this in a global way, configure
  7708. the variable @code{org-hide-leading-stars} or change this on a per-file basis
  7709. with
  7710. @example
  7711. #+STARTUP: hidestars
  7712. @end example
  7713. @noindent
  7714. Note that the opposite behavior is selected with @code{showstars}.
  7715. With hidden stars, the tree becomes:
  7716. @example
  7717. @group
  7718. * Top level headline
  7719. * Second level
  7720. * 3rd level
  7721. ...
  7722. @end group
  7723. @end example
  7724. @noindent
  7725. Note that the leading stars are not truly replaced by whitespace, they
  7726. are only fontified with the face @code{org-hide} that uses the
  7727. background color as font color. If you are not using either white or
  7728. black background, you may have to customize this face to get the wanted
  7729. effect. Another possibility is to set this font such that the extra
  7730. stars are @i{almost} invisible, for example using the color
  7731. @code{grey90} on a white background.
  7732. @item
  7733. Things become cleaner still if you skip all the even levels and use only odd
  7734. levels 1, 3, 5..., effectively adding two stars to go from one outline level
  7735. to the next. In this way we get the outline view shown at the beginning of
  7736. this section. In order to make the structure editing and export commands
  7737. handle this convention correctly, configure the variable
  7738. @code{org-odd-levels-only}, or set this on a per-file basis with one of the
  7739. following lines:
  7740. @example
  7741. #+STARTUP: odd
  7742. #+STARTUP: oddeven
  7743. @end example
  7744. You can convert an Org file from single-star-per-level to the
  7745. double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
  7746. RET} in that file. The reverse operation is @kbd{M-x
  7747. org-convert-to-oddeven-levels}.
  7748. @end enumerate
  7749. @node TTY keys, Interaction, Clean view, Miscellaneous
  7750. @section Using Org on a tty
  7751. @cindex tty key bindings
  7752. Because Org contains a large number of commands, by default much of
  7753. Org's core commands are bound to keys that are generally not
  7754. accessible on a tty, such as the cursor keys (@key{left}, @key{right},
  7755. @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
  7756. together with modifiers like @key{Meta} and/or @key{Shift}. To access
  7757. these commands on a tty when special keys are unavailable, the following
  7758. alternative bindings can be used. The tty bindings below will likely be
  7759. more cumbersome; you may find for some of the bindings below that a
  7760. customized work-around suits you better. For example, changing a time
  7761. stamp is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
  7762. tty you would rather use @kbd{C-c .} to re-insert the timestamp.
  7763. @multitable @columnfractions 0.15 0.2 0.2
  7764. @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
  7765. @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
  7766. @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
  7767. @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
  7768. @item @kbd{M-@key{right}} @tab @kbd{C-c C-x i} @tab @kbd{@key{Esc} @key{right}}
  7769. @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
  7770. @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
  7771. @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
  7772. @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
  7773. @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
  7774. @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
  7775. @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
  7776. @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
  7777. @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab
  7778. @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab
  7779. @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab
  7780. @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab
  7781. @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
  7782. @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
  7783. @end multitable
  7784. @node Interaction, Bugs, TTY keys, Miscellaneous
  7785. @section Interaction with other packages
  7786. @cindex packages, interaction with other
  7787. Org lives in the world of GNU Emacs and interacts in various ways
  7788. with other code out there.
  7789. @menu
  7790. * Cooperation:: Packages Org cooperates with
  7791. * Conflicts:: Packages that lead to conflicts
  7792. @end menu
  7793. @node Cooperation, Conflicts, Interaction, Interaction
  7794. @subsection Packages that Org cooperates with
  7795. @table @asis
  7796. @cindex @file{calc.el}
  7797. @item @file{calc.el} by Dave Gillespie
  7798. Org uses the Calc package for implementing spreadsheet
  7799. functionality in its tables (@pxref{The spreadsheet}). Org
  7800. checks for the availability of Calc by looking for the function
  7801. @code{calc-eval} which should be autoloaded in your setup if Calc has
  7802. been installed properly. As of Emacs 22, Calc is part of the Emacs
  7803. distribution. Another possibility for interaction between the two
  7804. packages is using Calc for embedded calculations. @xref{Embedded Mode,
  7805. , Embedded Mode, Calc, GNU Emacs Calc Manual}.
  7806. @cindex @file{constants.el}
  7807. @item @file{constants.el} by Carsten Dominik
  7808. In a table formula (@pxref{The spreadsheet}), it is possible to use
  7809. names for natural constants or units. Instead of defining your own
  7810. constants in the variable @code{org-table-formula-constants}, install
  7811. the @file{constants} package which defines a large number of constants
  7812. and units, and lets you use unit prefixes like @samp{M} for
  7813. @samp{Mega} etc. You will need version 2.0 of this package, available
  7814. at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
  7815. the function @code{constants-get}, which has to be autoloaded in your
  7816. setup. See the installation instructions in the file
  7817. @file{constants.el}.
  7818. @item @file{cdlatex.el} by Carsten Dominik
  7819. @cindex @file{cdlatex.el}
  7820. Org mode can make use of the CDLaTeX package to efficiently enter
  7821. La@TeX{} fragments into Org files. See @ref{CDLaTeX mode}.
  7822. @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
  7823. @cindex @file{imenu.el}
  7824. Imenu allows menu access to an index of items in a file. Org mode
  7825. supports Imenu - all you need to do to get the index is the following:
  7826. @lisp
  7827. (add-hook 'org-mode-hook
  7828. (lambda () (imenu-add-to-menubar "Imenu")))
  7829. @end lisp
  7830. By default the index is two levels deep - you can modify the depth using
  7831. the option @code{org-imenu-depth}.
  7832. @item @file{remember.el} by John Wiegley
  7833. @cindex @file{remember.el}
  7834. Org cooperates with remember, see @ref{Remember}.
  7835. @file{Remember.el} is not part of Emacs, find it on the web.
  7836. @item @file{speedbar.el} by Eric M. Ludlam
  7837. @cindex @file{speedbar.el}
  7838. Speedbar is a package that creates a special frame displaying files and
  7839. index items in files. Org mode supports Speedbar and allows you to
  7840. drill into Org files directly from the Speedbar. It also allows to
  7841. restrict the scope of agenda commands to a file or a subtree by using
  7842. the command @kbd{<} in the Speedbar frame.
  7843. @cindex @file{table.el}
  7844. @item @file{table.el} by Takaaki Ota
  7845. @kindex C-c C-c
  7846. @cindex table editor, @file{table.el}
  7847. @cindex @file{table.el}
  7848. Complex ASCII tables with automatic line wrapping, column- and
  7849. row-spanning, and alignment can be created using the Emacs table
  7850. package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
  7851. and also part of Emacs 22).
  7852. When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org mode
  7853. will call @command{table-recognize-table} and move the cursor into the
  7854. table. Inside a table, the keymap of Org mode is inactive. In order
  7855. to execute Org mode-related commands, leave the table.
  7856. @table @kbd
  7857. @kindex C-c C-c
  7858. @item C-c C-c
  7859. Recognize @file{table.el} table. Works when the cursor is in a
  7860. table.el table.
  7861. @c
  7862. @kindex C-c ~
  7863. @item C-c ~
  7864. Insert a table.el table. If there is already a table at point, this
  7865. command converts it between the table.el format and the Org mode
  7866. format. See the documentation string of the command
  7867. @code{org-convert-table} for the restrictions under which this is
  7868. possible.
  7869. @end table
  7870. @file{table.el} is part of Emacs 22.
  7871. @cindex @file{footnote.el}
  7872. @item @file{footnote.el} by Steven L. Baur
  7873. Org mode recognizes numerical footnotes as provided by this package
  7874. (@pxref{Footnotes}).
  7875. @end table
  7876. @node Conflicts, , Cooperation, Interaction
  7877. @subsection Packages that lead to conflicts with Org mode
  7878. @table @asis
  7879. @cindex @file{allout.el}
  7880. @item @file{allout.el} by Ken Manheimer
  7881. Startup of Org may fail with the error message
  7882. @code{(wrong-type-argument keymapp nil)} when there is an outdated
  7883. version @file{allout.el} on the load path, for example the version
  7884. distributed with Emacs 21.x. Upgrade to Emacs 22 and this problem will
  7885. disappear. If for some reason you cannot do this, make sure that org.el
  7886. is loaded @emph{before} @file{allout.el}, for example by putting
  7887. @code{(require 'org)} early enough into your @file{.emacs} file.
  7888. @cindex @file{CUA.el}
  7889. @item @file{CUA.el} by Kim. F. Storm
  7890. Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by
  7891. CUA mode (as well as pc-select-mode and s-region-mode) to select and
  7892. extend the region. If you want to use one of these packages along with
  7893. Org, configure the variable @code{org-replace-disputed-keys}. When
  7894. set, Org will move the following key bindings in Org files, and
  7895. in the agenda buffer (but not during date selection).
  7896. @example
  7897. S-UP -> M-p S-DOWN -> M-n
  7898. S-LEFT -> M-- S-RIGHT -> M-+
  7899. @end example
  7900. Yes, these are unfortunately more difficult to remember. If you want
  7901. to have other replacement keys, look at the variable
  7902. @code{org-disputed-keys}.
  7903. @item @file{windmove.el} by Hovav Shacham
  7904. @cindex @file{windmove.el}
  7905. Also this package uses the @kbd{S-<cursor>} keys, so everything written
  7906. in the paragraph above about CUA mode also applies here.
  7907. @cindex @file{footnote.el}
  7908. @item @file{footnote.el} by Steven L. Baur
  7909. Org supports the syntax of the footnote package, but only the
  7910. numerical footnote markers. Also, the default key for footnote
  7911. commands, @kbd{C-c !} is already used by Org. You could use the
  7912. variable @code{footnote-prefix} to switch footnotes commands to another
  7913. key. Or, you could use @code{org-replace-disputed-keys} and
  7914. @code{org-disputed-keys} to change the settings in Org.
  7915. @end table
  7916. @node Bugs, , Interaction, Miscellaneous
  7917. @section Bugs
  7918. @cindex bugs
  7919. Here is a list of things that should work differently, but which I
  7920. have found too hard to fix.
  7921. @itemize @bullet
  7922. @item
  7923. If a table field starts with a link, and if the corresponding table
  7924. column is narrowed (@pxref{Narrow columns}) to a width too small to
  7925. display the link, the field would look entirely empty even though it is
  7926. not. To prevent this, Org throws an error. The work-around is to
  7927. make the column wide enough to fit the link, or to add some text (at
  7928. least 2 characters) before the link in the same field.
  7929. @item
  7930. Narrowing table columns does not work on XEmacs, because the
  7931. @code{format} function does not transport text properties.
  7932. @item
  7933. Text in an entry protected with the @samp{QUOTE} keyword should not
  7934. autowrap.
  7935. @item
  7936. When the application called by @kbd{C-c C-o} to open a file link fails
  7937. (for example because the application does not exist or refuses to open
  7938. the file), it does so silently. No error message is displayed.
  7939. @item
  7940. Recalculating a table line applies the formulas from left to right.
  7941. If a formula uses @emph{calculated} fields further down the row,
  7942. multiple recalculation may be needed to get all fields consistent. You
  7943. may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
  7944. recalculate until convergence.
  7945. @item
  7946. The exporters work well, but could be made more efficient.
  7947. @end itemize
  7948. @node Extensions, Hacking, Miscellaneous, Top
  7949. @appendix Extensions
  7950. This appendix lists the extension modules that have been written for Org.
  7951. Many of these extensions live in the @file{contrib} directory of the Org
  7952. distribution, others are available somewhere on the web.
  7953. @menu
  7954. * Extensions in the contrib directory:: These come with the Org distro
  7955. * Other extensions:: These you have to find on the web.
  7956. @end menu
  7957. @node Extensions in the contrib directory, Other extensions, Extensions, Extensions
  7958. @section Extensions in the @file{contrib} directory
  7959. A number of extension are distributed with Org when you download it from its
  7960. homepage. Please note that these extensions are @emph{not} distributed as
  7961. part of Emacs, so if you use Org as delivered with Emacs, you still need to
  7962. go to @url{http://orgmode.org} to get access to these modules.
  7963. @table @asis
  7964. @item @file{org-annotate-file.el} by @i{Philip Jackson}
  7965. Annotate a file with org syntax, in a separate file, with links back to
  7966. the annotated file.
  7967. @item @file{org-annotation-helper.el} by @i{Bastien Guerry and Daniel E. German}
  7968. Call @i{remember} directly from Firefox/Opera, or from Adobe Reader.
  7969. When activating a special link or bookmark, Emacs receives a trigger to
  7970. create a note with a link back to the website. Requires some setup, a
  7971. detailes description is in
  7972. @file{contrib/packages/org-annotation-helper}.
  7973. @item @file{org-bookmark.el} by @i{Tokuya Kameshima}
  7974. Support for links to Emacs bookmarks.
  7975. @item @file{org-depend.el} by @i{Carsten Dominik}
  7976. TODO dependencies for Org-mode. Make TODO state changes in one entry
  7977. trigger changes in another, or be blocked by the state of another
  7978. entry. Also, easily create chains of TODO items with exactly one
  7979. active item at any time.
  7980. @item @file{org-elisp-symbol.el} by @i{Bastien Guerry}
  7981. Org links to emacs-lisp symbols. This can create annotated links that
  7982. exactly point to the definition location of a variable of function.
  7983. @item @file{org-eval.el} by @i{Carsten Dominik}
  7984. The @code{<lisp>} tag, adapted from Emacs Wiki and Emacs Muse, allows
  7985. text to be included in a document that is the result of evaluating some
  7986. code. Other scripting languages like @code{perl} can be supported with
  7987. this package as well.
  7988. @item @file{org-eval-light.el} by @i{Eric Schulte}
  7989. User-controlled evaluation of code in an Org buffer.
  7990. @item @file{org-exp-blocks.el} by @i{Eric Schulte}
  7991. Preprocess user-defined blocks for export.
  7992. @item @file{org-expiry.el} by @i{Bastien Guerry}
  7993. Expiry mechanism for Org entries.
  7994. @item @file{org-indent.el} by @i{Carsten Dominik}
  7995. Dynamic indentation of Org outlines. The plan is to indent an outline
  7996. according to level, but so far this is too hard for a proper and stable
  7997. implementation. Still, it works somewhat.
  7998. @item @file{org-interactive-query.el} by @i{Christopher League}
  7999. Interactive modification of tags queries. After running a general
  8000. query in Org, this package allows to narrow down the results by adding
  8001. more tags or keywords.
  8002. @item @file{org-mairix.el} by @i{Georg C. F. Greve}
  8003. Hook mairix search into Org for different MUAs.
  8004. @item @file{org-man.el} by @i{Carsten Dominik}
  8005. Support for links to manpages in Org-mode.
  8006. @item @file{org-mtags.el} by @i{Carsten Dominik}
  8007. Support for some Muse-like tags in Org-mode. This package allows you
  8008. to write @code{<example>} and @code{<src>} and other syntax copied from
  8009. Emacs Muse, right inside an Org file. The goal here is to make it easy
  8010. to publish the same file using either org-publish or Muse.
  8011. @item @file{org-panel.el} by @i{Lennard Borgman}
  8012. Simplified and display-aided access to some Org commands.
  8013. @item @file{org-registry.el} by @i{Bastien Guerry}
  8014. A registry for Org links, to find out from where links point to a given
  8015. file or location.
  8016. @item @file{org2rem.el} by @i{Bastien Guerry}
  8017. Convert org appointments into reminders for the @file{remind} program.
  8018. @item @file{org-screen.el} by @i{Andrew Hyatt}
  8019. Visit screen sessions through Org-mode links.
  8020. @item @file{org-toc.el} by @i{Bastien Guerry}
  8021. Table of contents in a separate buffer, with fast access to sections
  8022. and easy visibility cycling.
  8023. @item @file{orgtbl-sqlinsert.el} by @i{Jason Riedy}
  8024. Convert Org-mode tables to SQL insertions. Documentation for this can
  8025. be found on the Worg pages.
  8026. @end table
  8027. @node Other extensions, , Extensions in the contrib directory, Extensions
  8028. @section Other extensions
  8029. @i{TO BE DONE}
  8030. @node Hacking, History and Acknowledgments, Extensions, Top
  8031. @appendix Hacking
  8032. This appendix covers some aspects where users can extend the functionality of
  8033. Org.
  8034. @menu
  8035. * Adding hyperlink types:: New custom link types
  8036. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  8037. * Dynamic blocks:: Automatically filled blocks
  8038. * Special agenda views:: Customized views
  8039. * Using the property API:: Writing programs that use entry properties
  8040. * Using the mapping API:: Mapping over all or selected entries
  8041. @end menu
  8042. @node Adding hyperlink types, Tables in arbitrary syntax, Hacking, Hacking
  8043. @section Adding hyperlink types
  8044. @cindex hyperlinks, adding new types
  8045. Org has a large number of hyperlink types built-in
  8046. (@pxref{Hyperlinks}). If you would like to add new link types, it
  8047. provides an interface for doing so. Let's look at an example file
  8048. @file{org-man.el} that will add support for creating links like
  8049. @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
  8050. emacs:
  8051. @lisp
  8052. ;;; org-man.el - Support for links to manpages in Org
  8053. (require 'org)
  8054. (org-add-link-type "man" 'org-man-open)
  8055. (add-hook 'org-store-link-functions 'org-man-store-link)
  8056. (defcustom org-man-command 'man
  8057. "The Emacs command to be used to display a man page."
  8058. :group 'org-link
  8059. :type '(choice (const man) (const woman)))
  8060. (defun org-man-open (path)
  8061. "Visit the manpage on PATH.
  8062. PATH should be a topic that can be thrown at the man command."
  8063. (funcall org-man-command path))
  8064. (defun org-man-store-link ()
  8065. "Store a link to a manpage."
  8066. (when (memq major-mode '(Man-mode woman-mode))
  8067. ;; This is a man page, we do make this link
  8068. (let* ((page (org-man-get-page-name))
  8069. (link (concat "man:" page))
  8070. (description (format "Manpage for %s" page)))
  8071. (org-store-link-props
  8072. :type "man"
  8073. :link link
  8074. :description description))))
  8075. (defun org-man-get-page-name ()
  8076. "Extract the page name from the buffer name."
  8077. ;; This works for both `Man-mode' and `woman-mode'.
  8078. (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
  8079. (match-string 1 (buffer-name))
  8080. (error "Cannot create link to this man page")))
  8081. (provide 'org-man)
  8082. ;;; org-man.el ends here
  8083. @end lisp
  8084. @noindent
  8085. You would activate this new link type in @file{.emacs} with
  8086. @lisp
  8087. (require 'org-man)
  8088. @end lisp
  8089. @noindent
  8090. Let's go through the file and see what it does.
  8091. @enumerate
  8092. @item
  8093. It does @code{(require 'org)} to make sure that @file{org.el} has been
  8094. loaded.
  8095. @item
  8096. The next line calls @code{org-add-link-type} to define a new link type
  8097. with prefix @samp{man}. The call also contains the name of a function
  8098. that will be called to follow such a link.
  8099. @item
  8100. The next line adds a function to @code{org-store-link-functions}, in
  8101. order to allow the command @kbd{C-c l} to record a useful link in a
  8102. buffer displaying a man page.
  8103. @end enumerate
  8104. The rest of the file defines the necessary variables and functions.
  8105. First there is a customization variable that determines which emacs
  8106. command should be used to display man pages. There are two options,
  8107. @code{man} and @code{woman}. Then the function to follow a link is
  8108. defined. It gets the link path as an argument - in this case the link
  8109. path is just a topic for the manual command. The function calls the
  8110. value of @code{org-man-command} to display the man page.
  8111. Finally the function @code{org-man-store-link} is defined. When you try
  8112. to store a link with @kbd{C-c l}, also this function will be called to
  8113. try to make a link. The function must first decide if it is supposed to
  8114. create the link for this buffer type, we do this by checking the value
  8115. of the variable @code{major-mode}. If not, the function must exit and
  8116. return the value @code{nil}. If yes, the link is created by getting the
  8117. manual topic from the buffer name and prefixing it with the string
  8118. @samp{man:}. Then it must call the command @code{org-store-link-props}
  8119. and set the @code{:type} and @code{:link} properties. Optionally you
  8120. can also set the @code{:description} property to provide a default for
  8121. the link description when the link is later inserted into an Org
  8122. buffer with @kbd{C-c C-l}.
  8123. @node Tables in arbitrary syntax, Dynamic blocks, Adding hyperlink types, Hacking
  8124. @section Tables and lists in arbitrary syntax
  8125. @cindex tables, in other modes
  8126. @cindex lists, in other modes
  8127. @cindex Orgtbl mode
  8128. Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
  8129. frequent feature request has been to make it work with native tables in
  8130. specific languages, for example La@TeX{}. However, this is extremely
  8131. hard to do in a general way, would lead to a customization nightmare,
  8132. and would take away much of the simplicity of the Orgtbl mode table
  8133. editor.
  8134. This appendix describes a different approach. We keep the Orgtbl mode
  8135. table in its native format (the @i{source table}), and use a custom
  8136. function to @i{translate} the table to the correct syntax, and to
  8137. @i{install} it in the right location (the @i{target table}). This puts
  8138. the burden of writing conversion functions on the user, but it allows
  8139. for a very flexible system.
  8140. Bastien added the ability to do the same with lists. You can use Org's
  8141. facilities to edit and structure lists by turning @code{orgstruct-mode}
  8142. on, then locally exporting such lists in another format (HTML, La@TeX{}
  8143. or Texinfo.)
  8144. @menu
  8145. * Radio tables:: Sending and receiving
  8146. * A LaTeX example:: Step by step, almost a tutorial
  8147. * Translator functions:: Copy and modify
  8148. * Radio lists:: Doing the same for lists
  8149. @end menu
  8150. @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
  8151. @subsection Radio tables
  8152. @cindex radio tables
  8153. To define the location of the target table, you first need to create two
  8154. lines that are comments in the current mode, but contain magic words for
  8155. Orgtbl mode to find. Orgtbl mode will insert the translated table
  8156. between these lines, replacing whatever was there before. For example:
  8157. @example
  8158. /* BEGIN RECEIVE ORGTBL table_name */
  8159. /* END RECEIVE ORGTBL table_name */
  8160. @end example
  8161. @noindent
  8162. Just above the source table, we put a special line that tells
  8163. Orgtbl mode how to translate this table and where to install it. For
  8164. example:
  8165. @example
  8166. #+ORGTBL: SEND table_name translation_function arguments....
  8167. @end example
  8168. @noindent
  8169. @code{table_name} is the reference name for the table that is also used
  8170. in the receiver lines. @code{translation_function} is the Lisp function
  8171. that does the translation. Furthermore, the line can contain a list of
  8172. arguments (alternating key and value) at the end. The arguments will be
  8173. passed as a property list to the translation function for
  8174. interpretation. A few standard parameters are already recognized and
  8175. acted upon before the translation function is called:
  8176. @table @code
  8177. @item :skip N
  8178. Skip the first N lines of the table. Hlines do count as separate lines for
  8179. this parameter!
  8180. @item :skipcols (n1 n2 ...)
  8181. List of columns that should be skipped. If the table has a column with
  8182. calculation marks, that column is automatically discarded as well.
  8183. Please note that the translator function sees the table @emph{after} the
  8184. removal of these columns, the function never knows that there have been
  8185. additional columns.
  8186. @end table
  8187. @noindent
  8188. The one problem remaining is how to keep the source table in the buffer
  8189. without disturbing the normal workings of the file, for example during
  8190. compilation of a C file or processing of a La@TeX{} file. There are a
  8191. number of different solutions:
  8192. @itemize @bullet
  8193. @item
  8194. The table could be placed in a block comment if that is supported by the
  8195. language. For example, in C mode you could wrap the table between
  8196. @samp{/*} and @samp{*/} lines.
  8197. @item
  8198. Sometimes it is possible to put the table after some kind of @i{END}
  8199. statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
  8200. in La@TeX{}.
  8201. @item
  8202. You can just comment the table line by line whenever you want to process
  8203. the file, and uncomment it whenever you need to edit the table. This
  8204. only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
  8205. make this comment-toggling very easy, in particular if you bind it to a
  8206. key.
  8207. @end itemize
  8208. @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
  8209. @subsection A LaTeX example of radio tables
  8210. @cindex LaTeX, and Orgtbl mode
  8211. The best way to wrap the source table in La@TeX{} is to use the
  8212. @code{comment} environment provided by @file{comment.sty}. It has to be
  8213. activated by placing @code{\usepackage@{comment@}} into the document
  8214. header. Orgtbl mode can insert a radio table skeleton@footnote{By
  8215. default this works only for La@TeX{}, HTML, and Texinfo. Configure the
  8216. variable @code{orgtbl-radio-tables} to install templates for other
  8217. modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
  8218. be prompted for a table name, lets say we use @samp{salesfigures}. You
  8219. will then get the following template:
  8220. @cindex #+ORGTBL: SEND
  8221. @example
  8222. % BEGIN RECEIVE ORGTBL salesfigures
  8223. % END RECEIVE ORGTBL salesfigures
  8224. \begin@{comment@}
  8225. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  8226. | | |
  8227. \end@{comment@}
  8228. @end example
  8229. @noindent
  8230. The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
  8231. @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
  8232. into the receiver location with name @code{salesfigures}. You may now
  8233. fill in the table, feel free to use the spreadsheet features@footnote{If
  8234. the @samp{#+TBLFM} line contains an odd number of dollar characters,
  8235. this may cause problems with font-lock in LaTeX mode. As shown in the
  8236. example you can fix this by adding an extra line inside the
  8237. @code{comment} environment that is used to balance the dollar
  8238. expressions. If you are using AUCTeX with the font-latex library, a
  8239. much better solution is to add the @code{comment} environment to the
  8240. variable @code{LaTeX-verbatim-environments}.}:
  8241. @example
  8242. % BEGIN RECEIVE ORGTBL salesfigures
  8243. % END RECEIVE ORGTBL salesfigures
  8244. \begin@{comment@}
  8245. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  8246. | Month | Days | Nr sold | per day |
  8247. |-------+------+---------+---------|
  8248. | Jan | 23 | 55 | 2.4 |
  8249. | Feb | 21 | 16 | 0.8 |
  8250. | March | 22 | 278 | 12.6 |
  8251. #+TBLFM: $4=$3/$2;%.1f
  8252. % $ (optional extra dollar to keep font-lock happy, see footnote)
  8253. \end@{comment@}
  8254. @end example
  8255. @noindent
  8256. When you are done, press @kbd{C-c C-c} in the table to get the converted
  8257. table inserted between the two marker lines.
  8258. Now lets assume you want to make the table header by hand, because you
  8259. want to control how columns are aligned etc. In this case we make sure
  8260. that the table translator does skip the first 2 lines of the source
  8261. table, and tell the command to work as a @i{splice}, i.e. to not produce
  8262. header and footer commands of the target table:
  8263. @example
  8264. \begin@{tabular@}@{lrrr@}
  8265. Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
  8266. % BEGIN RECEIVE ORGTBL salesfigures
  8267. % END RECEIVE ORGTBL salesfigures
  8268. \end@{tabular@}
  8269. %
  8270. \begin@{comment@}
  8271. #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
  8272. | Month | Days | Nr sold | per day |
  8273. |-------+------+---------+---------|
  8274. | Jan | 23 | 55 | 2.4 |
  8275. | Feb | 21 | 16 | 0.8 |
  8276. | March | 22 | 278 | 12.6 |
  8277. #+TBLFM: $4=$3/$2;%.1f
  8278. \end@{comment@}
  8279. @end example
  8280. The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
  8281. Orgtbl mode. It uses a @code{tabular} environment to typeset the table
  8282. and marks horizontal lines with @code{\hline}. Furthermore, it
  8283. interprets the following parameters (see also @ref{Translator functions}):
  8284. @table @code
  8285. @item :splice nil/t
  8286. When set to t, return only table body lines, don't wrap them into a
  8287. tabular environment. Default is nil.
  8288. @item :fmt fmt
  8289. A format to be used to wrap each field, should contain @code{%s} for the
  8290. original field value. For example, to wrap each field value in dollars,
  8291. you could use @code{:fmt "$%s$"}. This may also be a property list with
  8292. column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
  8293. A function of one argument can be used in place of the strings; the
  8294. function must return a formatted string.
  8295. @item :efmt efmt
  8296. Use this format to print numbers with exponentials. The format should
  8297. have @code{%s} twice for inserting mantissa and exponent, for example
  8298. @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
  8299. may also be a property list with column numbers and formats, for example
  8300. @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
  8301. @code{efmt} has been applied to a value, @code{fmt} will also be
  8302. applied. Similar to @code{fmt}, functions of two arguments can be
  8303. supplied instead of strings.
  8304. @end table
  8305. @node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
  8306. @subsection Translator functions
  8307. @cindex HTML, and Orgtbl mode
  8308. @cindex translator function
  8309. Orgtbl mode has several translator functions built-in: @code{orgtbl-to-csv}
  8310. (comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values)
  8311. @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and @code{orgtbl-to-texinfo}.
  8312. Except for @code{orgtbl-to-html}@footnote{The HTML translator uses the same
  8313. code that produces tables during HTML export.}, these all use a generic
  8314. translator, @code{orgtbl-to-generic}. For example, @code{orgtbl-to-latex}
  8315. itself is a very short function that computes the column definitions for the
  8316. @code{tabular} environment, defines a few field and line separators and then
  8317. hands over to the generic translator. Here is the entire code:
  8318. @lisp
  8319. @group
  8320. (defun orgtbl-to-latex (table params)
  8321. "Convert the Orgtbl mode TABLE to LaTeX."
  8322. (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
  8323. org-table-last-alignment ""))
  8324. (params2
  8325. (list
  8326. :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
  8327. :tend "\\end@{tabular@}"
  8328. :lstart "" :lend " \\\\" :sep " & "
  8329. :efmt "%s\\,(%s)" :hline "\\hline")))
  8330. (orgtbl-to-generic table (org-combine-plists params2 params))))
  8331. @end group
  8332. @end lisp
  8333. As you can see, the properties passed into the function (variable
  8334. @var{PARAMS}) are combined with the ones newly defined in the function
  8335. (variable @var{PARAMS2}). The ones passed into the function (i.e. the
  8336. ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
  8337. would like to use the La@TeX{} translator, but wanted the line endings to
  8338. be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
  8339. overrule the default with
  8340. @example
  8341. #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
  8342. @end example
  8343. For a new language, you can either write your own converter function in
  8344. analogy with the La@TeX{} translator, or you can use the generic function
  8345. directly. For example, if you have a language where a table is started
  8346. with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
  8347. started with @samp{!BL!}, ended with @samp{!EL!} and where the field
  8348. separator is a TAB, you could call the generic translator like this (on
  8349. a single line!):
  8350. @example
  8351. #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
  8352. :lstart "!BL! " :lend " !EL!" :sep "\t"
  8353. @end example
  8354. @noindent
  8355. Please check the documentation string of the function
  8356. @code{orgtbl-to-generic} for a full list of parameters understood by
  8357. that function and remember that you can pass each of them into
  8358. @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
  8359. using the generic function.
  8360. Of course you can also write a completely new function doing complicated
  8361. things the generic translator cannot do. A translator function takes
  8362. two arguments. The first argument is the table, a list of lines, each
  8363. line either the symbol @code{hline} or a list of fields. The second
  8364. argument is the property list containing all parameters specified in the
  8365. @samp{#+ORGTBL: SEND} line. The function must return a single string
  8366. containing the formatted table. If you write a generally useful
  8367. translator, please post it on @code{emacs-orgmode@@gnu.org} so that
  8368. others can benefit from your work.
  8369. @node Radio lists, , Translator functions, Tables in arbitrary syntax
  8370. @subsection Radio lists
  8371. @cindex radio lists
  8372. @cindex org-list-insert-radio-list
  8373. Sending and receiving radio lists works exactly the same way than
  8374. sending and receiving radio tables (@pxref{Radio tables}) @footnote{You
  8375. need to load the @code{org-export-latex.el} package to use radio lists
  8376. since the relevant code is there for now.}. As for radio tables, you
  8377. can insert radio lists templates in HTML, La@TeX{} and Texinfo modes by
  8378. calling @code{org-list-insert-radio-list}.
  8379. Here are the differences with radio tables:
  8380. @itemize @minus
  8381. @item
  8382. Use @code{ORGLST} instead of @code{ORGTBL}.
  8383. @item
  8384. The available translation functions for radio lists don't take
  8385. parameters.
  8386. @item
  8387. `C-c C-c' will work when pressed on the first item of the list.
  8388. @end itemize
  8389. Here is a La@TeX{} example. Let's say that you have this in your
  8390. La@TeX{} file:
  8391. @example
  8392. % BEGIN RECEIVE ORGLST to-buy
  8393. % END RECEIVE ORGLST to-buy
  8394. \begin@{comment@}
  8395. #+ORGLIST: SEND to-buy orgtbl-to-latex
  8396. - a new house
  8397. - a new computer
  8398. + a new keyboard
  8399. + a new mouse
  8400. - a new life
  8401. \end@{comment@}
  8402. @end example
  8403. Pressing `C-c C-c' on @code{a new house} and will insert the converted
  8404. La@TeX{} list between the two marker lines.
  8405. @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
  8406. @section Dynamic blocks
  8407. @cindex dynamic blocks
  8408. Org documents can contain @emph{dynamic blocks}. These are
  8409. specially marked regions that are updated by some user-written function.
  8410. A good example for such a block is the clock table inserted by the
  8411. command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
  8412. Dynamic block are enclosed by a BEGIN-END structure that assigns a name
  8413. to the block and can also specify parameters for the function producing
  8414. the content of the block.
  8415. #+BEGIN:dynamic block
  8416. @example
  8417. #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
  8418. #+END:
  8419. @end example
  8420. Dynamic blocks are updated with the following commands
  8421. @table @kbd
  8422. @kindex C-c C-x C-u
  8423. @item C-c C-x C-u
  8424. Update dynamic block at point.
  8425. @kindex C-u C-c C-x C-u
  8426. @item C-u C-c C-x C-u
  8427. Update all dynamic blocks in the current file.
  8428. @end table
  8429. Updating a dynamic block means to remove all the text between BEGIN and
  8430. END, parse the BEGIN line for parameters and then call the specific
  8431. writer function for this block to insert the new content. If you want
  8432. to use the original content in the writer function, you can use the
  8433. extra parameter @code{:content}.
  8434. For a block with name @code{myblock}, the writer function is
  8435. @code{org-dblock-write:myblock} with as only parameter a property list
  8436. with the parameters given in the begin line. Here is a trivial example
  8437. of a block that keeps track of when the block update function was last
  8438. run:
  8439. @example
  8440. #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
  8441. #+END:
  8442. @end example
  8443. @noindent
  8444. The corresponding block writer function could look like this:
  8445. @lisp
  8446. (defun org-dblock-write:block-update-time (params)
  8447. (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
  8448. (insert "Last block update at: "
  8449. (format-time-string fmt (current-time)))))
  8450. @end lisp
  8451. If you want to make sure that all dynamic blocks are always up-to-date,
  8452. you could add the function @code{org-update-all-dblocks} to a hook, for
  8453. example @code{before-save-hook}. @code{org-update-all-dblocks} is
  8454. written in a way that is does nothing in buffers that are not in
  8455. @code{org-mode}.
  8456. @node Special agenda views, Using the property API, Dynamic blocks, Hacking
  8457. @section Special agenda views
  8458. @cindex agenda views, user-defined
  8459. Org provides a special hook that can be used to narrow down the
  8460. selection made by any of the agenda views. You may specify a function
  8461. that is used at each match to verify if the match should indeed be part
  8462. of the agenda view, and if not, how much should be skipped.
  8463. Let's say you want to produce a list of projects that contain a WAITING
  8464. tag anywhere in the project tree. Let's further assume that you have
  8465. marked all tree headings that define a project with the TODO keyword
  8466. PROJECT. In this case you would run a TODO search for the keyword
  8467. PROJECT, but skip the match unless there is a WAITING tag anywhere in
  8468. the subtree belonging to the project line.
  8469. To achieve this, you must write a function that searches the subtree for
  8470. the tag. If the tag is found, the function must return @code{nil} to
  8471. indicate that this match should not be skipped. If there is no such
  8472. tag, return the location of the end of the subtree, to indicate that
  8473. search should continue from there.
  8474. @lisp
  8475. (defun my-skip-unless-waiting ()
  8476. "Skip trees that are not waiting"
  8477. (let ((subtree-end (save-excursion (org-end-of-subtree t))))
  8478. (if (re-search-forward ":waiting:" subtree-end t)
  8479. nil ; tag found, do not skip
  8480. subtree-end))) ; tag not found, continue after end of subtree
  8481. @end lisp
  8482. Now you may use this function in an agenda custom command, for example
  8483. like this:
  8484. @lisp
  8485. (org-add-agenda-custom-command
  8486. '("b" todo "PROJECT"
  8487. ((org-agenda-skip-function 'my-skip-unless-waiting)
  8488. (org-agenda-overriding-header "Projects waiting for something: "))))
  8489. @end lisp
  8490. Note that this also binds @code{org-agenda-overriding-header} to get a
  8491. meaningful header in the agenda view.
  8492. A general way to create custom searches is to base them on a search for
  8493. entries with a certain level limit. If you want to study all entries with
  8494. your custom search function, simply do a search for @samp{LEVEL>0}, and then
  8495. use @code{org-agenda-skip-function} to select the entries you really want to
  8496. have.
  8497. You may also put a Lisp form into @code{org-agenda-skip-function}. In
  8498. particular, you may use the functions @code{org-agenda-skip-entry-if}
  8499. and @code{org-agenda-skip-subtree-if} in this form, for example:
  8500. @table @code
  8501. @item '(org-agenda-skip-entry-if 'scheduled)
  8502. Skip current entry if it has been scheduled.
  8503. @item '(org-agenda-skip-entry-if 'notscheduled)
  8504. Skip current entry if it has not been scheduled.
  8505. @item '(org-agenda-skip-entry-if 'deadline)
  8506. Skip current entry if it has a deadline.
  8507. @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
  8508. Skip current entry if it has a deadline, or if it is scheduled.
  8509. @item '(org-agenda-skip-entry 'regexp "regular expression")
  8510. Skip current entry if the regular expression matches in the entry.
  8511. @item '(org-agenda-skip-entry 'notregexp "regular expression")
  8512. Skip current entry unless the regular expression matches.
  8513. @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
  8514. Same as above, but check and skip the entire subtree.
  8515. @end table
  8516. Therefore we could also have written the search for WAITING projects
  8517. like this, even without defining a special function:
  8518. @lisp
  8519. (org-add-agenda-custom-command
  8520. '("b" todo "PROJECT"
  8521. ((org-agenda-skip-function '(org-agenda-skip-subtree-if
  8522. 'regexp ":waiting:"))
  8523. (org-agenda-overriding-header "Projects waiting for something: "))))
  8524. @end lisp
  8525. @node Using the property API, Using the mapping API, Special agenda views, Hacking
  8526. @section Using the property API
  8527. @cindex API, for properties
  8528. @cindex properties, API
  8529. Here is a description of the functions that can be used to work with
  8530. properties.
  8531. @defun org-entry-properties &optional pom which
  8532. Get all properties of the entry at point-or-marker POM.
  8533. This includes the TODO keyword, the tags, time strings for deadline,
  8534. scheduled, and clocking, and any additional properties defined in the
  8535. entry. The return value is an alist, keys may occur multiple times
  8536. if the property key was used several times.
  8537. POM may also be nil, in which case the current entry is used.
  8538. If WHICH is nil or `all', get all properties. If WHICH is
  8539. `special' or `standard', only get that subclass.
  8540. @end defun
  8541. @defun org-entry-get pom property &optional inherit
  8542. Get value of PROPERTY for entry at point-or-marker POM. By default,
  8543. this only looks at properties defined locally in the entry. If INHERIT
  8544. is non-nil and the entry does not have the property, then also check
  8545. higher levels of the hierarchy. If INHERIT is the symbol
  8546. @code{selective}, use inheritance if and only if the setting of
  8547. @code{org-use-property-inheritance} selects PROPERTY for inheritance.
  8548. @end defun
  8549. @defun org-entry-delete pom property
  8550. Delete the property PROPERTY from entry at point-or-marker POM.
  8551. @end defun
  8552. @defun org-entry-put pom property value
  8553. Set PROPERTY to VALUE for entry at point-or-marker POM.
  8554. @end defun
  8555. @defun org-buffer-property-keys &optional include-specials
  8556. Get all property keys in the current buffer.
  8557. @end defun
  8558. @defun org-insert-property-drawer
  8559. Insert a property drawer at point.
  8560. @end defun
  8561. @defun org-entry-put-multivalued-property pom property &rest values
  8562. Set PROPERTY at point-or-marker POM to VALUES. VALUES should be a list of
  8563. strings. They will be concatenated, with spaces as separators.
  8564. @end defun
  8565. @defun org-entry-get-multivalued-property pom property
  8566. Treat the value of the property PROPERTY as a whitespace-separated list of
  8567. values and return the values as a list of strings.
  8568. @end defun
  8569. @defun org-entry-add-to-multivalued-property pom property value
  8570. Treat the value of the property PROPERTY as a whitespace-separated list of
  8571. values and make sure that VALUE is in this list.
  8572. @end defun
  8573. @defun org-entry-remove-from-multivalued-property pom property value
  8574. Treat the value of the property PROPERTY as a whitespace-separated list of
  8575. values and make sure that VALUE is @emph{not} in this list.
  8576. @end defun
  8577. @defun org-entry-member-in-multivalued-property pom property value
  8578. Treat the value of the property PROPERTY as a whitespace-separated list of
  8579. values and check if VALUE is in this list.
  8580. @end defun
  8581. @node Using the mapping API, , Using the property API, Hacking
  8582. @section Using the mapping API
  8583. @cindex API, for mapping
  8584. @cindex mapping entries, API
  8585. Org has sophisticated mapping capabilities to find all entries satisfying
  8586. certain criteria. Internally, this functionality is used to produce agenda
  8587. views, but there is also an API that can be used to execute arbitrary
  8588. functions for each or selected entries. The main entry point for this API
  8589. is:
  8590. @defun org-map-entries func &optional match scope &rest skip
  8591. Call FUNC at each headline selected by MATCH in SCOPE.
  8592. FUNC is a function or a lisp form. The function will be called without
  8593. arguments, with the cursor positioned at the beginning of the headline.
  8594. The return values of all calls to the function will be collected and
  8595. returned as a list.
  8596. MATCH is a tags/property/todo match as it is used in the agenda match view.
  8597. Only headlines that are matched by this query will be considered during
  8598. the iteration. When MATCH is nil or t, all headlines will be
  8599. visited by the iteration.
  8600. SCOPE determines the scope of this command. It can be any of:
  8601. @example
  8602. nil @r{the current buffer, respecting the restriction if any}
  8603. tree @r{the subtree started with the entry at point}
  8604. file @r{the current buffer, without restriction}
  8605. file-with-archives
  8606. @r{the current buffer, and any archives associated with it}
  8607. agenda @r{all agenda files}
  8608. agenda-with-archives
  8609. @r{all agenda files with any archive files associated with them}
  8610. (file1 file2 ...)
  8611. @r{if this is a list, all files in the list will be scanned}
  8612. @end example
  8613. The remaining args are treated as settings for the skipping facilities of
  8614. the scanner. The following items can be given here:
  8615. @example
  8616. archive @r{skip trees with the archive tag}
  8617. comment @r{skip trees with the COMMENT keyword}
  8618. function or Lisp form
  8619. @r{will be used as value for @code{org-agenda-skip-function},}
  8620. @r{so whenever the the function returns t, FUNC}
  8621. @r{will not be called for that entry and search will}
  8622. @r{continue from the point where the function leaves it}
  8623. @end example
  8624. @end defun
  8625. The function given to that mapping routine can really do anything you like.
  8626. It can uce the property API (@pxref{Using the property API}) to gather more
  8627. information about the entry, or in order to change metadate in the entry.
  8628. Here are a couple of functions that might be handy:
  8629. @defun org-todo &optional arg
  8630. Change the TODO state of the entry, see the docstring of the functions for
  8631. the many possible values for the argument ARG.
  8632. @end defun
  8633. @defun org-priority &optional action
  8634. Change the priority of the entry, see the docstring of this function for the
  8635. possible values for ACTION.
  8636. @end defun
  8637. @defun org-toggle-tag tag &optional onoff
  8638. Toggle the tag TAG in the current entry. Setting ONOFF to either @code{on}
  8639. or @code{off} will not toggle tag, but ensure that it is either on or off.
  8640. @end defun
  8641. @defun org-promote
  8642. Promote the current entry.
  8643. @end defun
  8644. @defun org-demote
  8645. Demote the current entry.
  8646. @end defun
  8647. Here is a simple example that will turn all entries in the current file with
  8648. a tag @code{TOMORROW} into TODO entries with the keyword @code{UPCOMING}.
  8649. Entries in comment trees and in archive trees will be ignored.
  8650. @lisp
  8651. (org-map-entries
  8652. '(org-todo "UPCOMING")
  8653. "+TOMORROW" 'file 'archive 'comment)
  8654. @end lisp
  8655. The following example counts the number of entries with TODO keyword
  8656. @code{WAITING}, in all agenda files.
  8657. @lisp
  8658. (length (org-map-entries t "/+WAITING" 'agenda))
  8659. @end lisp
  8660. @node History and Acknowledgments, Main Index, Hacking, Top
  8661. @appendix History and Acknowledgments
  8662. @cindex acknowledgments
  8663. @cindex history
  8664. @cindex thanks
  8665. Org was borne in 2003, out of frustration over the user interface
  8666. of the Emacs Outline mode. I was trying to organize my notes and
  8667. projects, and using Emacs seemed to be the natural way to go. However,
  8668. having to remember eleven different commands with two or three keys per
  8669. command, only to hide and show parts of the outline tree, that seemed
  8670. entirely unacceptable to me. Also, when using outlines to take notes, I
  8671. constantly want to restructure the tree, organizing it parallel to my
  8672. thoughts and plans. @emph{Visibility cycling} and @emph{structure
  8673. editing} were originally implemented in the package
  8674. @file{outline-magic.el}, but quickly moved to the more general
  8675. @file{org.el}. As this environment became comfortable for project
  8676. planning, the next step was adding @emph{TODO entries}, basic @emph{time
  8677. stamps}, and @emph{table support}. These areas highlight the two main
  8678. goals that Org still has today: To create a new, outline-based,
  8679. plain text mode with innovative and intuitive editing features, and to
  8680. incorporate project planning functionality directly into a notes file.
  8681. A special thanks goes to @i{Bastien Guerry} who has not only writen a large
  8682. number of extensions to Org (most of them integrated into the core by now),
  8683. but has also helped the development and maintenance of Org so much that he
  8684. should be considered co-author of this package.
  8685. Since the first release, literally thousands of emails to me or on
  8686. @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
  8687. reports, feedback, new ideas, and sometimes patches and add-on code.
  8688. Many thanks to everyone who has helped to improve this package. I am
  8689. trying to keep here a list of the people who had significant influence
  8690. in shaping one or more aspects of Org. The list may not be
  8691. complete, if I have forgotten someone, please accept my apologies and
  8692. let me know.
  8693. @itemize @bullet
  8694. @item
  8695. @i{Russel Adams} came up with the idea for drawers.
  8696. @item
  8697. @i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
  8698. @item
  8699. @i{Christophe Bataillon} created the great unicorn logo that we use on the
  8700. Org-mode website.
  8701. @item
  8702. @i{Alex Bochannek} provided a patch for rounding time stamps.
  8703. @item
  8704. @i{Charles Cave}'s suggestion sparked the implementation of templates
  8705. for Remember.
  8706. @item
  8707. @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
  8708. specified time.
  8709. @item
  8710. @i{Gregory Chernov} patched support for lisp forms into table
  8711. calculations and improved XEmacs compatibility, in particular by porting
  8712. @file{nouline.el} to XEmacs.
  8713. @item
  8714. @i{Sacha Chua} suggested to copy some linking code from Planner.
  8715. @item
  8716. @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
  8717. came up with the idea of properties, and that there should be an API for
  8718. them.
  8719. @item
  8720. @i{Kees Dullemond} used to edit projects lists directly in HTML and so
  8721. inspired some of the early development, including HTML export. He also
  8722. asked for a way to narrow wide table columns.
  8723. @item
  8724. @i{Christian Egli} converted the documentation into Texinfo format,
  8725. patched CSS formatting into the HTML exporter, and inspired the agenda.
  8726. @item
  8727. @i{David Emery} provided a patch for custom CSS support in exported
  8728. HTML agendas.
  8729. @item
  8730. @i{Nic Ferrier} contributed mailcap and XOXO support.
  8731. @item
  8732. @i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
  8733. @item
  8734. @i{John Foerch} figured out how to make incremental search show context
  8735. around a match in a hidden outline tree.
  8736. @item
  8737. @i{Niels Giesen} had the idea to automatically archive DONE trees.
  8738. @item
  8739. @i{Bastien Guerry} wrote the La@TeX{} exporter and @file{org-bibtex.el}, and
  8740. has been prolific with patches, ideas, and bug reports.
  8741. @item
  8742. @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
  8743. @item
  8744. @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
  8745. task state change logging, and the clocktable. His clear explanations have
  8746. been critical when we started to adopt the GIT version control system.
  8747. @item
  8748. @i{Manuel Hermenegildo} has contributed various ideas, small fixed and
  8749. patches.
  8750. @item
  8751. @i{Phil Jackson} wrote @file{org-irc.el}.
  8752. @item
  8753. @i{Scott Jaderholm} proposed footnotes, control over whitespace between
  8754. folded entries, and column view for properties.
  8755. @item
  8756. @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
  8757. @item
  8758. @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
  8759. provided frequent feedback and some patches.
  8760. @item
  8761. @i{Jason F. McBrayer} suggested agenda export to CSV format.
  8762. @item
  8763. @i{Max Mikhanosha} came up with the idea of refiling.
  8764. @item
  8765. @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
  8766. basis.
  8767. @item
  8768. @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
  8769. happy.
  8770. @item
  8771. @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file
  8772. and to be able to quickly restrict the agenda to a subtree.
  8773. @item
  8774. @i{Todd Neal} provided patches for links to Info files and elisp forms.
  8775. @item
  8776. @i{Tim O'Callaghan} suggested in-file links, search options for general
  8777. file links, and TAGS.
  8778. @item
  8779. @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
  8780. into Japanese.
  8781. @item
  8782. @i{Oliver Oppitz} suggested multi-state TODO items.
  8783. @item
  8784. @i{Scott Otterson} sparked the introduction of descriptive text for
  8785. links, among other things.
  8786. @item
  8787. @i{Pete Phillips} helped during the development of the TAGS feature, and
  8788. provided frequent feedback.
  8789. @item
  8790. @i{T.V. Raman} reported bugs and suggested improvements.
  8791. @item
  8792. @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
  8793. control.
  8794. @item
  8795. @i{Kevin Rogers} contributed code to access VM files on remote hosts.
  8796. @item
  8797. @i{Sebastian Rose} wrote @file{org-info.js}, a Java script for displaying
  8798. webpages derived from Org using an Info-like, or a folding interface with
  8799. single key navigation.
  8800. @item
  8801. @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
  8802. conflict with @file{allout.el}.
  8803. @item
  8804. @i{Jason Riedy} generalized the send-receive mechanism for orgtbl tables with
  8805. extensive patches.
  8806. @item
  8807. @i{Philip Rooke} created the Org reference card, provided lots
  8808. of feedback, developed and applied standards to the Org documentation.
  8809. @item
  8810. @i{Christian Schlauer} proposed angular brackets around links, among
  8811. other things.
  8812. @item
  8813. @i{Eric Schulte} wrote @file{org-plot.el}.
  8814. @item
  8815. Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
  8816. @file{organizer-mode.el}.
  8817. @item
  8818. @i{Ilya Shlyakhter} proposed the Archive Sibling.
  8819. @item
  8820. @i{Stathis Sideris} wrote the @file{ditaa.jar} ASCII to PNG converter that is
  8821. now packaged into Org's @file{contrib} directory.
  8822. @item
  8823. @i{Daniel Sinder} came up with the idea of internal archiving by locking
  8824. subtrees.
  8825. @item
  8826. @i{Dale Smith} proposed link abbreviations.
  8827. @item
  8828. @i{James TD Smith} has contributed a large number of patches for useful
  8829. tweaks and features.
  8830. @item
  8831. @i{Adam Spiers} asked for global linking commands, inspired the link
  8832. extension system, added support for mairix, and proposed the mapping API.
  8833. @item
  8834. @i{Andy Stewart} contributed code to @file{org-w3m.el}, to copy HTML content
  8835. with links transformation to Org syntax.
  8836. @item
  8837. @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
  8838. chapter about publishing.
  8839. @item
  8840. @i{J@"urgen Vollmer} contributed code generating the table of contents
  8841. in HTML output.
  8842. @item
  8843. @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
  8844. keyword.
  8845. @item
  8846. @i{David Wainberg} suggested archiving, and improvements to the linking
  8847. system.
  8848. @item
  8849. @i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
  8850. @file{muse.el}, which have similar goals as Org. Initially the
  8851. development of Org was fully independent because I was not aware of the
  8852. existence of these packages. But with time I have accasionally looked
  8853. at John's code and learned a lot from it. John has also contributed a
  8854. number of great ideas and patches directly to Org, including the attachment
  8855. system (@file{org-attach.el}) and integration with Apple Mail
  8856. (@file{org-mac-message.el}).
  8857. @item
  8858. @i{Carsten Wimmer} suggested some changes and helped fix a bug in
  8859. linking to Gnus.
  8860. @item
  8861. @i{Roland Winkler} requested additional key bindings to make Org
  8862. work on a tty.
  8863. @item
  8864. @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
  8865. and contributed various ideas and code snippets.
  8866. @end itemize
  8867. @node Main Index, Key Index, History and Acknowledgments, Top
  8868. @unnumbered The Main Index
  8869. @printindex cp
  8870. @node Key Index, , Main Index, Top
  8871. @unnumbered Key Index
  8872. @printindex ky
  8873. @bye
  8874. @ignore
  8875. arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
  8876. @end ignore
  8877. @c Local variables:
  8878. @c ispell-local-dictionary: "en_US-w_accents"
  8879. @c ispell-local-pdict: "./.aspell.org.pws"
  8880. @c fill-column: 77
  8881. @c End: