org.texi 362 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188
  1. \input texinfo
  2. @c %**start of header
  3. @setfilename ../../info/org
  4. @settitle The Org Manual
  5. @set VERSION 6.02b
  6. @set DATE April 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.1 or
  35. any later version published by the Free Software Foundation; with no
  36. Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
  37. and with the Back-Cover Texts as in (a) below. A copy of the
  38. license is included in the section entitled ``GNU Free Documentation
  39. License.''
  40. (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
  41. this GNU Manual, like GNU software. Copies published by the Free
  42. Software Foundation raise funds for GNU development.''
  43. @end quotation
  44. @end copying
  45. @titlepage
  46. @title The Org Manual
  47. @subtitle Release @value{VERSION}
  48. @author by Carsten Dominik
  49. @c The following two commands start the copyright page.
  50. @page
  51. @vskip 0pt plus 1filll
  52. @insertcopying
  53. @end titlepage
  54. @c Output the table of contents at the beginning.
  55. @contents
  56. @ifnottex
  57. @node Top, Introduction, (dir), (dir)
  58. @top Org Mode Manual
  59. @insertcopying
  60. @end ifnottex
  61. @menu
  62. * Introduction:: Getting started
  63. * Document Structure:: A tree works like your brain
  64. * Tables:: Pure magic for quick formatting
  65. * Hyperlinks:: Notes in context
  66. * TODO Items:: Every tree branch can be a TODO item
  67. * Tags:: Tagging headlines and matching sets of tags
  68. * Properties and Columns:: Storing information about an entry
  69. * Dates and Times:: Making items useful for planning
  70. * Remember:: Quickly adding nodes to the outline tree
  71. * Agenda Views:: Collecting information into views
  72. * Embedded LaTeX:: LaTeX fragments and formulas
  73. * Exporting:: Sharing and publishing of notes
  74. * Publishing:: Create a web site of linked Org files
  75. * Miscellaneous:: All the rest which did not fit elsewhere
  76. * Extensions and Hacking:: It is possible to write add-on code
  77. * History and Acknowledgments:: How Org came into being
  78. * Main Index:: An index of Org's concepts and features
  79. * Key Index:: Key bindings and where they are described
  80. @detailmenu
  81. --- The Detailed Node Listing ---
  82. Introduction
  83. * Summary:: Brief summary of what Org does
  84. * Installation:: How to install a downloaded version of Org
  85. * Activation:: How to activate Org for certain buffers
  86. * Feedback:: Bug reports, ideas, patches etc.
  87. * Conventions:: Type-setting conventions in the manual
  88. Document Structure
  89. * Outlines:: Org is based on Outline mode
  90. * Headlines:: How to typeset Org tree headlines
  91. * Visibility cycling:: Show and hide, much simplified
  92. * Motion:: Jumping to other headlines
  93. * Structure editing:: Changing sequence and level of headlines
  94. * Archiving:: Move done task trees to a different place
  95. * Sparse trees:: Matches embedded in context
  96. * Plain lists:: Additional structure within an entry
  97. * Drawers:: Tucking stuff away
  98. * Orgstruct mode:: Structure editing outside Org
  99. Archiving
  100. * ARCHIVE tag:: Marking a tree as inactive
  101. * Moving subtrees:: Moving a tree to an archive file
  102. Tables
  103. * Built-in table editor:: Simple tables
  104. * Narrow columns:: Stop wasting space in tables
  105. * Column groups:: Grouping to trigger vertical lines
  106. * Orgtbl mode:: The table editor as minor mode
  107. * The spreadsheet:: The table editor has spreadsheet capabilities
  108. The spreadsheet
  109. * References:: How to refer to another field or range
  110. * Formula syntax for Calc:: Using Calc to compute stuff
  111. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  112. * Field formulas:: Formulas valid for a single field
  113. * Column formulas:: Formulas valid for an entire column
  114. * Editing and debugging formulas:: Fixing formulas
  115. * Updating the table:: Recomputing all dependent fields
  116. * Advanced features:: Field names, parameters and automatic recalc
  117. Hyperlinks
  118. * Link format:: How links in Org are formatted
  119. * Internal links:: Links to other places in the current file
  120. * External links:: URL-like links to the world
  121. * Handling links:: Creating, inserting and following
  122. * Using links outside Org:: Linking from my C source code?
  123. * Link abbreviations:: Shortcuts for writing complex links
  124. * Search options:: Linking to a specific location
  125. * Custom searches:: When the default search is not enough
  126. Internal links
  127. * Radio targets:: Make targets trigger links in plain text
  128. TODO Items
  129. * TODO basics:: Marking and displaying TODO entries
  130. * TODO extensions:: Workflow and assignments
  131. * Progress logging:: Dates and notes for progress
  132. * Priorities:: Some things are more important than others
  133. * Breaking down tasks:: Splitting a task into manageable pieces
  134. * Checkboxes:: Tick-off lists
  135. Extended use of TODO keywords
  136. * Workflow states:: From TODO to DONE in steps
  137. * TODO types:: I do this, Fred does the rest
  138. * Multiple sets in one file:: Mixing it all, and still finding your way
  139. * Fast access to TODO states:: Single letter selection of a state
  140. * Per-file keywords:: Different files, different requirements
  141. * Faces for TODO keywords:: Highlighting states
  142. Progress logging
  143. * Closing items:: When was this entry marked DONE?
  144. * Tracking TODO state changes:: When did the status change?
  145. Tags
  146. * Tag inheritance:: Tags use the tree structure of the outline
  147. * Setting tags:: How to assign tags to a headline
  148. * Tag searches:: Searching for combinations of tags
  149. Properties and Columns
  150. * Property syntax:: How properties are spelled out
  151. * Special properties:: Access to other Org mode features
  152. * Property searches:: Matching property values
  153. * Property inheritance:: Passing values down the tree
  154. * Column view:: Tabular viewing and editing
  155. * Property API:: Properties for Lisp programmers
  156. Column view
  157. * Defining columns:: The COLUMNS format property
  158. * Using column view:: How to create and use column view
  159. * Capturing column view:: A dynamic block for column view
  160. Defining columns
  161. * Scope of column definitions:: Where defined, where valid?
  162. * Column attributes:: Appearance and content of a column
  163. Dates and Times
  164. * Timestamps:: Assigning a time to a tree entry
  165. * Creating timestamps:: Commands which insert timestamps
  166. * Deadlines and scheduling:: Planning your work
  167. * Clocking work time:: Tracking how long you spend on a task
  168. * Effort estimates:: Planning work effort in advance
  169. Creating timestamps
  170. * The date/time prompt:: How Org mode helps you entering date and time
  171. * Custom time format:: Making dates look different
  172. Deadlines and scheduling
  173. * Inserting deadline/schedule:: Planning items
  174. * Repeated tasks:: Items that show up again and again
  175. Remember
  176. * Setting up Remember:: Some code for .emacs to get things going
  177. * Remember templates:: Define the outline of different note types
  178. * Storing notes:: Directly get the note to where it belongs
  179. * Refiling notes:: Moving a note or task to a project
  180. Agenda Views
  181. * Agenda files:: Files being searched for agenda information
  182. * Agenda dispatcher:: Keyboard access to agenda views
  183. * Built-in agenda views:: What is available out of the box?
  184. * Presentation and sorting:: How agenda items are prepared for display
  185. * Agenda commands:: Remote editing of Org trees
  186. * Custom agenda views:: Defining special searches and views
  187. * Agenda column view:: Using column view for collected entries
  188. The built-in agenda views
  189. * Weekly/daily agenda:: The calendar page with current tasks
  190. * Global TODO list:: All unfinished action items
  191. * Matching tags and properties:: Structured information with fine-tuned search
  192. * Timeline:: Time-sorted view for single file
  193. * Keyword search:: Finding entries by keyword
  194. * Stuck projects:: Find projects you need to review
  195. Presentation and sorting
  196. * Categories:: Not all tasks are equal
  197. * Time-of-day specifications:: How the agenda knows the time
  198. * Sorting of agenda items:: The order of things
  199. Custom agenda views
  200. * Storing searches:: Type once, use often
  201. * Block agenda:: All the stuff you need in a single buffer
  202. * Setting Options:: Changing the rules
  203. * Exporting Agenda Views:: Writing agendas to files
  204. * Using the agenda elsewhere:: Using agenda information in other programs
  205. Embedded LaTeX
  206. * Math symbols:: TeX macros for symbols and Greek letters
  207. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  208. * LaTeX fragments:: Complex formulas made easy
  209. * Processing LaTeX fragments:: Previewing LaTeX processing
  210. * CDLaTeX mode:: Speed up entering of formulas
  211. Exporting
  212. * Markup rules:: Which structures are recognized?
  213. * Export options:: Per-file export settings
  214. * The export dispatcher:: How to access exporter commands
  215. * ASCII export:: Exporting to plain ASCII
  216. * HTML export:: Exporting to HTML
  217. * LaTeX export:: Exporting to LaTeX
  218. * XOXO export:: Exporting to XOXO
  219. * iCalendar export:: Exporting in iCalendar format
  220. Markup rules
  221. * Document title:: How the document title is determined
  222. * Headings and sections:: The main structure of the exported document
  223. * Table of contents:: If, where, how to create a table of contents
  224. * Initial text:: Text before the first headline
  225. * Lists:: Plain lists are exported
  226. * Paragraphs:: What determines beginning and ending
  227. * Literal examples:: Source code and other examples
  228. * Tables exported:: Tables are exported richly
  229. * Footnotes:: Numbers like [1]
  230. * Emphasis and monospace:: To bold or not to bold
  231. * TeX macros and LaTeX fragments:: Create special, rich export.
  232. * Horizontal rules:: A line across the page
  233. * Comment lines:: Some lines will not be exported
  234. HTML export
  235. * HTML Export commands:: How to invoke HTML export
  236. * Quoting HTML tags:: Using direct HTML in Org mode
  237. * Links:: Transformation of links for HTML
  238. * Images:: How to include images
  239. * CSS support:: Changing the appearance of the output
  240. * Javascript support:: Info and Folding in a web browser
  241. LaTeX export
  242. * LaTeX export commands:: How to invoke LaTeX export
  243. * Quoting LaTeX code:: Incorporating literal LaTeX code
  244. * Sectioning structure:: Changing sectioning in LaTeX output
  245. Publishing
  246. * Configuration:: Defining projects
  247. * Sample configuration:: Example projects
  248. * Triggering publication:: Publication commands
  249. Configuration
  250. * Project alist:: The central configuration variable
  251. * Sources and destinations:: From here to there
  252. * Selecting files:: What files are part of the project?
  253. * Publishing action:: Setting the function doing the publishing
  254. * Publishing options:: Tweaking HTML export
  255. * Publishing links:: Which links keep working after publishing?
  256. * Project page index:: Publishing a list of project files
  257. Sample configuration
  258. * Simple example:: One-component publishing
  259. * Complex example:: A multi-component publishing example
  260. Miscellaneous
  261. * Completion:: M-TAB knows what you need
  262. * Customization:: Adapting Org to your taste
  263. * In-buffer settings:: Overview of the #+KEYWORDS
  264. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  265. * Clean view:: Getting rid of leading stars in the outline
  266. * TTY keys:: Using Org on a tty
  267. * Interaction:: Other Emacs packages
  268. * Bugs:: Things which do not work perfectly
  269. Interaction with other packages
  270. * Cooperation:: Packages Org cooperates with
  271. * Conflicts:: Packages that lead to conflicts
  272. Extensions, Hooks and Hacking
  273. * Extensions:: Existing 3rd-party extensions
  274. * Adding hyperlink types:: New custom link types
  275. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  276. * Dynamic blocks:: Automatically filled blocks
  277. * Special agenda views:: Customized views
  278. * Using the property API:: Writing programs that use entry properties
  279. Tables and lists in arbitrary syntax
  280. * Radio tables:: Sending and receiving
  281. * A LaTeX example:: Step by step, almost a tutorial
  282. * Translator functions:: Copy and modify
  283. * Radio lists:: Doing the same for lists
  284. @end detailmenu
  285. @end menu
  286. @node Introduction, Document Structure, Top, Top
  287. @chapter Introduction
  288. @cindex introduction
  289. @menu
  290. * Summary:: Brief summary of what Org does
  291. * Installation:: How to install a downloaded version of Org
  292. * Activation:: How to activate Org for certain buffers
  293. * Feedback:: Bug reports, ideas, patches etc.
  294. * Conventions:: Type-setting conventions in the manual
  295. @end menu
  296. @node Summary, Installation, Introduction, Introduction
  297. @section Summary
  298. @cindex summary
  299. Org is a mode for keeping notes, maintaining TODO lists, and doing
  300. project planning with a fast and effective plain-text system.
  301. Org develops organizational tasks around NOTES files that contain
  302. lists or information about projects as plain text. Org is
  303. implemented on top of Outline mode, which makes it possible to keep the
  304. content of large files well structured. Visibility cycling and
  305. structure editing help to work with the tree. Tables are easily created
  306. with a built-in table editor. Org supports TODO items, deadlines,
  307. time stamps, and scheduling. It dynamically compiles entries into an
  308. agenda that utilizes and smoothly integrates much of the Emacs calendar
  309. and diary. Plain text URL-like links connect to websites, emails,
  310. Usenet messages, BBDB entries, and any files related to the projects.
  311. For printing and sharing of notes, an Org file can be exported as a
  312. structured ASCII file, as HTML, or (TODO and agenda items only) as an
  313. iCalendar file. It can also serve as a publishing tool for a set of
  314. linked web pages.
  315. An important design aspect that distinguishes Org from for example
  316. Planner/Muse is that it encourages to store every piece of information
  317. only once. In Planner, you have project pages, day pages and possibly
  318. other files, duplicating some information such as tasks. In Org,
  319. you only have notes files. In your notes you mark entries as tasks,
  320. label them with tags and timestamps. All necessary lists like a
  321. schedule for the day, the agenda for a meeting, tasks lists selected by
  322. tags etc are created dynamically when you need them.
  323. Org keeps simple things simple. When first fired up, it should
  324. feel like a straightforward, easy to use outliner. Complexity is not
  325. imposed, but a large amount of functionality is available when you need
  326. it. Org is a toolbox and can be used in different ways, for
  327. example as:
  328. @example
  329. @r{@bullet{} outline extension with visibility cycling and structure editing}
  330. @r{@bullet{} ASCII system and table editor for taking structured notes}
  331. @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
  332. @r{@bullet{} TODO list editor}
  333. @r{@bullet{} full agenda and planner with deadlines and work scheduling}
  334. @r{@bullet{} environment to implement David Allen's GTD system}
  335. @r{@bullet{} a basic database application}
  336. @r{@bullet{} simple hypertext system, with HTML and LaTeX export}
  337. @r{@bullet{} publishing tool to create a set of interlinked webpages}
  338. @end example
  339. Org's automatic, context sensitive table editor with spreadsheet
  340. capabilities can be integrated into any major mode by activating the
  341. minor Orgtbl mode. Using a translation step, it can be used to maintain
  342. tables in arbitrary file types, for example in La@TeX{}. The structure
  343. editing and list creation capabilities can be used outside Org with
  344. the minor Orgstruct mode.
  345. @cindex FAQ
  346. There is a website for Org which provides links to the newest
  347. version of Org, as well as additional information, frequently asked
  348. questions (FAQ), links to tutorials etc. This page is located at
  349. @uref{http://orgmode.org}.
  350. @page
  351. @node Installation, Activation, Summary, Introduction
  352. @section Installation
  353. @cindex installation
  354. @cindex XEmacs
  355. @b{Important:} @i{If Org is part of the Emacs distribution or an
  356. XEmacs package, please skip this section and go directly to
  357. @ref{Activation}.}
  358. If you have downloaded Org from the Web, either as a distribution @file{.zip}
  359. or @file{.tar} file, or as a GIT archive, you must take the following steps
  360. to install it: Go into the unpacked Org distribution directory and edit the
  361. top section of the file @file{Makefile}. You must set the name of the Emacs
  362. binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
  363. directories where local Lisp and Info files are kept. If you don't have
  364. access to the system-wide directories, you can simply run Org directly from
  365. the distribution directory by adding the @file{lisp} subdirectory to the
  366. Emacs load path. To do this, add the following line to @file{.emacs}:
  367. @example
  368. (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
  369. @end example
  370. @noindent
  371. If you plan to use code from the @file{contrib} subdirectory, do a similar
  372. step for this directory:
  373. @example
  374. (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
  375. @end example
  376. @b{XEmacs users now need to install the file @file{noutline.el} from
  377. the @file{xemacs} sub-directory of the Org distribution. Use the
  378. command:}
  379. @example
  380. @b{make install-noutline}
  381. @end example
  382. @noindent Now byte-compile the Lisp files with the shell command:
  383. @example
  384. make
  385. @end example
  386. @noindent If you are running Org from the distribution directory, this is
  387. all. If you want to install into the system directories, use
  388. @example
  389. make install
  390. make install-info
  391. @end example
  392. @noindent Then add to @file{.emacs}:
  393. @lisp
  394. ;; This line only if Org is not part of the X/Emacs distribution.
  395. (require 'org-install)
  396. @end lisp
  397. @node Activation, Feedback, Installation, Introduction
  398. @section Activation
  399. @cindex activation
  400. @cindex autoload
  401. @cindex global key bindings
  402. @cindex key bindings, global
  403. @iftex
  404. @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
  405. PDF documentation as viewed by Acrobat reader to your .emacs file, the
  406. single quote character comes out incorrectly and the code will not work.
  407. You need to fix the single quotes by hand, or copy from Info
  408. documentation.}
  409. @end iftex
  410. Add the following lines to your @file{.emacs} file. The last two lines
  411. define @emph{global} keys for the commands @command{org-store-link},
  412. @command{org-agenda}, and @command{org-iswitchb} - please choose suitable
  413. keys yourself.
  414. @lisp
  415. ;; The following lines are always needed. Choose your own keys.
  416. (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  417. (global-set-key "\C-cl" 'org-store-link)
  418. (global-set-key "\C-ca" 'org-agenda)
  419. (global-set-key "\C-cb" 'org-iswitchb)
  420. @end lisp
  421. Furthermore, you must activate @code{font-lock-mode} in Org
  422. buffers, because significant functionality depends on font-locking being
  423. active. You can do this with either one of the following two lines
  424. (XEmacs user must use the second option):
  425. @lisp
  426. (global-font-lock-mode 1) ; for all buffers
  427. (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
  428. @end lisp
  429. @cindex Org mode, turning on
  430. With this setup, all files with extension @samp{.org} will be put
  431. into Org mode. As an alternative, make the first line of a file look
  432. like this:
  433. @example
  434. MY PROJECTS -*- mode: org; -*-
  435. @end example
  436. @noindent which will select Org mode for this buffer no matter what
  437. the file's name is. See also the variable
  438. @code{org-insert-mode-line-in-empty-file}.
  439. @node Feedback, Conventions, Activation, Introduction
  440. @section Feedback
  441. @cindex feedback
  442. @cindex bug reports
  443. @cindex maintainer
  444. @cindex author
  445. If you find problems with Org, or if you have questions, remarks,
  446. or ideas about it, please contact the maintainer @value{MAINTAINER} at
  447. @value{MAINTAINEREMAIL}.
  448. For bug reports, please provide as much information as possible,
  449. including the version information of Emacs (@kbd{C-h v emacs-version
  450. @key{RET}}) and Org (@kbd{C-h v org-version @key{RET}}), as well as
  451. the Org related setup in @file{.emacs}. If an error occurs, a
  452. backtrace can be very useful (see below on how to create one). Often a
  453. small example file helps, along with clear information about:
  454. @enumerate
  455. @item What exactly did you do?
  456. @item What did you expect to happen?
  457. @item What happened instead?
  458. @end enumerate
  459. @noindent Thank you for helping to improve this mode.
  460. @subsubheading How to create a useful backtrace
  461. @cindex backtrace of an error
  462. If working with Org produces an error with a message you don't
  463. understand, you may have hit a bug. The best way to report this is by
  464. providing, in addition to what was mentioned above, a @emph{Backtrace}.
  465. This is information from the built-in debugger about where and how the
  466. error occurred. Here is how to produce a useful backtrace:
  467. @enumerate
  468. @item
  469. Start a fresh Emacs or XEmacs, and make sure that it will load the
  470. original Lisp code in @file{org.el} instead of the compiled version in
  471. @file{org.elc}. The backtrace contains much more information if it is
  472. produced with uncompiled code. To do this, either rename @file{org.elc}
  473. to something else before starting Emacs, or ask Emacs explicitly to load
  474. @file{org.el} by using the command line
  475. @example
  476. emacs -l /path/to/org.el
  477. @end example
  478. @item
  479. Go to the @code{Options} menu and select @code{Enter Debugger on Error}
  480. (XEmacs has this option in the @code{Troubleshooting} sub-menu).
  481. @item
  482. Do whatever you have to do to hit the error. Don't forget to
  483. document the steps you take.
  484. @item
  485. When you hit the error, a @file{*Backtrace*} buffer will appear on the
  486. screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
  487. attach it to your bug report.
  488. @end enumerate
  489. @node Conventions, , Feedback, Introduction
  490. @section Typesetting conventions used in this manual
  491. Org uses three types of keywords: TODO keywords, tags, and property
  492. names. In this manual we use the following conventions:
  493. @table @code
  494. @item TODO
  495. @itemx WAITING
  496. TODO keywords are written with all capitals, even if they are
  497. user-defined.
  498. @item boss
  499. @itemx ARCHIVE
  500. User-defined tags are written in lowercase; built-in tags with special
  501. meaning are written with all capitals.
  502. @item Release
  503. @itemx PRIORITY
  504. User-defined properties are capitalized; built-in properties with
  505. special meaning are written with all capitals.
  506. @end table
  507. @node Document Structure, Tables, Introduction, Top
  508. @chapter Document Structure
  509. @cindex document structure
  510. @cindex structure of document
  511. Org is based on outline mode and provides flexible commands to
  512. edit the structure of the document.
  513. @menu
  514. * Outlines:: Org is based on Outline mode
  515. * Headlines:: How to typeset Org tree headlines
  516. * Visibility cycling:: Show and hide, much simplified
  517. * Motion:: Jumping to other headlines
  518. * Structure editing:: Changing sequence and level of headlines
  519. * Archiving:: Move done task trees to a different place
  520. * Sparse trees:: Matches embedded in context
  521. * Plain lists:: Additional structure within an entry
  522. * Drawers:: Tucking stuff away
  523. * Orgstruct mode:: Structure editing outside Org
  524. @end menu
  525. @node Outlines, Headlines, Document Structure, Document Structure
  526. @section Outlines
  527. @cindex outlines
  528. @cindex Outline mode
  529. Org is implemented on top of Outline mode. Outlines allow a
  530. document to be organized in a hierarchical structure, which (at least
  531. for me) is the best representation of notes and thoughts. An overview
  532. of this structure is achieved by folding (hiding) large parts of the
  533. document to show only the general document structure and the parts
  534. currently being worked on. Org greatly simplifies the use of
  535. outlines by compressing the entire show/hide functionality into a single
  536. command @command{org-cycle}, which is bound to the @key{TAB} key.
  537. @node Headlines, Visibility cycling, Outlines, Document Structure
  538. @section Headlines
  539. @cindex headlines
  540. @cindex outline tree
  541. Headlines define the structure of an outline tree. The headlines in
  542. Org start with one or more stars, on the left margin@footnote{See
  543. the variable @code{org-special-ctrl-a/e} to configure special behavior
  544. of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
  545. @example
  546. * Top level headline
  547. ** Second level
  548. *** 3rd level
  549. some text
  550. *** 3rd level
  551. more text
  552. * Another top level headline
  553. @end example
  554. @noindent Some people find the many stars too noisy and would prefer an
  555. outline that has whitespace followed by a single star as headline
  556. starters. @ref{Clean view} describes a setup to realize this.
  557. An empty line after the end of a subtree is considered part of it and
  558. will be hidden when the subtree is folded. However, if you leave at
  559. least two empty lines, one empty line will remain visible after folding
  560. the subtree, in order to structure the collapsed view. See the
  561. variable @code{org-cycle-separator-lines} to modify this behavior.
  562. @node Visibility cycling, Motion, Headlines, Document Structure
  563. @section Visibility cycling
  564. @cindex cycling, visibility
  565. @cindex visibility cycling
  566. @cindex trees, visibility
  567. @cindex show hidden text
  568. @cindex hide text
  569. Outlines make it possible to hide parts of the text in the buffer.
  570. Org uses just two commands, bound to @key{TAB} and
  571. @kbd{S-@key{TAB}} to change the visibility in the buffer.
  572. @cindex subtree visibility states
  573. @cindex subtree cycling
  574. @cindex folded, subtree visibility state
  575. @cindex children, subtree visibility state
  576. @cindex subtree, subtree visibility state
  577. @table @kbd
  578. @kindex @key{TAB}
  579. @item @key{TAB}
  580. @emph{Subtree cycling}: Rotate current subtree among the states
  581. @example
  582. ,-> FOLDED -> CHILDREN -> SUBTREE --.
  583. '-----------------------------------'
  584. @end example
  585. The cursor must be on a headline for this to work@footnote{see, however,
  586. the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
  587. beginning of the buffer and the first line is not a headline, then
  588. @key{TAB} actually runs global cycling (see below)@footnote{see the
  589. option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
  590. argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
  591. @cindex global visibility states
  592. @cindex global cycling
  593. @cindex overview, global visibility state
  594. @cindex contents, global visibility state
  595. @cindex show all, global visibility state
  596. @kindex S-@key{TAB}
  597. @item S-@key{TAB}
  598. @itemx C-u @key{TAB}
  599. @emph{Global cycling}: Rotate the entire buffer among the states
  600. @example
  601. ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
  602. '--------------------------------------'
  603. @end example
  604. When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
  605. CONTENTS view up to headlines of level N will be shown. Note that inside
  606. tables, @kbd{S-@key{TAB}} jumps to the previous field.
  607. @cindex show all, command
  608. @kindex C-c C-a
  609. @item C-c C-a
  610. Show all.
  611. @kindex C-c C-r
  612. @item C-c C-r
  613. Reveal context around point, showing the current entry, the following heading
  614. and the hierarchy above. Useful for working near a location that has been
  615. exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
  616. (@pxref{Agenda commands}). With a prefix argument show, on each
  617. level, all sibling headings.
  618. @kindex C-c C-x b
  619. @item C-c C-x b
  620. Show the current subtree in an indirect buffer@footnote{The indirect
  621. buffer
  622. @ifinfo
  623. (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
  624. @end ifinfo
  625. @ifnotinfo
  626. (see the Emacs manual for more information about indirect buffers)
  627. @end ifnotinfo
  628. will contain the entire buffer, but will be narrowed to the current
  629. tree. Editing the indirect buffer will also change the original buffer,
  630. but without affecting visibility in that buffer.}. With a numeric
  631. prefix argument N, go up to level N and then take that tree. If N is
  632. negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
  633. the previously used indirect buffer.
  634. @end table
  635. When Emacs first visits an Org file, the global state is set to
  636. OVERVIEW, i.e. only the top level headlines are visible. This can be
  637. configured through the variable @code{org-startup-folded}, or on a
  638. per-file basis by adding one of the following lines anywhere in the
  639. buffer:
  640. @example
  641. #+STARTUP: overview
  642. #+STARTUP: content
  643. #+STARTUP: showall
  644. @end example
  645. @node Motion, Structure editing, Visibility cycling, Document Structure
  646. @section Motion
  647. @cindex motion, between headlines
  648. @cindex jumping, to headlines
  649. @cindex headline navigation
  650. The following commands jump to other headlines in the buffer.
  651. @table @kbd
  652. @kindex C-c C-n
  653. @item C-c C-n
  654. Next heading.
  655. @kindex C-c C-p
  656. @item C-c C-p
  657. Previous heading.
  658. @kindex C-c C-f
  659. @item C-c C-f
  660. Next heading same level.
  661. @kindex C-c C-b
  662. @item C-c C-b
  663. Previous heading same level.
  664. @kindex C-c C-u
  665. @item C-c C-u
  666. Backward to higher level heading.
  667. @kindex C-c C-j
  668. @item C-c C-j
  669. Jump to a different place without changing the current outline
  670. visibility. Shows the document structure in a temporary buffer, where
  671. you can use the following keys to find your destination:
  672. @example
  673. @key{TAB} @r{Cycle visibility.}
  674. @key{down} / @key{up} @r{Next/previous visible headline.}
  675. n / p @r{Next/previous visible headline.}
  676. f / b @r{Next/previous headline same level.}
  677. u @r{One level up.}
  678. 0-9 @r{Digit argument.}
  679. @key{RET} @r{Select this location.}
  680. @end example
  681. @end table
  682. @node Structure editing, Archiving, Motion, Document Structure
  683. @section Structure editing
  684. @cindex structure editing
  685. @cindex headline, promotion and demotion
  686. @cindex promotion, of subtrees
  687. @cindex demotion, of subtrees
  688. @cindex subtree, cut and paste
  689. @cindex pasting, of subtrees
  690. @cindex cutting, of subtrees
  691. @cindex copying, of subtrees
  692. @cindex subtrees, cut and paste
  693. @table @kbd
  694. @kindex M-@key{RET}
  695. @item M-@key{RET}
  696. Insert new heading with same level as current. If the cursor is in a
  697. plain list item, a new item is created (@pxref{Plain lists}). To force
  698. creation of a new headline, use a prefix argument, or first press @key{RET}
  699. to get to the beginning of the next line. When this command is used in
  700. the middle of a line, the line is split and the rest of the line becomes
  701. the new headline@footnote{If you do not want the line to be split,
  702. customize the variable @code{org-M-RET-may-split-line}.}. If the
  703. command is used at the beginning of a headline, the new headline is
  704. created before the current line. If at the beginning of any other line,
  705. the content of that line is made the new heading. If the command is
  706. used at the end of a folded subtree (i.e. behind the ellipses at the end
  707. of a headline), then a headline like the current one will be inserted
  708. after the end of the subtree.
  709. @kindex C-@key{RET}
  710. @item C-@key{RET}
  711. Insert a new heading after the current subtree, same level as the
  712. current headline. This command works from anywhere in the entry.
  713. @kindex M-S-@key{RET}
  714. @item M-S-@key{RET}
  715. Insert new TODO entry with same level as current heading.
  716. @kindex M-@key{left}
  717. @item M-@key{left}
  718. Promote current heading by one level.
  719. @kindex M-@key{right}
  720. @item M-@key{right}
  721. Demote current heading by one level.
  722. @kindex M-S-@key{left}
  723. @item M-S-@key{left}
  724. Promote the current subtree by one level.
  725. @kindex M-S-@key{right}
  726. @item M-S-@key{right}
  727. Demote the current subtree by one level.
  728. @kindex M-S-@key{up}
  729. @item M-S-@key{up}
  730. Move subtree up (swap with previous subtree of same
  731. level).
  732. @kindex M-S-@key{down}
  733. @item M-S-@key{down}
  734. Move subtree down (swap with next subtree of same level).
  735. @kindex C-c C-x C-w
  736. @kindex C-c C-x C-k
  737. @item C-c C-x C-w
  738. @itemx C-c C-x C-k
  739. Kill subtree, i.e. remove it from buffer but save in kill ring.
  740. With a numeric prefix argument N, kill N sequential subtrees.
  741. @kindex C-c C-x M-w
  742. @item C-c C-x M-w
  743. Copy subtree to kill ring. With a numeric prefix argument N, copy the N
  744. sequential subtrees.
  745. @kindex C-c C-x C-y
  746. @item C-c C-x C-y
  747. Yank subtree from kill ring. This does modify the level of the subtree to
  748. make sure the tree fits in nicely at the yank position. The yank level can
  749. also be specified with a numeric prefix argument, or by yanking after a
  750. headline marker like @samp{****}.
  751. @kindex C-c C-w
  752. @item C-c C-w
  753. Refile entry to a different location. @xref{Refiling notes}.
  754. @kindex C-c ^
  755. @item C-c ^
  756. Sort same-level entries. When there is an active region, all entries in the
  757. region will be sorted. Otherwise the children of the current headline are
  758. sorted. The command prompts for the sorting method, which can be
  759. alphabetically, numerically, by time (using the first time stamp in each
  760. entry), by priority, or by TODO keyword (in the sequence the keywords have
  761. been defined in the setup). Reverse sorting is possible as well. You can
  762. also supply your own function to extract the sorting key. With a @kbd{C-u}
  763. prefix, sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes,
  764. duplicate entries will also be removed.
  765. @kindex C-c *
  766. @item C-c *
  767. Turn a normal line or plain list item into a headline (so that it
  768. becomes a subheading at its location). Also turn a headline into a
  769. normal line by removing the stars. If there is an active region, turn
  770. all lines in the region into headlines. Or, if the first line is a
  771. headline, remove the stars from all headlines in the region.
  772. @end table
  773. @cindex region, active
  774. @cindex active region
  775. @cindex Transient mark mode
  776. When there is an active region (Transient mark mode), promotion and
  777. demotion work on all headlines in the region. To select a region of
  778. headlines, it is best to place both point and mark at the beginning of a
  779. line, mark at the beginning of the first headline, and point at the line
  780. just after the last headline to change. Note that when the cursor is
  781. inside a table (@pxref{Tables}), the Meta-Cursor keys have different
  782. functionality.
  783. @node Archiving, Sparse trees, Structure editing, Document Structure
  784. @section Archiving
  785. @cindex archiving
  786. When a project represented by a (sub)tree is finished, you may want
  787. to move the tree out of the way and to stop it from contributing to the
  788. agenda. Org mode knows two ways of archiving. You can mark a tree with
  789. the ARCHIVE tag, or you can move an entire (sub)tree to a different
  790. location.
  791. @menu
  792. * ARCHIVE tag:: Marking a tree as inactive
  793. * Moving subtrees:: Moving a tree to an archive file
  794. @end menu
  795. @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
  796. @subsection The ARCHIVE tag
  797. @cindex internal archiving
  798. A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
  799. its location in the outline tree, but behaves in the following way:
  800. @itemize @minus
  801. @item
  802. It does not open when you attempt to do so with a visibility cycling
  803. command (@pxref{Visibility cycling}). You can force cycling archived
  804. subtrees with @kbd{C-@key{TAB}}, or by setting the option
  805. @code{org-cycle-open-archived-trees}. Also normal outline commands like
  806. @code{show-all} will open archived subtrees.
  807. @item
  808. During sparse tree construction (@pxref{Sparse trees}), matches in
  809. archived subtrees are not exposed, unless you configure the option
  810. @code{org-sparse-tree-open-archived-trees}.
  811. @item
  812. During agenda view construction (@pxref{Agenda Views}), the content of
  813. archived trees is ignored unless you configure the option
  814. @code{org-agenda-skip-archived-trees}.
  815. @item
  816. Archived trees are not exported (@pxref{Exporting}), only the headline
  817. is. Configure the details using the variable
  818. @code{org-export-with-archived-trees}.
  819. @end itemize
  820. The following commands help managing the ARCHIVE tag:
  821. @table @kbd
  822. @kindex C-c C-x a
  823. @item C-c C-x a
  824. Toggle the ARCHIVE tag for the current headline. When the tag is set,
  825. the headline changes to a shadowed face, and the subtree below it is
  826. hidden.
  827. @kindex C-u C-c C-x a
  828. @item C-u C-c C-x a
  829. Check if any direct children of the current headline should be archived.
  830. To do this, each subtree is checked for open TODO entries. If none are
  831. found, the command offers to set the ARCHIVE tag for the child. If the
  832. cursor is @emph{not} on a headline when this command is invoked, the
  833. level 1 trees will be checked.
  834. @kindex C-@kbd{TAB}
  835. @item C-@kbd{TAB}
  836. Cycle a tree even if it is tagged with ARCHIVE.
  837. @end table
  838. @node Moving subtrees, , ARCHIVE tag, Archiving
  839. @subsection Moving subtrees
  840. @cindex external archiving
  841. Once an entire project is finished, you may want to move it to a different
  842. location. Org can move it to an @emph{Attic Sibling} in the same tree, to a
  843. different tree in the current file, or to a different file, the archive file.
  844. @table @kbd
  845. @kindex C-c C-x A
  846. @item C-c C-x A
  847. Move the current entry to the @emph{Attic Sibling}. This is a sibling of the
  848. entry with the heading @samp{Attic} and the tag @samp{ARCHIVE}
  849. (@pxref{ARCHIVE tag}). The entry becomes a child of that sibling and in this
  850. way retains a lot of its original context, including inherited tags and
  851. approximate position in the outline.
  852. @kindex C-c C-x C-s
  853. @item C-c C-x C-s
  854. Archive the subtree starting at the cursor position to the location
  855. given by @code{org-archive-location}. Context information that could be
  856. lost like the file name, the category, inherited tags, and the TODO
  857. state will be store as properties in the entry.
  858. @kindex C-u C-c C-x C-s
  859. @item C-u C-c C-x C-s
  860. Check if any direct children of the current headline could be moved to
  861. the archive. To do this, each subtree is checked for open TODO entries.
  862. If none are found, the command offers to move it to the archive
  863. location. If the cursor is @emph{not} on a headline when this command
  864. is invoked, the level 1 trees will be checked.
  865. @end table
  866. @cindex archive locations
  867. The default archive location is a file in the same directory as the
  868. current file, with the name derived by appending @file{_archive} to the
  869. current file name. For information and examples on how to change this,
  870. see the documentation string of the variable
  871. @code{org-archive-location}. There is also an in-buffer option for
  872. setting this variable, for example@footnote{For backward compatibility,
  873. the following also works: If there are several such lines in a file,
  874. each specifies the archive location for the text below it. The first
  875. such line also applies to any text before its definition. However,
  876. using this method is @emph{strongly} deprecated as it is incompatible
  877. with the outline structure of the document. The correct method for
  878. setting multiple archive locations in a buffer is using a property.}:
  879. @example
  880. #+ARCHIVE: %s_done::
  881. @end example
  882. @noindent
  883. If you would like to have a special ARCHIVE location for a single entry
  884. or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
  885. location as the value (@pxref{Properties and Columns}).
  886. When a subtree is moved, it receives a number of special properties that
  887. record context information like the file from where the entry came, it's
  888. outline path the archiving time etc. Configure the variable
  889. @code{org-archive-save-context-info} to adjust the amount of information
  890. added.
  891. @node Sparse trees, Plain lists, Archiving, Document Structure
  892. @section Sparse trees
  893. @cindex sparse trees
  894. @cindex trees, sparse
  895. @cindex folding, sparse trees
  896. @cindex occur, command
  897. An important feature of Org mode is the ability to construct
  898. @emph{sparse trees} for selected information in an outline tree, so that
  899. the entire document is folded as much as possible, but the selected
  900. information is made visible along with the headline structure above
  901. it@footnote{See also the variables @code{org-show-hierarchy-above},
  902. @code{org-show-following-heading}, and @code{org-show-siblings} for
  903. detailed control on how much context is shown around each match.}. Just
  904. try it out and you will see immediately how it works.
  905. Org mode contains several commands creating such trees, all these
  906. commands can be accessed through a dispatcher:
  907. @table @kbd
  908. @kindex C-c /
  909. @item C-c /
  910. This prompts for an extra key to select a sparse-tree creating command.
  911. @kindex C-c / r
  912. @item C-c / r
  913. Occur. Prompts for a regexp and shows a sparse tree with all matches.
  914. If the match is in a headline, the headline is made visible. If the
  915. match is in the body of an entry, headline and body are made visible.
  916. In order to provide minimal context, also the full hierarchy of
  917. headlines above the match is shown, as well as the headline following
  918. the match. Each match is also highlighted; the highlights disappear
  919. when the buffer is changed by an editing command, or by pressing
  920. @kbd{C-c C-c}. When called with a @kbd{C-u} prefix argument, previous
  921. highlights are kept, so several calls to this command can be stacked.
  922. @end table
  923. @noindent
  924. For frequently used sparse trees of specific search strings, you can
  925. use the variable @code{org-agenda-custom-commands} to define fast
  926. keyboard access to specific sparse trees. These commands will then be
  927. accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
  928. For example:
  929. @lisp
  930. (setq org-agenda-custom-commands
  931. '(("f" occur-tree "FIXME")))
  932. @end lisp
  933. @noindent will define the key @kbd{C-c a f} as a shortcut for creating
  934. a sparse tree matching the string @samp{FIXME}.
  935. The other sparse tree commands select headings based on TODO keywords,
  936. tags, or properties and will be discussed later in this manual.
  937. @kindex C-c C-e v
  938. @cindex printing sparse trees
  939. @cindex visible text, printing
  940. To print a sparse tree, you can use the Emacs command
  941. @code{ps-print-buffer-with-faces} which does not print invisible parts
  942. of the document @footnote{This does not work under XEmacs, because
  943. XEmacs uses selective display for outlining, not text properties.}.
  944. Or you can use the command @kbd{C-c C-e v} to export only the visible
  945. part of the document and print the resulting file.
  946. @node Plain lists, Drawers, Sparse trees, Document Structure
  947. @section Plain lists
  948. @cindex plain lists
  949. @cindex lists, plain
  950. @cindex lists, ordered
  951. @cindex ordered lists
  952. Within an entry of the outline tree, hand-formatted lists can provide
  953. additional structure. They also provide a way to create lists of
  954. checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
  955. and the HTML exporter (@pxref{Exporting}) parses and formats them.
  956. Org knows ordered lists, unordered lists, and description lists.
  957. @itemize @bullet
  958. @item
  959. @emph{Unordered} list items start with @samp{-}, @samp{+}, or
  960. @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
  961. they will be seen as top-level headlines. Also, when you are hiding leading
  962. stars to get a clean outline view, plain list items starting with a star are
  963. visually indistinguishable from true headlines. In short: even though
  964. @samp{*} is supported, it may be better to not use it for plain list items.}
  965. as bullets.
  966. @item
  967. @emph{Ordered} list items start with a numeral followed by either a period or
  968. a right parenthesis, such as @samp{1.} or @samp{1)}.
  969. @item
  970. @emph{Description} list items are like unordered list items, but contain the
  971. separator @samp{ :: } to separate the description @emph{term} from the
  972. desciption.
  973. @end itemize
  974. Items belonging to the same list must have the same indentation on the first
  975. line. In particular, if an ordered list reaches number @samp{10.}, then the
  976. 2--digit numbers must be written left-aligned with the other numbers in the
  977. list. Indentation also determines the end of a list item. It ends before
  978. the next line that is indented like the bullet/number, or less. Empty lines
  979. are part of the previous item, so you can have several paragraphs in one
  980. item. If you would like an empty line to terminate all currently open plain
  981. lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
  982. Here is an example:
  983. @example
  984. @group
  985. ** Lord of the Rings
  986. My favorite scenes are (in this order)
  987. 1. The attack of the Rohirrim
  988. 2. Eowyns fight with the witch king
  989. + this was already my favorite scene in the book
  990. + I really like Miranda Otto.
  991. 3. Peter Jackson being shot by Legolas
  992. - on DVD only
  993. He makes a really funny face when it happens.
  994. But in the end, not individual scenes matter but the film as a whole.
  995. Important actors in this film are:
  996. - @b{Elijah Wood} :: He plays the Frodo
  997. - @b{Sean Austin} :: He plays the Sam, Frodos friend. I still remember
  998. him very well from his role as Mikey Walsh a in the Goonies.
  999. @end group
  1000. @end example
  1001. Org supports these lists by tuning filling and wrapping commands to
  1002. deal with them correctly@footnote{Org only changes the filling
  1003. settings for Emacs. For XEmacs, you should use Kyle E. Jones'
  1004. @file{filladapt.el}. To turn this on, put into @file{.emacs}:
  1005. @code{(require 'filladapt)}}, and by exporting them properly
  1006. (@pxref{Exporting}).
  1007. The following commands act on items when the cursor is in the first line
  1008. of an item (the line with the bullet or number).
  1009. @table @kbd
  1010. @kindex @key{TAB}
  1011. @item @key{TAB}
  1012. Items can be folded just like headline levels if you set the variable
  1013. @code{org-cycle-include-plain-lists}. The level of an item is then
  1014. given by the indentation of the bullet/number. Items are always
  1015. subordinate to real headlines, however; the hierarchies remain
  1016. completely separated.
  1017. If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
  1018. fixes the indentation of the current line in a heuristic way.
  1019. @kindex M-@key{RET}
  1020. @item M-@key{RET}
  1021. Insert new item at current level. With a prefix argument, force a new
  1022. heading (@pxref{Structure editing}). If this command is used in the middle
  1023. of a line, the line is @emph{split} and the rest of the line becomes the new
  1024. item@footnote{If you do not want the line to be split, customize the variable
  1025. @code{org-M-RET-may-split-line}.}. If this command is executed in the
  1026. @emph{whitespace before a bullet or number}, the new item is created
  1027. @emph{before} the current item. If the command is executed in the white
  1028. space before the text that is part of an item but does not contain the
  1029. bullet, a bullet is added to the current line.
  1030. @kindex M-S-@key{RET}
  1031. @item M-S-@key{RET}
  1032. Insert a new item with a checkbox (@pxref{Checkboxes}).
  1033. @kindex S-@key{up}
  1034. @kindex S-@key{down}
  1035. @item S-@key{up}
  1036. @itemx S-@key{down}
  1037. Jump to the previous/next item in the current list.
  1038. @kindex M-S-@key{up}
  1039. @kindex M-S-@key{down}
  1040. @item M-S-@key{up}
  1041. @itemx M-S-@key{down}
  1042. Move the item including subitems up/down (swap with previous/next item
  1043. of same indentation). If the list is ordered, renumbering is
  1044. automatic.
  1045. @kindex M-S-@key{left}
  1046. @kindex M-S-@key{right}
  1047. @item M-S-@key{left}
  1048. @itemx M-S-@key{right}
  1049. Decrease/increase the indentation of the item, including subitems.
  1050. Initially, the item tree is selected based on current indentation.
  1051. When these commands are executed several times in direct succession,
  1052. the initially selected region is used, even if the new indentation
  1053. would imply a different hierarchy. To use the new hierarchy, break
  1054. the command chain with a cursor motion or so.
  1055. @kindex C-c C-c
  1056. @item C-c C-c
  1057. If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
  1058. state of the checkbox. If not, this command makes sure that all the
  1059. items on this list level use the same bullet. Furthermore, if this is
  1060. an ordered list, make sure the numbering is OK.
  1061. @kindex C-c -
  1062. @item C-c -
  1063. Cycle the entire list level through the different itemize/enumerate bullets
  1064. (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}). With a numeric prefix
  1065. argument N, select the Nth bullet from this list. If there is an active
  1066. region when calling this, all lines will be converted to list items. If the
  1067. first line already was a list item, any item markers will be removed from the
  1068. list. Finally, even without an active region, a normal line will be
  1069. converted into a list item.
  1070. @end table
  1071. @node Drawers, Orgstruct mode, Plain lists, Document Structure
  1072. @section Drawers
  1073. @cindex drawers
  1074. @cindex visibility cycling, drawers
  1075. Sometimes you want to keep information associated with an entry, but you
  1076. normally don't want to see it. For this, Org mode has @emph{drawers}.
  1077. Drawers need to be configured with the variable
  1078. @code{org-drawers}@footnote{You can define drawers on a per-file basis
  1079. with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
  1080. look like this:
  1081. @example
  1082. ** This is a headline
  1083. Still outside the drawer
  1084. :DRAWERNAME:
  1085. This is inside the drawer.
  1086. :END:
  1087. After the drawer.
  1088. @end example
  1089. Visibility cycling (@pxref{Visibility cycling}) on the headline will
  1090. hide and show the entry, but keep the drawer collapsed to a single line.
  1091. In order to look inside the drawer, you need to move the cursor to the
  1092. drawer line and press @key{TAB} there. Org mode uses a drawer for
  1093. storing properties (@pxref{Properties and Columns}), and another one for
  1094. storing clock times (@pxref{Clocking work time}).
  1095. @node Orgstruct mode, , Drawers, Document Structure
  1096. @section The Orgstruct minor mode
  1097. @cindex Orgstruct mode
  1098. @cindex minor mode for structure editing
  1099. If you like the intuitive way the Org mode structure editing and list
  1100. formatting works, you might want to use these commands in other modes
  1101. like Text mode or Mail mode as well. The minor mode Orgstruct mode
  1102. makes this possible. You can always toggle the mode with @kbd{M-x
  1103. orgstruct-mode}. To turn it on by default, for example in Mail mode,
  1104. use
  1105. @lisp
  1106. (add-hook 'mail-mode-hook 'turn-on-orgstruct)
  1107. @end lisp
  1108. When this mode is active and the cursor is on a line that looks to
  1109. Org like a headline of the first line of a list item, most
  1110. structure editing commands will work, even if the same keys normally
  1111. have different functionality in the major mode you are using. If the
  1112. cursor is not in one of those special lines, Orgstruct mode lurks
  1113. silently in the shadow.
  1114. @node Tables, Hyperlinks, Document Structure, Top
  1115. @chapter Tables
  1116. @cindex tables
  1117. @cindex editing tables
  1118. Org comes with a fast and intuitive table editor. Spreadsheet-like
  1119. calculations are supported in connection with the Emacs @file{calc}
  1120. package
  1121. @ifinfo
  1122. (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
  1123. @end ifinfo
  1124. @ifnotinfo
  1125. (see the Emacs Calculator manual for more information about the Emacs
  1126. calculator).
  1127. @end ifnotinfo
  1128. @menu
  1129. * Built-in table editor:: Simple tables
  1130. * Narrow columns:: Stop wasting space in tables
  1131. * Column groups:: Grouping to trigger vertical lines
  1132. * Orgtbl mode:: The table editor as minor mode
  1133. * The spreadsheet:: The table editor has spreadsheet capabilities
  1134. @end menu
  1135. @node Built-in table editor, Narrow columns, Tables, Tables
  1136. @section The built-in table editor
  1137. @cindex table editor, built-in
  1138. Org makes it easy to format tables in plain ASCII. Any line with
  1139. @samp{|} as the first non-whitespace character is considered part of a
  1140. table. @samp{|} is also the column separator. A table might look like
  1141. this:
  1142. @example
  1143. | Name | Phone | Age |
  1144. |-------+-------+-----|
  1145. | Peter | 1234 | 17 |
  1146. | Anna | 4321 | 25 |
  1147. @end example
  1148. A table is re-aligned automatically each time you press @key{TAB} or
  1149. @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
  1150. the next field (@key{RET} to the next row) and creates new table rows
  1151. at the end of the table or before horizontal lines. The indentation
  1152. of the table is set by the first line. Any line starting with
  1153. @samp{|-} is considered as a horizontal separator line and will be
  1154. expanded on the next re-align to span the whole table width. So, to
  1155. create the above table, you would only type
  1156. @example
  1157. |Name|Phone|Age|
  1158. |-
  1159. @end example
  1160. @noindent and then press @key{TAB} to align the table and start filling in
  1161. fields.
  1162. When typing text into a field, Org treats @key{DEL},
  1163. @key{Backspace}, and all character keys in a special way, so that
  1164. inserting and deleting avoids shifting other fields. Also, when
  1165. typing @emph{immediately after the cursor was moved into a new field
  1166. with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
  1167. field is automatically made blank. If this behavior is too
  1168. unpredictable for you, configure the variables
  1169. @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
  1170. @table @kbd
  1171. @tsubheading{Creation and conversion}
  1172. @kindex C-c |
  1173. @item C-c |
  1174. Convert the active region to table. If every line contains at least one
  1175. TAB character, the function assumes that the material is tab separated.
  1176. If every line contains a comma, comma-separated values (CSV) are assumed.
  1177. If not, lines are split at whitespace into fields. You can use a prefix
  1178. argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
  1179. C-u} forces TAB, and a numeric argument N indicates that at least N
  1180. consecutive spaces, or alternatively a TAB will be the separator.
  1181. @*
  1182. If there is no active region, this command creates an empty Org
  1183. table. But it's easier just to start typing, like
  1184. @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
  1185. @tsubheading{Re-aligning and field motion}
  1186. @kindex C-c C-c
  1187. @item C-c C-c
  1188. Re-align the table without moving the cursor.
  1189. @c
  1190. @kindex @key{TAB}
  1191. @item @key{TAB}
  1192. Re-align the table, move to the next field. Creates a new row if
  1193. necessary.
  1194. @c
  1195. @kindex S-@key{TAB}
  1196. @item S-@key{TAB}
  1197. Re-align, move to previous field.
  1198. @c
  1199. @kindex @key{RET}
  1200. @item @key{RET}
  1201. Re-align the table and move down to next row. Creates a new row if
  1202. necessary. At the beginning or end of a line, @key{RET} still does
  1203. NEWLINE, so it can be used to split a table.
  1204. @tsubheading{Column and row editing}
  1205. @kindex M-@key{left}
  1206. @kindex M-@key{right}
  1207. @item M-@key{left}
  1208. @itemx M-@key{right}
  1209. Move the current column left/right.
  1210. @c
  1211. @kindex M-S-@key{left}
  1212. @item M-S-@key{left}
  1213. Kill the current column.
  1214. @c
  1215. @kindex M-S-@key{right}
  1216. @item M-S-@key{right}
  1217. Insert a new column to the left of the cursor position.
  1218. @c
  1219. @kindex M-@key{up}
  1220. @kindex M-@key{down}
  1221. @item M-@key{up}
  1222. @itemx M-@key{down}
  1223. Move the current row up/down.
  1224. @c
  1225. @kindex M-S-@key{up}
  1226. @item M-S-@key{up}
  1227. Kill the current row or horizontal line.
  1228. @c
  1229. @kindex M-S-@key{down}
  1230. @item M-S-@key{down}
  1231. Insert a new row above the current row. With a prefix argument, the line is
  1232. created below the current one.
  1233. @c
  1234. @kindex C-c -
  1235. @item C-c -
  1236. Insert a horizontal line below current row. With a prefix argument, the line
  1237. is created above the current line.
  1238. @c
  1239. @kindex C-c ^
  1240. @item C-c ^
  1241. Sort the table lines in the region. The position of point indicates the
  1242. column to be used for sorting, and the range of lines is the range
  1243. between the nearest horizontal separator lines, or the entire table. If
  1244. point is before the first column, you will be prompted for the sorting
  1245. column. If there is an active region, the mark specifies the first line
  1246. and the sorting column, while point should be in the last line to be
  1247. included into the sorting. The command prompts for the sorting type
  1248. (alphabetically, numerically, or by time). When called with a prefix
  1249. argument, alphabetic sorting will be case-sensitive.
  1250. @tsubheading{Regions}
  1251. @kindex C-c C-x M-w
  1252. @item C-c C-x M-w
  1253. Copy a rectangular region from a table to a special clipboard. Point
  1254. and mark determine edge fields of the rectangle. The process ignores
  1255. horizontal separator lines.
  1256. @c
  1257. @kindex C-c C-x C-w
  1258. @item C-c C-x C-w
  1259. Copy a rectangular region from a table to a special clipboard, and
  1260. blank all fields in the rectangle. So this is the ``cut'' operation.
  1261. @c
  1262. @kindex C-c C-x C-y
  1263. @item C-c C-x C-y
  1264. Paste a rectangular region into a table.
  1265. The upper right corner ends up in the current field. All involved fields
  1266. will be overwritten. If the rectangle does not fit into the present table,
  1267. the table is enlarged as needed. The process ignores horizontal separator
  1268. lines.
  1269. @c
  1270. @kindex C-c C-q
  1271. @kindex M-@key{RET}
  1272. @item C-c C-q
  1273. @itemx M-@kbd{RET}
  1274. Wrap several fields in a column like a paragraph. If there is an active
  1275. region, and both point and mark are in the same column, the text in the
  1276. column is wrapped to minimum width for the given number of lines. A numeric
  1277. prefix argument may be used to change the number of desired lines. If there
  1278. is no region, the current field is split at the cursor position and the text
  1279. fragment to the right of the cursor is prepended to the field one line
  1280. down. If there is no region, but you specify a prefix argument, the current
  1281. field is made blank, and the content is appended to the field above.
  1282. @tsubheading{Calculations}
  1283. @cindex formula, in tables
  1284. @cindex calculations, in tables
  1285. @cindex region, active
  1286. @cindex active region
  1287. @cindex Transient mark mode
  1288. @kindex C-c +
  1289. @item C-c +
  1290. Sum the numbers in the current column, or in the rectangle defined by
  1291. the active region. The result is shown in the echo area and can
  1292. be inserted with @kbd{C-y}.
  1293. @c
  1294. @kindex S-@key{RET}
  1295. @item S-@key{RET}
  1296. When current field is empty, copy from first non-empty field above.
  1297. When not empty, copy current field down to next row and move cursor
  1298. along with it. Depending on the variable
  1299. @code{org-table-copy-increment}, integer field values will be
  1300. incremented during copy. This key is also used by CUA mode
  1301. (@pxref{Cooperation}).
  1302. @tsubheading{Miscellaneous}
  1303. @kindex C-c `
  1304. @item C-c `
  1305. Edit the current field in a separate window. This is useful for fields
  1306. that are not fully visible (@pxref{Narrow columns}). When called with a
  1307. @kbd{C-u} prefix, just make the full field visible, so that it can be
  1308. edited in place.
  1309. @c
  1310. @item M-x org-table-import
  1311. Import a file as a table. The table should be TAB- or whitespace
  1312. separated. Useful, for example, to import a spreadsheet table or data
  1313. from a database, because these programs generally can write
  1314. TAB-separated text files. This command works by inserting the file into
  1315. the buffer and then converting the region to a table. Any prefix
  1316. argument is passed on to the converter, which uses it to determine the
  1317. separator.
  1318. @item C-c |
  1319. Tables can also be imported by pasting tabular text into the Org
  1320. buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
  1321. @kbd{C-c |} command (see above under @i{Creation and conversion}.
  1322. @c
  1323. @item M-x org-table-export
  1324. Export the table, by default as a TAB-separated file. Useful for data
  1325. exchange with, for example, spreadsheet or database programs. The format
  1326. used to export the file can be configured in the variable
  1327. @code{org-table-export-default-format}. You may also use properties
  1328. @code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
  1329. name and the format for table export in a subtree.
  1330. @end table
  1331. If you don't like the automatic table editor because it gets in your
  1332. way on lines which you would like to start with @samp{|}, you can turn
  1333. it off with
  1334. @lisp
  1335. (setq org-enable-table-editor nil)
  1336. @end lisp
  1337. @noindent Then the only table command that still works is
  1338. @kbd{C-c C-c} to do a manual re-align.
  1339. @node Narrow columns, Column groups, Built-in table editor, Tables
  1340. @section Narrow columns
  1341. @cindex narrow columns in tables
  1342. The width of columns is automatically determined by the table editor.
  1343. Sometimes a single field or a few fields need to carry more text,
  1344. leading to inconveniently wide columns. To limit@footnote{This feature
  1345. does not work on XEmacs.} the width of a column, one field anywhere in
  1346. the column may contain just the string @samp{<N>} where @samp{N} is an
  1347. integer specifying the width of the column in characters. The next
  1348. re-align will then set the width of this column to no more than this
  1349. value.
  1350. @example
  1351. @group
  1352. |---+------------------------------| |---+--------|
  1353. | | | | | <6> |
  1354. | 1 | one | | 1 | one |
  1355. | 2 | two | ----\ | 2 | two |
  1356. | 3 | This is a long chunk of text | ----/ | 3 | This=> |
  1357. | 4 | four | | 4 | four |
  1358. |---+------------------------------| |---+--------|
  1359. @end group
  1360. @end example
  1361. @noindent
  1362. Fields that are wider become clipped and end in the string @samp{=>}.
  1363. Note that the full text is still in the buffer, it is only invisible.
  1364. To see the full text, hold the mouse over the field - a tool-tip window
  1365. will show the full content. To edit such a field, use the command
  1366. @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
  1367. open a new window with the full field. Edit it and finish with @kbd{C-c
  1368. C-c}.
  1369. When visiting a file containing a table with narrowed columns, the
  1370. necessary character hiding has not yet happened, and the table needs to
  1371. be aligned before it looks nice. Setting the option
  1372. @code{org-startup-align-all-tables} will realign all tables in a file
  1373. upon visiting, but also slow down startup. You can also set this option
  1374. on a per-file basis with:
  1375. @example
  1376. #+STARTUP: align
  1377. #+STARTUP: noalign
  1378. @end example
  1379. @node Column groups, Orgtbl mode, Narrow columns, Tables
  1380. @section Column groups
  1381. @cindex grouping columns in tables
  1382. When Org exports tables, it does so by default without vertical
  1383. lines because that is visually more satisfying in general. Occasionally
  1384. however, vertical lines can be useful to structure a table into groups
  1385. of columns, much like horizontal lines can do for groups of rows. In
  1386. order to specify column groups, you can use a special row where the
  1387. first field contains only @samp{/}. The further fields can either
  1388. contain @samp{<} to indicate that this column should start a group,
  1389. @samp{>} to indicate the end of a column, or @samp{<>} to make a column
  1390. a group of its own. Boundaries between column groups will upon export be
  1391. marked with vertical lines. Here is an example:
  1392. @example
  1393. | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1394. |---+----+-----+-----+-----+---------+------------|
  1395. | / | <> | < | | > | < | > |
  1396. | # | 1 | 1 | 1 | 1 | 1 | 1 |
  1397. | # | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
  1398. | # | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
  1399. |---+----+-----+-----+-----+---------+------------|
  1400. #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2))
  1401. @end example
  1402. It is also sufficient to just insert the column group starters after
  1403. every vertical line you'd like to have:
  1404. @example
  1405. | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1406. |----+-----+-----+-----+---------+------------|
  1407. | / | < | | | < | |
  1408. @end example
  1409. @node Orgtbl mode, The spreadsheet, Column groups, Tables
  1410. @section The Orgtbl minor mode
  1411. @cindex Orgtbl mode
  1412. @cindex minor mode for tables
  1413. If you like the intuitive way the Org table editor works, you
  1414. might also want to use it in other modes like Text mode or Mail mode.
  1415. The minor mode Orgtbl mode makes this possible. You can always toggle
  1416. the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
  1417. example in mail mode, use
  1418. @lisp
  1419. (add-hook 'mail-mode-hook 'turn-on-orgtbl)
  1420. @end lisp
  1421. Furthermore, with some special setup, it is possible to maintain tables
  1422. in arbitrary syntax with Orgtbl mode. For example, it is possible to
  1423. construct La@TeX{} tables with the underlying ease and power of
  1424. Orgtbl mode, including spreadsheet capabilities. For details, see
  1425. @ref{Tables in arbitrary syntax}.
  1426. @node The spreadsheet, , Orgtbl mode, Tables
  1427. @section The spreadsheet
  1428. @cindex calculations, in tables
  1429. @cindex spreadsheet capabilities
  1430. @cindex @file{calc} package
  1431. The table editor makes use of the Emacs @file{calc} package to implement
  1432. spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
  1433. derive fields from other fields. While fully featured, Org's
  1434. implementation is not identical to other spreadsheets. For example,
  1435. Org knows the concept of a @emph{column formula} that will be
  1436. applied to all non-header fields in a column without having to copy the
  1437. formula to each relevant field.
  1438. @menu
  1439. * References:: How to refer to another field or range
  1440. * Formula syntax for Calc:: Using Calc to compute stuff
  1441. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  1442. * Field formulas:: Formulas valid for a single field
  1443. * Column formulas:: Formulas valid for an entire column
  1444. * Editing and debugging formulas:: Fixing formulas
  1445. * Updating the table:: Recomputing all dependent fields
  1446. * Advanced features:: Field names, parameters and automatic recalc
  1447. @end menu
  1448. @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
  1449. @subsection References
  1450. @cindex references
  1451. To compute fields in the table from other fields, formulas must
  1452. reference other fields or ranges. In Org, fields can be referenced
  1453. by name, by absolute coordinates, and by relative coordinates. To find
  1454. out what the coordinates of a field are, press @kbd{C-c ?} in that
  1455. field, or press @kbd{C-c @}} to toggle the display of a grid.
  1456. @subsubheading Field references
  1457. @cindex field references
  1458. @cindex references, to fields
  1459. Formulas can reference the value of another field in two ways. Like in
  1460. any other spreadsheet, you may reference fields with a letter/number
  1461. combination like @code{B3}, meaning the 2nd field in the 3rd row.
  1462. @c Such references are always fixed to that field, they don't change
  1463. @c when you copy and paste a formula to a different field. So
  1464. @c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
  1465. @noindent
  1466. Org also uses another, more general operator that looks like this:
  1467. @example
  1468. @@row$column
  1469. @end example
  1470. @noindent
  1471. Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
  1472. or relative to the current column like @samp{+1} or @samp{-2}.
  1473. The row specification only counts data lines and ignores horizontal
  1474. separator lines (hlines). You can use absolute row numbers
  1475. @samp{1}...@samp{N}, and row numbers relative to the current row like
  1476. @samp{+3} or @samp{-1}. Or specify the row relative to one of the
  1477. hlines: @samp{I} refers to the first hline@footnote{Note that only
  1478. hlines are counted that @emph{separate} table lines. If the table
  1479. starts with a hline above the header, it does not count.}, @samp{II} to
  1480. the second etc. @samp{-I} refers to the first such line above the
  1481. current line, @samp{+I} to the first such line below the current line.
  1482. You can also write @samp{III+2} which is the second data line after the
  1483. third hline in the table. Relative row numbers like @samp{-3} will not
  1484. cross hlines if the current line is too close to the hline. Instead,
  1485. the value directly at the hline is used.
  1486. @samp{0} refers to the current row and column. Also, if you omit
  1487. either the column or the row part of the reference, the current
  1488. row/column is implied.
  1489. Org's references with @emph{unsigned} numbers are fixed references
  1490. in the sense that if you use the same reference in the formula for two
  1491. different fields, the same field will be referenced each time.
  1492. Org's references with @emph{signed} numbers are floating
  1493. references because the same reference operator can reference different
  1494. fields depending on the field being calculated by the formula.
  1495. Here are a few examples:
  1496. @example
  1497. @@2$3 @r{2nd row, 3rd column}
  1498. C2 @r{same as previous}
  1499. $5 @r{column 5 in the current row}
  1500. E& @r{same as previous}
  1501. @@2 @r{current column, row 2}
  1502. @@-1$-3 @r{the field one row up, three columns to the left}
  1503. @@-I$2 @r{field just under hline above current row, column 2}
  1504. @end example
  1505. @subsubheading Range references
  1506. @cindex range references
  1507. @cindex references, to ranges
  1508. You may reference a rectangular range of fields by specifying two field
  1509. references connected by two dots @samp{..}. If both fields are in the
  1510. current row, you may simply use @samp{$2..$7}, but if at least one field
  1511. is in a different row, you need to use the general @code{@@row$column}
  1512. format at least for the first field (i.e the reference must start with
  1513. @samp{@@} in order to be interpreted correctly). Examples:
  1514. @example
  1515. $1..$3 @r{First three fields in the current row.}
  1516. $P..$Q @r{Range, using column names (see under Advanced)}
  1517. @@2$1..@@4$3 @r{6 fields between these two fields.}
  1518. A2..C4 @r{Same as above.}
  1519. @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
  1520. @end example
  1521. @noindent Range references return a vector of values that can be fed
  1522. into Calc vector functions. Empty fields in ranges are normally
  1523. suppressed, so that the vector contains only the non-empty fields (but
  1524. see the @samp{E} mode switch below). If there are no non-empty fields,
  1525. @samp{[0]} is returned to avoid syntax errors in formulas.
  1526. @subsubheading Named references
  1527. @cindex named references
  1528. @cindex references, named
  1529. @cindex name, of column or field
  1530. @cindex constants, in calculations
  1531. @samp{$name} is interpreted as the name of a column, parameter or
  1532. constant. Constants are defined globally through the variable
  1533. @code{org-table-formula-constants}, and locally (for the file) through a
  1534. line like
  1535. @example
  1536. #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
  1537. @end example
  1538. @noindent
  1539. Also properties (@pxref{Properties and Columns}) can be used as
  1540. constants in table formulas: For a property @samp{:Xyz:} use the name
  1541. @samp{$PROP_Xyz}, and the property will be searched in the current
  1542. outline entry and in the hierarchy above it. If you have the
  1543. @file{constants.el} package, it will also be used to resolve constants,
  1544. including natural constants like @samp{$h} for Planck's constant, and
  1545. units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
  1546. supply the values of constants in two different unit systems, @code{SI}
  1547. and @code{cgs}. Which one is used depends on the value of the variable
  1548. @code{constants-unit-system}. You can use the @code{#+STARTUP} options
  1549. @code{constSI} and @code{constcgs} to set this value for the current
  1550. buffer.}. Column names and parameters can be specified in special table
  1551. lines. These are described below, see @ref{Advanced features}. All
  1552. names must start with a letter, and further consist of letters and
  1553. numbers.
  1554. @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
  1555. @subsection Formula syntax for Calc
  1556. @cindex formula syntax, Calc
  1557. @cindex syntax, of formulas
  1558. A formula can be any algebraic expression understood by the Emacs
  1559. @file{Calc} package. @b{Note that @file{calc} has the
  1560. non-standard convention that @samp{/} has lower precedence than
  1561. @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
  1562. evaluation by @code{calc-eval} (@pxref{Calling Calc from
  1563. Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
  1564. Emacs Calc Manual}),
  1565. @c FIXME: The link to the Calc manual in HTML does not work.
  1566. variable substitution takes place according to the rules described above.
  1567. @cindex vectors, in table calculations
  1568. The range vectors can be directly fed into the Calc vector functions
  1569. like @samp{vmean} and @samp{vsum}.
  1570. @cindex format specifier
  1571. @cindex mode, for @file{calc}
  1572. A formula can contain an optional mode string after a semicolon. This
  1573. string consists of flags to influence Calc and other modes during
  1574. execution. By default, Org uses the standard Calc modes (precision
  1575. 12, angular units degrees, fraction and symbolic modes off. The display
  1576. format, however, has been changed to @code{(float 5)} to keep tables
  1577. compact. The default settings can be configured using the variable
  1578. @code{org-calc-default-modes}.
  1579. @example
  1580. p20 @r{switch the internal precision to 20 digits}
  1581. n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
  1582. D R @r{angle modes: degrees, radians}
  1583. F S @r{fraction and symbolic modes}
  1584. N @r{interpret all fields as numbers, use 0 for non-numbers}
  1585. T @r{force text interpretation}
  1586. E @r{keep empty fields in ranges}
  1587. @end example
  1588. @noindent
  1589. In addition, you may provide a @code{printf} format specifier to
  1590. reformat the final result. A few examples:
  1591. @example
  1592. $1+$2 @r{Sum of first and second field}
  1593. $1+$2;%.2f @r{Same, format result to two decimals}
  1594. exp($2)+exp($1) @r{Math functions can be used}
  1595. $0;%.1f @r{Reformat current cell to 1 decimal}
  1596. ($3-32)*5/9 @r{Degrees F -> C conversion}
  1597. $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
  1598. tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
  1599. sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
  1600. vmean($2..$7) @r{Compute column range mean, using vector function}
  1601. vmean($2..$7);EN @r{Same, but treat empty fields as 0}
  1602. taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
  1603. @end example
  1604. Calc also contains a complete set of logical operations. For example
  1605. @example
  1606. if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
  1607. @end example
  1608. @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
  1609. @subsection Emacs Lisp forms as formulas
  1610. @cindex Lisp forms, as table formulas
  1611. It is also possible to write a formula in Emacs Lisp; this can be useful
  1612. for string manipulation and control structures, if the Calc's
  1613. functionality is not enough. If a formula starts with a single quote
  1614. followed by an opening parenthesis, then it is evaluated as a lisp form.
  1615. The evaluation should return either a string or a number. Just as with
  1616. @file{calc} formulas, you can specify modes and a printf format after a
  1617. semicolon. With Emacs Lisp forms, you need to be conscious about the way
  1618. field references are interpolated into the form. By default, a
  1619. reference will be interpolated as a Lisp string (in double quotes)
  1620. containing the field. If you provide the @samp{N} mode switch, all
  1621. referenced elements will be numbers (non-number fields will be zero) and
  1622. interpolated as Lisp numbers, without quotes. If you provide the
  1623. @samp{L} flag, all fields will be interpolated literally, without quotes.
  1624. I.e., if you want a reference to be interpreted as a string by the Lisp
  1625. form, enclose the reference operator itself in double quotes, like
  1626. @code{"$3"}. Ranges are inserted as space-separated fields, so you can
  1627. embed them in list or vector syntax. A few examples, note how the
  1628. @samp{N} mode is used when we do computations in lisp.
  1629. @example
  1630. @r{Swap the first two characters of the content of column 1}
  1631. '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
  1632. @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
  1633. '(+ $1 $2);N
  1634. @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
  1635. '(apply '+ '($1..$4));N
  1636. @end example
  1637. @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
  1638. @subsection Field formulas
  1639. @cindex field formula
  1640. @cindex formula, for individual table field
  1641. To assign a formula to a particular field, type it directly into the
  1642. field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
  1643. press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
  1644. the field, the formula will be stored as the formula for this field,
  1645. evaluated, and the current field replaced with the result.
  1646. Formulas are stored in a special line starting with @samp{#+TBLFM:}
  1647. directly below the table. If you typed the equation in the 4th field of
  1648. the 3rd data line in the table, the formula will look like
  1649. @samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
  1650. with the appropriate commands, @i{absolute references} (but not relative
  1651. ones) in stored formulas are modified in order to still reference the
  1652. same field. Of cause this is not true if you edit the table structure
  1653. with normal editing commands - then you must fix the equations yourself.
  1654. Instead of typing an equation into the field, you may also use the
  1655. following command
  1656. @table @kbd
  1657. @kindex C-u C-c =
  1658. @item C-u C-c =
  1659. Install a new formula for the current field. The command prompts for a
  1660. formula, with default taken from the @samp{#+TBLFM:} line, applies
  1661. it to the current field and stores it.
  1662. @end table
  1663. @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
  1664. @subsection Column formulas
  1665. @cindex column formula
  1666. @cindex formula, for table column
  1667. Often in a table, the same formula should be used for all fields in a
  1668. particular column. Instead of having to copy the formula to all fields
  1669. in that column, Org allows to assign a single formula to an entire
  1670. column. If the table contains horizontal separator hlines, everything
  1671. before the first such line is considered part of the table @emph{header}
  1672. and will not be modified by column formulas.
  1673. To assign a formula to a column, type it directly into any field in the
  1674. column, preceded by an equal sign, like @samp{=$1+$2}. When you press
  1675. @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
  1676. field, the formula will be stored as the formula for the current column,
  1677. evaluated and the current field replaced with the result. If the field
  1678. contains only @samp{=}, the previously stored formula for this column is
  1679. used. For each column, Org will only remember the most recently
  1680. used formula. In the @samp{TBLFM:} line, column formulas will look like
  1681. @samp{$4=$1+$2}.
  1682. Instead of typing an equation into the field, you may also use the
  1683. following command:
  1684. @table @kbd
  1685. @kindex C-c =
  1686. @item C-c =
  1687. Install a new formula for the current column and replace current field with
  1688. the result of the formula. The command prompts for a formula, with default
  1689. taken from the @samp{#+TBLFM} line, applies it to the current field and
  1690. stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
  1691. will apply it to that many consecutive fields in the current column.
  1692. @end table
  1693. @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
  1694. @subsection Editing and debugging formulas
  1695. @cindex formula editing
  1696. @cindex editing, of table formulas
  1697. You can edit individual formulas in the minibuffer or directly in the
  1698. field. Org can also prepare a special buffer with all active
  1699. formulas of a table. When offering a formula for editing, Org
  1700. converts references to the standard format (like @code{B3} or @code{D&})
  1701. if possible. If you prefer to only work with the internal format (like
  1702. @code{@@3$2} or @code{$4}), configure the variable
  1703. @code{org-table-use-standard-references}.
  1704. @table @kbd
  1705. @kindex C-c =
  1706. @kindex C-u C-c =
  1707. @item C-c =
  1708. @itemx C-u C-c =
  1709. Edit the formula associated with the current column/field in the
  1710. minibuffer. See @ref{Column formulas} and @ref{Field formulas}.
  1711. @kindex C-u C-u C-c =
  1712. @item C-u C-u C-c =
  1713. Re-insert the active formula (either a
  1714. field formula, or a column formula) into the current field, so that you
  1715. can edit it directly in the field. The advantage over editing in the
  1716. minibuffer is that you can use the command @kbd{C-c ?}.
  1717. @kindex C-c ?
  1718. @item C-c ?
  1719. While editing a formula in a table field, highlight the field(s)
  1720. referenced by the reference at the cursor position in the formula.
  1721. @kindex C-c @}
  1722. @item C-c @}
  1723. Toggle the display of row and column numbers for a table, using
  1724. overlays. These are updated each time the table is aligned, you can
  1725. force it with @kbd{C-c C-c}.
  1726. @kindex C-c @{
  1727. @item C-c @{
  1728. Toggle the formula debugger on and off. See below.
  1729. @kindex C-c '
  1730. @item C-c '
  1731. Edit all formulas for the current table in a special buffer, where the
  1732. formulas will be displayed one per line. If the current field has an
  1733. active formula, the cursor in the formula editor will mark it.
  1734. While inside the special buffer, Org will automatically highlight
  1735. any field or range reference at the cursor position. You may edit,
  1736. remove and add formulas, and use the following commands:
  1737. @table @kbd
  1738. @kindex C-c C-c
  1739. @kindex C-x C-s
  1740. @item C-c C-c
  1741. @itemx C-x C-s
  1742. Exit the formula editor and store the modified formulas. With @kbd{C-u}
  1743. prefix, also apply the new formulas to the entire table.
  1744. @kindex C-c C-q
  1745. @item C-c C-q
  1746. Exit the formula editor without installing changes.
  1747. @kindex C-c C-r
  1748. @item C-c C-r
  1749. Toggle all references in the formula editor between standard (like
  1750. @code{B3}) and internal (like @code{@@3$2}).
  1751. @kindex @key{TAB}
  1752. @item @key{TAB}
  1753. Pretty-print or indent lisp formula at point. When in a line containing
  1754. a lisp formula, format the formula according to Emacs Lisp rules.
  1755. Another @key{TAB} collapses the formula back again. In the open
  1756. formula, @key{TAB} re-indents just like in Emacs lisp mode.
  1757. @kindex M-@key{TAB}
  1758. @item M-@key{TAB}
  1759. Complete Lisp symbols, just like in Emacs lisp mode.
  1760. @kindex S-@key{up}
  1761. @kindex S-@key{down}
  1762. @kindex S-@key{left}
  1763. @kindex S-@key{right}
  1764. @item S-@key{up}/@key{down}/@key{left}/@key{right}
  1765. Shift the reference at point. For example, if the reference is
  1766. @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
  1767. This also works for relative references, and for hline references.
  1768. @kindex M-S-@key{up}
  1769. @kindex M-S-@key{down}
  1770. @item M-S-@key{up}/@key{down}
  1771. Move the test line for column formulas in the Org buffer up and
  1772. down.
  1773. @kindex M-@key{up}
  1774. @kindex M-@key{down}
  1775. @item M-@key{up}/@key{down}
  1776. Scroll the window displaying the table.
  1777. @kindex C-c @}
  1778. @item C-c @}
  1779. Turn the coordinate grid in the table on and off.
  1780. @end table
  1781. @end table
  1782. Making a table field blank does not remove the formula associated with
  1783. the field, because that is stored in a different line (the @samp{TBLFM}
  1784. line) - during the next recalculation the field will be filled again.
  1785. To remove a formula from a field, you have to give an empty reply when
  1786. prompted for the formula, or to edit the @samp{#+TBLFM} line.
  1787. @kindex C-c C-c
  1788. You may edit the @samp{#+TBLFM} directly and re-apply the changed
  1789. equations with @kbd{C-c C-c} in that line, or with the normal
  1790. recalculation commands in the table.
  1791. @subsubheading Debugging formulas
  1792. @cindex formula debugging
  1793. @cindex debugging, of table formulas
  1794. When the evaluation of a formula leads to an error, the field content
  1795. becomes the string @samp{#ERROR}. If you would like see what is going
  1796. on during variable substitution and calculation in order to find a bug,
  1797. turn on formula debugging in the @code{Tbl} menu and repeat the
  1798. calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
  1799. field. Detailed information will be displayed.
  1800. @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
  1801. @subsection Updating the table
  1802. @cindex recomputing table fields
  1803. @cindex updating, table
  1804. Recalculation of a table is normally not automatic, but needs to be
  1805. triggered by a command. See @ref{Advanced features} for a way to make
  1806. recalculation at least semi-automatically.
  1807. In order to recalculate a line of a table or the entire table, use the
  1808. following commands:
  1809. @table @kbd
  1810. @kindex C-c *
  1811. @item C-c *
  1812. Recalculate the current row by first applying the stored column formulas
  1813. from left to right, and all field formulas in the current row.
  1814. @c
  1815. @kindex C-u C-c *
  1816. @item C-u C-c *
  1817. @kindex C-u C-c C-c
  1818. @itemx C-u C-c C-c
  1819. Recompute the entire table, line by line. Any lines before the first
  1820. hline are left alone, assuming that these are part of the table header.
  1821. @c
  1822. @kindex C-u C-u C-c *
  1823. @kindex C-u C-u C-c C-c
  1824. @item C-u C-u C-c *
  1825. @itemx C-u C-u C-c C-c
  1826. Iterate the table by recomputing it until no further changes occur.
  1827. This may be necessary if some computed fields use the value of other
  1828. fields that are computed @i{later} in the calculation sequence.
  1829. @end table
  1830. @node Advanced features, , Updating the table, The spreadsheet
  1831. @subsection Advanced features
  1832. If you want the recalculation of fields to happen automatically, or if
  1833. you want to be able to assign @i{names} to fields and columns, you need
  1834. to reserve the first column of the table for special marking characters.
  1835. @table @kbd
  1836. @kindex C-#
  1837. @item C-#
  1838. Rotate the calculation mark in first column through the states @samp{},
  1839. @samp{#}, @samp{*}, @samp{!}, @samp{$}. The meaning of these characters
  1840. is discussed below. When there is an active region, change all marks in
  1841. the region.
  1842. @end table
  1843. Here is an example of a table that collects exam results of students and
  1844. makes use of these features:
  1845. @example
  1846. @group
  1847. |---+---------+--------+--------+--------+-------+------|
  1848. | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
  1849. |---+---------+--------+--------+--------+-------+------|
  1850. | ! | | P1 | P2 | P3 | Tot | |
  1851. | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
  1852. | ^ | | m1 | m2 | m3 | mt | |
  1853. |---+---------+--------+--------+--------+-------+------|
  1854. | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
  1855. | # | Sara | 6 | 14 | 19 | 39 | 7.8 |
  1856. | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
  1857. |---+---------+--------+--------+--------+-------+------|
  1858. | | Average | | | | 29.7 | |
  1859. | ^ | | | | | at | |
  1860. | $ | max=50 | | | | | |
  1861. |---+---------+--------+--------+--------+-------+------|
  1862. #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
  1863. @end group
  1864. @end example
  1865. @noindent @b{Important}: Please note that for these special tables,
  1866. recalculating the table with @kbd{C-u C-c *} will only affect rows that
  1867. are marked @samp{#} or @samp{*}, and fields that have a formula assigned
  1868. to the field itself. The column formulas are not applied in rows with
  1869. empty first field.
  1870. @cindex marking characters, tables
  1871. The marking characters have the following meaning:
  1872. @table @samp
  1873. @item !
  1874. The fields in this line define names for the columns, so that you may
  1875. refer to a column as @samp{$Tot} instead of @samp{$6}.
  1876. @item ^
  1877. This row defines names for the fields @emph{above} the row. With such
  1878. a definition, any formula in the table may use @samp{$m1} to refer to
  1879. the value @samp{10}. Also, if you assign a formula to a names field, it
  1880. will be stored as @samp{$name=...}.
  1881. @item _
  1882. Similar to @samp{^}, but defines names for the fields in the row
  1883. @emph{below}.
  1884. @item $
  1885. Fields in this row can define @emph{parameters} for formulas. For
  1886. example, if a field in a @samp{$} row contains @samp{max=50}, then
  1887. formulas in this table can refer to the value 50 using @samp{$max}.
  1888. Parameters work exactly like constants, only that they can be defined on
  1889. a per-table basis.
  1890. @item #
  1891. Fields in this row are automatically recalculated when pressing
  1892. @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
  1893. is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
  1894. lines will be left alone by this command.
  1895. @item *
  1896. Selects this line for global recalculation with @kbd{C-u C-c *}, but
  1897. not for automatic recalculation. Use this when automatic
  1898. recalculation slows down editing too much.
  1899. @item
  1900. Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
  1901. All lines that should be recalculated should be marked with @samp{#}
  1902. or @samp{*}.
  1903. @item /
  1904. Do not export this line. Useful for lines that contain the narrowing
  1905. @samp{<N>} markers.
  1906. @end table
  1907. Finally, just to whet your appetite on what can be done with the
  1908. fantastic @file{calc} package, here is a table that computes the Taylor
  1909. series of degree @code{n} at location @code{x} for a couple of
  1910. functions.
  1911. @example
  1912. @group
  1913. |---+-------------+---+-----+--------------------------------------|
  1914. | | Func | n | x | Result |
  1915. |---+-------------+---+-----+--------------------------------------|
  1916. | # | exp(x) | 1 | x | 1 + x |
  1917. | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
  1918. | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
  1919. | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
  1920. | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
  1921. | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
  1922. |---+-------------+---+-----+--------------------------------------|
  1923. #+TBLFM: $5=taylor($2,$4,$3);n3
  1924. @end group
  1925. @end example
  1926. @node Hyperlinks, TODO Items, Tables, Top
  1927. @chapter Hyperlinks
  1928. @cindex hyperlinks
  1929. Like HTML, Org provides links inside a file, external links to
  1930. other files, Usenet articles, emails, and much more.
  1931. @menu
  1932. * Link format:: How links in Org are formatted
  1933. * Internal links:: Links to other places in the current file
  1934. * External links:: URL-like links to the world
  1935. * Handling links:: Creating, inserting and following
  1936. * Using links outside Org:: Linking from my C source code?
  1937. * Link abbreviations:: Shortcuts for writing complex links
  1938. * Search options:: Linking to a specific location
  1939. * Custom searches:: When the default search is not enough
  1940. @end menu
  1941. @node Link format, Internal links, Hyperlinks, Hyperlinks
  1942. @section Link format
  1943. @cindex link format
  1944. @cindex format, of links
  1945. Org will recognize plain URL-like links and activate them as
  1946. clickable links. The general link format, however, looks like this:
  1947. @example
  1948. [[link][description]] @r{or alternatively} [[link]]
  1949. @end example
  1950. Once a link in the buffer is complete (all brackets present), Org
  1951. will change the display so that @samp{description} is displayed instead
  1952. of @samp{[[link][description]]} and @samp{link} is displayed instead of
  1953. @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
  1954. which by default is an underlined face. You can directly edit the
  1955. visible part of a link. Note that this can be either the @samp{link}
  1956. part (if there is no description) or the @samp{description} part. To
  1957. edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
  1958. cursor on the link.
  1959. If you place the cursor at the beginning or just behind the end of the
  1960. displayed text and press @key{BACKSPACE}, you will remove the
  1961. (invisible) bracket at that location. This makes the link incomplete
  1962. and the internals are again displayed as plain text. Inserting the
  1963. missing bracket hides the link internals again. To show the
  1964. internal structure of all links, use the menu entry
  1965. @code{Org->Hyperlinks->Literal links}.
  1966. @node Internal links, External links, Link format, Hyperlinks
  1967. @section Internal links
  1968. @cindex internal links
  1969. @cindex links, internal
  1970. @cindex targets, for links
  1971. If the link does not look like a URL, it is considered to be internal in
  1972. the current file. Links such as @samp{[[My Target]]} or @samp{[[My
  1973. Target][Find my target]]} lead to a text search in the current file.
  1974. The link can be followed with @kbd{C-c C-o} when the cursor is on the
  1975. link, or with a mouse click (@pxref{Handling links}). The preferred
  1976. match for such a link is a dedicated target: the same string in double
  1977. angular brackets. Targets may be located anywhere; sometimes it is
  1978. convenient to put them into a comment line. For example
  1979. @example
  1980. # <<My Target>>
  1981. @end example
  1982. @noindent In HTML export (@pxref{HTML export}), such targets will become
  1983. named anchors for direct access through @samp{http} links@footnote{Note
  1984. that text before the first headline is usually not exported, so the
  1985. first such target should be after the first headline.}.
  1986. If no dedicated target exists, Org will search for the words in the
  1987. link. In the above example the search would be for @samp{my target}.
  1988. Links starting with a star like @samp{*My Target} restrict the search to
  1989. headlines. When searching, Org mode will first try an exact match, but
  1990. then move on to more and more lenient searches. For example, the link
  1991. @samp{[[*My Targets]]} will find any of the following:
  1992. @example
  1993. ** My targets
  1994. ** TODO my targets are bright
  1995. ** my 20 targets are
  1996. @end example
  1997. To insert a link targeting a headline, in-buffer completion can be used.
  1998. Just type a star followed by a few optional letters into the buffer and
  1999. press @kbd{M-@key{TAB}}. All headlines in the current buffer will be
  2000. offered as completions. @xref{Handling links}, for more commands
  2001. creating links.
  2002. Following a link pushes a mark onto Org's own mark ring. You can
  2003. return to the previous position with @kbd{C-c &}. Using this command
  2004. several times in direct succession goes back to positions recorded
  2005. earlier.
  2006. @menu
  2007. * Radio targets:: Make targets trigger links in plain text
  2008. @end menu
  2009. @node Radio targets, , Internal links, Internal links
  2010. @subsection Radio targets
  2011. @cindex radio targets
  2012. @cindex targets, radio
  2013. @cindex links, radio targets
  2014. Org can automatically turn any occurrences of certain target names
  2015. in normal text into a link. So without explicitly creating a link, the
  2016. text connects to the target radioing its position. Radio targets are
  2017. enclosed by triple angular brackets. For example, a target @samp{<<<My
  2018. Target>>>} causes each occurrence of @samp{my target} in normal text to
  2019. become activated as a link. The Org file is scanned automatically
  2020. for radio targets only when the file is first loaded into Emacs. To
  2021. update the target list during editing, press @kbd{C-c C-c} with the
  2022. cursor on or at a target.
  2023. @node External links, Handling links, Internal links, Hyperlinks
  2024. @section External links
  2025. @cindex links, external
  2026. @cindex external links
  2027. @cindex links, external
  2028. @cindex Gnus links
  2029. @cindex BBDB links
  2030. @cindex IRC links
  2031. @cindex URL links
  2032. @cindex file links
  2033. @cindex VM links
  2034. @cindex RMAIL links
  2035. @cindex WANDERLUST links
  2036. @cindex MH-E links
  2037. @cindex USENET links
  2038. @cindex SHELL links
  2039. @cindex Info links
  2040. @cindex elisp links
  2041. Org supports links to files, websites, Usenet and email messages,
  2042. BBDB database entries and links to both IRC conversations and their
  2043. logs. External links are URL-like locators. They start with a short
  2044. identifying string followed by a colon. There can be no space after
  2045. the colon. The following list shows examples for each link type.
  2046. @example
  2047. http://www.astro.uva.nl/~dominik @r{on the web}
  2048. file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
  2049. file:papers/last.pdf @r{file, relative path}
  2050. news:comp.emacs @r{Usenet link}
  2051. mailto:adent@@galaxy.net @r{Mail link}
  2052. vm:folder @r{VM folder link}
  2053. vm:folder#id @r{VM message link}
  2054. vm://myself@@some.where.org/folder#id @r{VM on remote machine}
  2055. wl:folder @r{WANDERLUST folder link}
  2056. wl:folder#id @r{WANDERLUST message link}
  2057. mhe:folder @r{MH-E folder link}
  2058. mhe:folder#id @r{MH-E message link}
  2059. rmail:folder @r{RMAIL folder link}
  2060. rmail:folder#id @r{RMAIL message link}
  2061. gnus:group @r{Gnus group link}
  2062. gnus:group#id @r{Gnus article link}
  2063. bbdb:Richard Stallman @r{BBDB link}
  2064. irc:/irc.com/#emacs/bob @r{IRC link}
  2065. shell:ls *.org @r{A shell command}
  2066. elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
  2067. @end example
  2068. A link should be enclosed in double brackets and may contain a
  2069. descriptive text to be displayed instead of the URL (@pxref{Link
  2070. format}), for example:
  2071. @example
  2072. [[http://www.gnu.org/software/emacs/][GNU Emacs]]
  2073. @end example
  2074. @noindent
  2075. If the description is a file name or URL that points to an image, HTML
  2076. export (@pxref{HTML export}) will inline the image as a clickable
  2077. button. If there is no description at all and the link points to an
  2078. image,
  2079. that image will be inlined into the exported HTML file.
  2080. @cindex angular brackets, around links
  2081. @cindex plain text external links
  2082. Org also finds external links in the normal text and activates them
  2083. as links. If spaces must be part of the link (for example in
  2084. @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
  2085. about the end of the link, enclose them in angular brackets.
  2086. @node Handling links, Using links outside Org, External links, Hyperlinks
  2087. @section Handling links
  2088. @cindex links, handling
  2089. Org provides methods to create a link in the correct syntax, to
  2090. insert it into an Org file, and to follow the link.
  2091. @table @kbd
  2092. @kindex C-c l
  2093. @cindex storing links
  2094. @item C-c l
  2095. Store a link to the current location. This is a @emph{global} command
  2096. which can be used in any buffer to create a link. The link will be
  2097. stored for later insertion into an Org buffer (see below). For
  2098. Org files, if there is a @samp{<<target>>} at the cursor, the
  2099. link points to the target. Otherwise it points to the current
  2100. headline. For VM, Rmail, Wanderlust, MH-E, Gnus and BBDB buffers, the
  2101. link will indicate the current article/entry. For W3 and W3M buffers,
  2102. the link goes to the current URL. For IRC links, if you set the
  2103. variable @code{org-irc-link-to-logs} to non-nil then @kbd{C-c l} will
  2104. store a @samp{file:/} style link to the relevant point in the logs for
  2105. the current conversation. Otherwise an @samp{irc:/} style link to the
  2106. user/channel/server under the point will be stored. For any other
  2107. files, the link will point to the file, with a search string
  2108. (@pxref{Search options}) pointing to the contents of the current line.
  2109. If there is an active region, the selected words will form the basis
  2110. of the search string. If the automatically created link is not
  2111. working correctly or accurately enough, you can write custom functions
  2112. to select the search string and to do the search for particular file
  2113. types - see @ref{Custom searches}. The key binding @kbd{C-c l} is
  2114. only a suggestion - see @ref{Installation}.
  2115. @c
  2116. @kindex C-c C-l
  2117. @cindex link completion
  2118. @cindex completion, of links
  2119. @cindex inserting links
  2120. @item C-c C-l
  2121. Insert a link. This prompts for a link to be inserted into the buffer. You
  2122. can just type a link, using text for an internal link, or one of the link
  2123. type prefixes mentioned in the examples above. All links stored during the
  2124. current session are part of the history for this prompt, so you can access
  2125. them with @key{up} and @key{down} (or @kbd{M-p/n}). Completion, on the other
  2126. hand, will help you to insert valid link prefixes like @samp{http:} or
  2127. @samp{ftp:}, including the prefixes defined through link abbreviations
  2128. (@pxref{Link abbreviations}). The link will be inserted into the
  2129. buffer@footnote{After insertion of a stored link, the link will be removed
  2130. from the list of stored links. To keep it in the list later use, use a
  2131. triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
  2132. @code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
  2133. If some text was selected when this command is called, the selected text
  2134. becomes the default description.@* Note that you don't have to use this
  2135. command to insert a link. Links in Org are plain text, and you can type
  2136. or paste them straight into the buffer. By using this command, the links are
  2137. automatically enclosed in double brackets, and you will be asked for the
  2138. optional descriptive text.
  2139. @c
  2140. @c If the link is a @samp{file:} link and
  2141. @c the linked file is located in the same directory as the current file or
  2142. @c a subdirectory of it, the path of the file will be inserted relative to
  2143. @c the current directory.
  2144. @c
  2145. @kindex C-u C-c C-l
  2146. @cindex file name completion
  2147. @cindex completion, of file names
  2148. @item C-u C-c C-l
  2149. When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
  2150. a file will be inserted and you may use file name completion to select
  2151. the name of the file. The path to the file is inserted relative to the
  2152. directory of the current org file, if the linked file is in the current
  2153. directory or in a sub-directory of it, or if the path is written relative
  2154. to the current directory using @samp{../}. Otherwise an absolute path
  2155. is used, if possible with @samp{~/} for your home directory. You can
  2156. force an absolute path with two @kbd{C-u} prefixes.
  2157. @c
  2158. @item C-c C-l @r{(with cursor on existing link)}
  2159. When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
  2160. link and description parts of the link.
  2161. @c
  2162. @cindex following links
  2163. @kindex C-c C-o
  2164. @item C-c C-o
  2165. Open link at point. This will launch a web browser for URLs (using
  2166. @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB
  2167. for the corresponding links, and execute the command in a shell link.
  2168. When the cursor is on an internal link, this commands runs the
  2169. corresponding search. When the cursor is on a TAG list in a headline,
  2170. it creates the corresponding TAGS view. If the cursor is on a time
  2171. stamp, it compiles the agenda for that date. Furthermore, it will visit
  2172. text and remote files in @samp{file:} links with Emacs and select a
  2173. suitable application for local non-text files. Classification of files
  2174. is based on file extension only. See option @code{org-file-apps}. If
  2175. you want to override the default application and visit the file with
  2176. Emacs, use a @kbd{C-u} prefix.
  2177. @c
  2178. @kindex mouse-2
  2179. @kindex mouse-1
  2180. @item mouse-2
  2181. @itemx mouse-1
  2182. On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
  2183. would. Under Emacs 22, also @kbd{mouse-1} will follow a link.
  2184. @c
  2185. @kindex mouse-3
  2186. @item mouse-3
  2187. Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
  2188. internal links to be displayed in another window@footnote{See the
  2189. variable @code{org-display-internal-link-with-indirect-buffer}}.
  2190. @c
  2191. @cindex mark ring
  2192. @kindex C-c %
  2193. @item C-c %
  2194. Push the current position onto the mark ring, to be able to return
  2195. easily. Commands following an internal link do this automatically.
  2196. @c
  2197. @cindex links, returning to
  2198. @kindex C-c &
  2199. @item C-c &
  2200. Jump back to a recorded position. A position is recorded by the
  2201. commands following internal links, and by @kbd{C-c %}. Using this
  2202. command several times in direct succession moves through a ring of
  2203. previously recorded positions.
  2204. @c
  2205. @kindex C-c C-x C-n
  2206. @kindex C-c C-x C-p
  2207. @cindex links, finding next/previous
  2208. @item C-c C-x C-n
  2209. @itemx C-c C-x C-p
  2210. Move forward/backward to the next link in the buffer. At the limit of
  2211. the buffer, the search fails once, and then wraps around. The key
  2212. bindings for this are really too long, you might want to bind this also
  2213. to @kbd{C-n} and @kbd{C-p}
  2214. @lisp
  2215. (add-hook 'org-load-hook
  2216. (lambda ()
  2217. (define-key 'org-mode-map "\C-n" 'org-next-link)
  2218. (define-key 'org-mode-map "\C-p" 'org-previous-link)))
  2219. @end lisp
  2220. @end table
  2221. @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
  2222. @section Using links outside Org
  2223. You can insert and follow links that have Org syntax not only in
  2224. Org, but in any Emacs buffer. For this, you should create two
  2225. global commands, like this (please select suitable global keys
  2226. yourself):
  2227. @lisp
  2228. (global-set-key "\C-c L" 'org-insert-link-global)
  2229. (global-set-key "\C-c o" 'org-open-at-point-global)
  2230. @end lisp
  2231. @node Link abbreviations, Search options, Using links outside Org, Hyperlinks
  2232. @section Link abbreviations
  2233. @cindex link abbreviations
  2234. @cindex abbreviation, links
  2235. Long URLs can be cumbersome to type, and often many similar links are
  2236. needed in a document. For this you can use link abbreviations. An
  2237. abbreviated link looks like this
  2238. @example
  2239. [[linkword:tag][description]]
  2240. @end example
  2241. @noindent
  2242. where the tag is optional. Such abbreviations are resolved according to
  2243. the information in the variable @code{org-link-abbrev-alist} that
  2244. relates the linkwords to replacement text. Here is an example:
  2245. @lisp
  2246. @group
  2247. (setq org-link-abbrev-alist
  2248. '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
  2249. ("google" . "http://www.google.com/search?q=")
  2250. ("ads" . "http://adsabs.harvard.edu/cgi-bin/
  2251. nph-abs_connect?author=%s&db_key=AST")))
  2252. @end group
  2253. @end lisp
  2254. If the replacement text contains the string @samp{%s}, it will be
  2255. replaced with the tag. Otherwise the tag will be appended to the string
  2256. in order to create the link. You may also specify a function that will
  2257. be called with the tag as the only argument to create the link.
  2258. With the above setting, you could link to a specific bug with
  2259. @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
  2260. @code{[[google:OrgMode]]} and find out what the Org author is
  2261. doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
  2262. If you need special abbreviations just for a single Org buffer, you
  2263. can define them in the file with
  2264. @example
  2265. #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
  2266. #+LINK: google http://www.google.com/search?q=%s
  2267. @end example
  2268. @noindent
  2269. In-buffer completion @pxref{Completion} can be used after @samp{[} to
  2270. complete link abbreviations.
  2271. @node Search options, Custom searches, Link abbreviations, Hyperlinks
  2272. @section Search options in file links
  2273. @cindex search option in file links
  2274. @cindex file links, searching
  2275. File links can contain additional information to make Emacs jump to a
  2276. particular location in the file when following a link. This can be a
  2277. line number or a search option after a double@footnote{For backward
  2278. compatibility, line numbers can also follow a single colon.} colon. For
  2279. example, when the command @kbd{C-c l} creates a link (@pxref{Handling
  2280. links}) to a file, it encodes the words in the current line as a search
  2281. string that can be used to find this line back later when following the
  2282. link with @kbd{C-c C-o}.
  2283. Here is the syntax of the different ways to attach a search to a file
  2284. link, together with an explanation:
  2285. @example
  2286. [[file:~/code/main.c::255]]
  2287. [[file:~/xx.org::My Target]]
  2288. [[file:~/xx.org::*My Target]]
  2289. [[file:~/xx.org::/regexp/]]
  2290. @end example
  2291. @table @code
  2292. @item 255
  2293. Jump to line 255.
  2294. @item My Target
  2295. Search for a link target @samp{<<My Target>>}, or do a text search for
  2296. @samp{my target}, similar to the search in internal links, see
  2297. @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
  2298. link will become an HTML reference to the corresponding named anchor in
  2299. the linked file.
  2300. @item *My Target
  2301. In an Org file, restrict search to headlines.
  2302. @item /regexp/
  2303. Do a regular expression search for @code{regexp}. This uses the Emacs
  2304. command @code{occur} to list all matches in a separate window. If the
  2305. target file is in Org mode, @code{org-occur} is used to create a
  2306. sparse tree with the matches.
  2307. @c If the target file is a directory,
  2308. @c @code{grep} will be used to search all files in the directory.
  2309. @end table
  2310. As a degenerate case, a file link with an empty file name can be used
  2311. to search the current file. For example, @code{[[file:::find me]]} does
  2312. a search for @samp{find me} in the current file, just as
  2313. @samp{[[find me]]} would.
  2314. @node Custom searches, , Search options, Hyperlinks
  2315. @section Custom Searches
  2316. @cindex custom search strings
  2317. @cindex search strings, custom
  2318. The default mechanism for creating search strings and for doing the
  2319. actual search related to a file link may not work correctly in all
  2320. cases. For example, BibTeX database files have many entries like
  2321. @samp{year="1993"} which would not result in good search strings,
  2322. because the only unique identification for a BibTeX entry is the
  2323. citation key.
  2324. If you come across such a problem, you can write custom functions to set
  2325. the right search string for a particular file type, and to do the search
  2326. for the string in the file. Using @code{add-hook}, these functions need
  2327. to be added to the hook variables
  2328. @code{org-create-file-search-functions} and
  2329. @code{org-execute-file-search-functions}. See the docstring for these
  2330. variables for more information. Org actually uses this mechanism
  2331. for Bib@TeX{} database files, and you can use the corresponding code as
  2332. an implementation example. Search for @samp{BibTeX links} in the source
  2333. file.
  2334. @node TODO Items, Tags, Hyperlinks, Top
  2335. @chapter TODO Items
  2336. @cindex TODO items
  2337. Org mode does not maintain TODO lists as separate documents. Instead,
  2338. TODO items are an integral part of the notes file, because TODO items
  2339. usually come up while taking notes! With Org mode, simply mark any
  2340. entry in a tree as being a TODO item. In this way, information is not
  2341. duplicated, and the entire context from which the TODO item emerged is
  2342. always present.
  2343. Of course, this technique for managing TODO items scatters them
  2344. throughout your notes file. Org mode compensates for this by providing
  2345. methods to give you an overview of all the things that you have to do.
  2346. @menu
  2347. * TODO basics:: Marking and displaying TODO entries
  2348. * TODO extensions:: Workflow and assignments
  2349. * Progress logging:: Dates and notes for progress
  2350. * Priorities:: Some things are more important than others
  2351. * Breaking down tasks:: Splitting a task into manageable pieces
  2352. * Checkboxes:: Tick-off lists
  2353. @end menu
  2354. @node TODO basics, TODO extensions, TODO Items, TODO Items
  2355. @section Basic TODO functionality
  2356. Any headline becomes a TODO item when it starts with the word
  2357. @samp{TODO}, for example:
  2358. @example
  2359. *** TODO Write letter to Sam Fortune
  2360. @end example
  2361. @noindent
  2362. The most important commands to work with TODO entries are:
  2363. @table @kbd
  2364. @kindex C-c C-t
  2365. @cindex cycling, of TODO states
  2366. @item C-c C-t
  2367. Rotate the TODO state of the current item among
  2368. @example
  2369. ,-> (unmarked) -> TODO -> DONE --.
  2370. '--------------------------------'
  2371. @end example
  2372. The same rotation can also be done ``remotely'' from the timeline and
  2373. agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
  2374. @kindex C-u C-c C-t
  2375. @item C-u C-c C-t
  2376. Select a specific keyword using completion or (if it has been set up)
  2377. the fast selection interface. For the latter, you need to assign keys
  2378. to TODO states, see @ref{Per-file keywords} and @ref{Setting tags} for
  2379. more information.
  2380. @kindex S-@key{right}
  2381. @kindex S-@key{left}
  2382. @item S-@key{right}
  2383. @itemx S-@key{left}
  2384. Select the following/preceding TODO state, similar to cycling. Useful
  2385. mostly if more than two TODO states are possible (@pxref{TODO
  2386. extensions}).
  2387. @kindex C-c C-v
  2388. @kindex C-c / t
  2389. @cindex sparse tree, for TODO
  2390. @item C-c C-v
  2391. @itemx C-c / t
  2392. View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
  2393. the entire buffer, but shows all TODO items and the headings hierarchy
  2394. above them. With a prefix argument, search for a specific TODO. You will be
  2395. prompted for the keyword, and you can also give a list of keywords like
  2396. @code{KWD1|KWD2|...}. With numeric prefix argument N, show the tree for the
  2397. Nth keyword in the variable @code{org-todo-keywords}. With two prefix
  2398. arguments, find all TODO and DONE entries.
  2399. @kindex C-c a t
  2400. @item C-c a t
  2401. Show the global TODO list. Collects the TODO items from all agenda
  2402. files (@pxref{Agenda Views}) into a single buffer. The new buffer will
  2403. be in @code{agenda-mode}, which provides commands to examine and
  2404. manipulate the TODO entries from the new buffer (@pxref{Agenda
  2405. commands}). @xref{Global TODO list}, for more information.
  2406. @kindex S-M-@key{RET}
  2407. @item S-M-@key{RET}
  2408. Insert a new TODO entry below the current one.
  2409. @end table
  2410. @node TODO extensions, Progress logging, TODO basics, TODO Items
  2411. @section Extended use of TODO keywords
  2412. @cindex extended TODO keywords
  2413. By default, marked TODO entries have one of only two states: TODO and
  2414. DONE. Org mode allows you to classify TODO items in more complex ways
  2415. with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
  2416. special setup, the TODO keyword system can work differently in different
  2417. files.
  2418. Note that @i{tags} are another way to classify headlines in general and
  2419. TODO items in particular (@pxref{Tags}).
  2420. @menu
  2421. * Workflow states:: From TODO to DONE in steps
  2422. * TODO types:: I do this, Fred does the rest
  2423. * Multiple sets in one file:: Mixing it all, and still finding your way
  2424. * Fast access to TODO states:: Single letter selection of a state
  2425. * Per-file keywords:: Different files, different requirements
  2426. * Faces for TODO keywords:: Highlighting states
  2427. @end menu
  2428. @node Workflow states, TODO types, TODO extensions, TODO extensions
  2429. @subsection TODO keywords as workflow states
  2430. @cindex TODO workflow
  2431. @cindex workflow states as TODO keywords
  2432. You can use TODO keywords to indicate different @emph{sequential} states
  2433. in the process of working on an item, for example@footnote{Changing
  2434. this variable only becomes effective after restarting Org mode in a
  2435. buffer.}:
  2436. @lisp
  2437. (setq org-todo-keywords
  2438. '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
  2439. @end lisp
  2440. The vertical bar separates the TODO keywords (states that @emph{need
  2441. action}) from the DONE states (which need @emph{no further action}. If
  2442. you don't provide the separator bar, the last state is used as the DONE
  2443. state.
  2444. @cindex completion, of TODO keywords
  2445. With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
  2446. to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
  2447. also use a numeric prefix argument to quickly select a specific state. For
  2448. example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
  2449. Or you can use @kbd{S-left} to go backward through the sequence. If you
  2450. define many keywords, you can use in-buffer completion
  2451. (@pxref{Completion}) or even a special one-key selection scheme
  2452. (@pxref{Fast access to TODO states}) to insert these words into the
  2453. buffer. Changing a TODO state can be logged with a timestamp, see
  2454. @ref{Tracking TODO state changes} for more information.
  2455. @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
  2456. @subsection TODO keywords as types
  2457. @cindex TODO types
  2458. @cindex names as TODO keywords
  2459. @cindex types as TODO keywords
  2460. The second possibility is to use TODO keywords to indicate different
  2461. @emph{types} of action items. For example, you might want to indicate
  2462. that items are for ``work'' or ``home''. Or, when you work with several
  2463. people on a single project, you might want to assign action items
  2464. directly to persons, by using their names as TODO keywords. This would
  2465. be set up like this:
  2466. @lisp
  2467. (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
  2468. @end lisp
  2469. In this case, different keywords do not indicate a sequence, but rather
  2470. different types. So the normal work flow would be to assign a task to a
  2471. person, and later to mark it DONE. Org mode supports this style by adapting
  2472. the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
  2473. @kbd{t} command in the timeline and agenda buffers.}. When used several
  2474. times in succession, it will still cycle through all names, in order to first
  2475. select the right type for a task. But when you return to the item after some
  2476. time and execute @kbd{C-c C-t} again, it will switch from any name directly
  2477. to DONE. Use prefix arguments or completion to quickly select a specific
  2478. name. You can also review the items of a specific TODO type in a sparse tree
  2479. by using a numeric prefix to @kbd{C-c C-v}. For example, to see all things
  2480. Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect Lucy's items
  2481. from all agenda files into a single buffer, you would use the numeric prefix
  2482. argument as well when creating the global TODO list: @kbd{C-3 C-c t}.
  2483. @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
  2484. @subsection Multiple keyword sets in one file
  2485. @cindex TODO keyword sets
  2486. Sometimes you may want to use different sets of TODO keywords in
  2487. parallel. For example, you may want to have the basic
  2488. @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
  2489. separate state indicating that an item has been canceled (so it is not
  2490. DONE, but also does not require action). Your setup would then look
  2491. like this:
  2492. @lisp
  2493. (setq org-todo-keywords
  2494. '((sequence "TODO" "|" "DONE")
  2495. (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
  2496. (sequence "|" "CANCELED")))
  2497. @end lisp
  2498. The keywords should all be different, this helps Org mode to keep track
  2499. of which subsequence should be used for a given entry. In this setup,
  2500. @kbd{C-c C-t} only operates within a subsequence, so it switches from
  2501. @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
  2502. (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
  2503. select the correct sequence. Besides the obvious ways like typing a
  2504. keyword or using completion, you may also apply the following commands:
  2505. @table @kbd
  2506. @kindex C-S-@key{right}
  2507. @kindex C-S-@key{left}
  2508. @item C-S-@key{right}
  2509. @itemx C-S-@key{left}
  2510. These keys jump from one TODO subset to the next. In the above example,
  2511. @kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
  2512. @code{REPORT}, and any of the words in the second row to @code{CANCELED}.
  2513. @kindex S-@key{right}
  2514. @kindex S-@key{left}
  2515. @item S-@key{right}
  2516. @itemx S-@key{left}
  2517. @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
  2518. @emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
  2519. would switch from @code{DONE} to @code{REPORT} in the example above.
  2520. @end table
  2521. @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
  2522. @subsection Fast access to TODO states
  2523. If you would like to quickly change an entry to an arbitrary TODO state
  2524. instead of cycling through the states, you can set up keys for
  2525. single-letter access to the states. This is done by adding the section
  2526. key after each keyword, in parenthesis. For example:
  2527. @lisp
  2528. (setq org-todo-keywords
  2529. '((sequence "TODO(t)" "|" "DONE(d)")
  2530. (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
  2531. (sequence "|" "CANCELED(c)")))
  2532. @end lisp
  2533. If you then press @code{C-u C-c C-t} followed by the selection key, the
  2534. entry will be switched to this state. @key{SPC} can be used to remove
  2535. any TODO keyword from an entry. Should you like this way of selecting
  2536. TODO states a lot, you might want to set the variable
  2537. @code{org-use-fast-todo-selection} to @code{t} and make this behavior
  2538. the default. Check also the variable
  2539. @code{org-fast-tag-selection-include-todo}, it allows to change the TODO
  2540. state through the tags interface (@pxref{Setting tags}), in case you
  2541. like to mingle the two concepts.
  2542. @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
  2543. @subsection Setting up keywords for individual files
  2544. @cindex keyword options
  2545. @cindex per-file keywords
  2546. It can be very useful to use different aspects of the TODO mechanism in
  2547. different files. For file-local settings, you need to add special lines
  2548. to the file which set the keywords and interpretation for that file
  2549. only. For example, to set one of the two examples discussed above, you
  2550. need one of the following lines, starting in column zero anywhere in the
  2551. file:
  2552. @example
  2553. #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
  2554. @end example
  2555. or
  2556. @example
  2557. #+TYP_TODO: Fred Sara Lucy Mike | DONE
  2558. @end example
  2559. A setup for using several sets in parallel would be:
  2560. @example
  2561. #+SEQ_TODO: TODO | DONE
  2562. #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
  2563. #+SEQ_TODO: | CANCELED
  2564. @end example
  2565. @cindex completion, of option keywords
  2566. @kindex M-@key{TAB}
  2567. @noindent To make sure you are using the correct keyword, type
  2568. @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
  2569. @cindex DONE, final TODO keyword
  2570. Remember that the keywords after the vertical bar (or the last keyword
  2571. if no bar is there) must always mean that the item is DONE (although you
  2572. may use a different word). After changing one of these lines, use
  2573. @kbd{C-c C-c} with the cursor still in the line to make the changes
  2574. known to Org mode@footnote{Org mode parses these lines only when
  2575. Org mode is activated after visiting a file. @kbd{C-c C-c} with the
  2576. cursor in a line starting with @samp{#+} is simply restarting Org mode
  2577. for the current buffer.}.
  2578. @node Faces for TODO keywords, , Per-file keywords, TODO extensions
  2579. @subsection Faces for TODO keywords
  2580. @cindex faces, for TODO keywords
  2581. Org mode highlights TODO keywords with special faces: @code{org-todo}
  2582. for keywords indicating that an item still has to be acted upon, and
  2583. @code{org-done} for keywords indicating that an item is finished. If
  2584. you are using more than 2 different states, you might want to use
  2585. special faces for some of them. This can be done using the variable
  2586. @code{org-todo-keyword-faces}. For example:
  2587. @lisp
  2588. (setq org-todo-keyword-faces
  2589. '(("TODO" . org-warning)
  2590. ("DEFERRED" . shadow)
  2591. ("CANCELED" . (:foreground "blue" :weight bold))))
  2592. @end lisp
  2593. While using a list with face properties as shown for CANCELED
  2594. @emph{should} work, this does not aways seem to be the case. If
  2595. necessary, define a special face and use that.
  2596. @page
  2597. @node Progress logging, Priorities, TODO extensions, TODO Items
  2598. @section Progress logging
  2599. @cindex progress logging
  2600. @cindex logging, of progress
  2601. Org mode can automatically record a time stamp and possibly a note when
  2602. you mark a TODO item as DONE, or even each time you change the state of
  2603. a TODO item. This system is highly configurable, settings can be on a
  2604. per-keyword basis and can be localized to a file or even a subtree. For
  2605. information on how to clock working time for a task, see @ref{Clocking
  2606. work time}.
  2607. @menu
  2608. * Closing items:: When was this entry marked DONE?
  2609. * Tracking TODO state changes:: When did the status change?
  2610. @end menu
  2611. @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
  2612. @subsection Closing items
  2613. The most basic logging is to keep track of @emph{when} a certain TODO
  2614. item was finished. This is achieved with@footnote{The corresponding
  2615. in-buffer setting is: @code{#+STARTUP: logdone}}.
  2616. @lisp
  2617. (setq org-log-done 'time)
  2618. @end lisp
  2619. @noindent
  2620. Then each time you turn an entry from a TODO (not-done) state into any
  2621. of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
  2622. just after the headline. If you turn the entry back into a TODO item
  2623. through further state cycling, that line will be removed again. If you
  2624. want to record a note along with the timestamp, use@footnote{The
  2625. corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
  2626. @lisp
  2627. (setq org-log-done 'note)
  2628. @end lisp
  2629. @noindent
  2630. You will then be prompted for a note, and that note will be stored below
  2631. the entry with a @samp{Closing Note} heading.
  2632. In the timeline (@pxref{Timeline}) and in the agenda
  2633. (@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
  2634. display the TODO items with a @samp{CLOSED} timestamp on each day,
  2635. giving you an overview of what has been done.
  2636. @node Tracking TODO state changes, , Closing items, Progress logging
  2637. @subsection Tracking TODO state changes
  2638. When TODO keywords are used as workflow states (@pxref{Workflow
  2639. states}), you might want to keep track of when a state change occurred
  2640. and maybe take a note about this change. Since it is normally too much
  2641. to record a note for every state, Org mode expects configuration on a
  2642. per-keyword basis for this. This is achieved by adding special markers
  2643. @samp{!} (for a time stamp) and @samp{@@} (for a note) in parenthesis
  2644. after each keyword. For example, with the setting
  2645. @lisp
  2646. (setq org-todo-keywords
  2647. '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
  2648. @end lisp
  2649. @noindent
  2650. you not only define global TODO keywords and fast access keys, but also
  2651. request that a time is recorded when the entry is turned into
  2652. DONE@footnote{It is possible that Org mode will record two time stamps
  2653. when you are using both @code{org-log-done} and state change logging.
  2654. However, it will never prompt for two notes - if you have configured
  2655. both, the state change recording note will take precedence and cancel
  2656. the @samp{Closing Note}.}, and that a note is recorded when switching to
  2657. WAIT or CANCELED. The setting for WAIT is even more special: The
  2658. @samp{!} after the slash means that in addition to the note taken when
  2659. entering the state, a time stamp should be recorded when @i{leaving} the
  2660. WAIT state, if and only if the @i{target} state does not configure
  2661. logging for entering it. So it has no effect when switching from WAIT
  2662. to DONE, because DONE is configured to record a timestamp only. But
  2663. when switching from WAIT back to TODO, the @samp{/!} in the WAIT
  2664. setting now triggers a timestamp even though TODO has no logging
  2665. configured.
  2666. You can use the exact same syntax for setting logging preferences local
  2667. to a buffer:
  2668. @example
  2669. #+SEQ_TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
  2670. @end example
  2671. In order to define logging settings that are local to a subtree or a
  2672. single item, define a LOGGING property in this entry. Any non-empty
  2673. LOGGING property resets all logging settings to nil. You may then turn
  2674. on logging for this specific tree using STARTUP keywords like
  2675. @code{lognotedone} or @code{logrepeat}, as well as adding state specific
  2676. settings like @code{TODO(!)}. For example
  2677. @example
  2678. * TODO Log each state with only a time
  2679. :PROPERTIES:
  2680. :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
  2681. :END:
  2682. * TODO Only log when switching to WAIT, and when repeating
  2683. :PROPERTIES:
  2684. :LOGGING: WAIT(@@) logrepeat
  2685. :END:
  2686. * TODO No logging at all
  2687. :PROPERTIES:
  2688. :LOGGING: nil
  2689. :END:
  2690. @end example
  2691. @node Priorities, Breaking down tasks, Progress logging, TODO Items
  2692. @section Priorities
  2693. @cindex priorities
  2694. If you use Org mode extensively, you may end up enough TODO items that
  2695. it starts to make sense to prioritize them. Prioritizing can be done by
  2696. placing a @emph{priority cookie} into the headline of a TODO item, like
  2697. this
  2698. @example
  2699. *** TODO [#A] Write letter to Sam Fortune
  2700. @end example
  2701. @noindent
  2702. By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
  2703. @samp{C}. @samp{A} is the highest priority. An entry without a cookie
  2704. is treated as priority @samp{B}. Priorities make a difference only in
  2705. the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have
  2706. no inherent meaning to Org mode.
  2707. Priorities can be attached to any outline tree entries; they do not need
  2708. to be TODO items.
  2709. @table @kbd
  2710. @kindex @kbd{C-c ,}
  2711. @item @kbd{C-c ,}
  2712. Set the priority of the current headline. The command prompts for a
  2713. priority character @samp{A}, @samp{B} or @samp{C}. When you press
  2714. @key{SPC} instead, the priority cookie is removed from the headline.
  2715. The priorities can also be changed ``remotely'' from the timeline and
  2716. agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
  2717. @c
  2718. @kindex S-@key{up}
  2719. @kindex S-@key{down}
  2720. @item S-@key{up}
  2721. @itemx S-@key{down}
  2722. Increase/decrease priority of current headline@footnote{See also the
  2723. option @code{org-priority-start-cycle-with-default'}.}. Note that these
  2724. keys are also used to modify time stamps (@pxref{Creating timestamps}).
  2725. Furthermore, these keys are also used by CUA mode (@pxref{Conflicts}).
  2726. @end table
  2727. You can change the range of allowed priorities by setting the variables
  2728. @code{org-highest-priority}, @code{org-lowest-priority}, and
  2729. @code{org-default-priority}. For an individual buffer, you may set
  2730. these values (highest, lowest, default) like this (please make sure that
  2731. the highest priority is earlier in the alphabet than the lowest
  2732. priority):
  2733. @example
  2734. #+PRIORITIES: A C B
  2735. @end example
  2736. @node Breaking down tasks, Checkboxes, Priorities, TODO Items
  2737. @section Breaking tasks down into subtasks
  2738. @cindex tasks, breaking down
  2739. It is often advisable to break down large tasks into smaller, manageable
  2740. subtasks. You can do this by creating an outline tree below a TODO
  2741. item, with detailed subtasks on the tree@footnote{To keep subtasks out
  2742. of the global TODO list, see the
  2743. @code{org-agenda-todo-list-sublevels}.}. Another possibility is the use
  2744. of checkboxes to identify (a hierarchy of) a large number of subtasks
  2745. (@pxref{Checkboxes}).
  2746. @node Checkboxes, , Breaking down tasks, TODO Items
  2747. @section Checkboxes
  2748. @cindex checkboxes
  2749. Every item in a plain list (@pxref{Plain lists}) can be made into a
  2750. checkbox by starting it with the string @samp{[ ]}. This feature is
  2751. similar to TODO items (@pxref{TODO Items}), but is more lightweight.
  2752. Checkboxes are not included into the global TODO list, so they are often
  2753. great to split a task into a number of simple steps. Or you can use
  2754. them in a shopping list. To toggle a checkbox, use @kbd{C-c C-c}, or
  2755. use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}).
  2756. Here is an example of a checkbox list.
  2757. @example
  2758. * TODO Organize party [2/4]
  2759. - [-] call people [1/3]
  2760. - [ ] Peter
  2761. - [X] Sarah
  2762. - [ ] Sam
  2763. - [X] order food
  2764. - [ ] think about what music to play
  2765. - [X] talk to the neighbors
  2766. @end example
  2767. Checkboxes work hierarchically, so if a checkbox item has children that
  2768. are checkboxes, toggling one of the children checkboxes will make the
  2769. parent checkbox reflect if none, some, or all of the children are
  2770. checked.
  2771. @cindex statistics, for checkboxes
  2772. @cindex checkbox statistics
  2773. The @samp{[2/4]} and @samp{[1/3]} in the first and second line are
  2774. cookies indicating how many checkboxes present in this entry have been
  2775. checked off, and the total number of checkboxes are present. This can
  2776. give you an idea on how many checkboxes remain, even without opening a
  2777. folded entry. The cookies can be placed into a headline or into (the
  2778. first line of) a plain list item. Each cookie covers all checkboxes
  2779. structurally below the headline/item on which the cookie appear. You
  2780. have to insert the cookie yourself by typing either @samp{[/]} or
  2781. @samp{[%]}. With @samp{[/]} you get an @samp{n out of m} result, as in
  2782. the examples above. With @samp{[%]} you get information about the
  2783. percentage of checkboxes checked (in the above example, this would be
  2784. @samp{[50%]} and @samp{[33%]}, respectively).
  2785. @noindent The following commands work with checkboxes:
  2786. @table @kbd
  2787. @kindex C-c C-c
  2788. @item C-c C-c
  2789. Toggle checkbox at point. With a prefix argument, set it to @samp{[-]},
  2790. which is considered to be an intermediate state.
  2791. @kindex C-c C-x C-b
  2792. @item C-c C-x C-b
  2793. Toggle checkbox at point.
  2794. @itemize @minus
  2795. @item
  2796. If there is an active region, toggle the first checkbox in the region
  2797. and set all remaining boxes to the same status as the first. If you
  2798. want to toggle all boxes in the region independently, use a prefix
  2799. argument.
  2800. @item
  2801. If the cursor is in a headline, toggle checkboxes in the region between
  2802. this headline and the next (so @emph{not} the entire subtree).
  2803. @item
  2804. If there is no active region, just toggle the checkbox at point.
  2805. @end itemize
  2806. @kindex M-S-@key{RET}
  2807. @item M-S-@key{RET}
  2808. Insert a new item with a checkbox.
  2809. This works only if the cursor is already in a plain list item
  2810. (@pxref{Plain lists}).
  2811. @kindex C-c #
  2812. @item C-c #
  2813. Update the checkbox statistics in the current outline entry. When
  2814. called with a @kbd{C-u} prefix, update the entire file. Checkbox
  2815. statistic cookies are updated automatically if you toggle checkboxes
  2816. with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}. If you
  2817. delete boxes or add/change them by hand, use this command to get things
  2818. back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
  2819. @end table
  2820. @node Tags, Properties and Columns, TODO Items, Top
  2821. @chapter Tags
  2822. @cindex tags
  2823. @cindex headline tagging
  2824. @cindex matching, tags
  2825. @cindex sparse tree, tag based
  2826. An excellent way to implement labels and contexts for cross-correlating
  2827. information is to assign @i{tags} to headlines. Org mode has extensive
  2828. support for tags.
  2829. Every headline can contain a list of tags; they occur at the end of the
  2830. headline. Tags are normal words containing letters, numbers, @samp{_},
  2831. and @samp{@@}. Tags must be preceded and followed by a single colon,
  2832. e.g., @samp{:WORK:}. Several tags can be specified, as in
  2833. @samp{:work:URGENT:}.
  2834. @menu
  2835. * Tag inheritance:: Tags use the tree structure of the outline
  2836. * Setting tags:: How to assign tags to a headline
  2837. * Tag searches:: Searching for combinations of tags
  2838. @end menu
  2839. @node Tag inheritance, Setting tags, Tags, Tags
  2840. @section Tag inheritance
  2841. @cindex tag inheritance
  2842. @cindex inheritance, of tags
  2843. @cindex sublevels, inclusion into tags match
  2844. @i{Tags} make use of the hierarchical structure of outline trees. If a
  2845. heading has a certain tag, all subheadings will inherit the tag as
  2846. well. For example, in the list
  2847. @example
  2848. * Meeting with the French group :work:
  2849. ** Summary by Frank :boss:notes:
  2850. *** TODO Prepare slides for him :action:
  2851. @end example
  2852. @noindent
  2853. the final heading will have the tags @samp{:work:}, @samp{:boss:},
  2854. @samp{:notes:}, and @samp{:action:} even though the final heading is not
  2855. explicitly marked with those tags. When executing tag searches and
  2856. Org mode finds that a certain headline matches the search criterion, it
  2857. will not check any sublevel headline, assuming that these also match and
  2858. that the list of matches could become very long because of that. If you
  2859. do want the sublevels be tested and listed as well, you may set the
  2860. variable @code{org-tags-match-list-sublevels}. To limit tag inheritance
  2861. to specific tags, or to turn it off entirely, use the variable
  2862. @code{org-use-tag-inheritance}.
  2863. @node Setting tags, Tag searches, Tag inheritance, Tags
  2864. @section Setting tags
  2865. @cindex setting tags
  2866. @cindex tags, setting
  2867. @kindex M-@key{TAB}
  2868. Tags can simply be typed into the buffer at the end of a headline.
  2869. After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
  2870. also a special command for inserting tags:
  2871. @table @kbd
  2872. @kindex C-c C-c
  2873. @item C-c C-c
  2874. @cindex completion, of tags
  2875. Enter new tags for the current headline. Org mode will either offer
  2876. completion or a special single-key interface for setting tags, see
  2877. below. After pressing @key{RET}, the tags will be inserted and aligned
  2878. to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
  2879. tags in the current buffer will be aligned to that column, just to make
  2880. things look nice. TAGS are automatically realigned after promotion,
  2881. demotion, and TODO state changes (@pxref{TODO basics}).
  2882. @end table
  2883. Org will support tag insertion based on a @emph{list of tags}. By
  2884. default this list is constructed dynamically, containing all tags
  2885. currently used in the buffer. You may also globally specify a hard list
  2886. of tags with the variable @code{org-tag-alist}. Finally you can set
  2887. the default tags for a given file with lines like
  2888. @example
  2889. #+TAGS: @@work @@home @@tennisclub
  2890. #+TAGS: laptop car pc sailboat
  2891. @end example
  2892. If you have globally defined your preferred set of tags using the
  2893. variable @code{org-tag-alist}, but would like to use a dynamic tag list
  2894. in a specific file, add an empty TAGS option line to that file:
  2895. @example
  2896. #+TAGS:
  2897. @end example
  2898. By default Org mode uses the standard minibuffer completion facilities for
  2899. entering tags. However, it also implements another, quicker, tag selection
  2900. method called @emph{fast tag selection}. This allows you to select and
  2901. deselect tags with just a single key press. For this to work well you should
  2902. assign unique letters to most of your commonly used tags. You can do this
  2903. globally by configuring the variable @code{org-tag-alist} in your
  2904. @file{.emacs} file. For example, you may find the need to tag many items in
  2905. different files with @samp{:@@home:}. In this case you can set something
  2906. like:
  2907. @lisp
  2908. (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
  2909. @end lisp
  2910. @noindent If the tag is only relevant to the file you are working on then you
  2911. can, instead, set the TAGS option line as:
  2912. @example
  2913. #+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
  2914. @end example
  2915. @noindent
  2916. You can also group together tags that are mutually exclusive. By using
  2917. braces, as in:
  2918. @example
  2919. #+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
  2920. @end example
  2921. @noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
  2922. and @samp{@@tennisclub} should be selected. Multiple such groups are allowed.
  2923. @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
  2924. these lines to activate any changes.
  2925. @noindent
  2926. To set these mutually exclusive groups in the variable @code{org-mode-alist}
  2927. you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
  2928. of the braces. The previous example would be set globally by the following
  2929. configuration:
  2930. @lisp
  2931. (setq org-tag-alist '((:startgroup . nil)
  2932. ("@@work" . ?w) ("@@home" . ?h)
  2933. ("@@tennisclub" . ?t)
  2934. (:endgroup . nil)
  2935. ("laptop" . ?l) ("pc" . ?p)))
  2936. @end lisp
  2937. If at least one tag has a selection key then pressing @kbd{C-c C-c} will
  2938. automatically present you with a special interface, listing inherited tags,
  2939. the tags of the current headline, and a list of all valid tags with
  2940. corresponding keys@footnote{Keys will automatically be assigned to tags which
  2941. have no configured keys.}. In this interface, you can use the following
  2942. keys:
  2943. @table @kbd
  2944. @item a-z...
  2945. Pressing keys assigned to tags will add or remove them from the list of
  2946. tags in the current line. Selecting a tag in a group of mutually
  2947. exclusive tags will turn off any other tags from that group.
  2948. @kindex @key{TAB}
  2949. @item @key{TAB}
  2950. Enter a tag in the minibuffer, even if the tag is not in the predefined
  2951. list. You will be able to complete on all tags present in the buffer.
  2952. @kindex @key{SPC}
  2953. @item @key{SPC}
  2954. Clear all tags for this line.
  2955. @kindex @key{RET}
  2956. @item @key{RET}
  2957. Accept the modified set.
  2958. @item C-g
  2959. Abort without installing changes.
  2960. @item q
  2961. If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
  2962. @item !
  2963. Turn off groups of mutually exclusive tags. Use this to (as an
  2964. exception) assign several tags from such a group.
  2965. @item C-c
  2966. Toggle auto-exit after the next change (see below).
  2967. If you are using expert mode, the first @kbd{C-c} will display the
  2968. selection window.
  2969. @end table
  2970. @noindent
  2971. This method lets you assign tags to a headline with very few keys. With
  2972. the above setup, you could clear the current tags and set @samp{@@home},
  2973. @samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
  2974. C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to
  2975. @samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
  2976. alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
  2977. @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
  2978. @key{RET} @key{RET}}.
  2979. If you find that most of the time, you need only a single key press to
  2980. modify your list of tags, set the variable
  2981. @code{org-fast-tag-selection-single-key}. Then you no longer have to
  2982. press @key{RET} to exit fast tag selection - it will immediately exit
  2983. after the first change. If you then occasionally need more keys, press
  2984. @kbd{C-c} to turn off auto-exit for the current tag selection process
  2985. (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
  2986. C-c}). If you set the variable to the value @code{expert}, the special
  2987. window is not even shown for single-key tag selection, it comes up only
  2988. when you press an extra @kbd{C-c}.
  2989. @node Tag searches, , Setting tags, Tags
  2990. @section Tag searches
  2991. @cindex tag searches
  2992. @cindex searching for tags
  2993. Once a system of tags has been set up, it can be used to collect related
  2994. information into special lists.
  2995. @table @kbd
  2996. @kindex C-c \
  2997. @kindex C-c / T
  2998. @item C-c \
  2999. @itemx C-c / T
  3000. Create a sparse tree with all headlines matching a tags search. With a
  3001. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  3002. @kindex C-c a m
  3003. @item C-c a m
  3004. Create a global list of tag matches from all agenda files.
  3005. @xref{Matching tags and properties}.
  3006. @kindex C-c a M
  3007. @item C-c a M
  3008. Create a global list of tag matches from all agenda files, but check
  3009. only TODO items and force checking subitems (see variable
  3010. @code{org-tags-match-list-sublevels}).
  3011. @end table
  3012. @cindex Boolean logic, for tag searches
  3013. A @i{tags} search string can use Boolean operators @samp{&} for AND and
  3014. @samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
  3015. Parenthesis are currently not implemented. A tag may also be preceded
  3016. by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
  3017. positive selection. The AND operator @samp{&} is optional when @samp{+}
  3018. or @samp{-} is present. Examples:
  3019. @table @samp
  3020. @item +work-boss
  3021. Select headlines tagged @samp{:work:}, but discard those also tagged
  3022. @samp{:boss:}.
  3023. @item work|laptop
  3024. Selects lines tagged @samp{:work:} or @samp{:laptop:}.
  3025. @item work|laptop&night
  3026. Like before, but require the @samp{:laptop:} lines to be tagged also
  3027. @samp{:night:}.
  3028. @end table
  3029. @cindex TODO keyword matching, with tags search
  3030. If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
  3031. can be useful to also match on the TODO keyword. This can be done by
  3032. adding a condition after a slash to a tags match. The syntax is similar
  3033. to the tag matches, but should be applied with consideration: For
  3034. example, a positive selection on several TODO keywords can not
  3035. meaningfully be combined with boolean AND. However, @emph{negative
  3036. selection} combined with AND can be meaningful. To make sure that only
  3037. lines are checked that actually have any TODO keyword, use @kbd{C-c a
  3038. M}, or equivalently start the TODO part after the slash with @samp{!}.
  3039. Examples:
  3040. @table @samp
  3041. @item work/WAITING
  3042. Select @samp{:work:}-tagged TODO lines with the specific TODO
  3043. keyword @samp{WAITING}.
  3044. @item work/!-WAITING-NEXT
  3045. Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
  3046. nor @samp{NEXT}
  3047. @item work/+WAITING|+NEXT
  3048. Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
  3049. @samp{NEXT}.
  3050. @end table
  3051. @cindex regular expressions, with tags search
  3052. Any element of the tag/todo match can be a regular expression - in this
  3053. case it must be enclosed in curly braces. For example,
  3054. @samp{work+@{^boss.*@}} matches headlines that contain the tag
  3055. @samp{:work:} and any tag @i{starting} with @samp{boss}.
  3056. @cindex level, require for tags/property match
  3057. @cindex category, require for tags/property match
  3058. You can also require a headline to be of a certain level or category, by
  3059. writing instead of any TAG an expression like @samp{LEVEL=3} or
  3060. @samp{CATEGORY="work"}, respectively. For example, a search
  3061. @samp{+LEVEL=3+boss/-DONE} lists all level three headlines that have the
  3062. tag @samp{boss} and are @emph{not} marked with the TODO keyword DONE.
  3063. @node Properties and Columns, Dates and Times, Tags, Top
  3064. @chapter Properties and Columns
  3065. @cindex properties
  3066. Properties are a set of key-value pairs associated with an entry. There
  3067. are two main applications for properties in Org mode. First, properties
  3068. are like tags, but with a value. Second, you can use properties to
  3069. implement (very basic) database capabilities in an Org buffer. For
  3070. an example of the first application, imagine maintaining a file where
  3071. you document bugs and plan releases of a piece of software. Instead of
  3072. using tags like @code{:release_1:}, @code{:release_2:}, one can use a
  3073. property, say @code{:Release:}, that in different subtrees has different
  3074. values, such as @code{1.0} or @code{2.0}. For an example of the second
  3075. application of properties, imagine keeping track of your music CD's,
  3076. where properties could be things such as the album artist, date of
  3077. release, number of tracks, and so on.
  3078. Properties can be conveniently edited and viewed in column view
  3079. (@pxref{Column view}).
  3080. Properties are like tags, but with a value. For example, in a file
  3081. where you document bugs and plan releases of a piece of software,
  3082. instead of using tags like @code{:release_1:}, @code{:release_2:}, it
  3083. can be more efficient to use a property @code{:Release:} with a value
  3084. @code{1.0} or @code{2.0}. Second, you can use properties to implement
  3085. (very basic) database capabilities in an Org buffer, for example to
  3086. create a list of Music CD's you own. You can edit and view properties
  3087. conveniently in column view (@pxref{Column view}).
  3088. @menu
  3089. * Property syntax:: How properties are spelled out
  3090. * Special properties:: Access to other Org mode features
  3091. * Property searches:: Matching property values
  3092. * Property inheritance:: Passing values down the tree
  3093. * Column view:: Tabular viewing and editing
  3094. * Property API:: Properties for Lisp programmers
  3095. @end menu
  3096. @node Property syntax, Special properties, Properties and Columns, Properties and Columns
  3097. @section Property syntax
  3098. @cindex property syntax
  3099. @cindex drawer, for properties
  3100. Properties are key-value pairs. They need to be inserted into a special
  3101. drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
  3102. is specified on a single line, with the key (surrounded by colons)
  3103. first, and the value after it. Here is an example:
  3104. @example
  3105. * CD collection
  3106. ** Classic
  3107. *** Goldberg Variations
  3108. :PROPERTIES:
  3109. :Title: Goldberg Variations
  3110. :Composer: J.S. Bach
  3111. :Artist: Glen Gould
  3112. :Publisher: Deutsche Grammphon
  3113. :NDisks: 1
  3114. :END:
  3115. @end example
  3116. You may define the allowed values for a particular property @samp{:Xyz:}
  3117. by setting a property @samp{:Xyz_ALL:}. This special property is
  3118. @emph{inherited}, so if you set it in a level 1 entry, it will apply to
  3119. the entire tree. When allowed values are defined, setting the
  3120. corresponding property becomes easier and is less prone to typing
  3121. errors. For the example with the CD collection, we can predefine
  3122. publishers and the number of disks in a box like this:
  3123. @example
  3124. * CD collection
  3125. :PROPERTIES:
  3126. :NDisks_ALL: 1 2 3 4
  3127. :Publisher_ALL: "Deutsche Grammophon" Phillips EMI
  3128. :END:
  3129. @end example
  3130. If you want to set properties that can be inherited by any entry in a
  3131. file, use a line like
  3132. @example
  3133. #+PROPERTY: NDisks_ALL 1 2 3 4
  3134. @end example
  3135. Property values set with the global variable
  3136. @code{org-global-properties} can be inherited by all entries in all
  3137. Org files.
  3138. @noindent
  3139. The following commands help to work with properties:
  3140. @table @kbd
  3141. @kindex M-@key{TAB}
  3142. @item M-@key{TAB}
  3143. After an initial colon in a line, complete property keys. All keys used
  3144. in the current file will be offered as possible completions.
  3145. @kindex C-c C-x p
  3146. @item C-c C-x p
  3147. Set a property. This prompts for a property name and a value. If
  3148. necessary, the property drawer is created as well.
  3149. @item M-x org-insert-property-drawer
  3150. Insert a property drawer into the current entry. The drawer will be
  3151. inserted early in the entry, but after the lines with planning
  3152. information like deadlines.
  3153. @kindex C-c C-c
  3154. @item C-c C-c
  3155. With the cursor in a property drawer, this executes property commands.
  3156. @item C-c C-c s
  3157. Set a property in the current entry. Both the property and the value
  3158. can be inserted using completion.
  3159. @kindex S-@key{right}
  3160. @kindex S-@key{left}
  3161. @item S-@key{left}/@key{right}
  3162. Switch property at point to the next/previous allowed value.
  3163. @item C-c C-c d
  3164. Remove a property from the current entry.
  3165. @item C-c C-c D
  3166. Globally remove a property, from all entries in the current file.
  3167. @item C-c C-c c
  3168. Compute the property at point, using the operator and scope from the
  3169. nearest column format definition.
  3170. @end table
  3171. @node Special properties, Property searches, Property syntax, Properties and Columns
  3172. @section Special properties
  3173. @cindex properties, special
  3174. Special properties provide alternative access method to Org mode
  3175. features discussed in the previous chapters, like the TODO state or the
  3176. priority of an entry. This interface exists so that you can include
  3177. these states into columns view (@pxref{Column view}), or to use them in
  3178. queries. The following property names are special and should not be
  3179. used as keys in the properties drawer:
  3180. @example
  3181. TODO @r{The TODO keyword of the entry.}
  3182. TAGS @r{The tags defined directly in the headline.}
  3183. ALLTAGS @r{All tags, including inherited ones.}
  3184. PRIORITY @r{The priority of the entry, a string with a single letter.}
  3185. DEADLINE @r{The deadline time string, without the angular brackets.}
  3186. SCHEDULED @r{The scheduling time stamp, without the angular brackets.}
  3187. TIMESTAMP @r{The first keyword-less time stamp in the entry.}
  3188. TIMESTAMP_IA @r{The first inactive time stamp in the entry.}
  3189. CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
  3190. @r{must be run first to compute the values.}
  3191. @end example
  3192. @node Property searches, Property inheritance, Special properties, Properties and Columns
  3193. @section Property searches
  3194. @cindex properties, searching
  3195. @cindex searching, of properties
  3196. To create sparse trees and special lists with selection based on properties,
  3197. the same commands are used as for tag searches (@pxref{Tag searches}), and
  3198. the same logic applies. For example, here is a search string:
  3199. @example
  3200. +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2+With=@{Sarah\|Denny@}
  3201. @end example
  3202. @noindent
  3203. If the comparison value is a plain number, a numerical comparison is done,
  3204. and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
  3205. @samp{>=}, and @samp{<>}. If the comparison value is enclosed in double
  3206. quotes, a string comparison is done, and the same operators are allowed. If
  3207. the comparison value is enclosed in curly braces, a regexp match is
  3208. performed, with @samp{=} meaning that the regexp matches the property value,
  3209. and @samp{<>} meaning that it does not match. So the search string in the
  3210. example finds entries tagged @samp{:work:} but not @samp{:boss:}, which also
  3211. have a priority value @samp{A}, a @samp{:Coffee:} property with the value
  3212. @samp{unlimited}, an @samp{Effort} property that is numerically smaller than
  3213. 2, and a @samp{:With:} property that is matched by the regular expression
  3214. @samp{Sarah\|Denny}.
  3215. You can configure Org mode to use property inheritance during a search, but
  3216. beware that this can slow down searches considerably. See @ref{Property
  3217. inheritance} for details.
  3218. There is also a special command for creating sparse trees based on a
  3219. single property:
  3220. @table @kbd
  3221. @kindex C-c / p
  3222. @item C-c / p
  3223. Create a sparse tree based on the value of a property. This first
  3224. prompts for the name of a property, and then for a value. A sparse tree
  3225. is created with all entries that define this property with the given
  3226. value. If you enclose the value into curly braces, it is interpreted as
  3227. a regular expression and matched against the property values.
  3228. @end table
  3229. @node Property inheritance, Column view, Property searches, Properties and Columns
  3230. @section Property Inheritance
  3231. @cindex properties, inheritance
  3232. @cindex inheritance, of properties
  3233. The outline structure of Org mode documents lends itself for an
  3234. inheritance model of properties: If the parent in a tree has a certain
  3235. property, the children can inherit this property. Org mode does not
  3236. turn this on by default, because it can slow down property searches
  3237. significantly and is often not needed. However, if you find inheritance
  3238. useful, you can turn it on by setting the variable
  3239. @code{org-use-property-inheritance}. It may be set to @code{t}, to make
  3240. all properties inherited from the parent, to a list of properties
  3241. that should be inherited, or to a regular expression that matches
  3242. inherited properties.
  3243. Org mode has a few properties for which inheritance is hard-coded, at
  3244. least for the special applications for which they are used:
  3245. @table @code
  3246. @item COLUMNS
  3247. The @code{:COLUMNS:} property defines the format of column view
  3248. (@pxref{Column view}). It is inherited in the sense that the level
  3249. where a @code{:COLUMNS:} property is defined is used as the starting
  3250. point for a column view table, independently of the location in the
  3251. subtree from where columns view is turned on.
  3252. @item CATEGORY
  3253. For agenda view, a category set through a @code{:CATEGORY:} property
  3254. applies to the entire subtree.
  3255. @item ARCHIVE
  3256. For archiving, the @code{:ARCHIVE:} property may define the archive
  3257. location for the entire subtree (@pxref{Moving subtrees}).
  3258. @item LOGGING
  3259. The LOGGING property may define logging settings for an entry or a
  3260. subtree (@pxref{Tracking TODO state changes}).
  3261. @end table
  3262. @node Column view, Property API, Property inheritance, Properties and Columns
  3263. @section Column view
  3264. A great way to view and edit properties in an outline tree is
  3265. @emph{column view}. In column view, each outline item is turned into a
  3266. table row. Columns in this table provide access to properties of the
  3267. entries. Org mode implements columns by overlaying a tabular structure
  3268. over the headline of each item. While the headlines have been turned
  3269. into a table row, you can still change the visibility of the outline
  3270. tree. For example, you get a compact table by switching to CONTENTS
  3271. view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
  3272. is active), but you can still open, read, and edit the entry below each
  3273. headline. Or, you can switch to column view after executing a sparse
  3274. tree command and in this way get a table only for the selected items.
  3275. Column view also works in agenda buffers (@pxref{Agenda Views}) where
  3276. queries have collected selected items, possibly from a number of files.
  3277. @menu
  3278. * Defining columns:: The COLUMNS format property
  3279. * Using column view:: How to create and use column view
  3280. * Capturing column view:: A dynamic block for column view
  3281. @end menu
  3282. @node Defining columns, Using column view, Column view, Column view
  3283. @subsection Defining columns
  3284. @cindex column view, for properties
  3285. @cindex properties, column view
  3286. Setting up a column view first requires defining the columns. This is
  3287. done by defining a column format line.
  3288. @menu
  3289. * Scope of column definitions:: Where defined, where valid?
  3290. * Column attributes:: Appearance and content of a column
  3291. @end menu
  3292. @node Scope of column definitions, Column attributes, Defining columns, Defining columns
  3293. @subsubsection Scope of column definitions
  3294. To define a column format for an entire file, use a line like
  3295. @example
  3296. #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3297. @end example
  3298. To specify a format that only applies to a specific tree, add a
  3299. @code{:COLUMNS:} property to the top node of that tree, for example:
  3300. @example
  3301. ** Top node for columns view
  3302. :PROPERTIES:
  3303. :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3304. :END:
  3305. @end example
  3306. If a @code{:COLUMNS:} property is present in an entry, it defines columns
  3307. for the entry itself, and for the entire subtree below it. Since the
  3308. column definition is part of the hierarchical structure of the document,
  3309. you can define columns on level 1 that are general enough for all
  3310. sublevels, and more specific columns further down, when you edit a
  3311. deeper part of the tree.
  3312. @node Column attributes, , Scope of column definitions, Defining columns
  3313. @subsubsection Column attributes
  3314. A column definition sets the attributes of a column. The general
  3315. definition looks like this:
  3316. @example
  3317. %[width]property[(title)][@{summary-type@}]
  3318. @end example
  3319. @noindent
  3320. Except for the percent sign and the property name, all items are
  3321. optional. The individual parts have the following meaning:
  3322. @example
  3323. width @r{An integer specifying the width of the column in characters.}
  3324. @r{If omitted, the width will be determined automatically.}
  3325. property @r{The property that should be edited in this column.}
  3326. (title) @r{The header text for the column. If omitted, the}
  3327. @r{property name is used.}
  3328. @{summary-type@} @r{The summary type. If specified, the column values for}
  3329. @r{parent nodes are computed from the children.}
  3330. @r{Supported summary types are:}
  3331. @{+@} @r{Sum numbers in this column.}
  3332. @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.}
  3333. @{$@} @r{Currency, short for @samp{+;%.2f}.}
  3334. @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
  3335. @{X@} @r{Checkbox status, [X] if all children are [X].}
  3336. @{X/@} @r{Checkbox status, [n/m].}
  3337. @{X%@} @r{Checkbox status, [n%].}
  3338. @end example
  3339. @noindent
  3340. Here is an example for a complete columns definition, along with allowed
  3341. values.
  3342. @example
  3343. :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.}
  3344. %10Time_Estimate@{:@} %CLOCKSUM
  3345. :Owner_ALL: Tammy Mark Karl Lisa Don
  3346. :Status_ALL: "In progress" "Not started yet" "Finished" ""
  3347. :Approved_ALL: "[ ]" "[X]"
  3348. @end example
  3349. The first column, @samp{%25ITEM}, means the first 25 characters of the
  3350. item itself, i.e. of the headline. You probably always should start the
  3351. column definition with the @samp{ITEM} specifier. The other specifiers
  3352. create columns @samp{Owner} with a list of names as allowed values, for
  3353. @samp{Status} with four different possible values, and for a checkbox
  3354. field @samp{Approved}. When no width is given after the @samp{%}
  3355. character, the column will be exactly as wide as it needs to be in order
  3356. to fully display all values. The @samp{Approved} column does have a
  3357. modified title (@samp{Approved?}, with a question mark). Summaries will
  3358. be created for the @samp{Time_Estimate} column by adding time duration
  3359. expressions like HH:MM, and for the @samp{Approved} column, by providing
  3360. an @samp{[X]} status if all children have been checked. The
  3361. @samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
  3362. in the subtree.
  3363. @node Using column view, Capturing column view, Defining columns, Column view
  3364. @subsection Using column view
  3365. @table @kbd
  3366. @tsubheading{Turning column view on and off}
  3367. @kindex C-c C-x C-c
  3368. @item C-c C-x C-c
  3369. Create the column view for the local environment. This command searches
  3370. the hierarchy, up from point, for a @code{:COLUMNS:} property that defines
  3371. a format. When one is found, the column view table is established for
  3372. the entire tree, starting from the entry that contains the @code{:COLUMNS:}
  3373. property. If none is found, the format is taken from the @code{#+COLUMNS}
  3374. line or from the variable @code{org-columns-default-format}, and column
  3375. view is established for the current entry and its subtree.
  3376. @kindex r
  3377. @item r
  3378. Recreate the column view, to include recent changes made in the buffer.
  3379. @kindex g
  3380. @item g
  3381. Same as @kbd{r}.
  3382. @kindex q
  3383. @item q
  3384. Exit column view.
  3385. @tsubheading{Editing values}
  3386. @item @key{left} @key{right} @key{up} @key{down}
  3387. Move through the column view from field to field.
  3388. @kindex S-@key{left}
  3389. @kindex S-@key{right}
  3390. @item S-@key{left}/@key{right}
  3391. Switch to the next/previous allowed value of the field. For this, you
  3392. have to have specified allowed values for a property.
  3393. @kindex n
  3394. @kindex p
  3395. @itemx n / p
  3396. Same as @kbd{S-@key{left}/@key{right}}
  3397. @kindex e
  3398. @item e
  3399. Edit the property at point. For the special properties, this will
  3400. invoke the same interface that you normally use to change that
  3401. property. For example, when editing a TAGS property, the tag completion
  3402. or fast selection interface will pop up.
  3403. @kindex C-c C-c
  3404. @item C-c C-c
  3405. When there is a checkbox at point, toggle it.
  3406. @kindex v
  3407. @item v
  3408. View the full value of this property. This is useful if the width of
  3409. the column is smaller than that of the value.
  3410. @kindex a
  3411. @item a
  3412. Edit the list of allowed values for this property. If the list is found
  3413. in the hierarchy, the modified values is stored there. If no list is
  3414. found, the new value is stored in the first entry that is part of the
  3415. current column view.
  3416. @tsubheading{Modifying the table structure}
  3417. @kindex <
  3418. @kindex >
  3419. @item < / >
  3420. Make the column narrower/wider by one character.
  3421. @kindex S-M-@key{right}
  3422. @item S-M-@key{right}
  3423. Insert a new column, to the right of the current column.
  3424. @kindex S-M-@key{left}
  3425. @item S-M-@key{left}
  3426. Delete the current column.
  3427. @end table
  3428. @node Capturing column view, , Using column view, Column view
  3429. @subsection Capturing column view
  3430. Since column view is just an overlay over a buffer, it cannot be
  3431. exported or printed directly. If you want to capture a column view, use
  3432. this @code{columnview} dynamic block (@pxref{Dynamic blocks}). The frame
  3433. of this block looks like this:
  3434. @example
  3435. * The column view
  3436. #+BEGIN: columnview :hlines 1 :id "label"
  3437. #+END:
  3438. @end example
  3439. @noindent This dynamic block has the following parameters:
  3440. @table @code
  3441. @item :id
  3442. This is most important parameter. Column view is a feature that is
  3443. often localized to a certain (sub)tree, and the capture block might be
  3444. in a different location in the file. To identify the tree whose view to
  3445. capture, you can use 3 values:
  3446. @example
  3447. local @r{use the tree in which the capture block is located}
  3448. global @r{make a global view, including all headings in the file}
  3449. "label" @r{call column view in the tree that has and @code{:ID:}}
  3450. @r{property with the value @i{label}}
  3451. @end example
  3452. @item :hlines
  3453. When @code{t}, insert a hline after every line. When a number N, insert
  3454. a hline before each headline with level @code{<= N}.
  3455. @item :vlines
  3456. When set to @code{t}, enforce column groups to get vertical lines.
  3457. @item :maxlevel
  3458. When set to a number, don't capture entries below this level.
  3459. @item :skip-empty-rows
  3460. When set to @code{t}, skip row where the only non-empty specifier of the
  3461. column view is @code{ITEM}.
  3462. @end table
  3463. @noindent
  3464. The following commands insert or update the dynamic block:
  3465. @table @kbd
  3466. @kindex C-c C-x r
  3467. @item C-c C-x r
  3468. Insert a dynamic block capturing a column view. You will be prompted
  3469. for the scope or id of the view.
  3470. @kindex C-c C-c
  3471. @item C-c C-c
  3472. @kindex C-c C-x C-u
  3473. @itemx C-c C-x C-u
  3474. Update dynamical block at point. The cursor needs to be in the
  3475. @code{#+BEGIN} line of the dynamic block.
  3476. @kindex C-u C-c C-x C-u
  3477. @item C-u C-c C-x C-u
  3478. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  3479. you have several clock table blocks in a buffer.
  3480. @end table
  3481. @node Property API, , Column view, Properties and Columns
  3482. @section The Property API
  3483. @cindex properties, API
  3484. @cindex API, for properties
  3485. There is a full API for accessing and changing properties. This API can
  3486. be used by Emacs Lisp programs to work with properties and to implement
  3487. features based on them. For more information see @ref{Using the
  3488. property API}.
  3489. @node Dates and Times, Remember, Properties and Columns, Top
  3490. @chapter Dates and Times
  3491. @cindex dates
  3492. @cindex times
  3493. @cindex time stamps
  3494. @cindex date stamps
  3495. To assist project planning, TODO items can be labeled with a date and/or
  3496. a time. The specially formatted string carrying the date and time
  3497. information is called a @emph{timestamp} in Org mode. This may be a
  3498. little confusing because timestamp is often used as indicating when
  3499. something was created or last changed. However, in Org mode this term
  3500. is used in a much wider sense.
  3501. @menu
  3502. * Timestamps:: Assigning a time to a tree entry
  3503. * Creating timestamps:: Commands which insert timestamps
  3504. * Deadlines and scheduling:: Planning your work
  3505. * Clocking work time:: Tracking how long you spend on a task
  3506. * Effort estimates:: Planning work effort in advance
  3507. @end menu
  3508. @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
  3509. @section Timestamps, deadlines and scheduling
  3510. @cindex time stamps
  3511. @cindex ranges, time
  3512. @cindex date stamps
  3513. @cindex deadlines
  3514. @cindex scheduling
  3515. A time stamp is a specification of a date (possibly with time or a range
  3516. of times) in a special format, either @samp{<2003-09-16 Tue>} or
  3517. @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
  3518. 12:00-12:30>}@footnote{This is the standard ISO date/time format. To
  3519. use an alternative format, see @ref{Custom time format}.}. A time stamp
  3520. can appear anywhere in the headline or body of an Org tree entry. Its
  3521. presence causes entries to be shown on specific dates in the agenda
  3522. (@pxref{Weekly/daily agenda}). We distinguish:
  3523. @table @var
  3524. @item Plain time stamp; Event; Appointment
  3525. @cindex timestamp
  3526. A simple time stamp just assigns a date/time to an item. This is just
  3527. like writing down an appointment or event in a paper agenda. In the
  3528. timeline and agenda displays, the headline of an entry associated with a
  3529. plain time stamp will be shown exactly on that date.
  3530. @example
  3531. * Meet Peter at the movies <2006-11-01 Wed 19:15>
  3532. * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
  3533. @end example
  3534. @item Time stamp with repeater interval
  3535. @cindex timestamp, with repeater interval
  3536. A time stamp may contain a @emph{repeater interval}, indicating that it
  3537. applies not only on the given date, but again and again after a certain
  3538. interval of N days (d), weeks (w), months(m), or years(y). The
  3539. following will show up in the agenda every Wednesday:
  3540. @example
  3541. * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
  3542. @end example
  3543. @item Diary-style sexp entries
  3544. For more complex date specifications, Org mode supports using the
  3545. special sexp diary entries implemented in the Emacs calendar/diary
  3546. package. For example
  3547. @example
  3548. * The nerd meeting on every 2nd Thursday of the month
  3549. <%%(diary-float t 4 2)>
  3550. @end example
  3551. @item Time/Date range
  3552. @cindex timerange
  3553. @cindex date range
  3554. Two time stamps connected by @samp{--} denote a range. The headline
  3555. will be shown on the first and last day of the range, and on any dates
  3556. that are displayed and fall in the range. Here is an example:
  3557. @example
  3558. ** Meeting in Amsterdam
  3559. <2004-08-23 Mon>--<2004-08-26 Thu>
  3560. @end example
  3561. @item Inactive time stamp
  3562. @cindex timestamp, inactive
  3563. @cindex inactive timestamp
  3564. Just like a plain time stamp, but with square brackets instead of
  3565. angular ones. These time stamps are inactive in the sense that they do
  3566. @emph{not} trigger an entry to show up in the agenda.
  3567. @example
  3568. * Gillian comes late for the fifth time [2006-11-01 Wed]
  3569. @end example
  3570. @end table
  3571. @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
  3572. @section Creating timestamps
  3573. @cindex creating timestamps
  3574. @cindex timestamps, creating
  3575. For Org mode to recognize time stamps, they need to be in the specific
  3576. format. All commands listed below produce time stamps in the correct
  3577. format.
  3578. @table @kbd
  3579. @kindex C-c .
  3580. @item C-c .
  3581. Prompt for a date and insert a corresponding time stamp. When the
  3582. cursor is at a previously used time stamp, it is updated to NOW. When
  3583. this command is used twice in succession, a time range is inserted.
  3584. @c
  3585. @kindex C-u C-c .
  3586. @item C-u C-c .
  3587. Like @kbd{C-c .}, but use the alternative format which contains date
  3588. and time. The default time can be rounded to multiples of 5 minutes,
  3589. see the option @code{org-time-stamp-rounding-minutes}.
  3590. @c
  3591. @kindex C-c !
  3592. @item C-c !
  3593. Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
  3594. an agenda entry.
  3595. @c
  3596. @kindex C-c <
  3597. @item C-c <
  3598. Insert a time stamp corresponding to the cursor date in the Calendar.
  3599. @c
  3600. @kindex C-c >
  3601. @item C-c >
  3602. Access the Emacs calendar for the current date. If there is a
  3603. timestamp in the current line, go to the corresponding date
  3604. instead.
  3605. @c
  3606. @kindex C-c C-o
  3607. @item C-c C-o
  3608. Access the agenda for the date given by the time stamp or -range at
  3609. point (@pxref{Weekly/daily agenda}).
  3610. @c
  3611. @kindex S-@key{left}
  3612. @kindex S-@key{right}
  3613. @item S-@key{left}
  3614. @itemx S-@key{right}
  3615. Change date at cursor by one day. These key bindings conflict with
  3616. CUA mode (@pxref{Conflicts}).
  3617. @c
  3618. @kindex S-@key{up}
  3619. @kindex S-@key{down}
  3620. @item S-@key{up}
  3621. @itemx S-@key{down}
  3622. Change the item under the cursor in a timestamp. The cursor can be on a
  3623. year, month, day, hour or minute. Note that if the cursor is in a
  3624. headline and not at a time stamp, these same keys modify the priority of
  3625. an item. (@pxref{Priorities}). The key bindings also conflict with
  3626. CUA mode (@pxref{Conflicts}).
  3627. @c
  3628. @kindex C-c C-y
  3629. @cindex evaluate time range
  3630. @item C-c C-y
  3631. Evaluate a time range by computing the difference between start and end.
  3632. With a prefix argument, insert result after the time range (in a table: into
  3633. the following column).
  3634. @end table
  3635. @menu
  3636. * The date/time prompt:: How Org mode helps you entering date and time
  3637. * Custom time format:: Making dates look different
  3638. @end menu
  3639. @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
  3640. @subsection The date/time prompt
  3641. @cindex date, reading in minibuffer
  3642. @cindex time, reading in minibuffer
  3643. When Org mode prompts for a date/time, the default is shown as an ISO
  3644. date, and the prompt therefore seems to ask for an ISO date. But it
  3645. will in fact accept any string containing some date and/or time
  3646. information, and it is really smart about interpreting your input. You
  3647. can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
  3648. copied from an email message. Org mode will find whatever information
  3649. is in there and derive anything you have not specified from the
  3650. @emph{default date and time}. The default is usually the current date
  3651. and time, but when modifying an existing time stamp, or when entering
  3652. the second stamp of a range, it is taken from the stamp in the buffer.
  3653. When filling in information, Org mode assumes that most of the time you
  3654. will want to enter a date in the future: If you omit the month/year and
  3655. the given day/month is @i{before} today, it will assume that you mean a
  3656. future date@footnote{See the variable
  3657. @code{org-read-date-prefer-future}.}.
  3658. For example, lets assume that today is @b{June 13, 2006}. Here is how
  3659. various inputs will be interpreted, the items filled in by Org mode are
  3660. in @b{bold}.
  3661. @example
  3662. 3-2-5 --> 2003-02-05
  3663. 14 --> @b{2006}-@b{06}-14
  3664. 12 --> @b{2006}-@b{07}-12
  3665. Fri --> nearest Friday (defaultdate or later)
  3666. sep 15 --> @b{2006}-11-15
  3667. feb 15 --> @b{2007}-02-15
  3668. sep 12 9 --> 2009-09-12
  3669. 12:45 --> @b{2006}-@b{06}-@b{13} 12:45
  3670. 22 sept 0:34 --> @b{2006}-09-22 0:34
  3671. w4 --> ISO week for of the current year @b{2006}
  3672. 2012 w4 fri --> Friday of ISO week 4 in 2012
  3673. 2012-w04-5 --> Same as above
  3674. @end example
  3675. Furthermore you can specify a relative date by giving, as the
  3676. @emph{first} thing in the input: a plus/minus sign, a number and a
  3677. letter [dwmy] to indicate change in days weeks, months, years. With a
  3678. single plus or minus, the date is always relative to today. With a
  3679. double plus or minus, it is relative to the default date. If instead of
  3680. a single letter, you use the abbreviation of day name, the date will be
  3681. the nth such day. E.g.
  3682. @example
  3683. +0 --> today
  3684. . --> today
  3685. +4d --> four days from today
  3686. +4 --> same as above
  3687. +2w --> two weeks from today
  3688. ++5 --> five days from default date
  3689. +2tue --> second tuesday from now.
  3690. @end example
  3691. The function understands English month and weekday abbreviations. If
  3692. you want to use unabbreviated names and/or other languages, configure
  3693. the variables @code{parse-time-months} and @code{parse-time-weekdays}.
  3694. @cindex calendar, for selecting date
  3695. Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
  3696. you don't need/want the calendar, configure the variable
  3697. @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
  3698. prompt, either by clicking on a date in the calendar, or by pressing
  3699. @key{RET}, the date selected in the calendar will be combined with the
  3700. information entered at the prompt. You can control the calendar fully
  3701. from the minibuffer:
  3702. @kindex <
  3703. @kindex >
  3704. @kindex mouse-1
  3705. @kindex S-@key{right}
  3706. @kindex S-@key{left}
  3707. @kindex S-@key{down}
  3708. @kindex S-@key{up}
  3709. @kindex M-S-@key{right}
  3710. @kindex M-S-@key{left}
  3711. @kindex @key{RET}
  3712. @example
  3713. > / < @r{Scroll calendar forward/backward by one month.}
  3714. mouse-1 @r{Select date by clicking on it.}
  3715. S-@key{right}/@key{left} @r{One day forward/backward.}
  3716. S-@key{down}/@key{up} @r{One week forward/backward.}
  3717. M-S-@key{right}/@key{left} @r{One month forward/backward.}
  3718. @key{RET} @r{Choose date in calendar.}
  3719. @end example
  3720. The actions of the date/time prompt may seem complex, but I assure you they
  3721. will grow on you, and you will start getting annoyed by pretty much any other
  3722. way of entering a date/time out there. To help you understand what is going
  3723. on, the current interpretation of your input will be displayed live in the
  3724. minibuffer@footnote{If you find this distracting, turn the display of with
  3725. @code{org-read-date-display-live}.}.
  3726. @node Custom time format, , The date/time prompt, Creating timestamps
  3727. @subsection Custom time format
  3728. @cindex custom date/time format
  3729. @cindex time format, custom
  3730. @cindex date format, custom
  3731. Org mode uses the standard ISO notation for dates and times as it is
  3732. defined in ISO 8601. If you cannot get used to this and require another
  3733. representation of date and time to keep you happy, you can get it by
  3734. customizing the variables @code{org-display-custom-times} and
  3735. @code{org-time-stamp-custom-formats}.
  3736. @table @kbd
  3737. @kindex C-c C-x C-t
  3738. @item C-c C-x C-t
  3739. Toggle the display of custom formats for dates and times.
  3740. @end table
  3741. @noindent
  3742. Org mode needs the default format for scanning, so the custom date/time
  3743. format does not @emph{replace} the default format - instead it is put
  3744. @emph{over} the default format using text properties. This has the
  3745. following consequences:
  3746. @itemize @bullet
  3747. @item
  3748. You cannot place the cursor onto a time stamp anymore, only before or
  3749. after.
  3750. @item
  3751. The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
  3752. each component of a time stamp. If the cursor is at the beginning of
  3753. the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
  3754. just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
  3755. time will be changed by one minute.
  3756. @item
  3757. If the time stamp contains a range of clock times or a repeater, these
  3758. will not be overlayed, but remain in the buffer as they were.
  3759. @item
  3760. When you delete a time stamp character-by-character, it will only
  3761. disappear from the buffer after @emph{all} (invisible) characters
  3762. belonging to the ISO timestamp have been removed.
  3763. @item
  3764. If the custom time stamp format is longer than the default and you are
  3765. using dates in tables, table alignment will be messed up. If the custom
  3766. format is shorter, things do work as expected.
  3767. @end itemize
  3768. @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
  3769. @section Deadlines and scheduling
  3770. A time stamp may be preceded by special keywords to facilitate planning:
  3771. @table @var
  3772. @item DEADLINE
  3773. @cindex DEADLINE keyword
  3774. Meaning: the task (most likely a TODO item, though not necessarily) is supposed
  3775. to be finished on that date.
  3776. On the deadline date, the task will be listed in the agenda. In
  3777. addition, the agenda for @emph{today} will carry a warning about the
  3778. approaching or missed deadline, starting
  3779. @code{org-deadline-warning-days} before the due date, and continuing
  3780. until the entry is marked DONE. An example:
  3781. @example
  3782. *** TODO write article about the Earth for the Guide
  3783. The editor in charge is [[bbdb:Ford Prefect]]
  3784. DEADLINE: <2004-02-29 Sun>
  3785. @end example
  3786. You can specify a different lead time for warnings for a specific
  3787. deadlines using the following syntax. Here is an example with a warning
  3788. period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
  3789. @item SCHEDULED
  3790. @cindex SCHEDULED keyword
  3791. Meaning: you are planning to start working on that task on the given
  3792. date.
  3793. The headline will be listed under the given date@footnote{It will still
  3794. be listed on that date after it has been marked DONE. If you don't like
  3795. this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
  3796. addition, a reminder that the scheduled date has passed will be present
  3797. in the compilation for @emph{today}, until the entry is marked DONE.
  3798. I.e., the task will automatically be forwarded until completed.
  3799. @example
  3800. *** TODO Call Trillian for a date on New Years Eve.
  3801. SCHEDULED: <2004-12-25 Sat>
  3802. @end example
  3803. @noindent
  3804. @b{Important:} Scheduling an item in Org mode should @i{not} be
  3805. understood in the same way that we understand @i{scheduling a meeting}.
  3806. Setting a date for a meeting is just a simple appointment, you should
  3807. mark this entry with a simple plain time stamp, to get this item shown
  3808. on the date where it applies. This is a frequent mis-understanding from
  3809. Org-users. In Org mode, @i{scheduling} means setting a date when you
  3810. want to start working on an action item.
  3811. @end table
  3812. You may use time stamps with repeaters in scheduling and deadline
  3813. entries. Org mode will issue early and late warnings based on the
  3814. assumption that the time stamp represents the @i{nearest instance} of
  3815. the repeater. However, the use of diary sexp entries like
  3816. @c
  3817. @code{<%%(diary-float t 42)>}
  3818. @c
  3819. in scheduling and deadline timestamps is limited. Org mode does not
  3820. know enough about the internals of each sexp function to issue early and
  3821. late warnings. However, it will show the item on each day where the
  3822. sexp entry matches.
  3823. @menu
  3824. * Inserting deadline/schedule:: Planning items
  3825. * Repeated tasks:: Items that show up again and again
  3826. @end menu
  3827. @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
  3828. @subsection Inserting deadlines or schedules
  3829. The following commands allow to quickly insert a deadline or to schedule
  3830. an item:
  3831. @table @kbd
  3832. @c
  3833. @kindex C-c C-d
  3834. @item C-c C-d
  3835. Insert @samp{DEADLINE} keyword along with a stamp. The insertion will
  3836. happen in the line directly following the headline. When called with a
  3837. prefix arg, an existing deadline will be removed from the entry.
  3838. @c FIXME Any CLOSED timestamp will be removed.????????
  3839. @c
  3840. @kindex C-c / d
  3841. @cindex sparse tree, for deadlines
  3842. @item C-c / d
  3843. Create a sparse tree with all deadlines that are either past-due, or
  3844. which will become due within @code{org-deadline-warning-days}.
  3845. With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
  3846. prefix, check that many days. For example, @kbd{C-1 C-c / d} shows
  3847. all deadlines due tomorrow.
  3848. @c
  3849. @kindex C-c C-s
  3850. @item C-c C-s
  3851. Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
  3852. happen in the line directly following the headline. Any CLOSED
  3853. timestamp will be removed. When called with a prefix argument, remove
  3854. the scheduling date from the entry.
  3855. @end table
  3856. @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
  3857. @subsection Repeated tasks
  3858. Some tasks need to be repeated again and again. Org mode helps to
  3859. organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
  3860. or plain time stamp. In the following example
  3861. @example
  3862. ** TODO Pay the rent
  3863. DEADLINE: <2005-10-01 Sat +1m>
  3864. @end example
  3865. the @code{+1m} is a repeater; the intended interpretation is that the
  3866. task has a deadline on <2005-10-01> and repeats itself every (one) month
  3867. starting from that time. If you need both a repeater and a special
  3868. warning period in a deadline entry, the repeater comes first and the
  3869. warning period last: @code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
  3870. Deadlines and scheduled items produce entries in the agenda when they
  3871. are over-due, so it is important to be able to mark such an entry as
  3872. completed once you have done so. When you mark a DEADLINE or a SCHEDULE
  3873. with the TODO keyword DONE, it will no longer produce entries in the
  3874. agenda. The problem with this is, however, that then also the
  3875. @emph{next} instance of the repeated entry will not be active. Org mode
  3876. deals with this in the following way: When you try to mark such an entry
  3877. DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
  3878. time stamp by the repeater interval, and immediately set the entry state
  3879. back to TODO. In the example above, setting the state to DONE would
  3880. actually switch the date like this:
  3881. @example
  3882. ** TODO Pay the rent
  3883. DEADLINE: <2005-11-01 Tue +1m>
  3884. @end example
  3885. A timestamp@footnote{You can change this using the option
  3886. @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
  3887. @code{lognoterepeat}, and @code{nologrepeat}. With @code{lognoterepeat}, you
  3888. will aslo be prompted for a note.} will be added under the deadline, to keep
  3889. a record that you actually acted on the previous instance of this deadline.
  3890. As a consequence of shifting the base date, this entry will no longer be
  3891. visible in the agenda when checking past dates, but all future instances
  3892. will be visible.
  3893. With the @samp{+1m} cookie, the date shift will always be exactly one
  3894. month. So if you have not payed the rent for three months, marking this
  3895. entry DONE will still keep it as an overdue deadline. Depending on the
  3896. task, this may not be the best way to handle it. For example, if you
  3897. forgot to call you father for 3 weeks, it does not make sense to call
  3898. him 3 times in a single day to make up for it. Finally, there are tasks
  3899. like changing batteries which should always repeat a certain time
  3900. @i{after} the last time you did it. For these tasks, Org mode has
  3901. special repeaters markers with @samp{++} and @samp{.+}. For example:
  3902. @example
  3903. ** TODO Call Father
  3904. DEADLINE: <2008-02-10 Sun ++1w>
  3905. Marking this DONE will shift the date by at least one week,
  3906. but also by as many weeks as it takes to get this date into
  3907. the future. However, it stays on a Sunday, even if you called
  3908. and marked it done on Saturday.
  3909. ** TODO Check the batteries in the smoke detectors
  3910. DEADLINE: <2005-11-01 Tue .+1m>
  3911. Marking this DONE will shift the date to one month after
  3912. today.
  3913. @end example
  3914. You may have both scheduling and deadline information for a specific
  3915. task - just make sure that the repeater intervals on both are the same.
  3916. @node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times
  3917. @section Clocking work time
  3918. Org mode allows you to clock the time you spent on specific tasks in a
  3919. project. When you start working on an item, you can start the clock.
  3920. When you stop working on that task, or when you mark the task done, the
  3921. clock is stopped and the corresponding time interval is recorded. It
  3922. also computes the total time spent on each subtree of a project.
  3923. @table @kbd
  3924. @kindex C-c C-x C-i
  3925. @item C-c C-x C-i
  3926. Start the clock on the current item (clock-in). This inserts the CLOCK
  3927. keyword together with a timestamp. If this is not the first clocking of
  3928. this item, the multiple CLOCK lines will be wrapped into a
  3929. @code{:CLOCK:} drawer (see also the variable
  3930. @code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument,
  3931. select the task from a list of recently clocked tasks. With two @kbd{C-u
  3932. C-u} prefixes, clock into the task at point and mark it as the default task.
  3933. The default task will always be available when selecting a clocking task,
  3934. with letter @kbd{d}.
  3935. @kindex C-c C-x C-o
  3936. @item C-c C-x C-o
  3937. Stop the clock (clock-out). The inserts another timestamp at the same
  3938. location where the clock was last started. It also directly computes
  3939. the resulting time in inserts it after the time range as @samp{=>
  3940. HH:MM}. See the variable @code{org-log-note-clock-out} for the
  3941. possibility to record an additional note together with the clock-out
  3942. time stamp@footnote{The corresponding in-buffer setting is:
  3943. @code{#+STARTUP: lognoteclock-out}}.
  3944. @kindex C-c C-y
  3945. @item C-c C-y
  3946. Recompute the time interval after changing one of the time stamps. This
  3947. is only necessary if you edit the time stamps directly. If you change
  3948. them with @kbd{S-@key{cursor}} keys, the update is automatic.
  3949. @kindex C-c C-t
  3950. @item C-c C-t
  3951. Changing the TODO state of an item to DONE automatically stops the clock
  3952. if it is running in this same item.
  3953. @kindex C-c C-x C-x
  3954. @item C-c C-x C-x
  3955. Cancel the current clock. This is useful if a clock was started by
  3956. mistake, or if you ended up working on something else.
  3957. @kindex C-c C-x C-j
  3958. @item C-c C-x C-j
  3959. Jump to the entry that contains the currently running clock. With a
  3960. @kbd{C-u} prefix arg, select the target task from a list of recently clocked
  3961. tasks.
  3962. @kindex C-c C-x C-d
  3963. @item C-c C-x C-d
  3964. Display time summaries for each subtree in the current buffer. This
  3965. puts overlays at the end of each headline, showing the total time
  3966. recorded under that heading, including the time of any subheadings. You
  3967. can use visibility cycling to study the tree, but the overlays disappear
  3968. when you change the buffer (see variable
  3969. @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
  3970. @kindex C-c C-x C-r
  3971. @item C-c C-x C-r
  3972. Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
  3973. report as an Org mode table into the current file. When the cursor is
  3974. at an existing clock table, just update it. When called with a prefix
  3975. argument, jump to the first clock report in the current document and
  3976. update it.
  3977. @example
  3978. #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
  3979. #+END: clocktable
  3980. @end example
  3981. @noindent
  3982. If such a block already exists at point, its content is replaced by the
  3983. new table. The @samp{BEGIN} line can specify options:
  3984. @example
  3985. :maxlevel @r{Maximum level depth to which times are listed in the table.}
  3986. :emphasize @r{When @code{t}, emphasize level one and level two items}
  3987. :scope @r{The scope to consider. This can be any of the following:}
  3988. nil @r{the current buffer or narrowed region}
  3989. file @r{the full current buffer}
  3990. subtree @r{the subtree where the clocktable is located}
  3991. treeN @r{the surrounding level N tree, for example @code{tree3}}
  3992. tree @r{the surrounding level 1 tree}
  3993. agenda @r{all agenda files}
  3994. ("file"..) @r{scan these files}
  3995. file-with-archives @r{current file and its archives}
  3996. agenda-with-archives @r{all agenda files, including archives}
  3997. :block @r{The time block to consider. This block is specified either}
  3998. @r{absolute, or relative to the current time and may be any of}
  3999. @r{these formats:}
  4000. 2007-12-31 @r{New year eve 2007}
  4001. 2007-12 @r{December 2007}
  4002. 2007-W50 @r{ISO-week 50 in 2007}
  4003. 2007 @r{the year 2007}
  4004. today, yesterday, today-N @r{a relative day}
  4005. thisweek, lastweek, thisweek-N @r{a relative week}
  4006. thismonth, lastmonth, thismonth-N @r{a relative month}
  4007. thisyear, lastyear, thisyear-N @r{a relative year}
  4008. @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
  4009. :tstart @r{A time string specifying when to start considering times}
  4010. :tend @r{A time string specifying when to stop considering times}
  4011. :step @r{@code{week} or @code{day}, to split the table into chunks.}
  4012. @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
  4013. :link @r{Link the item headlines in the table to their origins}
  4014. @end example
  4015. So to get a clock summary of the current level 1 tree, for the current
  4016. day, you could write
  4017. @example
  4018. #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
  4019. #+END: clocktable
  4020. @end example
  4021. and to use a specific time range you could write@footnote{Note that all
  4022. parameters must be specified in a single line - the line is broken here
  4023. only to fit it onto the manual.}
  4024. @example
  4025. #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
  4026. :tend "<2006-08-10 Thu 12:00>"
  4027. #+END: clocktable
  4028. @end example
  4029. @kindex C-c C-c
  4030. @item C-c C-c
  4031. @kindex C-c C-x C-u
  4032. @itemx C-c C-x C-u
  4033. Update dynamical block at point. The cursor needs to be in the
  4034. @code{#+BEGIN} line of the dynamic block.
  4035. @kindex C-u C-c C-x C-u
  4036. @item C-u C-c C-x C-u
  4037. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  4038. you have several clock table blocks in a buffer.
  4039. @kindex S-@key{left}
  4040. @kindex S-@key{right}
  4041. @item S-@key{left}
  4042. @itemx S-@key{right}
  4043. Shift the current @code{:block} interval and update the table. The cursor
  4044. needs to be in the @code{#+BEGIN: clocktable} line for this command. If
  4045. @code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
  4046. @end table
  4047. The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
  4048. the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
  4049. worked on or closed during a day.
  4050. @node Effort estimates, , Clocking work time, Dates and Times
  4051. @section Effort estimates
  4052. @cindex Effort estimates
  4053. If you want to plan your work in a very detailed way, or if you need to
  4054. produce offers with quotations of the estimated work effort, you may want to
  4055. assign effort estimates to entries. If you are also clocking your work, you
  4056. may later want to compare the planned effort with the actual working time, a
  4057. great way to improve planning estimates. Effort estimates are stored in a
  4058. special property @samp{Effort}@footnote{You may change the property being
  4059. used with the variable @code{org-effort-property}.}. Clearly the best way to
  4060. work with effort estimates is through column view (@pxref{Column view}). You
  4061. should start by setting up discrete values for effort estimates, and a
  4062. @code{COLUMNS} format that displays these values together with clock sums (if
  4063. you want to clock your time). For a specific buffer you can use
  4064. @example
  4065. #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
  4066. #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
  4067. @end example
  4068. @noindent
  4069. or you can set up these values globally by customizing the variables
  4070. @code{org-global-properties} and @code{org-columns-default-format}. In
  4071. particular if you want to use this setup also in the agenda, a global setup
  4072. may be advised.
  4073. The way to assign estimates to individual items is then to switch to column
  4074. mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
  4075. value. The values you enter will immediately be summed up in the hierarchy.
  4076. In the column next to it, any clocked time will be displayed.
  4077. If you switch to column view in the daily/weekly agenda, the effort column
  4078. will summarize the estimated work effort for each day@footnote{Please note
  4079. the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
  4080. column view}.}, and you can use this to find space in your schedule. To get
  4081. an overview of the entire part of the day that is committed, you can set the
  4082. option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
  4083. appointments on a day that take place over a specified time interval will
  4084. then also be added to the load estimate of the day.
  4085. @node Remember, Agenda Views, Dates and Times, Top
  4086. @chapter Remember
  4087. @cindex @file{remember.el}
  4088. The @i{Remember} package by John Wiegley lets you store quick notes with
  4089. little interruption of your work flow. See
  4090. @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
  4091. information. It is an excellent way to add new notes and tasks to
  4092. Org files. Org significantly expands the possibilities of
  4093. @i{remember}: You may define templates for different note types, and
  4094. associate target files and headlines with specific templates. It also
  4095. allows you to select the location where a note should be stored
  4096. interactively, on the fly.
  4097. @menu
  4098. * Setting up Remember:: Some code for .emacs to get things going
  4099. * Remember templates:: Define the outline of different note types
  4100. * Storing notes:: Directly get the note to where it belongs
  4101. * Refiling notes:: Moving a note or task to a project
  4102. @end menu
  4103. @node Setting up Remember, Remember templates, Remember, Remember
  4104. @section Setting up Remember
  4105. The following customization will tell @i{remember} to use org files as
  4106. target, and to create annotations compatible with Org links.
  4107. @example
  4108. (org-remember-insinuate)
  4109. (setq org-directory "~/path/to/my/orgfiles/")
  4110. (setq org-default-notes-file (concat org-directory "/notes.org"))
  4111. (define-key global-map "\C-cr" 'org-remember)
  4112. @end example
  4113. The last line binds the command @code{org-remember} to a global
  4114. key@footnote{Please select your own key, @kbd{C-c r} is only a
  4115. suggestion.}. @code{org-remember} basically just calls @code{remember},
  4116. but it makes a few things easier: If there is an active region, it will
  4117. automatically copy the region into the remember buffer. It also allows
  4118. to jump to the buffer and location where remember notes are being
  4119. stored: Just call @code{org-remember} with a prefix argument. If you
  4120. use two prefix arguments, Org jumps to the location where the last
  4121. remember note was stored.
  4122. @node Remember templates, Storing notes, Setting up Remember, Remember
  4123. @section Remember templates
  4124. @cindex templates, for remember
  4125. In combination with Org, you can use templates to generate
  4126. different types of @i{remember} notes. For example, if you would like
  4127. to use one template to create general TODO entries, another one for
  4128. journal entries, and a third one for collecting random ideas, you could
  4129. use:
  4130. @example
  4131. (setq org-remember-templates
  4132. '(("Todo" ?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
  4133. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
  4134. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  4135. @end example
  4136. @noindent In these entries, the first string is just a name, and the
  4137. character specifies how to select the template. It is useful if the
  4138. character is also the first letter of the name. The next string
  4139. specifies the template. Two more (optional) strings give the file in
  4140. which, and the headline under which the new note should be stored. The
  4141. file (if not present or @code{nil}) defaults to
  4142. @code{org-default-notes-file}, the heading to
  4143. @code{org-remember-default-headline}. If the file name is not an
  4144. absolute path, it will be interpreted relative to @code{org-directory}.
  4145. An optional sixth element specifies the contexts in which the user can
  4146. select the template. This element can be either a list of major modes
  4147. or a function. @code{org-remember} will first check whether the function
  4148. returns @code{t} or if we are in any of the listed major mode, and select
  4149. the template accordingly.
  4150. So for example:
  4151. @example
  4152. (setq org-remember-templates
  4153. '(("Bug" ?b "* BUG %?\n %i\n %a" "~/org/BUGS.org" "Bugs" (emacs-lisp-mode))
  4154. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org" my-check)
  4155. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  4156. @end example
  4157. The first template will only be available when invoking @code{org-remember}
  4158. from an buffer in @code{emacs-lisp-mode}. The second template will only be
  4159. available when the function @code{my-check} returns @code{t}. The third
  4160. template will be proposed in any context.
  4161. When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
  4162. something, Org will prompt for a key to select the template (if you have
  4163. more than one template) and then prepare the buffer like
  4164. @example
  4165. * TODO
  4166. [[file:link to where you called remember]]
  4167. @end example
  4168. @noindent
  4169. During expansion of the template, special @kbd{%}-escapes allow dynamic
  4170. insertion of content:
  4171. @example
  4172. %^@{prompt@} @r{prompt the user for a string and replace this sequence with it.}
  4173. @r{You may specify a default value and a completion table with}
  4174. @r{%^@{prompt|default|completion2|completion3...@}}
  4175. @r{The arrow keys access a prompt-specific history.}
  4176. %t @r{time stamp, date only}
  4177. %T @r{time stamp with date and time}
  4178. %u, %U @r{like the above, but inactive time stamps}
  4179. %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
  4180. @r{You may define a prompt like @code{%^@{Birthday@}t}}
  4181. %n @r{user name (taken from @code{user-full-name})}
  4182. %a @r{annotation, normally the link created with @code{org-store-link}}
  4183. %A @r{like @code{%a}, but prompt for the description part}
  4184. %i @r{initial content, the region when remember is called with C-u.}
  4185. @r{The entire text will be indented like @code{%i} itself.}
  4186. %c @r{Current kill ring head.}
  4187. %x @r{Content of the X clipboard.}
  4188. %^C @r{Interactive selection of which kill or clip to use.}
  4189. %^L @r{Like @code{%^C}, but insert as link.}
  4190. %^g @r{prompt for tags, with completion on tags in target file.}
  4191. %^G @r{prompt for tags, with completion all tags in all agenda files.}
  4192. %:keyword @r{specific information for certain link types, see below}
  4193. %[pathname] @r{insert the contents of the file given by @code{pathname}}
  4194. %(sexp) @r{evaluate elisp @code{(sexp)} and replace with the result}
  4195. %! @r{immediately store note after completing the template}
  4196. @r{(skipping the @kbd{C-c C-c} that normally triggers storing)}
  4197. @end example
  4198. @noindent
  4199. For specific link types, the following keywords will be
  4200. defined@footnote{If you define your own link types (@pxref{Adding
  4201. hyperlink types}), any property you store with
  4202. @code{org-store-link-props} can be accessed in remember templates in a
  4203. similar way.}:
  4204. @example
  4205. Link type | Available keywords
  4206. -------------------+----------------------------------------------
  4207. bbdb | %:name %:company
  4208. bbdb | %::server %:port %:nick
  4209. vm, wl, mh, rmail | %:type %:subject %:message-id
  4210. | %:from %:fromname %:fromaddress
  4211. | %:to %:toname %:toaddress
  4212. | %: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}.}}
  4213. gnus | %:group, @r{for messages also all email fields}
  4214. w3, w3m | %:url
  4215. info | %:file %:node
  4216. calendar | %:date"
  4217. @end example
  4218. @noindent
  4219. To place the cursor after template expansion use:
  4220. @example
  4221. %? @r{After completing the template, position cursor here.}
  4222. @end example
  4223. @noindent
  4224. If you change your mind about which template to use, call
  4225. @code{org-remember} in the remember buffer. You may then select a new
  4226. template that will be filled with the previous context information.
  4227. @node Storing notes, Refiling notes, Remember templates, Remember
  4228. @section Storing notes
  4229. When you are finished preparing a note with @i{remember}, you have to press
  4230. @kbd{C-c C-c} to file the note away. If you have started the clock in the
  4231. remember buffer, you will first be asked if you want to clock out
  4232. now@footnote{To avoid this query, configure the variable
  4233. @code{org-remember-clock-out-on-exit}.}. If you answer @kbd{n}, the clock
  4234. will continue to run after the note is filed away.
  4235. The handler will then store the note in the file and under the headline
  4236. specified in the template, or it will use the default file and headlines.
  4237. The window configuration will be restored, sending you back to the working
  4238. context before the call to @code{remember}. To re-use the location found
  4239. during the last call to @code{remember}, exit the remember buffer with
  4240. @kbd{C-u C-u C-c C-c}, i.e. specify a double prefix argument to @kbd{C-c
  4241. C-c}.
  4242. If you want to store the note directly to a different place, use
  4243. @kbd{C-u C-c C-c} instead to exit remember@footnote{Configure the
  4244. variable @code{org-remember-store-without-prompt} to make this behavior
  4245. the default.}. The handler will then first prompt for a target file -
  4246. if you press @key{RET}, the value specified for the template is used.
  4247. Then the command offers the headings tree of the selected file, with the
  4248. cursor position at the default headline (if you had specified one in the
  4249. template). You can either immediately press @key{RET} to get the note
  4250. placed there. Or you can use the following keys to find a different
  4251. location:
  4252. @example
  4253. @key{TAB} @r{Cycle visibility.}
  4254. @key{down} / @key{up} @r{Next/previous visible headline.}
  4255. n / p @r{Next/previous visible headline.}
  4256. f / b @r{Next/previous headline same level.}
  4257. u @r{One level up.}
  4258. @c 0-9 @r{Digit argument.}
  4259. @end example
  4260. @noindent
  4261. Pressing @key{RET} or @key{left} or @key{right}
  4262. then leads to the following result.
  4263. @multitable @columnfractions 0.2 0.15 0.65
  4264. @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
  4265. @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
  4266. @item @tab @tab depending on @code{org-reverse-note-order}.
  4267. @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
  4268. @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
  4269. @item @tab @tab depending on @code{org-reverse-note-order}.
  4270. @item not on headline @tab @key{RET}
  4271. @tab at cursor position, level taken from context.
  4272. @end multitable
  4273. Before inserting the text into a tree, the function ensures that the
  4274. text has a headline, i.e. a first line that starts with a @samp{*}. If
  4275. not, a headline is constructed from the current date and some additional
  4276. data. If you have indented the text of the note below the headline, the
  4277. indentation will be adapted if inserting the note into the tree requires
  4278. demotion from level 1.
  4279. @node Refiling notes, , Storing notes, Remember
  4280. @section Refiling notes
  4281. @cindex refiling notes
  4282. Remember is usually used to quickly capture notes and tasks into one or
  4283. a few capture lists. When reviewing the captured data, you may want to
  4284. refile some of the entries into a different list, for example into a
  4285. project. Cutting, finding the right location and then pasting the note
  4286. is cumbersome. To simplify this process, you can use the following
  4287. special command:
  4288. @table @kbd
  4289. @kindex C-c C-w
  4290. @item C-c C-w
  4291. Refile the entry at point. This command offers possible locations for
  4292. refiling the entry and lets you select one with completion. The item is
  4293. filed below the target heading as a subitem. Depending on
  4294. @code{org-reverse-note-order}, it will be either the first of last
  4295. subitem.@* By default, all level 1 headlines in the current buffer are
  4296. considered to be targets, but you can have more complex definitions
  4297. across a number of files. See the variable @code{org-refile-targets}
  4298. for details.
  4299. @kindex C-u C-c C-w
  4300. @item C-u C-c C-w
  4301. Use the refile interface to jump to a heading.
  4302. @kindex C-u C-u C-c C-w
  4303. @item C-u C-u C-c C-w
  4304. Jump to the location where @code{org-refile} last moved a tree to.
  4305. @end table
  4306. @node Agenda Views, Embedded LaTeX, Remember, Top
  4307. @chapter Agenda Views
  4308. @cindex agenda views
  4309. Due to the way Org works, TODO items, time-stamped items, and
  4310. tagged headlines can be scattered throughout a file or even a number of
  4311. files. To get an overview of open action items, or of events that are
  4312. important for a particular date, this information must be collected,
  4313. sorted and displayed in an organized way.
  4314. Org can select items based on various criteria, and display them
  4315. in a separate buffer. Seven different view types are provided:
  4316. @itemize @bullet
  4317. @item
  4318. an @emph{agenda} that is like a calendar and shows information
  4319. for specific dates,
  4320. @item
  4321. a @emph{TODO list} that covers all unfinished
  4322. action items,
  4323. @item
  4324. a @emph{tags view}, showings headlines based on
  4325. the tags associated with them,
  4326. @item
  4327. a @emph{timeline view} that shows all events in a single Org file,
  4328. in time-sorted view,
  4329. @item
  4330. a @emph{keyword search view} that shows all entries from multiple files
  4331. that contain specified keywords.
  4332. @item
  4333. a @emph{stuck projects view} showing projects that currently don't move
  4334. along, and
  4335. @item
  4336. @emph{custom views} that are special tag/keyword searches and
  4337. combinations of different views.
  4338. @end itemize
  4339. @noindent
  4340. The extracted information is displayed in a special @emph{agenda
  4341. buffer}. This buffer is read-only, but provides commands to visit the
  4342. corresponding locations in the original Org files, and even to
  4343. edit these files remotely.
  4344. Two variables control how the agenda buffer is displayed and whether the
  4345. window configuration is restored when the agenda exits:
  4346. @code{org-agenda-window-setup} and
  4347. @code{org-agenda-restore-windows-after-quit}.
  4348. @menu
  4349. * Agenda files:: Files being searched for agenda information
  4350. * Agenda dispatcher:: Keyboard access to agenda views
  4351. * Built-in agenda views:: What is available out of the box?
  4352. * Presentation and sorting:: How agenda items are prepared for display
  4353. * Agenda commands:: Remote editing of Org trees
  4354. * Custom agenda views:: Defining special searches and views
  4355. * Agenda column view:: Using column view for collected entries
  4356. @end menu
  4357. @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
  4358. @section Agenda files
  4359. @cindex agenda files
  4360. @cindex files for agenda
  4361. The information to be shown is normally collected from all @emph{agenda
  4362. files}, the files listed in the variable
  4363. @code{org-agenda-files}@footnote{If the value of that variable is not a
  4364. list, but a single file name, then the list of agenda files will be
  4365. maintained in that external file.}. If a directory is part of this list,
  4366. all files with the extension @file{.org} in this directory will be part
  4367. of the list.
  4368. Thus even if you only work with a single Org file, this file should
  4369. be put into that list@footnote{When using the dispatcher, pressing
  4370. @kbd{<} before selecting a command will actually limit the command to
  4371. the current file, and ignore @code{org-agenda-files} until the next
  4372. dispatcher command.}. You can customize @code{org-agenda-files}, but
  4373. the easiest way to maintain it is through the following commands
  4374. @cindex files, adding to agenda list
  4375. @table @kbd
  4376. @kindex C-c [
  4377. @item C-c [
  4378. Add current file to the list of agenda files. The file is added to
  4379. the front of the list. If it was already in the list, it is moved to
  4380. the front. With a prefix argument, file is added/moved to the end.
  4381. @kindex C-c ]
  4382. @item C-c ]
  4383. Remove current file from the list of agenda files.
  4384. @kindex C-,
  4385. @kindex C-'
  4386. @item C-,
  4387. @itemx C-'
  4388. Cycle through agenda file list, visiting one file after the other.
  4389. @kindex M-x org-iswitchb
  4390. @item M-x org-iswitchb
  4391. Command to use an @code{iswitchb}-like interface to switch to and between Org
  4392. buffers.
  4393. @end table
  4394. @noindent
  4395. The Org menu contains the current list of files and can be used
  4396. to visit any of them.
  4397. If you would like to focus the agenda temporarily onto a file not in
  4398. this list, or onto just one file in the list or even only a subtree in a
  4399. file, this can be done in different ways. For a single agenda command,
  4400. you may press @kbd{<} once or several times in the dispatcher
  4401. (@pxref{Agenda dispatcher}). To restrict the agenda scope for an
  4402. extended period, use the following commands:
  4403. @table @kbd
  4404. @kindex C-c C-x <
  4405. @item C-c C-x <
  4406. Permanently restrict the agenda to the current subtree. When with a
  4407. prefix argument, or with the cursor before the first headline in a file,
  4408. the agenda scope is set to the entire file. This restriction remains in
  4409. effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
  4410. or @kbd{>} in the agenda dispatcher. If there is a window displaying an
  4411. agenda view, the new restriction takes effect immediately.
  4412. @kindex C-c C-x <
  4413. @item C-c C-x <
  4414. Remove the permanent restriction created by @kbd{C-c C-x <}.
  4415. @end table
  4416. @noindent
  4417. When working with @file{Speedbar}, you can use the following commands in
  4418. the Speedbar frame:
  4419. @table @kbd
  4420. @kindex <
  4421. @item < @r{in the speedbar frame}
  4422. Permanently restrict the agenda to the item at the cursor in the
  4423. Speedbar frame, either an Org file or a subtree in such a file.
  4424. If there is a window displaying an agenda view, the new restriction takes
  4425. effect immediately.
  4426. @kindex <
  4427. @item > @r{in the speedbar frame}
  4428. Lift the restriction again.
  4429. @end table
  4430. @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
  4431. @section The agenda dispatcher
  4432. @cindex agenda dispatcher
  4433. @cindex dispatching agenda commands
  4434. The views are created through a dispatcher that should be bound to a
  4435. global key, for example @kbd{C-c a} (@pxref{Installation}). In the
  4436. following we will assume that @kbd{C-c a} is indeed how the dispatcher
  4437. is accessed and list keyboard access to commands accordingly. After
  4438. pressing @kbd{C-c a}, an additional letter is required to execute a
  4439. command. The dispatcher offers the following default commands:
  4440. @table @kbd
  4441. @item a
  4442. Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
  4443. @item t @r{/} T
  4444. Create a list of all TODO items (@pxref{Global TODO list}).
  4445. @item m @r{/} M
  4446. Create a list of headlines matching a TAGS expression (@pxref{Matching
  4447. tags and properties}).
  4448. @item L
  4449. Create the timeline view for the current buffer (@pxref{Timeline}).
  4450. @item s
  4451. Create a list of entries selected by a boolean expression of keywords
  4452. and/or regular expressions that must or must not occur in the entry.
  4453. @item /
  4454. Search for a regular expression in all agenda files and additionally in
  4455. the files listed in @code{org-agenda-multi-occur-extra-files}. This
  4456. uses the Emacs command @code{multi-occur}. A prefix argument can be
  4457. used to specify the number of context lines for each match, default is
  4458. 1.
  4459. @item # @r{/} !
  4460. Create a list of stuck projects (@pxref{Stuck projects}).
  4461. @item <
  4462. Restrict an agenda command to the current buffer@footnote{For backward
  4463. compatibility, you can also press @kbd{1} to restrict to the current
  4464. buffer.}. After pressing @kbd{<}, you still need to press the character
  4465. selecting the command.
  4466. @item < <
  4467. If there is an active region, restrict the following agenda command to
  4468. the region. Otherwise, restrict it to the current subtree@footnote{For
  4469. backward compatibility, you can also press @kbd{0} to restrict to the
  4470. current buffer.}. After pressing @kbd{< <}, you still need to press the
  4471. character selecting the command.
  4472. @end table
  4473. You can also define custom commands that will be accessible through the
  4474. dispatcher, just like the default commands. This includes the
  4475. possibility to create extended agenda buffers that contain several
  4476. blocks together, for example the weekly agenda, the global TODO list and
  4477. a number of special tags matches. @xref{Custom agenda views}.
  4478. @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
  4479. @section The built-in agenda views
  4480. In this section we describe the built-in views.
  4481. @menu
  4482. * Weekly/daily agenda:: The calendar page with current tasks
  4483. * Global TODO list:: All unfinished action items
  4484. * Matching tags and properties:: Structured information with fine-tuned search
  4485. * Timeline:: Time-sorted view for single file
  4486. * Keyword search:: Finding entries by keyword
  4487. * Stuck projects:: Find projects you need to review
  4488. @end menu
  4489. @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
  4490. @subsection The weekly/daily agenda
  4491. @cindex agenda
  4492. @cindex weekly agenda
  4493. @cindex daily agenda
  4494. The purpose of the weekly/daily @emph{agenda} is to act like a page of a
  4495. paper agenda, showing all the tasks for the current week or day.
  4496. @table @kbd
  4497. @cindex org-agenda, command
  4498. @kindex C-c a a
  4499. @item C-c a a
  4500. Compile an agenda for the current week from a list of org files. The
  4501. agenda shows the entries for each day. With a numeric
  4502. prefix@footnote{For backward compatibility, the universal prefix
  4503. @kbd{C-u} causes all TODO entries to be listed before the agenda. This
  4504. feature is deprecated, use the dedicated TODO list, or a block agenda
  4505. instead.} (like @kbd{C-u 2 1 C-c a a}) you may set the number of days
  4506. to be displayed (see also the variable @code{org-agenda-ndays})
  4507. @end table
  4508. Remote editing from the agenda buffer means, for example, that you can
  4509. change the dates of deadlines and appointments from the agenda buffer.
  4510. The commands available in the Agenda buffer are listed in @ref{Agenda
  4511. commands}.
  4512. @subsubheading Calendar/Diary integration
  4513. @cindex calendar integration
  4514. @cindex diary integration
  4515. Emacs contains the calendar and diary by Edward M. Reingold. The
  4516. calendar displays a three-month calendar with holidays from different
  4517. countries and cultures. The diary allows you to keep track of
  4518. anniversaries, lunar phases, sunrise/set, recurrent appointments
  4519. (weekly, monthly) and more. In this way, it is quite complementary to
  4520. Org. It can be very useful to combine output from Org with
  4521. the diary.
  4522. In order to include entries from the Emacs diary into Org mode's
  4523. agenda, you only need to customize the variable
  4524. @lisp
  4525. (setq org-agenda-include-diary t)
  4526. @end lisp
  4527. @noindent After that, everything will happen automatically. All diary
  4528. entries including holidays, anniversaries etc will be included in the
  4529. agenda buffer created by Org mode. @key{SPC}, @key{TAB}, and
  4530. @key{RET} can be used from the agenda buffer to jump to the diary
  4531. file in order to edit existing diary entries. The @kbd{i} command to
  4532. insert new entries for the current date works in the agenda buffer, as
  4533. well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
  4534. Sunrise/Sunset times, show lunar phases and to convert to other
  4535. calendars, respectively. @kbd{c} can be used to switch back and forth
  4536. between calendar and agenda.
  4537. If you are using the diary only for sexp entries and holidays, it is
  4538. faster to not use the above setting, but instead to copy or even move
  4539. the entries into an Org file. Org mode evaluates diary-style sexp
  4540. entries, and does it faster because there is no overhead for first
  4541. creating the diary display. Note that the sexp entries must start at
  4542. the left margin, no white space is allowed before them. For example,
  4543. the following segment of an Org file will be processed and entries
  4544. will be made in the agenda:
  4545. @example
  4546. * Birthdays and similar stuff
  4547. #+CATEGORY: Holiday
  4548. %%(org-calendar-holiday) ; special function for holiday names
  4549. #+CATEGORY: Ann
  4550. %%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
  4551. %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
  4552. @end example
  4553. @subsubheading Appointment reminders
  4554. @cindex @file{appt.el}
  4555. @cindex appointment reminders
  4556. Org can interact with Emacs appointments notification facility.
  4557. To add all the appointments of your agenda files, use the command
  4558. @code{org-agenda-to-appt}. This commands also lets you filter through
  4559. the list of your appointments and add only those belonging to a specific
  4560. category or matching a regular expression. See the docstring for
  4561. details.
  4562. @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
  4563. @subsection The global TODO list
  4564. @cindex global TODO list
  4565. @cindex TODO list, global
  4566. The global TODO list contains all unfinished TODO items, formatted and
  4567. collected into a single place.
  4568. @table @kbd
  4569. @kindex C-c a t
  4570. @item C-c a t
  4571. Show the global TODO list. This collects the TODO items from all
  4572. agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
  4573. @code{agenda-mode}, so there are commands to examine and manipulate
  4574. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  4575. @kindex C-c a T
  4576. @item C-c a T
  4577. @cindex TODO keyword matching
  4578. Like the above, but allows selection of a specific TODO keyword. You
  4579. can also do this by specifying a prefix argument to @kbd{C-c a t}. With
  4580. a @kbd{C-u} prefix you are prompted for a keyword, and you may also
  4581. specify several keywords by separating them with @samp{|} as boolean OR
  4582. operator. With a numeric prefix, the Nth keyword in
  4583. @code{org-todo-keywords} is selected.
  4584. @kindex r
  4585. The @kbd{r} key in the agenda buffer regenerates it, and you can give
  4586. a prefix argument to this command to change the selected TODO keyword,
  4587. for example @kbd{3 r}. If you often need a search for a specific
  4588. keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
  4589. Matching specific TODO keywords can also be done as part of a tags
  4590. search (@pxref{Tag searches}).
  4591. @end table
  4592. Remote editing of TODO items means that you can change the state of a
  4593. TODO entry with a single key press. The commands available in the
  4594. TODO list are described in @ref{Agenda commands}.
  4595. @cindex sublevels, inclusion into TODO list
  4596. Normally the global TODO list simply shows all headlines with TODO
  4597. keywords. This list can become very long. There are two ways to keep
  4598. it more compact:
  4599. @itemize @minus
  4600. @item
  4601. Some people view a TODO item that has been @emph{scheduled} for
  4602. execution (@pxref{Timestamps}) as no longer @emph{open}. Configure the
  4603. variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
  4604. items from the global TODO list.
  4605. @item
  4606. TODO items may have sublevels to break up the task into subtasks. In
  4607. such cases it may be enough to list only the highest level TODO headline
  4608. and omit the sublevels from the global list. Configure the variable
  4609. @code{org-agenda-todo-list-sublevels} to get this behavior.
  4610. @end itemize
  4611. @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
  4612. @subsection Matching tags and properties
  4613. @cindex matching, of tags
  4614. @cindex matching, of properties
  4615. @cindex tags view
  4616. If headlines in the agenda files are marked with @emph{tags}
  4617. (@pxref{Tags}), you can select headlines based on the tags that apply
  4618. to them and collect them into an agenda buffer.
  4619. @table @kbd
  4620. @kindex C-c a m
  4621. @item C-c a m
  4622. Produce a list of all headlines that match a given set of tags. The
  4623. command prompts for a selection criterion, which is a boolean logic
  4624. expression with tags, like @samp{+work+urgent-withboss} or
  4625. @samp{work|home} (@pxref{Tags}). If you often need a specific search,
  4626. define a custom command for it (@pxref{Agenda dispatcher}).
  4627. @kindex C-c a M
  4628. @item C-c a M
  4629. Like @kbd{C-c a m}, but only select headlines that are also TODO items
  4630. and force checking subitems (see variable
  4631. @code{org-tags-match-list-sublevels}). Matching specific TODO keywords
  4632. together with a tags match is also possible, see @ref{Tag searches}.
  4633. @end table
  4634. The commands available in the tags list are described in @ref{Agenda
  4635. commands}.
  4636. @node Timeline, Keyword search, Matching tags and properties, Built-in agenda views
  4637. @subsection Timeline for a single file
  4638. @cindex timeline, single file
  4639. @cindex time-sorted view
  4640. The timeline summarizes all time-stamped items from a single Org mode
  4641. file in a @emph{time-sorted view}. The main purpose of this command is
  4642. to give an overview over events in a project.
  4643. @table @kbd
  4644. @kindex C-c a L
  4645. @item C-c a L
  4646. Show a time-sorted view of the org file, with all time-stamped items.
  4647. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  4648. (scheduled or not) are also listed under the current date.
  4649. @end table
  4650. @noindent
  4651. The commands available in the timeline buffer are listed in
  4652. @ref{Agenda commands}.
  4653. @node Keyword search, Stuck projects, Timeline, Built-in agenda views
  4654. @subsection Keyword search
  4655. @cindex keyword search
  4656. @cindex searching, for keywords
  4657. This agenda view is a general text search facility for Org mode entries.
  4658. It is particularly useful to find notes.
  4659. @table @kbd
  4660. @kindex C-c a s
  4661. @item C-c a s
  4662. This is a special search that lets you select entries by keywords or
  4663. regular expression, using a boolean logic. For example, the search
  4664. string
  4665. @example
  4666. +computer +wifi -ethernet -@{8\.11[bg]@}
  4667. @end example
  4668. @noindent
  4669. will search for note entries that contain the keywords @code{computer}
  4670. and @code{wifi}, but not the keyword @code{ethernet}, and which are also
  4671. not matched by the regular expression @code{8\.11[bg]}, meaning to
  4672. exclude both 8.11b and 8.11g.
  4673. Note that in addition to the agenda files, this command will also search
  4674. the files listed in @code{org-agenda-text-search-extra-files}.
  4675. @end table
  4676. @node Stuck projects, , Keyword search, Built-in agenda views
  4677. @subsection Stuck projects
  4678. If you are following a system like David Allen's GTD to organize your
  4679. work, one of the ``duties'' you have is a regular review to make sure
  4680. that all projects move along. A @emph{stuck} project is a project that
  4681. has no defined next actions, so it will never show up in the TODO lists
  4682. Org mode produces. During the review, you need to identify such
  4683. projects and define next actions for them.
  4684. @table @kbd
  4685. @kindex C-c a #
  4686. @item C-c a #
  4687. List projects that are stuck.
  4688. @kindex C-c a !
  4689. @item C-c a !
  4690. Customize the variable @code{org-stuck-projects} to define what a stuck
  4691. project is and how to find it.
  4692. @end table
  4693. You almost certainly will have to configure this view before it will
  4694. work for you. The built-in default assumes that all your projects are
  4695. level-2 headlines, and that a project is not stuck if it has at least
  4696. one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
  4697. Lets assume that you, in your own way of using Org mode, identify
  4698. projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
  4699. indicate a project that should not be considered yet. Lets further
  4700. assume that the TODO keyword DONE marks finished projects, and that NEXT
  4701. and TODO indicate next actions. The tag @@SHOP indicates shopping and
  4702. is a next action even without the NEXT tag. Finally, if the project
  4703. contains the special word IGNORE anywhere, it should not be listed
  4704. either. In this case you would start by identifying eligible projects
  4705. with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
  4706. TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
  4707. are not stuck. The correct customization for this is
  4708. @lisp
  4709. (setq org-stuck-projects
  4710. '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
  4711. "\\<IGNORE\\>"))
  4712. @end lisp
  4713. @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
  4714. @section Presentation and sorting
  4715. @cindex presentation, of agenda items
  4716. Before displaying items in an agenda view, Org mode visually prepares
  4717. the items and sorts them. Each item occupies a single line. The line
  4718. starts with a @emph{prefix} that contains the @emph{category}
  4719. (@pxref{Categories}) of the item and other important information. You can
  4720. customize the prefix using the option @code{org-agenda-prefix-format}.
  4721. The prefix is followed by a cleaned-up version of the outline headline
  4722. associated with the item.
  4723. @menu
  4724. * Categories:: Not all tasks are equal
  4725. * Time-of-day specifications:: How the agenda knows the time
  4726. * Sorting of agenda items:: The order of things
  4727. @end menu
  4728. @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
  4729. @subsection Categories
  4730. @cindex category
  4731. The category is a broad label assigned to each agenda item. By default,
  4732. the category is simply derived from the file name, but you can also
  4733. specify it with a special line in the buffer, like this@footnote{For
  4734. backward compatibility, the following also works: If there are several
  4735. such lines in a file, each specifies the category for the text below it.
  4736. The first category also applies to any text before the first CATEGORY
  4737. line. However, using this method is @emph{strongly} deprecated as it is
  4738. incompatible with the outline structure of the document. The correct
  4739. method for setting multiple categories in a buffer is using a
  4740. property.}:
  4741. @example
  4742. #+CATEGORY: Thesis
  4743. @end example
  4744. @noindent
  4745. If you would like to have a special CATEGORY for a single entry or a
  4746. (sub)tree, give the entry a @code{:CATEGORY:} property with the location
  4747. as the value (@pxref{Properties and Columns}).
  4748. @noindent
  4749. The display in the agenda buffer looks best if the category is not
  4750. longer than 10 characters.
  4751. @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
  4752. @subsection Time-of-day specifications
  4753. @cindex time-of-day specification
  4754. Org mode checks each agenda item for a time-of-day specification. The
  4755. time can be part of the time stamp that triggered inclusion into the
  4756. agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
  4757. ranges can be specified with two time stamps, like
  4758. @c
  4759. @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
  4760. In the headline of the entry itself, a time(range) may also appear as
  4761. plain text (like @samp{12:45} or a @samp{8:30-1pm}. If the agenda
  4762. integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
  4763. specifications in diary entries are recognized as well.
  4764. For agenda display, Org mode extracts the time and displays it in a
  4765. standard 24 hour format as part of the prefix. The example times in
  4766. the previous paragraphs would end up in the agenda like this:
  4767. @example
  4768. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  4769. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  4770. 19:00...... The Vogon reads his poem
  4771. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  4772. @end example
  4773. @cindex time grid
  4774. If the agenda is in single-day mode, or for the display of today, the
  4775. timed entries are embedded in a time grid, like
  4776. @example
  4777. 8:00...... ------------------
  4778. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  4779. 10:00...... ------------------
  4780. 12:00...... ------------------
  4781. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  4782. 14:00...... ------------------
  4783. 16:00...... ------------------
  4784. 18:00...... ------------------
  4785. 19:00...... The Vogon reads his poem
  4786. 20:00...... ------------------
  4787. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  4788. @end example
  4789. The time grid can be turned on and off with the variable
  4790. @code{org-agenda-use-time-grid}, and can be configured with
  4791. @code{org-agenda-time-grid}.
  4792. @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
  4793. @subsection Sorting of agenda items
  4794. @cindex sorting, of agenda items
  4795. @cindex priorities, of agenda items
  4796. Before being inserted into a view, the items are sorted. How this is
  4797. done depends on the type of view.
  4798. @itemize @bullet
  4799. @item
  4800. For the daily/weekly agenda, the items for each day are sorted. The
  4801. default order is to first collect all items containing an explicit
  4802. time-of-day specification. These entries will be shown at the beginning
  4803. of the list, as a @emph{schedule} for the day. After that, items remain
  4804. grouped in categories, in the sequence given by @code{org-agenda-files}.
  4805. Within each category, items are sorted by priority (@pxref{Priorities}),
  4806. which is composed of the base priority (2000 for priority @samp{A}, 1000
  4807. for @samp{B}, and 0 for @samp{C}), plus additional increments for
  4808. overdue scheduled or deadline items.
  4809. @item
  4810. For the TODO list, items remain in the order of categories, but within
  4811. each category, sorting takes place according to priority
  4812. (@pxref{Priorities}).
  4813. @item
  4814. For tags matches, items are not sorted at all, but just appear in the
  4815. sequence in which they are found in the agenda files.
  4816. @end itemize
  4817. Sorting can be customized using the variable
  4818. @code{org-agenda-sorting-strategy}, and may also include criteria based on
  4819. the estimated effort of an entry.
  4820. @c FIXME: link!!!!!!!!
  4821. @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
  4822. @section Commands in the agenda buffer
  4823. @cindex commands, in agenda buffer
  4824. Entries in the agenda buffer are linked back to the org file or diary
  4825. file where they originate. You are not allowed to edit the agenda
  4826. buffer itself, but commands are provided to show and jump to the
  4827. original entry location, and to edit the org-files ``remotely'' from
  4828. the agenda buffer. In this way, all information is stored only once,
  4829. removing the risk that your agenda and note files may diverge.
  4830. Some commands can be executed with mouse clicks on agenda lines. For
  4831. the other commands, the cursor needs to be in the desired line.
  4832. @table @kbd
  4833. @tsubheading{Motion}
  4834. @cindex motion commands in agenda
  4835. @kindex n
  4836. @item n
  4837. Next line (same as @key{up} and @kbd{C-p}).
  4838. @kindex p
  4839. @item p
  4840. Previous line (same as @key{down} and @kbd{C-n}).
  4841. @tsubheading{View/Go to org file}
  4842. @kindex mouse-3
  4843. @kindex @key{SPC}
  4844. @item mouse-3
  4845. @itemx @key{SPC}
  4846. Display the original location of the item in another window.
  4847. @c
  4848. @kindex L
  4849. @item L
  4850. Display original location and recenter that window.
  4851. @c
  4852. @kindex mouse-2
  4853. @kindex mouse-1
  4854. @kindex @key{TAB}
  4855. @item mouse-2
  4856. @itemx mouse-1
  4857. @itemx @key{TAB}
  4858. Go to the original location of the item in another window. Under Emacs
  4859. 22, @kbd{mouse-1} will also works for this.
  4860. @c
  4861. @kindex @key{RET}
  4862. @itemx @key{RET}
  4863. Go to the original location of the item and delete other windows.
  4864. @c
  4865. @kindex f
  4866. @item f
  4867. Toggle Follow mode. In Follow mode, as you move the cursor through
  4868. the agenda buffer, the other window always shows the corresponding
  4869. location in the org file. The initial setting for this mode in new
  4870. agenda buffers can be set with the variable
  4871. @code{org-agenda-start-with-follow-mode}.
  4872. @c
  4873. @kindex b
  4874. @item b
  4875. Display the entire subtree of the current item in an indirect buffer. With a
  4876. numeric prefix argument N, go up to level N and then take that tree. If N is
  4877. negative, go up that many levels. With a @kbd{C-u} prefix, do not remove the
  4878. previously used indirect buffer.
  4879. @c
  4880. @kindex l
  4881. @item l
  4882. Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
  4883. logging was on (variable @code{org-log-done}) are shown in the agenda,
  4884. as are entries that have been clocked on that day.
  4885. @c
  4886. @kindex R
  4887. @item R
  4888. Toggle Clockreport mode. In clockreport mode, the daily/weekly agenda will
  4889. always show a table with the clocked times for the timespan and file scope
  4890. covered by the current agenda view. The initial setting for this mode in new
  4891. agenda buffers can be set with the variable
  4892. @code{org-agenda-start-with-clockreport-mode}.
  4893. @tsubheading{Change display}
  4894. @cindex display changing, in agenda
  4895. @kindex o
  4896. @item o
  4897. Delete other windows.
  4898. @c
  4899. @kindex d
  4900. @kindex w
  4901. @kindex m
  4902. @kindex y
  4903. @item d w m y
  4904. Switch to day/week/month/year view. When switching to day or week view,
  4905. this setting becomes the default for subsequent agenda commands. Since
  4906. month and year views are slow to create, they do not become the default.
  4907. A numeric prefix argument may be used to jump directly to a specific day
  4908. of the year, ISO week, month, or year, respectively. For example,
  4909. @kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When
  4910. setting day, week, or month view, a year may be encoded in the prefix
  4911. argument as well. For example, @kbd{200712 w} will jump to week 12 in
  4912. 2007. If such a year specification has only one or two digits, it will
  4913. be mapped to the interval 1938-2037.
  4914. @c
  4915. @kindex D
  4916. @item D
  4917. Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
  4918. @c
  4919. @kindex G
  4920. @item G
  4921. Toggle the time grid on and off. See also the variables
  4922. @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
  4923. @c
  4924. @kindex r
  4925. @item r
  4926. Recreate the agenda buffer, for example to reflect the changes
  4927. after modification of the time stamps of items with S-@key{left} and
  4928. S-@key{right}. When the buffer is the global TODO list, a prefix
  4929. argument is interpreted to create a selective list for a specific TODO
  4930. keyword.
  4931. @kindex g
  4932. @item g
  4933. Same as @kbd{r}.
  4934. @c
  4935. @kindex s
  4936. @kindex C-x C-s
  4937. @item s
  4938. @itemx C-x C-s
  4939. Save all Org buffers in the current Emacs session.
  4940. @c
  4941. @kindex @key{right}
  4942. @item @key{right}
  4943. Display the following @code{org-agenda-ndays} days. For example, if
  4944. the display covers a week, switch to the following week. With prefix
  4945. arg, go forward that many times @code{org-agenda-ndays} days.
  4946. @c
  4947. @kindex @key{left}
  4948. @item @key{left}
  4949. Display the previous dates.
  4950. @c
  4951. @kindex .
  4952. @item .
  4953. Go to today.
  4954. @c
  4955. @kindex C-c C-x C-c
  4956. @item C-c C-x C-c
  4957. Invoke column view (@pxref{Column view}) in the agenda buffer. The column
  4958. view format is taken from the entry at point, or (if there is no entry at
  4959. point), from the first entry in the agenda view. So whatever the format for
  4960. that entry would be in the original buffer (taken from a property, from a
  4961. @code{#+COLUMNS} line, or from the default variable
  4962. @code{org-columns-default-format}), will be used in the agenda.
  4963. @tsubheading{Query editing}
  4964. @cindex query editing, in agenda
  4965. @kindex [
  4966. @kindex ]
  4967. @kindex @{
  4968. @kindex @}
  4969. @item [ ] @{ @}
  4970. In the @i{search view} (@pxref{Keyword search}), these keys add new
  4971. search words (@kbd{[} and @kbd{]}) or new regular expressions (@kbd{@{}
  4972. and @kbd{@}}) to the query string. The opening bracket/brace will add a
  4973. positive search term prefixed by @samp{+}, indicating that this search
  4974. term @i{must} occur/match in the entry. Closing bracket/brace add a
  4975. negative search term which @i{must not} occur/match in the entry for it
  4976. to be selected.
  4977. @tsubheading{Remote editing}
  4978. @cindex remote editing, from agenda
  4979. @item 0-9
  4980. Digit argument.
  4981. @c
  4982. @cindex undoing remote-editing events
  4983. @cindex remote editing, undo
  4984. @kindex C-_
  4985. @item C-_
  4986. Undo a change due to a remote editing command. The change is undone
  4987. both in the agenda buffer and in the remote buffer.
  4988. @c
  4989. @kindex t
  4990. @item t
  4991. Change the TODO state of the item, both in the agenda and in the
  4992. original org file.
  4993. @c
  4994. @kindex C-k
  4995. @item C-k
  4996. Delete the current agenda item along with the entire subtree belonging
  4997. to it in the original Org file. If the text to be deleted remotely
  4998. is longer than one line, the kill needs to be confirmed by the user. See
  4999. variable @code{org-agenda-confirm-kill}.
  5000. @c
  5001. @kindex a
  5002. @item a
  5003. Toggle the ARCHIVE tag for the current headline.
  5004. @c
  5005. @kindex A
  5006. @item A
  5007. Move the subtree corresponding to the current entry to its @emph{Archive
  5008. Sibling}.
  5009. @c
  5010. @kindex $
  5011. @item $
  5012. Archive the subtree corresponding to the current headline. This means the
  5013. entry will be moved to the configured archive location, most likely a
  5014. different file.
  5015. @c
  5016. @kindex T
  5017. @item T
  5018. Show all tags associated with the current item. Because of
  5019. inheritance, this may be more than the tags listed in the line itself.
  5020. @c
  5021. @kindex :
  5022. @item :
  5023. Set tags for the current headline. If there is an active region in the
  5024. agenda, change a tag for all headings in the region.
  5025. @c
  5026. @kindex ,
  5027. @item ,
  5028. Set the priority for the current item. Org mode prompts for the
  5029. priority character. If you reply with @key{SPC}, the priority cookie
  5030. is removed from the entry.
  5031. @c
  5032. @kindex P
  5033. @item P
  5034. Display weighted priority of current item.
  5035. @c
  5036. @kindex +
  5037. @kindex S-@key{up}
  5038. @item +
  5039. @itemx S-@key{up}
  5040. Increase the priority of the current item. The priority is changed in
  5041. the original buffer, but the agenda is not resorted. Use the @kbd{r}
  5042. key for this.
  5043. @c
  5044. @kindex -
  5045. @kindex S-@key{down}
  5046. @item -
  5047. @itemx S-@key{down}
  5048. Decrease the priority of the current item.
  5049. @c
  5050. @kindex C-c C-s
  5051. @item C-c C-s
  5052. Schedule this item
  5053. @c
  5054. @kindex C-c C-d
  5055. @item C-c C-d
  5056. Set a deadline for this item.
  5057. @c
  5058. @kindex S-@key{right}
  5059. @item S-@key{right}
  5060. Change the time stamp associated with the current line by one day into the
  5061. future. With a numeric prefix argument, change it by that many days. For
  5062. example, @kbd{3 6 5 S-@key{right}} will change it by a year. The stamp is
  5063. changed in the original org file, but the change is not directly reflected in
  5064. the agenda buffer. Use the @kbd{r} key to update the buffer.
  5065. @c
  5066. @kindex S-@key{left}
  5067. @item S-@key{left}
  5068. Change the time stamp associated with the current line by one day
  5069. into the past.
  5070. @c
  5071. @kindex >
  5072. @item >
  5073. Change the time stamp associated with the current line to today.
  5074. The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
  5075. on my keyboard.
  5076. @c
  5077. @kindex I
  5078. @item I
  5079. Start the clock on the current item. If a clock is running already, it
  5080. is stopped first.
  5081. @c
  5082. @kindex O
  5083. @item O
  5084. Stop the previously started clock.
  5085. @c
  5086. @kindex X
  5087. @item X
  5088. Cancel the currently running clock.
  5089. @kindex J
  5090. @item J
  5091. Jump to the running clock in another window.
  5092. @tsubheading{Calendar commands}
  5093. @cindex calendar commands, from agenda
  5094. @kindex c
  5095. @item c
  5096. Open the Emacs calendar and move to the date at the agenda cursor.
  5097. @c
  5098. @item c
  5099. When in the calendar, compute and show the Org mode agenda for the
  5100. date at the cursor.
  5101. @c
  5102. @cindex diary entries, creating from agenda
  5103. @kindex i
  5104. @item i
  5105. Insert a new entry into the diary. Prompts for the type of entry
  5106. (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
  5107. entry in the diary, just as @kbd{i d} etc. would do in the calendar.
  5108. The date is taken from the cursor position.
  5109. @c
  5110. @kindex M
  5111. @item M
  5112. Show the phases of the moon for the three months around current date.
  5113. @c
  5114. @kindex S
  5115. @item S
  5116. Show sunrise and sunset times. The geographical location must be set
  5117. with calendar variables, see documentation of the Emacs calendar.
  5118. @c
  5119. @kindex C
  5120. @item C
  5121. Convert the date at cursor into many other cultural and historic
  5122. calendars.
  5123. @c
  5124. @kindex H
  5125. @item H
  5126. Show holidays for three month around the cursor date.
  5127. @item M-x org-export-icalendar-combine-agenda-files
  5128. Export a single iCalendar file containing entries from all agenda files.
  5129. This is a globally available command, and also available in the agenda menu.
  5130. @tsubheading{Exporting to a file}
  5131. @kindex C-x C-w
  5132. @item C-x C-w
  5133. @cindex exporting agenda views
  5134. @cindex agenda views, exporting
  5135. Write the agenda view to a file. Depending on the extension of the
  5136. selected file name, the view will be exported as HTML (extension
  5137. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
  5138. plain text (any other extension). Use the variable
  5139. @code{org-agenda-exporter-settings} to set options for @file{ps-print}
  5140. and for @file{htmlize} to be used during export.
  5141. @tsubheading{Quit and Exit}
  5142. @kindex q
  5143. @item q
  5144. Quit agenda, remove the agenda buffer.
  5145. @c
  5146. @kindex x
  5147. @cindex agenda files, removing buffers
  5148. @item x
  5149. Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
  5150. for the compilation of the agenda. Buffers created by the user to
  5151. visit org files will not be removed.
  5152. @end table
  5153. @node Custom agenda views, Agenda column view, Agenda commands, Agenda Views
  5154. @section Custom agenda views
  5155. @cindex custom agenda views
  5156. @cindex agenda views, custom
  5157. Custom agenda commands serve two purposes: to store and quickly access
  5158. frequently used TODO and tags searches, and to create special composite
  5159. agenda buffers. Custom agenda commands will be accessible through the
  5160. dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
  5161. @menu
  5162. * Storing searches:: Type once, use often
  5163. * Block agenda:: All the stuff you need in a single buffer
  5164. * Setting Options:: Changing the rules
  5165. * Exporting Agenda Views:: Writing agendas to files
  5166. * Using the agenda elsewhere:: Using agenda information in other programs
  5167. @end menu
  5168. @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
  5169. @subsection Storing searches
  5170. The first application of custom searches is the definition of keyboard
  5171. shortcuts for frequently used searches, either creating an agenda
  5172. buffer, or a sparse tree (the latter covering of course only the current
  5173. buffer).
  5174. @kindex C-c a C
  5175. Custom commands are configured in the variable
  5176. @code{org-agenda-custom-commands}. You can customize this variable, for
  5177. example by pressing @kbd{C-c a C}. You can also directly set it with
  5178. Emacs Lisp in @file{.emacs}. The following example contains all valid
  5179. search types:
  5180. @lisp
  5181. @group
  5182. (setq org-agenda-custom-commands
  5183. '(("w" todo "WAITING")
  5184. ("W" todo-tree "WAITING")
  5185. ("u" tags "+boss-urgent")
  5186. ("v" tags-todo "+boss-urgent")
  5187. ("U" tags-tree "+boss-urgent")
  5188. ("f" occur-tree "\\<FIXME\\>")
  5189. ("h" . "HOME+Name tags searches") ; description for "h" prefix
  5190. ("hl" tags "+home+Lisa")
  5191. ("hp" tags "+home+Peter")
  5192. ("hk" tags "+home+Kim")))
  5193. @end group
  5194. @end lisp
  5195. @noindent
  5196. The initial string in each entry defines the keys you have to press
  5197. after the dispatcher command @kbd{C-c a} in order to access the command.
  5198. Usually this will be just a single character, but if you have many
  5199. similar commands, you can also define two-letter combinations where the
  5200. first character is the same in several combinations and serves as a
  5201. prefix key@footnote{You can provide a description for a prefix key by
  5202. inserting a cons cell with the prefix and the description.}. The second
  5203. parameter is the search type, followed by the string or regular
  5204. expression to be used for the matching. The example above will
  5205. therefore define:
  5206. @table @kbd
  5207. @item C-c a w
  5208. as a global search for TODO entries with @samp{WAITING} as the TODO
  5209. keyword
  5210. @item C-c a W
  5211. as the same search, but only in the current buffer and displaying the
  5212. results as a sparse tree
  5213. @item C-c a u
  5214. as a global tags search for headlines marked @samp{:boss:} but not
  5215. @samp{:urgent:}
  5216. @item C-c a v
  5217. as the same search as @kbd{C-c a u}, but limiting the search to
  5218. headlines that are also TODO items
  5219. @item C-c a U
  5220. as the same search as @kbd{C-c a u}, but only in the current buffer and
  5221. displaying the result as a sparse tree
  5222. @item C-c a f
  5223. to create a sparse tree (again: current buffer only) with all entries
  5224. containing the word @samp{FIXME}
  5225. @item C-c a h
  5226. as a prefix command for a HOME tags search where you have to press an
  5227. additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
  5228. Peter, or Kim) as additional tag to match.
  5229. @end table
  5230. @node Block agenda, Setting Options, Storing searches, Custom agenda views
  5231. @subsection Block agenda
  5232. @cindex block agenda
  5233. @cindex agenda, with block views
  5234. Another possibility is the construction of agenda views that comprise
  5235. the results of @emph{several} commands, each of which creates a block in
  5236. the agenda buffer. The available commands include @code{agenda} for the
  5237. daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
  5238. for the global TODO list (as constructed with @kbd{C-c a t}), and the
  5239. matching commands discussed above: @code{todo}, @code{tags}, and
  5240. @code{tags-todo}. Here are two examples:
  5241. @lisp
  5242. @group
  5243. (setq org-agenda-custom-commands
  5244. '(("h" "Agenda and Home-related tasks"
  5245. ((agenda "")
  5246. (tags-todo "home")
  5247. (tags "garden")))
  5248. ("o" "Agenda and Office-related tasks"
  5249. ((agenda "")
  5250. (tags-todo "work")
  5251. (tags "office")))))
  5252. @end group
  5253. @end lisp
  5254. @noindent
  5255. This will define @kbd{C-c a h} to create a multi-block view for stuff
  5256. you need to attend to at home. The resulting agenda buffer will contain
  5257. your agenda for the current week, all TODO items that carry the tag
  5258. @samp{home}, and also all lines tagged with @samp{garden}. Finally the
  5259. command @kbd{C-c a o} provides a similar view for office tasks.
  5260. @node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
  5261. @subsection Setting options for custom commands
  5262. @cindex options, for custom agenda views
  5263. Org mode contains a number of variables regulating agenda construction
  5264. and display. The global variables define the behavior for all agenda
  5265. commands, including the custom commands. However, if you want to change
  5266. some settings just for a single custom view, you can do so. Setting
  5267. options requires inserting a list of variable names and values at the
  5268. right spot in @code{org-agenda-custom-commands}. For example:
  5269. @lisp
  5270. @group
  5271. (setq org-agenda-custom-commands
  5272. '(("w" todo "WAITING"
  5273. ((org-agenda-sorting-strategy '(priority-down))
  5274. (org-agenda-prefix-format " Mixed: ")))
  5275. ("U" tags-tree "+boss-urgent"
  5276. ((org-show-following-heading nil)
  5277. (org-show-hierarchy-above nil)))
  5278. ("N" search ""
  5279. ((org-agenda-files '("~org/notes.org"))
  5280. (org-agenda-text-search-extra-files nil)))))
  5281. @end group
  5282. @end lisp
  5283. @noindent
  5284. Now the @kbd{C-c a w} command will sort the collected entries only by
  5285. priority, and the prefix format is modified to just say @samp{ Mixed: }
  5286. instead of giving the category of the entry. The sparse tags tree of
  5287. @kbd{C-c a U} will now turn out ultra-compact, because neither the
  5288. headline hierarchy above the match, nor the headline following the match
  5289. will be shown. The command @kbd{C-c a N} will do a text search limited
  5290. to only a single file.
  5291. For command sets creating a block agenda,
  5292. @code{org-agenda-custom-commands} has two separate spots for setting
  5293. options. You can add options that should be valid for just a single
  5294. command in the set, and options that should be valid for all commands in
  5295. the set. The former are just added to the command entry, the latter
  5296. must come after the list of command entries. Going back to the block
  5297. agenda example (@pxref{Block agenda}), let's change the sorting strategy
  5298. for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
  5299. the results for GARDEN tags query in the opposite order,
  5300. @code{priority-up}. This would look like this:
  5301. @lisp
  5302. @group
  5303. (setq org-agenda-custom-commands
  5304. '(("h" "Agenda and Home-related tasks"
  5305. ((agenda)
  5306. (tags-todo "home")
  5307. (tags "garden"
  5308. ((org-agenda-sorting-strategy '(priority-up)))))
  5309. ((org-agenda-sorting-strategy '(priority-down))))
  5310. ("o" "Agenda and Office-related tasks"
  5311. ((agenda)
  5312. (tags-todo "work")
  5313. (tags "office")))))
  5314. @end group
  5315. @end lisp
  5316. As you see, the values and parenthesis setting is a little complex.
  5317. When in doubt, use the customize interface to set this variable - it
  5318. fully supports its structure. Just one caveat: When setting options in
  5319. this interface, the @emph{values} are just lisp expressions. So if the
  5320. value is a string, you need to add the double quotes around the value
  5321. yourself.
  5322. @node Exporting Agenda Views, Using the agenda elsewhere, Setting Options, Custom agenda views
  5323. @subsection Exporting Agenda Views
  5324. @cindex agenda views, exporting
  5325. If you are away from your computer, it can be very useful to have a
  5326. printed version of some agenda views to carry around. Org mode can
  5327. export custom agenda views as plain text, HTML@footnote{You need to
  5328. install Hrvoje Niksic' @file{htmlize.el}.} postscript, and iCalendar
  5329. files. If you want to do this only occasionally, use the command
  5330. @table @kbd
  5331. @kindex C-x C-w
  5332. @item C-x C-w
  5333. @cindex exporting agenda views
  5334. @cindex agenda views, exporting
  5335. Write the agenda view to a file. Depending on the extension of the
  5336. selected file name, the view will be exported as HTML (extension
  5337. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}),
  5338. iCalendar (extension @file{.ics}), or plain text (any other extension).
  5339. Use the variable @code{org-agenda-exporter-settings} to
  5340. set options for @file{ps-print} and for @file{htmlize} to be used during
  5341. export, for example
  5342. @lisp
  5343. (setq org-agenda-exporter-settings
  5344. '((ps-number-of-columns 2)
  5345. (ps-landscape-mode t)
  5346. (htmlize-output-type 'css)))
  5347. @end lisp
  5348. @end table
  5349. If you need to export certain agenda views frequently, you can associate
  5350. any custom agenda command with a list of output file names
  5351. @footnote{If you want to store standard views like the weekly agenda
  5352. or the global TODO list as well, you need to define custom commands for
  5353. them in order to be able to specify file names.}. Here is an example
  5354. that first does define custom commands for the agenda and the global
  5355. todo list, together with a number of files to which to export them.
  5356. Then we define two block agenda commands and specify file names for them
  5357. as well. File names can be relative to the current working directory,
  5358. or absolute.
  5359. @lisp
  5360. @group
  5361. (setq org-agenda-custom-commands
  5362. '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
  5363. ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
  5364. ("h" "Agenda and Home-related tasks"
  5365. ((agenda "")
  5366. (tags-todo "home")
  5367. (tags "garden"))
  5368. nil
  5369. ("~/views/home.html"))
  5370. ("o" "Agenda and Office-related tasks"
  5371. ((agenda)
  5372. (tags-todo "work")
  5373. (tags "office"))
  5374. nil
  5375. ("~/views/office.ps" "~/calendars/office.ics"))))
  5376. @end group
  5377. @end lisp
  5378. The extension of the file name determines the type of export. If it is
  5379. @file{.html}, Org mode will use the @file{htmlize.el} package to convert
  5380. the buffer to HTML and save it to this file name. If the extension is
  5381. @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
  5382. postscript output. If the extension is @file{.ics}, iCalendar export is
  5383. run export over all files that were used to construct the agenda, and
  5384. limit the export to entries listed in the agenda now. Any other
  5385. extension produces a plain ASCII file.
  5386. The export files are @emph{not} created when you use one of those
  5387. commands interactively because this might use too much overhead.
  5388. Instead, there is a special command to produce @emph{all} specified
  5389. files in one step:
  5390. @table @kbd
  5391. @kindex C-c a e
  5392. @item C-c a e
  5393. Export all agenda views that have export file names associated with
  5394. them.
  5395. @end table
  5396. You can use the options section of the custom agenda commands to also
  5397. set options for the export commands. For example:
  5398. @lisp
  5399. (setq org-agenda-custom-commands
  5400. '(("X" agenda ""
  5401. ((ps-number-of-columns 2)
  5402. (ps-landscape-mode t)
  5403. (org-agenda-prefix-format " [ ] ")
  5404. (org-agenda-with-colors nil)
  5405. (org-agenda-remove-tags t))
  5406. ("theagenda.ps"))))
  5407. @end lisp
  5408. @noindent
  5409. This command sets two options for the postscript exporter, to make it
  5410. print in two columns in landscape format - the resulting page can be cut
  5411. in two and then used in a paper agenda. The remaining settings modify
  5412. the agenda prefix to omit category and scheduling information, and
  5413. instead include a checkbox to check off items. We also remove the tags
  5414. to make the lines compact, and we don't want to use colors for the
  5415. black-and-white printer. Settings specified in
  5416. @code{org-agenda-exporter-settings} will also apply, but the settings
  5417. in @code{org-agenda-custom-commands} take precedence.
  5418. @noindent
  5419. From the command line you may also use
  5420. @example
  5421. emacs -f org-batch-store-agenda-views -kill
  5422. @end example
  5423. @noindent
  5424. or, if you need to modify some parameters
  5425. @example
  5426. emacs -eval '(org-batch-store-agenda-views \
  5427. org-agenda-ndays 30 \
  5428. org-agenda-start-day "2007-11-01" \
  5429. org-agenda-include-diary nil \
  5430. org-agenda-files (quote ("~/org/project.org")))' \
  5431. -kill
  5432. @end example
  5433. @noindent
  5434. which will create the agenda views restricted to the file
  5435. @file{~/org/project.org}, without diary entries and with 30 days
  5436. extent.
  5437. @node Using the agenda elsewhere, , Exporting Agenda Views, Custom agenda views
  5438. @subsection Using agenda information outside of Org
  5439. @cindex agenda, pipe
  5440. @cindex Scripts, for agenda processing
  5441. Org provides commands to access agenda information for the command
  5442. line in emacs batch mode. This extracted information can be sent
  5443. directly to a printer, or it can be read by a program that does further
  5444. processing of the data. The first of these commands is the function
  5445. @code{org-batch-agenda}, that produces an agenda view and sends it as
  5446. ASCII text to STDOUT. The command takes a single string as parameter.
  5447. If the string has length 1, it is used as a key to one of the commands
  5448. you have configured in @code{org-agenda-custom-commands}, basically any
  5449. key you can use after @kbd{C-c a}. For example, to directly print the
  5450. current TODO list, you could use
  5451. @example
  5452. emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
  5453. @end example
  5454. If the parameter is a string with 2 or more characters, it is used as a
  5455. tags/todo match string. For example, to print your local shopping list
  5456. (all items with the tag @samp{shop}, but excluding the tag
  5457. @samp{NewYork}), you could use
  5458. @example
  5459. emacs -batch -l ~/.emacs \
  5460. -eval '(org-batch-agenda "+shop-NewYork")' | lpr
  5461. @end example
  5462. @noindent
  5463. You may also modify parameters on the fly like this:
  5464. @example
  5465. emacs -batch -l ~/.emacs \
  5466. -eval '(org-batch-agenda "a" \
  5467. org-agenda-ndays 30 \
  5468. org-agenda-include-diary nil \
  5469. org-agenda-files (quote ("~/org/project.org")))' \
  5470. | lpr
  5471. @end example
  5472. @noindent
  5473. which will produce a 30 day agenda, fully restricted to the Org file
  5474. @file{~/org/projects.org}, not even including the diary.
  5475. If you want to process the agenda data in more sophisticated ways, you
  5476. can use the command @code{org-batch-agenda-csv} to get a comma-separated
  5477. list of values for each agenda item. Each line in the output will
  5478. contain a number of fields separated by commas. The fields in a line
  5479. are:
  5480. @example
  5481. category @r{The category of the item}
  5482. head @r{The headline, without TODO kwd, TAGS and PRIORITY}
  5483. type @r{The type of the agenda entry, can be}
  5484. todo @r{selected in TODO match}
  5485. tagsmatch @r{selected in tags match}
  5486. diary @r{imported from diary}
  5487. deadline @r{a deadline}
  5488. scheduled @r{scheduled}
  5489. timestamp @r{appointment, selected by timestamp}
  5490. closed @r{entry was closed on date}
  5491. upcoming-deadline @r{warning about nearing deadline}
  5492. past-scheduled @r{forwarded scheduled item}
  5493. block @r{entry has date block including date}
  5494. todo @r{The TODO keyword, if any}
  5495. tags @r{All tags including inherited ones, separated by colons}
  5496. date @r{The relevant date, like 2007-2-14}
  5497. time @r{The time, like 15:00-16:50}
  5498. extra @r{String with extra planning info}
  5499. priority-l @r{The priority letter if any was given}
  5500. priority-n @r{The computed numerical priority}
  5501. @end example
  5502. @noindent
  5503. Time and date will only be given if a timestamp (or deadline/scheduled)
  5504. lead to the selection of the item.
  5505. A CSV list like this is very easy to use in a post processing script.
  5506. For example, here is a Perl program that gets the TODO list from
  5507. Emacs/Org and prints all the items, preceded by a checkbox:
  5508. @example
  5509. @group
  5510. #!/usr/bin/perl
  5511. # define the Emacs command to run
  5512. $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
  5513. # run it and capture the output
  5514. $agenda = qx@{$cmd 2>/dev/null@};
  5515. # loop over all lines
  5516. foreach $line (split(/\n/,$agenda)) @{
  5517. # get the individual values
  5518. ($category,$head,$type,$todo,$tags,$date,$time,$extra,
  5519. $priority_l,$priority_n) = split(/,/,$line);
  5520. # proccess and print
  5521. print "[ ] $head\n";
  5522. @}
  5523. @end group
  5524. @end example
  5525. @node Agenda column view, , Custom agenda views, Agenda Views
  5526. @section Using column view in the agenda
  5527. @cindex column view, in agenda
  5528. @cindex agenda, column view
  5529. Column view (@pxref{Column view}) is normally used to view and edit
  5530. properties embedded in the hierarchical structure of an Org file. It can be
  5531. quite useful to use column view also from the agenda, where entries are
  5532. collected by certain criteria.
  5533. @table @kbd
  5534. @kindex C-c C-x C-c
  5535. @item C-c C-x C-c
  5536. Turn on column view in the agenda.
  5537. @end table
  5538. To understand how to use this properly, it is important to realize that the
  5539. entries in the agenda are no longer in their proper outline environment.
  5540. This causes the following issues:
  5541. @enumerate
  5542. @item
  5543. Org needs to make a decision which @code{COLUMNS} format to use. Since the
  5544. entries in the agenda are collected from different files, and different files
  5545. may have different @code{COLUMNS} formats, this is a non-trivial problem.
  5546. Org first checks if the variable @code{org-overriding-columns-format} is
  5547. currently set, and if yes takes the format from there. Otherwise it takes
  5548. the format associated with the first item in the agenda, or, if that item
  5549. does not have a specific format (defined in a property, or in it's file), it
  5550. uses @code{org-columns-default-format}.
  5551. @item
  5552. If any of the columns has a summary type defined (@pxref{Column attributes}),
  5553. turning on column view in the agenda will visit all relevant agenda files and
  5554. make sure that the computations of this property are up to date. This is
  5555. also true for the special @code{CLOCKSUM} property. Org will then sum the
  5556. values displayed in the agenda. In the daily/weekly agenda, the sums will
  5557. cover a single day, in all other views they cover the entire block. It is
  5558. vital to realize that the agenda may show the same entry @emph{twice} (for
  5559. example as scheduled and as a deadline), and it may show two entries from the
  5560. same hierarchy (for example a @emph{parent} and it's @emph{child}). In these
  5561. cases, the summation in the agenda will lead to incorrect results because
  5562. some values will count double.
  5563. @item
  5564. When the column view in the agenda shows the @code{CLOCKSUM}, that is always
  5565. the entire clocked time for this item. So even in the daily/weekly agenda,
  5566. the clocksum listed in column view may originate from times outside the
  5567. current view. This has the advantage that you can compare these values with
  5568. a column listing the planned total effort for a task - one of the major
  5569. applications for column view in the agenda. If you want information about
  5570. clocked time in the displayed period use clock table mode (press @kbd{R} in
  5571. the agenda).
  5572. @end enumerate
  5573. @node Embedded LaTeX, Exporting, Agenda Views, Top
  5574. @chapter Embedded LaTeX
  5575. @cindex @TeX{} interpretation
  5576. @cindex La@TeX{} interpretation
  5577. Plain ASCII is normally sufficient for almost all note taking. One
  5578. exception, however, are scientific notes which need to be able to contain
  5579. mathematical symbols and the occasional formula. La@TeX{}@footnote{La@TeX{}
  5580. is a macro system based on Donald E. Knuth's @TeX{} system. Many of the
  5581. features described here as ``La@TeX{}'' are really from @TeX{}, but for
  5582. simplicity I am blurring this distinction.} is widely used to typeset
  5583. scientific documents. Org mode supports embedding La@TeX{} code into its
  5584. files, because many academics are used to reading La@TeX{} source code, and
  5585. because it can be readily processed into images for HTML production.
  5586. It is not necessary to mark La@TeX{} macros and code in any special way.
  5587. If you observe a few conventions, Org mode knows how to find it and what
  5588. to do with it.
  5589. @menu
  5590. * Math symbols:: TeX macros for symbols and Greek letters
  5591. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  5592. * LaTeX fragments:: Complex formulas made easy
  5593. * Processing LaTeX fragments:: Previewing LaTeX processing
  5594. * CDLaTeX mode:: Speed up entering of formulas
  5595. @end menu
  5596. @node Math symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
  5597. @section Math symbols
  5598. @cindex math symbols
  5599. @cindex TeX macros
  5600. You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
  5601. to indicate the Greek letter, or @samp{\to} to indicate an arrow.
  5602. Completion for these macros is available, just type @samp{\} and maybe a
  5603. few letters, and press @kbd{M-@key{TAB}} to see possible completions.
  5604. Unlike La@TeX{} code, Org mode allows these macros to be present
  5605. without surrounding math delimiters, for example:
  5606. @example
  5607. Angles are written as Greek letters \alpha, \beta and \gamma.
  5608. @end example
  5609. During HTML export (@pxref{HTML export}), these symbols are translated
  5610. into the proper syntax for HTML, for the above examples this is
  5611. @samp{&alpha;} and @samp{&rarr;}, respectively.
  5612. @node Subscripts and superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
  5613. @section Subscripts and superscripts
  5614. @cindex subscript
  5615. @cindex superscript
  5616. Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
  5617. and subscripts. Again, these can be used without embedding them in
  5618. math-mode delimiters. To increase the readability of ASCII text, it is
  5619. not necessary (but OK) to surround multi-character sub- and superscripts
  5620. with curly braces. For example
  5621. @example
  5622. The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
  5623. the sun is R_@{sun@} = 6.96 x 10^8 m.
  5624. @end example
  5625. To avoid interpretation as raised or lowered text, you can quote
  5626. @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
  5627. During HTML export (@pxref{HTML export}), subscript and superscripts
  5628. are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
  5629. @node LaTeX fragments, Processing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
  5630. @section LaTeX fragments
  5631. @cindex LaTeX fragments
  5632. With symbols, sub- and superscripts, HTML is pretty much at its end when
  5633. it comes to representing mathematical formulas@footnote{Yes, there is
  5634. MathML, but that is not yet fully supported by many browsers, and there
  5635. is no decent converter for turning La@TeX{} or ASCII representations of
  5636. formulas into MathML. So for the time being, converting formulas into
  5637. images seems the way to go.}. More complex expressions need a dedicated
  5638. formula processor. To this end, Org mode can contain arbitrary La@TeX{}
  5639. fragments. It provides commands to preview the typeset result of these
  5640. fragments, and upon export to HTML, all fragments will be converted to
  5641. images and inlined into the HTML document@footnote{The La@TeX{} export
  5642. will not use images for displaying La@TeX{} fragments but include these
  5643. fragments directly into the La@TeX{} code.}. For this to work you
  5644. need to be on a system with a working La@TeX{} installation. You also
  5645. need the @file{dvipng} program, available at
  5646. @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
  5647. will be used when processing a fragment can be configured with the
  5648. variable @code{org-format-latex-header}.
  5649. La@TeX{} fragments don't need any special marking at all. The following
  5650. snippets will be identified as La@TeX{} source code:
  5651. @itemize @bullet
  5652. @item
  5653. Environments of any kind. The only requirement is that the
  5654. @code{\begin} statement appears on a new line, preceded by only
  5655. whitespace.
  5656. @item
  5657. Text within the usual La@TeX{} math delimiters. To avoid conflicts with
  5658. currency specifications, single @samp{$} characters are only recognized
  5659. as math delimiters if the enclosed text contains at most two line breaks,
  5660. is directly attached to the @samp{$} characters with no whitespace in
  5661. between, and if the closing @samp{$} is followed by whitespace or
  5662. punctuation. For the other delimiters, there is no such restriction, so
  5663. when in doubt, use @samp{\(...\)} as inline math delimiters.
  5664. @end itemize
  5665. @noindent For example:
  5666. @example
  5667. \begin@{equation@} % arbitrary environments,
  5668. x=\sqrt@{b@} % even tables, figures
  5669. \end@{equation@} % etc
  5670. If $a^2=b$ and \( b=2 \), then the solution must be
  5671. either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
  5672. @end example
  5673. @noindent
  5674. If you need any of the delimiter ASCII sequences for other purposes, you
  5675. can configure the option @code{org-format-latex-options} to deselect the
  5676. ones you do not wish to have interpreted by the La@TeX{} converter.
  5677. @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
  5678. @section Processing LaTeX fragments
  5679. @cindex LaTeX fragments, preview
  5680. La@TeX{} fragments can be processed to produce a preview images of the
  5681. typeset expressions:
  5682. @table @kbd
  5683. @kindex C-c C-x C-l
  5684. @item C-c C-x C-l
  5685. Produce a preview image of the La@TeX{} fragment at point and overlay it
  5686. over the source code. If there is no fragment at point, process all
  5687. fragments in the current entry (between two headlines). When called
  5688. with a prefix argument, process the entire subtree. When called with
  5689. two prefix arguments, or when the cursor is before the first headline,
  5690. process the entire buffer.
  5691. @kindex C-c C-c
  5692. @item C-c C-c
  5693. Remove the overlay preview images.
  5694. @end table
  5695. During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
  5696. converted into images and inlined into the document if the following
  5697. setting is active:
  5698. @lisp
  5699. (setq org-export-with-LaTeX-fragments t)
  5700. @end lisp
  5701. @node CDLaTeX mode, , Processing LaTeX fragments, Embedded LaTeX
  5702. @section Using CDLaTeX to enter math
  5703. @cindex CDLaTeX
  5704. CDLaTeX mode is a minor mode that is normally used in combination with a
  5705. major La@TeX{} mode like AUCTeX in order to speed-up insertion of
  5706. environments and math templates. Inside Org mode, you can make use of
  5707. some of the features of CDLaTeX mode. You need to install
  5708. @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
  5709. AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
  5710. Don't use CDLaTeX mode itself under Org mode, but use the light
  5711. version @code{org-cdlatex-mode} that comes as part of Org mode. Turn it
  5712. on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
  5713. Org files with
  5714. @lisp
  5715. (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
  5716. @end lisp
  5717. When this mode is enabled, the following features are present (for more
  5718. details see the documentation of CDLaTeX mode):
  5719. @itemize @bullet
  5720. @kindex C-c @{
  5721. @item
  5722. Environment templates can be inserted with @kbd{C-c @{}.
  5723. @item
  5724. @kindex @key{TAB}
  5725. The @key{TAB} key will do template expansion if the cursor is inside a
  5726. La@TeX{} fragment@footnote{Org mode has a method to test if the cursor is
  5727. inside such a fragment, see the documentation of the function
  5728. @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
  5729. expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
  5730. correctly inside the first brace. Another @key{TAB} will get you into
  5731. the second brace. Even outside fragments, @key{TAB} will expand
  5732. environment abbreviations at the beginning of a line. For example, if
  5733. you write @samp{equ} at the beginning of a line and press @key{TAB},
  5734. this abbreviation will be expanded to an @code{equation} environment.
  5735. To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
  5736. @item
  5737. @kindex _
  5738. @kindex ^
  5739. Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
  5740. characters together with a pair of braces. If you use @key{TAB} to move
  5741. out of the braces, and if the braces surround only a single character or
  5742. macro, they are removed again (depending on the variable
  5743. @code{cdlatex-simplify-sub-super-scripts}).
  5744. @item
  5745. @kindex `
  5746. Pressing the backquote @kbd{`} followed by a character inserts math
  5747. macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
  5748. after the backquote, a help window will pop up.
  5749. @item
  5750. @kindex '
  5751. Pressing the normal quote @kbd{'} followed by another character modifies
  5752. the symbol before point with an accent or a font. If you wait more than
  5753. 1.5 seconds after the backquote, a help window will pop up. Character
  5754. modification will work only inside La@TeX{} fragments, outside the quote
  5755. is normal.
  5756. @end itemize
  5757. @node Exporting, Publishing, Embedded LaTeX, Top
  5758. @chapter Exporting
  5759. @cindex exporting
  5760. Org mode documents can be exported into a variety of other formats. For
  5761. printing and sharing of notes, ASCII export produces a readable and
  5762. simple version of an Org file. HTML export allows you to publish a
  5763. notes file on the web, while the XOXO format provides a solid base for
  5764. exchange with a broad range of other applications. La@TeX{} export lets
  5765. you use Org mode and its structured editing functions to easily create
  5766. La@TeX{} files. To incorporate entries with associated times like
  5767. deadlines or appointments into a desktop calendar program like iCal,
  5768. Org mode can also produce extracts in the iCalendar format. Currently
  5769. Org mode only supports export, not import of these different formats.
  5770. @menu
  5771. * Markup rules:: Which structures are recognized?
  5772. * Export options:: Per-file export settings
  5773. * The export dispatcher:: How to access exporter commands
  5774. * ASCII export:: Exporting to plain ASCII
  5775. * HTML export:: Exporting to HTML
  5776. * LaTeX export:: Exporting to LaTeX
  5777. * XOXO export:: Exporting to XOXO
  5778. * iCalendar export:: Exporting in iCalendar format
  5779. @end menu
  5780. @node Markup rules, Export options, Exporting, Exporting
  5781. @section Markup rules
  5782. When exporting Org mode documents, the exporter tries to reflect the
  5783. structure of the document as accurately as possible in the back-end. Since
  5784. export targets like HTML or La@TeX{} allow much richer formatting, Org mode
  5785. has rules how to prepare text for rich export. This section summarizes the
  5786. markup rule used in an Org mode buffer.
  5787. @menu
  5788. * Document title:: How the document title is determined
  5789. * Headings and sections:: The main structure of the exported document
  5790. * Table of contents:: If, where, how to create a table of contents
  5791. * Initial text:: Text before the first headline
  5792. * Lists:: Plain lists are exported
  5793. * Paragraphs:: What determines beginning and ending
  5794. * Literal examples:: Source code and other examples
  5795. * Tables exported:: Tables are exported richly
  5796. * Footnotes:: Numbers like [1]
  5797. * Emphasis and monospace:: To bold or not to bold
  5798. * TeX macros and LaTeX fragments:: Create special, rich export.
  5799. * Horizontal rules:: A line across the page
  5800. * Comment lines:: Some lines will not be exported
  5801. @end menu
  5802. @node Document title, Headings and sections, Markup rules, Markup rules
  5803. @subheading Document title
  5804. @noindent
  5805. The title of the exported document is taken from the special line
  5806. @example
  5807. #+TITLE: This is the title of the document
  5808. @end example
  5809. @noindent
  5810. If this line does not exist, the title is derived from the first non-empty,
  5811. non-comment line in the buffer. If no such line exists, or if you have
  5812. turned off exporting of the text before the first headline (see below), the
  5813. title will be the file name without extension.
  5814. If you are exporting only a subtree by marking is as the region, the heading
  5815. of the subtree will become the title of the document.
  5816. @node Headings and sections, Table of contents, Document title, Markup rules
  5817. @subheading Headings and sections
  5818. The outline structure of the document as described in @ref{Document
  5819. Structure} forms the basis for defining sections of the exported document.
  5820. However, since the outline structure is also used for (for example) lists of
  5821. tasks, only the first three outline levels will be used as headings. Deeper
  5822. levels will become itemized lists. You can change the location of this
  5823. switch, globally by setting the variable @code{org-headline-levels}, or on a
  5824. per file basis with a line
  5825. @example
  5826. #+OPTIONS: H:4
  5827. @end example
  5828. @node Table of contents, Initial text, Headings and sections, Markup rules
  5829. @subheading Table of contents
  5830. The table of contents is normally inserted directly before the first headline
  5831. of the file. If you would like to get it to a different location, insert the
  5832. string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
  5833. location. The depth of the table of contents is by default the same as the
  5834. number of headline levels, but you can choose a smaller number or turn off
  5835. the table of contents entirely by configuring the variable
  5836. @code{org-export-with-toc}, or on a per-file basis with a line like
  5837. @example
  5838. #+OPTIONS: toc:2 (only to two levels in TOC)
  5839. #+OPTIONS: toc:nil (no TOC at all)
  5840. @end example
  5841. @node Initial text, Lists, Table of contents, Markup rules
  5842. @subheading Text before the first headline
  5843. Org mode normally exports the text before the first headline, and even uses
  5844. the first line as the document title. The text will be fully marked up. If
  5845. you need to include literal HTML or La@TeX{} code, use the special constructs
  5846. described below in the sections for the individual exporters.
  5847. Some people like to use the space before the first headline for setup and
  5848. internal links and therefore would like to control the exported text before
  5849. the first headline in a different way. You can do so by setting the variable
  5850. @code{org-export-skip-text-before-1st-heading} to @code{t}. On a per-file
  5851. basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
  5852. @noindent
  5853. If you still want to have some text before the first headline, use the
  5854. @code{#+TEXT} construct:
  5855. @example
  5856. #+OPTIONS: skip:t
  5857. #+TEXT: This text will go before the *first* headline.
  5858. #+TEXT: [TABLE-OF-CONTENTS]
  5859. #+TEXT: This goes between the table of contents and the first headline
  5860. @end example
  5861. @node Lists, Paragraphs, Initial text, Markup rules
  5862. @subheading Lists
  5863. Plain lists as described in @ref{Plain lists} are translated to the back-ends
  5864. syntax for such lists. Most back-ends support unordered, ordered, and
  5865. description lists.
  5866. @node Paragraphs, Literal examples, Lists, Markup rules
  5867. @subheading Paragraphs, line breaks, and quoting
  5868. Paragraphs are separated by at least one empty line. If you need to enforce
  5869. a line break within a paragraph, use @samp{\\} at the end of a line.
  5870. When quoting a passage from another document, it is customary to format this
  5871. as a paragraph that is indented on both the left and the right margin. You
  5872. can include quotations in Org mode documents like this:
  5873. @example
  5874. #+begin_quote
  5875. Everything should be made as simple as possible,
  5876. but not any simpler -- Albert Einstein
  5877. #+end_quote
  5878. @end example
  5879. @node Literal examples, Tables exported, Paragraphs, Markup rules
  5880. @subheading Literal examples
  5881. You can include literal examples that should not be subjected to
  5882. markup. Such examples will be typeset in monospace, so this is well suited
  5883. for source code and similar examples.
  5884. @example
  5885. #+begin_example
  5886. Some example from a text file.
  5887. #+end_example
  5888. @end example
  5889. For simplicity when using small examples, you can also start the example
  5890. lines with a colon:
  5891. @example
  5892. : Some example from a text file.
  5893. @end example
  5894. If the example is source code from a programming language, or any other text
  5895. that can be marked up by font-lock in Emacs, you can ask for the example to
  5896. look like the fontified Emacs buffer@footnote{Currently this works only for
  5897. the HTML back-end, and requires the @file{htmlize.el} package version 1.34 or
  5898. later.}. This is done with the @samp{src} block, where you also need to
  5899. specify the name of the major mode that should be used to fontify the
  5900. example:
  5901. @example
  5902. #+begin_src emacs-lisp
  5903. (defun org-xor (a b)
  5904. "Exclusive or."
  5905. (if a (not b) b))
  5906. #+end_src
  5907. @end example
  5908. @node Tables exported, Footnotes, Literal examples, Markup rules
  5909. @subheading Tables
  5910. Both the native Org mode tables (@pxref{Tables}) and tables formatted with
  5911. the @file{table.el} package will be exported properly. For Org mode tables,
  5912. the lines before the first horizontal separator line will become table header
  5913. lines.
  5914. @node Footnotes, Emphasis and monospace, Tables exported, Markup rules
  5915. @subheading Footnotes
  5916. @cindex footnotes
  5917. @cindex @file{footnote.el}
  5918. @kindex C-c !
  5919. Numbers in square brackets are treated as footnote markers, and lines
  5920. starting with such a marker are interpreted as the footnote itself. You can
  5921. use the Emacs package @file{footnote.el} to create footnotes@footnote{The
  5922. @file{footnote} package uses @kbd{C-c !} to invoke its commands. This
  5923. binding conflicts with the Org mode command for inserting inactive time
  5924. stamps. You could use the variable @code{footnote-prefix} to switch
  5925. footnotes commands to another key. Or, if you are too used to this binding,
  5926. you could use @code{org-replace-disputed-keys} and @code{org-disputed-keys}
  5927. to change the settings in Org.}. For example:
  5928. @example
  5929. The Org homepage[1] now looks a lot better than it used to.
  5930. [1] The link is: http://orgmode.org
  5931. @end example
  5932. @node Emphasis and monospace, TeX macros and LaTeX fragments, Footnotes, Markup rules
  5933. @subheading Emphasis and monospace
  5934. @cindex underlined text
  5935. @cindex bold text
  5936. @cindex italic text
  5937. @cindex verbatim text
  5938. You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
  5939. and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
  5940. in the code and verbatim string is not processed for Org mode specific
  5941. syntax, it is exported verbatim.
  5942. @node TeX macros and LaTeX fragments, Horizontal rules, Emphasis and monospace, Markup rules
  5943. @subheading @TeX{} macros and La@TeX{} fragments
  5944. @cindex LaTeX fragments, export
  5945. @cindex TeX macros, export
  5946. @cindex HTML entities
  5947. @cindex LaTeX entities
  5948. A @TeX{}-like syntax is used to specify special characters. Where possible,
  5949. these will be transformed into the native format of the exporter back-end.
  5950. Strings like @code{\alpha} will be exported as @code{&alpha;} in the HTML
  5951. output, and as @code{$\alpha$} in the La@TeX{} output. Similarly,
  5952. @code{\nbsp} will become @code{&nbsp;} in HTML and @code{~} in La@TeX{}.
  5953. This applies for a large number of entities, with names taken from both HTML
  5954. and La@TeX{}, see the variable @code{org-html-entities} for the complete
  5955. list. If you are unsure about a name, use @kbd{M-@key{TAB}} for completion
  5956. after having types the backslash and maybe a few characters
  5957. (@pxref{Completion}).
  5958. La@TeX{} fragments are converted into images for HTML export, and they are
  5959. written literally into the La@TeX{} export. See also @ref{Embedded LaTeX}.
  5960. Finally, @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
  5961. @samp{...} are all converted into special commands creating hyphens of
  5962. different lengths or a compact set of dots.
  5963. @node Horizontal rules, Comment lines, TeX macros and LaTeX fragments, Markup rules
  5964. @subheading Horizontal rules
  5965. @cindex horizontal rules, in exported files
  5966. A line consisting of only dashes, and at least 5 of them, will be
  5967. exported as a horizontal line (@samp{<hr/>} in HTML).
  5968. @node Comment lines, , Horizontal rules, Markup rules
  5969. @subheading Comment lines
  5970. @cindex comment lines
  5971. @cindex exporting, not
  5972. Lines starting with @samp{#} in column zero are treated as comments
  5973. and will never be exported. Also entire subtrees starting with the
  5974. word @samp{COMMENT} will never be exported.
  5975. @table @kbd
  5976. @kindex C-c ;
  5977. @item C-c ;
  5978. Toggle the COMMENT keyword at the beginning of an entry.
  5979. @end table
  5980. @node Export options, The export dispatcher, Markup rules, Exporting
  5981. @section Export options
  5982. @cindex options, for export
  5983. @cindex completion, of option keywords
  5984. The exporter recognizes special lines in the buffer which provide
  5985. additional information. These lines may be put anywhere in the file.
  5986. The whole set of lines can be inserted into the buffer with @kbd{C-c
  5987. C-e t}. For individual lines, a good way to make sure the keyword is
  5988. correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
  5989. (@pxref{Completion}).
  5990. @table @kbd
  5991. @kindex C-c C-e t
  5992. @item C-c C-e t
  5993. Insert template with export options, see example below.
  5994. @end table
  5995. @example
  5996. #+TITLE: the title to be shown (default is the buffer name)
  5997. #+AUTHOR: the author (default taken from @code{user-full-name})
  5998. #+DATE: A date, fixed, of a format string for @code{format-time-string}
  5999. #+EMAIL: his/her email address (default from @code{user-mail-address})
  6000. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  6001. #+TEXT: Some descriptive text to be inserted at the beginning.
  6002. #+TEXT: Several lines may be given.
  6003. #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
  6004. @end example
  6005. @noindent
  6006. The OPTIONS line is a compact@footnote{If you want to configure many options
  6007. this way, you can use several OPTIONS lines.} form to specify export settings. Here
  6008. you can:
  6009. @cindex headline levels
  6010. @cindex section-numbers
  6011. @cindex table of contents
  6012. @cindex line-break preservation
  6013. @cindex quoted HTML tags
  6014. @cindex fixed-width sections
  6015. @cindex tables
  6016. @cindex @TeX{}-like syntax for sub- and superscripts
  6017. @cindex footnotes
  6018. @cindex special strings
  6019. @cindex emphasized text
  6020. @cindex @TeX{} macros
  6021. @cindex La@TeX{} fragments
  6022. @cindex author info, in export
  6023. @cindex time info, in export
  6024. @example
  6025. H: @r{set the number of headline levels for export}
  6026. num: @r{turn on/off section-numbers}
  6027. toc: @r{turn on/off table of contents, or set level limit (integer)}
  6028. \n: @r{turn on/off line-break-preservation}
  6029. @@: @r{turn on/off quoted HTML tags}
  6030. :: @r{turn on/off fixed-width sections}
  6031. |: @r{turn on/off tables}
  6032. ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
  6033. @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
  6034. @r{the simple @code{a_b} will be left as it is.}
  6035. -: @r{turn on/off conversion of special strings.}
  6036. f: @r{turn on/off footnotes like this[1].}
  6037. *: @r{turn on/off emphasized text (bold, italic, underlined)}
  6038. TeX: @r{turn on/off simple @TeX{} macros in plain text}
  6039. LaTeX: @r{turn on/off La@TeX{} fragments}
  6040. skip: @r{turn on/off skipping the text before the first heading}
  6041. author: @r{turn on/off inclusion of author name/email into exported file}
  6042. timestamp: @r{turn on/off inclusion creation time into exported file}
  6043. d: @r{turn on/off inclusion of drawers}
  6044. @end example
  6045. These options take effect in both the HTML and La@TeX{} export, except
  6046. for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
  6047. @code{nil} for the La@TeX{} export.
  6048. @node The export dispatcher, ASCII export, Export options, Exporting
  6049. @section The export dispatcher
  6050. All export commands can be reached using the export dispatcher, which is a
  6051. prefix key that prompts for an additional key specifying the command.
  6052. Normally the entire file is exported, but if there is an active region that
  6053. contains one outline tree, the first heading is used as document title and
  6054. the subtrees are exported.
  6055. @table @kbd
  6056. @kindex C-c C-e
  6057. @item C-c C-e
  6058. Dispatcher for export and publishing commands. Displays a help-window
  6059. listing the additional key(s) needed to launch an export or publishing
  6060. command. The prefix arg is passed through to the exporter. If the option
  6061. @code{org-export-run-in-background} is set, Org will run the command in the
  6062. background if that seems useful for the specific command (i.e. commands that
  6063. write to a file).
  6064. @kindex C-c C-e v
  6065. @item C-c C-e v
  6066. Like @kbd{C-c C-e}, but only export the text that is currently visible
  6067. (i.e. not hidden by outline visibility).
  6068. @kindex C-u C-u C-c C-e
  6069. @item C-u C-u C-c C-e
  6070. Call an the exporter, but reverse the setting of
  6071. @code{org-export-run-in-background}, i.e. request background processing if
  6072. not set, or force processing in the current Emacs process if st.
  6073. @end table
  6074. @node ASCII export, HTML export, The export dispatcher, Exporting
  6075. @section ASCII export
  6076. @cindex ASCII export
  6077. ASCII export produces a simple and very readable version of an Org mode
  6078. file.
  6079. @cindex region, active
  6080. @cindex active region
  6081. @cindex Transient mark mode
  6082. @table @kbd
  6083. @kindex C-c C-e a
  6084. @item C-c C-e a
  6085. Export as ASCII file. For an org file @file{myfile.org}, the ASCII file
  6086. will be @file{myfile.txt}. The file will be overwritten without
  6087. warning. If there is an active region, only the region will be
  6088. exported. If the selected region is a single tree, the tree head will
  6089. become the document title. If the tree head entry has or inherits an
  6090. @code{:EXPORT_FILE_NAME:} property, that name will be used for the
  6091. export.
  6092. @kindex C-c C-e v a
  6093. @item C-c C-e v a
  6094. Export only the visible part of the document.
  6095. @end table
  6096. @cindex headline levels, for exporting
  6097. In the exported version, the first 3 outline levels will become
  6098. headlines, defining a general document structure. Additional levels
  6099. will be exported as itemized lists. If you want that transition to occur
  6100. at a different level, specify it with a prefix argument. For example,
  6101. @example
  6102. @kbd{C-1 C-c C-e a}
  6103. @end example
  6104. @noindent
  6105. creates only top level headlines and does the rest as items. When
  6106. headlines are converted to items, the indentation of the text following
  6107. the headline is changed to fit nicely under the item. This is done with
  6108. the assumption that the first body line indicates the base indentation of
  6109. the body text. Any indentation larger than this is adjusted to preserve
  6110. the layout relative to the first line. Should there be lines with less
  6111. indentation than the first, these are left alone.
  6112. @node HTML export, LaTeX export, ASCII export, Exporting
  6113. @section HTML export
  6114. @cindex HTML export
  6115. Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
  6116. HTML formatting, in ways similar to John Grubers @emph{markdown}
  6117. language, but with additional support for tables.
  6118. @menu
  6119. * HTML Export commands:: How to invoke HTML export
  6120. * Quoting HTML tags:: Using direct HTML in Org mode
  6121. * Links:: Transformation of links for HTML
  6122. * Images:: How to include images
  6123. * CSS support:: Changing the appearance of the output
  6124. * Javascript support:: Info and Folding in a web browser
  6125. @end menu
  6126. @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
  6127. @subsection HTML export commands
  6128. @cindex region, active
  6129. @cindex active region
  6130. @cindex Transient mark mode
  6131. @table @kbd
  6132. @kindex C-c C-e h
  6133. @item C-c C-e h
  6134. Export as HTML file @file{myfile.html}. For an org file
  6135. @file{myfile.org}, the ASCII file will be @file{myfile.html}. The file
  6136. will be overwritten without warning. If there is an active region, only
  6137. the region will be exported. If the selected region is a single tree,
  6138. the tree head will become the document title. If the tree head entry
  6139. has or inherits an @code{:EXPORT_FILE_NAME:} property, that name will be
  6140. used for the export.
  6141. @kindex C-c C-e b
  6142. @item C-c C-e b
  6143. Export as HTML file and immediately open it with a browser.
  6144. @kindex C-c C-e H
  6145. @item C-c C-e H
  6146. Export to a temporary buffer, do not create a file.
  6147. @kindex C-c C-e R
  6148. @item C-c C-e R
  6149. Export the active region to a temporary buffer. With a prefix argument, do
  6150. not produce the file header and footer, but just the plain HTML section for
  6151. the region. This is good for cut-and-paste operations.
  6152. @kindex C-c C-e v h
  6153. @kindex C-c C-e v b
  6154. @kindex C-c C-e v H
  6155. @kindex C-c C-e v R
  6156. @item C-c C-e v h
  6157. @item C-c C-e v b
  6158. @item C-c C-e v H
  6159. @item C-c C-e v R
  6160. Export only the visible part of the document.
  6161. @item M-x org-export-region-as-html
  6162. Convert the region to HTML under the assumption that it was Org mode
  6163. syntax before. This is a global command that can be invoked in any
  6164. buffer.
  6165. @item M-x org-replace-region-by-HTML
  6166. Replace the active region (assumed to be in Org mode syntax) by HTML
  6167. code.
  6168. @end table
  6169. @cindex headline levels, for exporting
  6170. In the exported version, the first 3 outline levels will become headlines,
  6171. defining a general document structure. Additional levels will be exported as
  6172. itemized lists. If you want that transition to occur at a different level,
  6173. specify it with a numeric prefix argument. For example,
  6174. @example
  6175. @kbd{C-2 C-c C-e b}
  6176. @end example
  6177. @noindent
  6178. creates two levels of headings and does the rest as items.
  6179. @node Quoting HTML tags, Links, HTML Export commands, HTML export
  6180. @subsection Quoting HTML tags
  6181. Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
  6182. @samp{&gt;} in HTML export. If you want to include simple HTML tags
  6183. which should be interpreted as such, mark them with @samp{@@} as in
  6184. @samp{@@<b>bold text@@</b>}. Note that this really works only for
  6185. simple tags. For more extensive HTML that should be copied verbatim to
  6186. the exported file use either
  6187. @example
  6188. #+HTML: Literal HTML code for export
  6189. @end example
  6190. @noindent or
  6191. @example
  6192. #+BEGIN_HTML
  6193. All lines between these markers are exported literally
  6194. #+END_HTML
  6195. @end example
  6196. @node Links, Images, Quoting HTML tags, HTML export
  6197. @subsection Links
  6198. @cindex links, in HTML export
  6199. @cindex internal links, in HTML export
  6200. @cindex external links, in HTML export
  6201. Internal links (@pxref{Internal links}) will continue to work in HTML
  6202. files only if they match a dedicated @samp{<<target>>}. Automatic links
  6203. created by radio targets (@pxref{Radio targets}) will also work in the
  6204. HTML file. Links to external files will still work if the HTML file is
  6205. in the same directory as the Org file. Links to other @file{.org}
  6206. files will be translated into HTML links under the assumption that an
  6207. HTML version also exists of the linked file. For information related to
  6208. linking files while publishing them to a publishing directory see
  6209. @ref{Publishing links}.
  6210. @node Images, CSS support, Links, HTML export
  6211. @subsection Images
  6212. @cindex images, inline in HTML
  6213. @cindex inlining images in HTML
  6214. HTML export can inline images given as links in the Org file, and
  6215. it can make an image the clickable part of a link. By
  6216. default@footnote{but see the variable
  6217. @code{org-export-html-inline-images}}, images are inlined if a link does
  6218. not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
  6219. while @samp{[[file:myimg.jpg][the image]]} will just produce a link
  6220. @samp{the image} that points to the image. If the description part
  6221. itself is a @code{file:} link or a @code{http:} URL pointing to an
  6222. image, this image will be inlined and activated so that clicking on the
  6223. image will activate the link. For example, to include a thumbnail that
  6224. will link to a high resolution version of the image, you could use:
  6225. @example
  6226. [[file:highres.jpg][file:thumb.jpg]]
  6227. @end example
  6228. @noindent
  6229. and you could use @code{http} addresses just as well.
  6230. @node CSS support, Javascript support, Images, HTML export
  6231. @subsection CSS support
  6232. @cindex CSS, for HTML export
  6233. @cindex HTML export, CSS
  6234. You can also give style information for the exported file. The HTML
  6235. exporter assigns the following CSS classes to appropriate parts of the
  6236. document - your style specifications may change these:
  6237. @example
  6238. .todo @r{TODO keywords}
  6239. .done @r{the DONE keyword}
  6240. .timestamp @r{time stamp}
  6241. .timestamp-kwd @r{keyword associated with a time stamp, like SCHEDULED}
  6242. .tag @r{tag in a headline}
  6243. .target @r{target for links}
  6244. @end example
  6245. The default style specification can be configured through the option
  6246. @code{org-export-html-style}. If you want to use a file-local style,
  6247. you may use file variables, best wrapped into a COMMENT section at the
  6248. end of the outline tree. For example@footnote{Under Emacs 21, the
  6249. continuation lines for a variable value should have no @samp{#} at the
  6250. start of the line.}:
  6251. @example
  6252. * COMMENT html style specifications
  6253. # Local Variables:
  6254. # org-export-html-style: " <style type=\"text/css\">
  6255. # p @{font-weight: normal; color: gray; @}
  6256. # h1 @{color: black; @}
  6257. # </style>"
  6258. # End:
  6259. @end example
  6260. Remember to execute @kbd{M-x normal-mode} after changing this to make
  6261. the new style visible to Emacs. This command restarts Org mode for the
  6262. current buffer and forces Emacs to re-evaluate the local variables
  6263. section in the buffer.
  6264. @c FIXME: More about header and footer styles
  6265. @c FIXME: Talk about links and targets.
  6266. @node Javascript support, , CSS support, HTML export
  6267. @subsection Javascript supported display of web pages
  6268. @emph{Sebastian Rose} has written a JavaScript program especially designed to
  6269. enhance the web viewing experience of HTML files created with Org. This
  6270. program allows to view large files in two different ways. The first one is
  6271. an @emph{Info}-like mode where each section is displayed separately and
  6272. navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
  6273. as well, press @kbd{?} for an overview of the available keys). The second
  6274. view type is a @emph{folding} view much like Org provides it inside Emacs.
  6275. The script is available at @url{http://orgmode.org/org-info.js} and you can
  6276. find the documentation for it at @url{http://orgmode.org/org-infojs.html}.
  6277. We are serving the script from our site, but if you use it a lot, you might
  6278. not want to be dependent on @url{orgmode.org} and prefer to install a local
  6279. copy on your own web server.
  6280. To use the script, you need to make sure that the @file{org-infojs.el} module
  6281. gets loaded. It should be loaded by default, try @kbd{M-x customize-variable
  6282. @key{RET} org-modules @key{RET}} to convince yourself that this is indeed the
  6283. case. All it then takes to make use of the program is adding a single line
  6284. to the Org file:
  6285. @example
  6286. #+INFOSJ_OPT: view:info toc:nil
  6287. @end example
  6288. @noindent
  6289. If this line is found, the HTML header will automatically contain the code
  6290. needed to invoke the script. Using the line above, you can set the following
  6291. viewing options:
  6292. @example
  6293. path: @r{The path to the script. The default is to grab the script from}
  6294. @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
  6295. @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
  6296. view: @r{Initial view when website is first shown. Possible values are}
  6297. info @r{Info-like interface with one section per page.}
  6298. overview @r{Folding interface, initially showing only top-level.}
  6299. content @r{Folding interface, starting with all headlines visible.}
  6300. showall @r{Folding interface, all headlines and text visible.}
  6301. sdepth: @r{Maximum headline level that will still become an independent}
  6302. @r{section for info and folding modes. The default is taken from}
  6303. @r{@code{org-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
  6304. @r{If this is smaller than in @code{org-headline-levels}, each}
  6305. @r{info/folding section can still contain children headlines.}
  6306. toc: @r{Should the table of content @emph{initially} be visible?}
  6307. @r{Even when @code{nil}, you can always get to the toc with @kbd{i}.}
  6308. tdepth: @r{The depth of the table of contents. The defaults are taken from}
  6309. @r{the variables @code{org-headline-levels} and @code{org-export-with-toc}.}
  6310. ltoc: @r{Should there be short contents (children) in each section?}
  6311. mouse: @r{Headings are highlighted when the mouse is over them. Should be}
  6312. @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
  6313. buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the}
  6314. @r{default), only one such button will be present.}
  6315. @end example
  6316. You can choose default values for these options by customizing the variable
  6317. @code{org-infojs-options}. If you always want to apply the script to your
  6318. pages, configure the variable @code{org-export-html-use-infojs}.
  6319. @node LaTeX export, XOXO export, HTML export, Exporting
  6320. @section LaTeX export
  6321. @cindex LaTeX export
  6322. Org mode contains a La@TeX{} exporter written by Bastien Guerry.
  6323. @menu
  6324. * LaTeX export commands:: How to invoke LaTeX export
  6325. * Quoting LaTeX code:: Incorporating literal LaTeX code
  6326. * Sectioning structure:: Changing sectioning in LaTeX output
  6327. @end menu
  6328. @node LaTeX export commands, Quoting LaTeX code, LaTeX export, LaTeX export
  6329. @subsection LaTeX export commands
  6330. @table @kbd
  6331. @kindex C-c C-e l
  6332. @item C-c C-e l
  6333. Export as La@TeX{} file @file{myfile.tex}.
  6334. @kindex C-c C-e L
  6335. @item C-c C-e L
  6336. Export to a temporary buffer, do not create a file.
  6337. @kindex C-c C-e v l
  6338. @kindex C-c C-e v L
  6339. @item C-c C-e v l
  6340. @item C-c C-e v L
  6341. Export only the visible part of the document.
  6342. @item M-x org-export-region-as-latex
  6343. Convert the region to La@TeX{} under the assumption that it was Org mode
  6344. syntax before. This is a global command that can be invoked in any
  6345. buffer.
  6346. @item M-x org-replace-region-by-latex
  6347. Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
  6348. code.
  6349. @end table
  6350. @cindex headline levels, for exporting
  6351. In the exported version, the first 3 outline levels will become
  6352. headlines, defining a general document structure. Additional levels
  6353. will be exported as description lists. The exporter can ignore them or
  6354. convert them to a custom string depending on
  6355. @code{org-latex-low-levels}.
  6356. If you want that transition to occur at a different level, specify it
  6357. with a numeric prefix argument. For example,
  6358. @example
  6359. @kbd{C-2 C-c C-e l}
  6360. @end example
  6361. @noindent
  6362. creates two levels of headings and does the rest as items.
  6363. @node Quoting LaTeX code, Sectioning structure, LaTeX export commands, LaTeX export
  6364. @subsection Quoting LaTeX code
  6365. Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
  6366. inserted into the La@TeX{} file. Furthermore, you can add special code
  6367. that should only be present in La@TeX{} export with the following
  6368. constructs:
  6369. @example
  6370. #+LaTeX: Literal LaTeX code for export
  6371. @end example
  6372. @noindent or
  6373. @example
  6374. #+BEGIN_LaTeX
  6375. All lines between these markers are exported literally
  6376. #+END_LaTeX
  6377. @end example
  6378. @node Sectioning structure, , Quoting LaTeX code, LaTeX export
  6379. @subsection Sectioning structure
  6380. @cindex LaTeX class
  6381. @cindex LaTeX sectioning structure
  6382. By default, the La@TeX{} output uses the class @code{article}.
  6383. You can change this globally by setting a different value for
  6384. @code{org-export-latex-default-class} or locally by adding an option
  6385. like @code{#+LaTeX_CLASS: myclass} in your file. The class should be
  6386. listed in @code{org-export-latex-classes}, where you can also define the
  6387. sectioning structure for each class.
  6388. @node XOXO export, iCalendar export, LaTeX export, Exporting
  6389. @section XOXO export
  6390. @cindex XOXO export
  6391. Org mode contains an exporter that produces XOXO-style output.
  6392. Currently, this exporter only handles the general outline structure and
  6393. does not interpret any additional Org mode features.
  6394. @table @kbd
  6395. @kindex C-c C-e x
  6396. @item C-c C-e x
  6397. Export as XOXO file @file{myfile.html}.
  6398. @kindex C-c C-e v
  6399. @item C-c C-e v x
  6400. Export only the visible part of the document.
  6401. @end table
  6402. @node iCalendar export, , XOXO export, Exporting
  6403. @section iCalendar export
  6404. @cindex iCalendar export
  6405. Some people like to use Org mode for keeping track of projects, but
  6406. still prefer a standard calendar application for anniversaries and
  6407. appointments. In this case it can be useful to have deadlines and
  6408. other time-stamped items in Org files show up in the calendar
  6409. application. Org mode can export calendar information in the standard
  6410. iCalendar format. If you also want to have TODO entries included in the
  6411. export, configure the variable @code{org-icalendar-include-todo}.
  6412. @table @kbd
  6413. @kindex C-c C-e i
  6414. @item C-c C-e i
  6415. Create iCalendar entries for the current file and store them in the same
  6416. directory, using a file extension @file{.ics}.
  6417. @kindex C-c C-e I
  6418. @item C-c C-e I
  6419. Like @kbd{C-c C-e i}, but do this for all files in
  6420. @code{org-agenda-files}. For each of these files, a separate iCalendar
  6421. file will be written.
  6422. @kindex C-c C-e c
  6423. @item C-c C-e c
  6424. Create a single large iCalendar file from all files in
  6425. @code{org-agenda-files} and write it to the file given by
  6426. @code{org-combined-agenda-icalendar-file}.
  6427. @end table
  6428. The export will honor SUMMARY, DESCRIPTION and LOCATION properties if
  6429. the selected entries have them. If not, the summary will be derived
  6430. from the headline, and the description from the body (limited to
  6431. @code{org-icalendar-include-body} characters).
  6432. How this calendar is best read and updated, depends on the application
  6433. you are using. The FAQ covers this issue.
  6434. @node Publishing, Miscellaneous, Exporting, Top
  6435. @chapter Publishing
  6436. @cindex publishing
  6437. Org includes@footnote{@file{org-publish.el} is not distributed with
  6438. Emacs 21, if you are still using Emacs 21, you need you need to download
  6439. this file separately.} a publishing management system that allows you to
  6440. configure automatic HTML conversion of @emph{projects} composed of
  6441. interlinked org files. This system is called @emph{org-publish}. You can
  6442. also configure org-publish to automatically upload your exported HTML
  6443. pages and related attachments, such as images and source code files, to
  6444. a web server. Org-publish turns Org into a web-site authoring tool.
  6445. You can also use Org-publish to convert files into La@TeX{}, or even
  6446. combine HTML and La@TeX{} conversion so that files are available in both
  6447. formats on the server@footnote{Since La@TeX{} files on a server are not
  6448. that helpful, you surely want to perform further conversion on them --
  6449. e.g. convert them to @code{PDF} format.}.
  6450. Org-publish has been contributed to Org by David O'Toole.
  6451. @menu
  6452. * Configuration:: Defining projects
  6453. * Sample configuration:: Example projects
  6454. * Triggering publication:: Publication commands
  6455. @end menu
  6456. @node Configuration, Sample configuration, Publishing, Publishing
  6457. @section Configuration
  6458. Publishing needs significant configuration to specify files, destination
  6459. and many other properties of a project.
  6460. @menu
  6461. * Project alist:: The central configuration variable
  6462. * Sources and destinations:: From here to there
  6463. * Selecting files:: What files are part of the project?
  6464. * Publishing action:: Setting the function doing the publishing
  6465. * Publishing options:: Tweaking HTML export
  6466. * Publishing links:: Which links keep working after publishing?
  6467. * Project page index:: Publishing a list of project files
  6468. @end menu
  6469. @node Project alist, Sources and destinations, Configuration, Configuration
  6470. @subsection The variable @code{org-publish-project-alist}
  6471. @cindex org-publish-project-alist
  6472. @cindex projects, for publishing
  6473. Org-publish is configured almost entirely through setting the value of
  6474. one variable, called @code{org-publish-project-alist}.
  6475. Each element of the list configures one project, and may be in one of
  6476. the two following forms:
  6477. @lisp
  6478. ("project-name" :property value :property value ...)
  6479. @r{or}
  6480. ("project-name" :components ("project-name" "project-name" ...))
  6481. @end lisp
  6482. In both cases, projects are configured by specifying property values.
  6483. A project defines the set of files that will be published, as well as
  6484. the publishing configuration to use when publishing those files. When
  6485. a project takes the second form listed above, the individual members
  6486. of the ``components'' property are taken to be components of the
  6487. project, which group together files requiring different publishing
  6488. options. When you publish such a ``meta-project'' all the components
  6489. will also publish.
  6490. @node Sources and destinations, Selecting files, Project alist, Configuration
  6491. @subsection Sources and destinations for files
  6492. @cindex directories, for publishing
  6493. Most properties are optional, but some should always be set. In
  6494. particular, org-publish needs to know where to look for source files,
  6495. and where to put published files.
  6496. @multitable @columnfractions 0.3 0.7
  6497. @item @code{:base-directory}
  6498. @tab Directory containing publishing source files
  6499. @item @code{:publishing-directory}
  6500. @tab Directory (possibly remote) where output files will be published.
  6501. @item @code{:preparation-function}
  6502. @tab Function called before starting publishing process, for example to
  6503. run @code{make} for updating files to be published.
  6504. @end multitable
  6505. @noindent
  6506. @node Selecting files, Publishing action, Sources and destinations, Configuration
  6507. @subsection Selecting files
  6508. @cindex files, selecting for publishing
  6509. By default, all files with extension @file{.org} in the base directory
  6510. are considered part of the project. This can be modified by setting the
  6511. properties
  6512. @multitable @columnfractions 0.25 0.75
  6513. @item @code{:base-extension}
  6514. @tab Extension (without the dot!) of source files. This actually is a
  6515. regular expression.
  6516. @item @code{:exclude}
  6517. @tab Regular expression to match file names that should not be
  6518. published, even though they have been selected on the basis of their
  6519. extension.
  6520. @item @code{:include}
  6521. @tab List of files to be included regardless of @code{:base-extension}
  6522. and @code{:exclude}.
  6523. @end multitable
  6524. @node Publishing action, Publishing options, Selecting files, Configuration
  6525. @subsection Publishing action
  6526. @cindex action, for publishing
  6527. Publishing means that a file is copied to the destination directory and
  6528. possibly transformed in the process. The default transformation is to
  6529. export Org files as HTML files, and this is done by the function
  6530. @code{org-publish-org-to-html} which calls the HTML exporter
  6531. (@pxref{HTML export}). But you also can publish your files in La@TeX{} by
  6532. using the function @code{org-publish-org-to-latex} instead. Other files
  6533. like images only need to be copied to the publishing destination. For
  6534. non-Org files, you need to specify the publishing function.
  6535. @multitable @columnfractions 0.3 0.7
  6536. @item @code{:publishing-function}
  6537. @tab Function executing the publication of a file. This may also be a
  6538. list of functions, which will all be called in turn.
  6539. @end multitable
  6540. The function must accept two arguments: a property list containing at
  6541. least a @code{:publishing-directory} property, and the name of the file
  6542. to be published. It should take the specified file, make the necessary
  6543. transformation (if any) and place the result into the destination folder.
  6544. You can write your own publishing function, but @code{org-publish}
  6545. provides one for attachments (files that only need to be copied):
  6546. @code{org-publish-attachment}.
  6547. @node Publishing options, Publishing links, Publishing action, Configuration
  6548. @subsection Options for the HTML/LaTeX exporters
  6549. @cindex options, for publishing
  6550. The property list can be used to set many export options for the HTML
  6551. and La@TeX{} exporters. In most cases, these properties correspond to user
  6552. variables in Org. The table below lists these properties along
  6553. with the variable they belong to. See the documentation string for the
  6554. respective variable for details.
  6555. @multitable @columnfractions 0.3 0.7
  6556. @item @code{:language} @tab @code{org-export-default-language}
  6557. @item @code{:headline-levels} @tab @code{org-export-headline-levels}
  6558. @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
  6559. @item @code{:table-of-contents} @tab @code{org-export-with-toc}
  6560. @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
  6561. @item @code{:emphasize} @tab @code{org-export-with-emphasize}
  6562. @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
  6563. @item @code{:special-strings} @tab @code{org-export-with-special-strings}
  6564. @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
  6565. @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
  6566. @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
  6567. @item @code{:timestamps} .@tab @code{org-export-with-timestamps}
  6568. @item @code{:tags} .@tab @code{org-export-with-tags}
  6569. @item @code{:tables} @tab @code{org-export-with-tables}
  6570. @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
  6571. @item @code{:style} @tab @code{org-export-html-style}
  6572. @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
  6573. @item @code{:inline-images} @tab @code{org-export-html-inline-images}
  6574. @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
  6575. @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
  6576. @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
  6577. @item @code{:preamble} @tab @code{org-export-html-preamble}
  6578. @item @code{:postamble} @tab @code{org-export-html-postamble}
  6579. @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
  6580. @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
  6581. @item @code{:author} @tab @code{user-full-name}
  6582. @item @code{:email} @tab @code{user-mail-address}
  6583. @end multitable
  6584. If you use several email addresses, separate them by a semi-column.
  6585. Most of the @code{org-export-with-*} variables have the same effect in
  6586. both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
  6587. @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
  6588. La@TeX{} export.
  6589. When a property is given a value in @code{org-publish-project-alist},
  6590. its setting overrides the value of the corresponding user variable (if
  6591. any) during publishing. Options set within a file (@pxref{Export
  6592. options}), however, override everything.
  6593. @node Publishing links, Project page index, Publishing options, Configuration
  6594. @subsection Links between published files
  6595. @cindex links, publishing
  6596. To create a link from one Org file to another, you would use
  6597. something like @samp{[[file:foo.org][The foo]]} or simply
  6598. @samp{file:foo.org.} (@pxref{Hyperlinks}). Upon publishing this link
  6599. becomes a link to @file{foo.html}. In this way, you can interlink the
  6600. pages of your "org web" project and the links will work as expected when
  6601. you publish them to HTML.
  6602. You may also link to related files, such as images. Provided you are
  6603. careful with relative pathnames, and provided you have also configured
  6604. @code{org-publish} to upload the related files, these links will work
  6605. too. @ref{Complex example} for an example of this usage.
  6606. Sometime an Org file to be published may contain links that are
  6607. only valid in your production environment, but not in the publishing
  6608. location. In this case, use the property
  6609. @multitable @columnfractions 0.4 0.6
  6610. @item @code{:link-validation-function}
  6611. @tab Function to validate links
  6612. @end multitable
  6613. @noindent
  6614. to define a function for checking link validity. This function must
  6615. accept two arguments, the file name and a directory relative to which
  6616. the file name is interpreted in the production environment. If this
  6617. function returns @code{nil}, then the HTML generator will only insert a
  6618. description into the HTML file, but no link. One option for this
  6619. function is @code{org-publish-validate-link} which checks if the given
  6620. file is part of any project in @code{org-publish-project-alist}.
  6621. @node Project page index, , Publishing links, Configuration
  6622. @subsection Project page index
  6623. @cindex index, of published pages
  6624. The following properties may be used to control publishing of an
  6625. index of files or summary page for a given project.
  6626. @multitable @columnfractions 0.25 0.75
  6627. @item @code{:auto-index}
  6628. @tab When non-nil, publish an index during org-publish-current-project or
  6629. org-publish-all.
  6630. @item @code{:index-filename}
  6631. @tab Filename for output of index. Defaults to @file{index.org} (which
  6632. becomes @file{index.html}).
  6633. @item @code{:index-title}
  6634. @tab Title of index page. Defaults to name of file.
  6635. @item @code{:index-function}
  6636. @tab Plug-in function to use for generation of index.
  6637. Defaults to @code{org-publish-org-index}, which generates a plain list
  6638. of links to all files in the project.
  6639. @end multitable
  6640. @node Sample configuration, Triggering publication, Configuration, Publishing
  6641. @section Sample configuration
  6642. Below we provide two example configurations. The first one is a simple
  6643. project publishing only a set of Org files. The second example is
  6644. more complex, with a multi-component project.
  6645. @menu
  6646. * Simple example:: One-component publishing
  6647. * Complex example:: A multi-component publishing example
  6648. @end menu
  6649. @node Simple example, Complex example, Sample configuration, Sample configuration
  6650. @subsection Example: simple publishing configuration
  6651. This example publishes a set of Org files to the @file{public_html}
  6652. directory on the local machine.
  6653. @lisp
  6654. (setq org-publish-project-alist
  6655. '(("org"
  6656. :base-directory "~/org/"
  6657. :publishing-directory "~/public_html"
  6658. :section-numbers nil
  6659. :table-of-contents nil
  6660. :style "<link rel=stylesheet
  6661. href=\"../other/mystyle.css\"
  6662. type=\"text/css\">")))
  6663. @end lisp
  6664. @node Complex example, , Simple example, Sample configuration
  6665. @subsection Example: complex publishing configuration
  6666. This more complicated example publishes an entire website, including
  6667. org files converted to HTML, image files, emacs lisp source code, and
  6668. style sheets. The publishing-directory is remote and private files are
  6669. excluded.
  6670. To ensure that links are preserved, care should be taken to replicate
  6671. your directory structure on the web server, and to use relative file
  6672. paths. For example, if your org files are kept in @file{~/org} and your
  6673. publishable images in @file{~/images}, you'd link to an image with
  6674. @c
  6675. @example
  6676. file:../images/myimage.png
  6677. @end example
  6678. @c
  6679. On the web server, the relative path to the image should be the
  6680. same. You can accomplish this by setting up an "images" folder in the
  6681. right place on the web server, and publishing images to it.
  6682. @lisp
  6683. (setq org-publish-project-alist
  6684. '(("orgfiles"
  6685. :base-directory "~/org/"
  6686. :base-extension "org"
  6687. :publishing-directory "/ssh:user@@host:~/html/notebook/"
  6688. :publishing-function org-publish-org-to-html
  6689. :exclude "PrivatePage.org" ;; regexp
  6690. :headline-levels 3
  6691. :section-numbers nil
  6692. :table-of-contents nil
  6693. :style "<link rel=stylesheet
  6694. href=\"../other/mystyle.css\" type=\"text/css\">"
  6695. :auto-preamble t
  6696. :auto-postamble nil)
  6697. ("images"
  6698. :base-directory "~/images/"
  6699. :base-extension "jpg\\|gif\\|png"
  6700. :publishing-directory "/ssh:user@@host:~/html/images/"
  6701. :publishing-function org-publish-attachment)
  6702. ("other"
  6703. :base-directory "~/other/"
  6704. :base-extension "css\\|el"
  6705. :publishing-directory "/ssh:user@@host:~/html/other/"
  6706. :publishing-function org-publish-attachment)
  6707. ("website" :components ("orgfiles" "images" "other"))))
  6708. @end lisp
  6709. @node Triggering publication, , Sample configuration, Publishing
  6710. @section Triggering publication
  6711. Once org-publish is properly configured, you can publish with the
  6712. following functions:
  6713. @table @kbd
  6714. @item C-c C-e C
  6715. Prompt for a specific project and publish all files that belong to it.
  6716. @item C-c C-e P
  6717. Publish the project containing the current file.
  6718. @item C-c C-e F
  6719. Publish only the current file.
  6720. @item C-c C-e A
  6721. Publish all projects.
  6722. @end table
  6723. Org uses timestamps to track when a file has changed. The above
  6724. functions normally only publish changed files. You can override this and
  6725. force publishing of all files by giving a prefix argument.
  6726. @node Miscellaneous, Extensions and Hacking, Publishing, Top
  6727. @chapter Miscellaneous
  6728. @menu
  6729. * Completion:: M-TAB knows what you need
  6730. * Customization:: Adapting Org to your taste
  6731. * In-buffer settings:: Overview of the #+KEYWORDS
  6732. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  6733. * Clean view:: Getting rid of leading stars in the outline
  6734. * TTY keys:: Using Org on a tty
  6735. * Interaction:: Other Emacs packages
  6736. * Bugs:: Things which do not work perfectly
  6737. @end menu
  6738. @node Completion, Customization, Miscellaneous, Miscellaneous
  6739. @section Completion
  6740. @cindex completion, of @TeX{} symbols
  6741. @cindex completion, of TODO keywords
  6742. @cindex completion, of dictionary words
  6743. @cindex completion, of option keywords
  6744. @cindex completion, of tags
  6745. @cindex completion, of property keys
  6746. @cindex completion, of link abbreviations
  6747. @cindex @TeX{} symbol completion
  6748. @cindex TODO keywords completion
  6749. @cindex dictionary word completion
  6750. @cindex option keyword completion
  6751. @cindex tag completion
  6752. @cindex link abbreviations, completion of
  6753. Org supports in-buffer completion. This type of completion does
  6754. not make use of the minibuffer. You simply type a few letters into
  6755. the buffer and use the key to complete text right there.
  6756. @table @kbd
  6757. @kindex M-@key{TAB}
  6758. @item M-@key{TAB}
  6759. Complete word at point
  6760. @itemize @bullet
  6761. @item
  6762. At the beginning of a headline, complete TODO keywords.
  6763. @item
  6764. After @samp{\}, complete @TeX{} symbols supported by the exporter.
  6765. @item
  6766. After @samp{*}, complete headlines in the current buffer so that they
  6767. can be used in search links like @samp{[[*find this headline]]}.
  6768. @item
  6769. After @samp{:} in a headline, complete tags. The list of tags is taken
  6770. from the variable @code{org-tag-alist} (possibly set through the
  6771. @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
  6772. dynamically from all tags used in the current buffer.
  6773. @item
  6774. After @samp{:} and not in a headline, complete property keys. The list
  6775. of keys is constructed dynamically from all keys used in the current
  6776. buffer.
  6777. @item
  6778. After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
  6779. @item
  6780. After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
  6781. @samp{OPTIONS} which set file-specific options for Org mode. When the
  6782. option keyword is already complete, pressing @kbd{M-@key{TAB}} again
  6783. will insert example settings for this keyword.
  6784. @item
  6785. In the line after @samp{#+STARTUP: }, complete startup keywords,
  6786. i.e. valid keys for this line.
  6787. @item
  6788. Elsewhere, complete dictionary words using Ispell.
  6789. @end itemize
  6790. @end table
  6791. @node Customization, In-buffer settings, Completion, Miscellaneous
  6792. @section Customization
  6793. @cindex customization
  6794. @cindex options, for customization
  6795. @cindex variables, for customization
  6796. There are more than 180 variables that can be used to customize
  6797. Org. For the sake of compactness of the manual, I am not
  6798. describing the variables here. A structured overview of customization
  6799. variables is available with @kbd{M-x org-customize}. Or select
  6800. @code{Browse Org Group} from the @code{Org->Customization} menu. Many
  6801. settings can also be activated on a per-file basis, by putting special
  6802. lines into the buffer (@pxref{In-buffer settings}).
  6803. @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
  6804. @section Summary of in-buffer settings
  6805. @cindex in-buffer settings
  6806. @cindex special keywords
  6807. Org mode uses special lines in the buffer to define settings on a
  6808. per-file basis. These lines start with a @samp{#+} followed by a
  6809. keyword, a colon, and then individual words defining a setting. Several
  6810. setting words can be in the same line, but you can also have multiple
  6811. lines for the keyword. While these settings are described throughout
  6812. the manual, here is a summary. After changing any of those lines in the
  6813. buffer, press @kbd{C-c C-c} with the cursor still in the line to
  6814. activate the changes immediately. Otherwise they become effective only
  6815. when the file is visited again in a new Emacs session.
  6816. @table @kbd
  6817. @item #+ARCHIVE: %s_done::
  6818. This line sets the archive location for the agenda file. It applies for
  6819. all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
  6820. of the file. The first such line also applies to any entries before it.
  6821. The corresponding variable is @code{org-archive-location}.
  6822. @item #+CATEGORY:
  6823. This line sets the category for the agenda file. The category applies
  6824. for all subsequent lines until the next @samp{#+CATEGORY} line, or the
  6825. end of the file. The first such line also applies to any entries before it.
  6826. @item #+COLUMNS: %25ITEM .....
  6827. Set the default format for columns view. This format applies when
  6828. columns view is invoked in location where no @code{COLUMNS} property
  6829. applies.
  6830. @item #+CONSTANTS: name1=value1 ...
  6831. Set file-local values for constants to be used in table formulas. This
  6832. line set the local variable @code{org-table-formula-constants-local}.
  6833. The global version of this variable is
  6834. @code{org-table-formula-constants}.
  6835. @item #+DRAWERS: NAME1 .....
  6836. Set the file-local set of drawers. The corresponding global variable is
  6837. @code{org-drawers}.
  6838. @item #+LINK: linkword replace
  6839. These lines (several are allowed) specify link abbreviations.
  6840. @xref{Link abbreviations}. The corresponding variable is
  6841. @code{org-link-abbrev-alist}.
  6842. @item #+PRIORITIES: highest lowest default
  6843. This line sets the limits and the default for the priorities. All three
  6844. must be either letters A-Z or numbers 0-9. The highest priority must
  6845. have a lower ASCII number that the lowest priority.
  6846. @item #+PROPERTY: Property_Name Value
  6847. This line sets a default inheritance value for entries in the current
  6848. buffer, most useful for specifying the allowed values of a property.
  6849. @item #+STARTUP:
  6850. This line sets options to be used at startup of Org mode, when an
  6851. Org file is being visited. The first set of options deals with the
  6852. initial visibility of the outline tree. The corresponding variable for
  6853. global default settings is @code{org-startup-folded}, with a default
  6854. value @code{t}, which means @code{overview}.
  6855. @cindex @code{overview}, STARTUP keyword
  6856. @cindex @code{content}, STARTUP keyword
  6857. @cindex @code{showall}, STARTUP keyword
  6858. @example
  6859. overview @r{top-level headlines only}
  6860. content @r{all headlines}
  6861. showall @r{no folding at all, show everything}
  6862. @end example
  6863. Then there are options for aligning tables upon visiting a file. This
  6864. is useful in files containing narrowed table columns. The corresponding
  6865. variable is @code{org-startup-align-all-tables}, with a default value
  6866. @code{nil}.
  6867. @cindex @code{align}, STARTUP keyword
  6868. @cindex @code{noalign}, STARTUP keyword
  6869. @example
  6870. align @r{align all tables}
  6871. noalign @r{don't align tables on startup}
  6872. @end example
  6873. Logging closing and reinstating TODO items, and clock intervals
  6874. (variables @code{org-log-done}, @code{org-log-note-clock-out}, and
  6875. @code{org-log-repeat}) can be configured using these options.
  6876. @cindex @code{logdone}, STARTUP keyword
  6877. @cindex @code{lognotedone}, STARTUP keyword
  6878. @cindex @code{nologdone}, STARTUP keyword
  6879. @cindex @code{lognoteclock-out}, STARTUP keyword
  6880. @cindex @code{nolognoteclock-out}, STARTUP keyword
  6881. @cindex @code{logrepeat}, STARTUP keyword
  6882. @cindex @code{lognoterepeat}, STARTUP keyword
  6883. @cindex @code{nologrepeat}, STARTUP keyword
  6884. @example
  6885. logdone @r{record a timestamp when an item is marked DONE}
  6886. lognotedone @r{record timestamp and a note when DONE}
  6887. nologdone @r{don't record when items are marked DONE}
  6888. logrepeat @r{record a time when reinstating a repeating item}
  6889. lognoterepeat @r{record a note when reinstating a repeating item}
  6890. nologrepeat @r{do not record when reinstating repeating item}
  6891. lognoteclock-out @r{record a note when clocking out}
  6892. nolognoteclock-out @r{don't record a note when clocking out}
  6893. @end example
  6894. Here are the options for hiding leading stars in outline headings. The
  6895. corresponding variables are @code{org-hide-leading-stars} and
  6896. @code{org-odd-levels-only}, both with a default setting @code{nil}
  6897. (meaning @code{showstars} and @code{oddeven}).
  6898. @cindex @code{hidestars}, STARTUP keyword
  6899. @cindex @code{showstars}, STARTUP keyword
  6900. @cindex @code{odd}, STARTUP keyword
  6901. @cindex @code{even}, STARTUP keyword
  6902. @example
  6903. hidestars @r{make all but one of the stars starting a headline invisible.}
  6904. showstars @r{show all stars starting a headline}
  6905. odd @r{allow only odd outline levels (1,3,...)}
  6906. oddeven @r{allow all outline levels}
  6907. @end example
  6908. To turn on custom format overlays over time stamps (variables
  6909. @code{org-put-time-stamp-overlays} and
  6910. @code{org-time-stamp-overlay-formats}), use
  6911. @cindex @code{customtime}, STARTUP keyword
  6912. @example
  6913. customtime @r{overlay custom time format}
  6914. @end example
  6915. The following options influence the table spreadsheet (variable
  6916. @code{constants-unit-system}).
  6917. @cindex @code{constcgs}, STARTUP keyword
  6918. @cindex @code{constSI}, STARTUP keyword
  6919. @example
  6920. constcgs @r{@file{constants.el} should use the c-g-s unit system}
  6921. constSI @r{@file{constants.el} should use the SI unit system}
  6922. @end example
  6923. @item #+TAGS: TAG1(c1) TAG2(c2)
  6924. These lines (several such lines are allowed) specify the valid tags in
  6925. this file, and (potentially) the corresponding @emph{fast tag selection}
  6926. keys. The corresponding variable is @code{org-tag-alist}.
  6927. @item #+TBLFM:
  6928. This line contains the formulas for the table directly above the line.
  6929. @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS, #+DATE:
  6930. These lines provide settings for exporting files. For more details see
  6931. @ref{Export options}.
  6932. @item #+SEQ_TODO: #+TYP_TODO:
  6933. These lines set the TODO keywords and their interpretation in the
  6934. current file. The corresponding variables are @code{org-todo-keywords}
  6935. and @code{org-todo-interpretation}.
  6936. @end table
  6937. @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
  6938. @section The very busy C-c C-c key
  6939. @kindex C-c C-c
  6940. @cindex C-c C-c, overview
  6941. The key @kbd{C-c C-c} has many purposes in Org, which are all
  6942. mentioned scattered throughout this manual. One specific function of
  6943. this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
  6944. other circumstances it means something like @emph{Hey Org, look
  6945. here and update according to what you see here}. Here is a summary of
  6946. what this means in different contexts.
  6947. @itemize @minus
  6948. @item
  6949. If there are highlights in the buffer from the creation of a sparse
  6950. tree, or from clock display, remove these highlights.
  6951. @item
  6952. If the cursor is in one of the special @code{#+KEYWORD} lines, this
  6953. triggers scanning the buffer for these lines and updating the
  6954. information.
  6955. @item
  6956. If the cursor is inside a table, realign the table. This command
  6957. works even if the automatic table editor has been turned off.
  6958. @item
  6959. If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
  6960. the entire table.
  6961. @item
  6962. If the cursor is inside a table created by the @file{table.el} package,
  6963. activate that table.
  6964. @item
  6965. If the current buffer is a remember buffer, close the note and file it.
  6966. With a prefix argument, file it, without further interaction, to the
  6967. default location.
  6968. @item
  6969. If the cursor is on a @code{<<<target>>>}, update radio targets and
  6970. corresponding links in this buffer.
  6971. @item
  6972. If the cursor is in a property line or at the start or end of a property
  6973. drawer, offer property commands.
  6974. @item
  6975. If the cursor is in a plain list item with a checkbox, toggle the status
  6976. of the checkbox.
  6977. @item
  6978. If the cursor is on a numbered item in a plain list, renumber the
  6979. ordered list.
  6980. @item
  6981. If the cursor is on the @code{#+BEGIN} line of a dynamical block, the
  6982. block is updated.
  6983. @end itemize
  6984. @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
  6985. @section A cleaner outline view
  6986. @cindex hiding leading stars
  6987. @cindex clean outline view
  6988. Some people find it noisy and distracting that the Org headlines
  6989. are starting with a potentially large number of stars. For example
  6990. the tree from @ref{Headlines}:
  6991. @example
  6992. * Top level headline
  6993. ** Second level
  6994. *** 3rd level
  6995. some text
  6996. *** 3rd level
  6997. more text
  6998. * Another top level headline
  6999. @end example
  7000. @noindent
  7001. Unfortunately this is deeply ingrained into the code of Org and
  7002. cannot be easily changed. You can, however, modify the display in such
  7003. a way that all leading stars become invisible and the outline more easy
  7004. to read. To do this, customize the variable
  7005. @code{org-hide-leading-stars} like this:
  7006. @lisp
  7007. (setq org-hide-leading-stars t)
  7008. @end lisp
  7009. @noindent
  7010. or change this on a per-file basis with one of the lines (anywhere in
  7011. the buffer)
  7012. @example
  7013. #+STARTUP: showstars
  7014. #+STARTUP: hidestars
  7015. @end example
  7016. @noindent
  7017. Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
  7018. the modifications.
  7019. With stars hidden, the tree becomes:
  7020. @example
  7021. * Top level headline
  7022. * Second level
  7023. * 3rd level
  7024. some text
  7025. * 3rd level
  7026. more text
  7027. * Another top level headline
  7028. @end example
  7029. @noindent
  7030. Note that the leading stars are not truly replaced by whitespace, they
  7031. are only fontified with the face @code{org-hide} that uses the
  7032. background color as font color. If you are not using either white or
  7033. black background, you may have to customize this face to get the wanted
  7034. effect. Another possibility is to set this font such that the extra
  7035. stars are @i{almost} invisible, for example using the color
  7036. @code{grey90} on a white background.
  7037. Things become cleaner still if you skip all the even levels and use only
  7038. odd levels 1, 3, 5..., effectively adding two stars to go from one
  7039. outline level to the next:
  7040. @example
  7041. * Top level headline
  7042. * Second level
  7043. * 3rd level
  7044. some text
  7045. * 3rd level
  7046. more text
  7047. * Another top level headline
  7048. @end example
  7049. @noindent
  7050. In order to make the structure editing and export commands handle this
  7051. convention correctly, use
  7052. @lisp
  7053. (setq org-odd-levels-only t)
  7054. @end lisp
  7055. @noindent
  7056. or set this on a per-file basis with one of the following lines (don't
  7057. forget to press @kbd{C-c C-c} with the cursor in the startup line to
  7058. activate changes immediately).
  7059. @example
  7060. #+STARTUP: odd
  7061. #+STARTUP: oddeven
  7062. @end example
  7063. You can convert an Org file from single-star-per-level to the
  7064. double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
  7065. RET} in that file. The reverse operation is @kbd{M-x
  7066. org-convert-to-oddeven-levels}.
  7067. @node TTY keys, Interaction, Clean view, Miscellaneous
  7068. @section Using Org on a tty
  7069. @cindex tty key bindings
  7070. Because Org contains a large number of commands, by default much of
  7071. Org's core commands are bound to keys that are generally not
  7072. accessible on a tty, such as the cursor keys (@key{left}, @key{right},
  7073. @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
  7074. together with modifiers like @key{Meta} and/or @key{Shift}. To access
  7075. these commands on a tty when special keys are unavailable, the following
  7076. alternative bindings can be used. The tty bindings below will likely be
  7077. more cumbersome; you may find for some of the bindings below that a
  7078. customized work-around suits you better. For example, changing a time
  7079. stamp is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
  7080. tty you would rather use @kbd{C-c .} to re-insert the timestamp.
  7081. @multitable @columnfractions 0.15 0.2 0.2
  7082. @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
  7083. @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
  7084. @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
  7085. @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
  7086. @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}}
  7087. @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
  7088. @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
  7089. @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
  7090. @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
  7091. @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
  7092. @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
  7093. @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
  7094. @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
  7095. @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab
  7096. @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab
  7097. @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab
  7098. @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab
  7099. @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
  7100. @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
  7101. @end multitable
  7102. @node Interaction, Bugs, TTY keys, Miscellaneous
  7103. @section Interaction with other packages
  7104. @cindex packages, interaction with other
  7105. Org lives in the world of GNU Emacs and interacts in various ways
  7106. with other code out there.
  7107. @menu
  7108. * Cooperation:: Packages Org cooperates with
  7109. * Conflicts:: Packages that lead to conflicts
  7110. @end menu
  7111. @node Cooperation, Conflicts, Interaction, Interaction
  7112. @subsection Packages that Org cooperates with
  7113. @table @asis
  7114. @cindex @file{calc.el}
  7115. @item @file{calc.el} by Dave Gillespie
  7116. Org uses the Calc package for implementing spreadsheet
  7117. functionality in its tables (@pxref{The spreadsheet}). Org
  7118. checks for the availability of Calc by looking for the function
  7119. @code{calc-eval} which should be autoloaded in your setup if Calc has
  7120. been installed properly. As of Emacs 22, Calc is part of the Emacs
  7121. distribution. Another possibility for interaction between the two
  7122. packages is using Calc for embedded calculations. @xref{Embedded Mode,
  7123. , Embedded Mode, Calc, GNU Emacs Calc Manual}.
  7124. @cindex @file{constants.el}
  7125. @item @file{constants.el} by Carsten Dominik
  7126. In a table formula (@pxref{The spreadsheet}), it is possible to use
  7127. names for natural constants or units. Instead of defining your own
  7128. constants in the variable @code{org-table-formula-constants}, install
  7129. the @file{constants} package which defines a large number of constants
  7130. and units, and lets you use unit prefixes like @samp{M} for
  7131. @samp{Mega} etc. You will need version 2.0 of this package, available
  7132. at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
  7133. the function @code{constants-get}, which has to be autoloaded in your
  7134. setup. See the installation instructions in the file
  7135. @file{constants.el}.
  7136. @item @file{cdlatex.el} by Carsten Dominik
  7137. @cindex @file{cdlatex.el}
  7138. Org mode can make use of the CDLaTeX package to efficiently enter
  7139. La@TeX{} fragments into Org files. See @ref{CDLaTeX mode}.
  7140. @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
  7141. @cindex @file{imenu.el}
  7142. Imenu allows menu access to an index of items in a file. Org mode
  7143. supports Imenu - all you need to do to get the index is the following:
  7144. @lisp
  7145. (add-hook 'org-mode-hook
  7146. (lambda () (imenu-add-to-menubar "Imenu")))
  7147. @end lisp
  7148. By default the index is two levels deep - you can modify the depth using
  7149. the option @code{org-imenu-depth}.
  7150. @item @file{remember.el} by John Wiegley
  7151. @cindex @file{remember.el}
  7152. Org cooperates with remember, see @ref{Remember}.
  7153. @file{Remember.el} is not part of Emacs, find it on the web.
  7154. @item @file{speedbar.el} by Eric M. Ludlam
  7155. @cindex @file{speedbar.el}
  7156. Speedbar is a package that creates a special frame displaying files and
  7157. index items in files. Org mode supports Speedbar and allows you to
  7158. drill into Org files directly from the Speedbar. It also allows to
  7159. restrict the scope of agenda commands to a file or a subtree by using
  7160. the command @kbd{<} in the Speedbar frame.
  7161. @cindex @file{table.el}
  7162. @item @file{table.el} by Takaaki Ota
  7163. @kindex C-c C-c
  7164. @cindex table editor, @file{table.el}
  7165. @cindex @file{table.el}
  7166. Complex ASCII tables with automatic line wrapping, column- and
  7167. row-spanning, and alignment can be created using the Emacs table
  7168. package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
  7169. and also part of Emacs 22).
  7170. When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org mode
  7171. will call @command{table-recognize-table} and move the cursor into the
  7172. table. Inside a table, the keymap of Org mode is inactive. In order
  7173. to execute Org mode-related commands, leave the table.
  7174. @table @kbd
  7175. @kindex C-c C-c
  7176. @item C-c C-c
  7177. Recognize @file{table.el} table. Works when the cursor is in a
  7178. table.el table.
  7179. @c
  7180. @kindex C-c ~
  7181. @item C-c ~
  7182. Insert a table.el table. If there is already a table at point, this
  7183. command converts it between the table.el format and the Org mode
  7184. format. See the documentation string of the command
  7185. @code{org-convert-table} for the restrictions under which this is
  7186. possible.
  7187. @end table
  7188. @file{table.el} is part of Emacs 22.
  7189. @cindex @file{footnote.el}
  7190. @item @file{footnote.el} by Steven L. Baur
  7191. Org mode recognizes numerical footnotes as provided by this package
  7192. (@pxref{Footnotes}).
  7193. @end table
  7194. @node Conflicts, , Cooperation, Interaction
  7195. @subsection Packages that lead to conflicts with Org mode
  7196. @table @asis
  7197. @cindex @file{allout.el}
  7198. @item @file{allout.el} by Ken Manheimer
  7199. Startup of Org may fail with the error message
  7200. @code{(wrong-type-argument keymapp nil)} when there is an outdated
  7201. version @file{allout.el} on the load path, for example the version
  7202. distributed with Emacs 21.x. Upgrade to Emacs 22 and this problem will
  7203. disappear. If for some reason you cannot do this, make sure that org.el
  7204. is loaded @emph{before} @file{allout.el}, for example by putting
  7205. @code{(require 'org)} early enough into your @file{.emacs} file.
  7206. @cindex @file{CUA.el}
  7207. @item @file{CUA.el} by Kim. F. Storm
  7208. Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by
  7209. CUA mode (as well as pc-select-mode and s-region-mode) to select and
  7210. extend the region. If you want to use one of these packages along with
  7211. Org, configure the variable @code{org-replace-disputed-keys}. When
  7212. set, Org will move the following key bindings in Org files, and
  7213. in the agenda buffer (but not during date selection).
  7214. @example
  7215. S-UP -> M-p S-DOWN -> M-n
  7216. S-LEFT -> M-- S-RIGHT -> M-+
  7217. @end example
  7218. Yes, these are unfortunately more difficult to remember. If you want
  7219. to have other replacement keys, look at the variable
  7220. @code{org-disputed-keys}.
  7221. @item @file{windmove.el} by Hovav Shacham
  7222. @cindex @file{windmove.el}
  7223. Also this package uses the @kbd{S-<cursor>} keys, so everything written
  7224. in the paragraph above about CUA mode also applies here.
  7225. @cindex @file{footnote.el}
  7226. @item @file{footnote.el} by Steven L. Baur
  7227. Org supports the syntax of the footnote package, but only the
  7228. numerical footnote markers. Also, the default key for footnote
  7229. commands, @kbd{C-c !} is already used by Org. You could use the
  7230. variable @code{footnote-prefix} to switch footnotes commands to another
  7231. key. Or, you could use @code{org-replace-disputed-keys} and
  7232. @code{org-disputed-keys} to change the settings in Org.
  7233. @end table
  7234. @node Bugs, , Interaction, Miscellaneous
  7235. @section Bugs
  7236. @cindex bugs
  7237. Here is a list of things that should work differently, but which I
  7238. have found too hard to fix.
  7239. @itemize @bullet
  7240. @item
  7241. If a table field starts with a link, and if the corresponding table
  7242. column is narrowed (@pxref{Narrow columns}) to a width too small to
  7243. display the link, the field would look entirely empty even though it is
  7244. not. To prevent this, Org throws an error. The work-around is to
  7245. make the column wide enough to fit the link, or to add some text (at
  7246. least 2 characters) before the link in the same field.
  7247. @item
  7248. Narrowing table columns does not work on XEmacs, because the
  7249. @code{format} function does not transport text properties.
  7250. @item
  7251. Text in an entry protected with the @samp{QUOTE} keyword should not
  7252. autowrap.
  7253. @item
  7254. When the application called by @kbd{C-c C-o} to open a file link fails
  7255. (for example because the application does not exist or refuses to open
  7256. the file), it does so silently. No error message is displayed.
  7257. @item
  7258. Recalculating a table line applies the formulas from left to right.
  7259. If a formula uses @emph{calculated} fields further down the row,
  7260. multiple recalculation may be needed to get all fields consistent. You
  7261. may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
  7262. recalculate until convergence.
  7263. @item
  7264. A single letter cannot be made bold, for example @samp{*a*}.
  7265. @item
  7266. The exporters work well, but could be made more efficient.
  7267. @end itemize
  7268. @node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
  7269. @appendix Extensions, Hooks and Hacking
  7270. This appendix lists extensions for Org written by other authors.
  7271. It also covers some aspects where users can extend the functionality of
  7272. Org.
  7273. @menu
  7274. * Extensions:: Existing 3rd-party extensions
  7275. * Adding hyperlink types:: New custom link types
  7276. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  7277. * Dynamic blocks:: Automatically filled blocks
  7278. * Special agenda views:: Customized views
  7279. * Using the property API:: Writing programs that use entry properties
  7280. @end menu
  7281. @node Extensions, Adding hyperlink types, Extensions and Hacking, Extensions and Hacking
  7282. @section Third-party extensions for Org
  7283. @cindex extension, third-party
  7284. There are lots of extensions that have been written by other people. Most of
  7285. them have either been integrated into Org by now, or they can be found in the
  7286. Org distribution, in the @file{contrib} directory. The list has gotten too
  7287. long to cover in any detail here, but there is a seaparate manual for these
  7288. extensions.
  7289. @node Adding hyperlink types, Tables in arbitrary syntax, Extensions, Extensions and Hacking
  7290. @section Adding hyperlink types
  7291. @cindex hyperlinks, adding new types
  7292. Org has a large number of hyperlink types built-in
  7293. (@pxref{Hyperlinks}). If you would like to add new link types, it
  7294. provides an interface for doing so. Lets look at an example file
  7295. @file{org-man.el} that will add support for creating links like
  7296. @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
  7297. emacs:
  7298. @lisp
  7299. ;;; org-man.el - Support for links to manpages in Org
  7300. (require 'org)
  7301. (org-add-link-type "man" 'org-man-open)
  7302. (add-hook 'org-store-link-functions 'org-man-store-link)
  7303. (defcustom org-man-command 'man
  7304. "The Emacs command to be used to display a man page."
  7305. :group 'org-link
  7306. :type '(choice (const man) (const woman)))
  7307. (defun org-man-open (path)
  7308. "Visit the manpage on PATH.
  7309. PATH should be a topic that can be thrown at the man command."
  7310. (funcall org-man-command path))
  7311. (defun org-man-store-link ()
  7312. "Store a link to a manpage."
  7313. (when (memq major-mode '(Man-mode woman-mode))
  7314. ;; This is a man page, we do make this link
  7315. (let* ((page (org-man-get-page-name))
  7316. (link (concat "man:" page))
  7317. (description (format "Manpage for %s" page)))
  7318. (org-store-link-props
  7319. :type "man"
  7320. :link link
  7321. :description description))))
  7322. (defun org-man-get-page-name ()
  7323. "Extract the page name from the buffer name."
  7324. ;; This works for both `Man-mode' and `woman-mode'.
  7325. (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
  7326. (match-string 1 (buffer-name))
  7327. (error "Cannot create link to this man page")))
  7328. (provide 'org-man)
  7329. ;;; org-man.el ends here
  7330. @end lisp
  7331. @noindent
  7332. You would activate this new link type in @file{.emacs} with
  7333. @lisp
  7334. (require 'org-man)
  7335. @end lisp
  7336. @noindent
  7337. Lets go through the file and see what it does.
  7338. @enumerate
  7339. @item
  7340. It does @code{(require 'org)} to make sure that @file{org.el} has been
  7341. loaded.
  7342. @item
  7343. The next line calls @code{org-add-link-type} to define a new link type
  7344. with prefix @samp{man}. The call also contains the name of a function
  7345. that will be called to follow such a link.
  7346. @item
  7347. The next line adds a function to @code{org-store-link-functions}, in
  7348. order to allow the command @kbd{C-c l} to record a useful link in a
  7349. buffer displaying a man page.
  7350. @end enumerate
  7351. The rest of the file defines the necessary variables and functions.
  7352. First there is a customization variable that determines which emacs
  7353. command should be used to display man pages. There are two options,
  7354. @code{man} and @code{woman}. Then the function to follow a link is
  7355. defined. It gets the link path as an argument - in this case the link
  7356. path is just a topic for the manual command. The function calls the
  7357. value of @code{org-man-command} to display the man page.
  7358. Finally the function @code{org-man-store-link} is defined. When you try
  7359. to store a link with @kbd{C-c l}, also this function will be called to
  7360. try to make a link. The function must first decide if it is supposed to
  7361. create the link for this buffer type, we do this by checking the value
  7362. of the variable @code{major-mode}. If not, the function must exit and
  7363. return the value @code{nil}. If yes, the link is created by getting the
  7364. manual topic from the buffer name and prefixing it with the string
  7365. @samp{man:}. Then it must call the command @code{org-store-link-props}
  7366. and set the @code{:type} and @code{:link} properties. Optionally you
  7367. can also set the @code{:description} property to provide a default for
  7368. the link description when the link is later inserted into an Org
  7369. buffer with @kbd{C-c C-l}.
  7370. @node Tables in arbitrary syntax, Dynamic blocks, Adding hyperlink types, Extensions and Hacking
  7371. @section Tables and lists in arbitrary syntax
  7372. @cindex tables, in other modes
  7373. @cindex lists, in other modes
  7374. @cindex Orgtbl mode
  7375. Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
  7376. frequent feature request has been to make it work with native tables in
  7377. specific languages, for example La@TeX{}. However, this is extremely
  7378. hard to do in a general way, would lead to a customization nightmare,
  7379. and would take away much of the simplicity of the Orgtbl mode table
  7380. editor.
  7381. This appendix describes a different approach. We keep the Orgtbl mode
  7382. table in its native format (the @i{source table}), and use a custom
  7383. function to @i{translate} the table to the correct syntax, and to
  7384. @i{install} it in the right location (the @i{target table}). This puts
  7385. the burden of writing conversion functions on the user, but it allows
  7386. for a very flexible system.
  7387. Bastien added the ability to do the same with lists. You can use Org's
  7388. facilities to edit and structure lists by turning @code{orgstruct-mode}
  7389. on, then locally exporting such lists in another format (HTML, La@TeX{}
  7390. or Texinfo.)
  7391. @menu
  7392. * Radio tables:: Sending and receiving
  7393. * A LaTeX example:: Step by step, almost a tutorial
  7394. * Translator functions:: Copy and modify
  7395. * Radio lists:: Doing the same for lists
  7396. @end menu
  7397. @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
  7398. @subsection Radio tables
  7399. @cindex radio tables
  7400. To define the location of the target table, you first need to create two
  7401. lines that are comments in the current mode, but contain magic words for
  7402. Orgtbl mode to find. Orgtbl mode will insert the translated table
  7403. between these lines, replacing whatever was there before. For example:
  7404. @example
  7405. /* BEGIN RECEIVE ORGTBL table_name */
  7406. /* END RECEIVE ORGTBL table_name */
  7407. @end example
  7408. @noindent
  7409. Just above the source table, we put a special line that tells
  7410. Orgtbl mode how to translate this table and where to install it. For
  7411. example:
  7412. @example
  7413. #+ORGTBL: SEND table_name translation_function arguments....
  7414. @end example
  7415. @noindent
  7416. @code{table_name} is the reference name for the table that is also used
  7417. in the receiver lines. @code{translation_function} is the Lisp function
  7418. that does the translation. Furthermore, the line can contain a list of
  7419. arguments (alternating key and value) at the end. The arguments will be
  7420. passed as a property list to the translation function for
  7421. interpretation. A few standard parameters are already recognized and
  7422. acted upon before the translation function is called:
  7423. @table @code
  7424. @item :skip N
  7425. Skip the first N lines of the table. Hlines do count!
  7426. @item :skipcols (n1 n2 ...)
  7427. List of columns that should be skipped. If the table has a column with
  7428. calculation marks, that column is automatically discarded as well.
  7429. Please note that the translator function sees the table @emph{after} the
  7430. removal of these columns, the function never knows that there have been
  7431. additional columns.
  7432. @end table
  7433. @noindent
  7434. The one problem remaining is how to keep the source table in the buffer
  7435. without disturbing the normal workings of the file, for example during
  7436. compilation of a C file or processing of a La@TeX{} file. There are a
  7437. number of different solutions:
  7438. @itemize @bullet
  7439. @item
  7440. The table could be placed in a block comment if that is supported by the
  7441. language. For example, in C mode you could wrap the table between
  7442. @samp{/*} and @samp{*/} lines.
  7443. @item
  7444. Sometimes it is possible to put the table after some kind of @i{END}
  7445. statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
  7446. in La@TeX{}.
  7447. @item
  7448. You can just comment the table line by line whenever you want to process
  7449. the file, and uncomment it whenever you need to edit the table. This
  7450. only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
  7451. make this comment-toggling very easy, in particular if you bind it to a
  7452. key.
  7453. @end itemize
  7454. @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
  7455. @subsection A LaTeX example of radio tables
  7456. @cindex LaTeX, and Orgtbl mode
  7457. The best way to wrap the source table in La@TeX{} is to use the
  7458. @code{comment} environment provided by @file{comment.sty}. It has to be
  7459. activated by placing @code{\usepackage@{comment@}} into the document
  7460. header. Orgtbl mode can insert a radio table skeleton@footnote{By
  7461. default this works only for La@TeX{}, HTML, and Texinfo. Configure the
  7462. variable @code{orgtbl-radio-tables} to install templates for other
  7463. modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
  7464. be prompted for a table name, lets say we use @samp{salesfigures}. You
  7465. will then get the following template:
  7466. @example
  7467. % BEGIN RECEIVE ORGTBL salesfigures
  7468. % END RECEIVE ORGTBL salesfigures
  7469. \begin@{comment@}
  7470. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  7471. | | |
  7472. \end@{comment@}
  7473. @end example
  7474. @noindent
  7475. The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
  7476. @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
  7477. into the receiver location with name @code{salesfigures}. You may now
  7478. fill in the table, feel free to use the spreadsheet features@footnote{If
  7479. the @samp{#+TBLFM} line contains an odd number of dollar characters,
  7480. this may cause problems with font-lock in LaTeX mode. As shown in the
  7481. example you can fix this by adding an extra line inside the
  7482. @code{comment} environment that is used to balance the dollar
  7483. expressions. If you are using AUCTeX with the font-latex library, a
  7484. much better solution is to add the @code{comment} environment to the
  7485. variable @code{LaTeX-verbatim-environments}.}:
  7486. @example
  7487. % BEGIN RECEIVE ORGTBL salesfigures
  7488. % END RECEIVE ORGTBL salesfigures
  7489. \begin@{comment@}
  7490. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  7491. | Month | Days | Nr sold | per day |
  7492. |-------+------+---------+---------|
  7493. | Jan | 23 | 55 | 2.4 |
  7494. | Feb | 21 | 16 | 0.8 |
  7495. | March | 22 | 278 | 12.6 |
  7496. #+TBLFM: $4=$3/$2;%.1f
  7497. % $ (optional extra dollar to keep font-lock happy, see footnote)
  7498. \end@{comment@}
  7499. @end example
  7500. @noindent
  7501. When you are done, press @kbd{C-c C-c} in the table to get the converted
  7502. table inserted between the two marker lines.
  7503. Now lets assume you want to make the table header by hand, because you
  7504. want to control how columns are aligned etc. In this case we make sure
  7505. that the table translator does skip the first 2 lines of the source
  7506. table, and tell the command to work as a @i{splice}, i.e. to not produce
  7507. header and footer commands of the target table:
  7508. @example
  7509. \begin@{tabular@}@{lrrr@}
  7510. Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
  7511. % BEGIN RECEIVE ORGTBL salesfigures
  7512. % END RECEIVE ORGTBL salesfigures
  7513. \end@{tabular@}
  7514. %
  7515. \begin@{comment@}
  7516. #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
  7517. | Month | Days | Nr sold | per day |
  7518. |-------+------+---------+---------|
  7519. | Jan | 23 | 55 | 2.4 |
  7520. | Feb | 21 | 16 | 0.8 |
  7521. | March | 22 | 278 | 12.6 |
  7522. #+TBLFM: $4=$3/$2;%.1f
  7523. \end@{comment@}
  7524. @end example
  7525. The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
  7526. Orgtbl mode. It uses a @code{tabular} environment to typeset the table
  7527. and marks horizontal lines with @code{\hline}. Furthermore, it
  7528. interprets the following parameters:
  7529. @table @code
  7530. @item :splice nil/t
  7531. When set to t, return only table body lines, don't wrap them into a
  7532. tabular environment. Default is nil.
  7533. @item :fmt fmt
  7534. A format to be used to wrap each field, should contain @code{%s} for the
  7535. original field value. For example, to wrap each field value in dollars,
  7536. you could use @code{:fmt "$%s$"}. This may also be a property list with
  7537. column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
  7538. A function of one argument can be used in place of the strings; the
  7539. function must return a formatted string.
  7540. @item :efmt efmt
  7541. Use this format to print numbers with exponentials. The format should
  7542. have @code{%s} twice for inserting mantissa and exponent, for example
  7543. @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
  7544. may also be a property list with column numbers and formats, for example
  7545. @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
  7546. @code{efmt} has been applied to a value, @code{fmt} will also be
  7547. applied. Similar to @code{fmt}, functions of two arguments can be
  7548. supplied instead of strings.
  7549. @end table
  7550. @node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
  7551. @subsection Translator functions
  7552. @cindex HTML, and Orgtbl mode
  7553. @cindex translator function
  7554. Orgtbl mode has several translator functions built-in:
  7555. @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and
  7556. @code{orgtbl-to-texinfo}. Except for @code{orgtbl-to-html}@footnote{The
  7557. HTML translator uses the same code that produces tables during HTML
  7558. export.}, these all use a generic translator, @code{orgtbl-to-generic}.
  7559. For example, @code{orgtbl-to-latex} itself is a very short function that
  7560. computes the column definitions for the @code{tabular} environment,
  7561. defines a few field and line separators and then hands over to the
  7562. generic translator. Here is the entire code:
  7563. @lisp
  7564. @group
  7565. (defun orgtbl-to-latex (table params)
  7566. "Convert the Orgtbl mode TABLE to LaTeX."
  7567. (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
  7568. org-table-last-alignment ""))
  7569. (params2
  7570. (list
  7571. :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
  7572. :tend "\\end@{tabular@}"
  7573. :lstart "" :lend " \\\\" :sep " & "
  7574. :efmt "%s\\,(%s)" :hline "\\hline")))
  7575. (orgtbl-to-generic table (org-combine-plists params2 params))))
  7576. @end group
  7577. @end lisp
  7578. As you can see, the properties passed into the function (variable
  7579. @var{PARAMS}) are combined with the ones newly defined in the function
  7580. (variable @var{PARAMS2}). The ones passed into the function (i.e. the
  7581. ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
  7582. would like to use the La@TeX{} translator, but wanted the line endings to
  7583. be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
  7584. overrule the default with
  7585. @example
  7586. #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
  7587. @end example
  7588. For a new language, you can either write your own converter function in
  7589. analogy with the La@TeX{} translator, or you can use the generic function
  7590. directly. For example, if you have a language where a table is started
  7591. with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
  7592. started with @samp{!BL!}, ended with @samp{!EL!} and where the field
  7593. separator is a TAB, you could call the generic translator like this (on
  7594. a single line!):
  7595. @example
  7596. #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
  7597. :lstart "!BL! " :lend " !EL!" :sep "\t"
  7598. @end example
  7599. @noindent
  7600. Please check the documentation string of the function
  7601. @code{orgtbl-to-generic} for a full list of parameters understood by
  7602. that function and remember that you can pass each of them into
  7603. @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
  7604. using the generic function.
  7605. Of course you can also write a completely new function doing complicated
  7606. things the generic translator cannot do. A translator function takes
  7607. two arguments. The first argument is the table, a list of lines, each
  7608. line either the symbol @code{hline} or a list of fields. The second
  7609. argument is the property list containing all parameters specified in the
  7610. @samp{#+ORGTBL: SEND} line. The function must return a single string
  7611. containing the formatted table. If you write a generally useful
  7612. translator, please post it on @code{emacs-orgmode@@gnu.org} so that
  7613. others can benefit from your work.
  7614. @node Radio lists, , Translator functions, Tables in arbitrary syntax
  7615. @subsection Radio lists
  7616. @cindex radio lists
  7617. @cindex org-list-insert-radio-list
  7618. Sending and receiving radio lists works exactly the same way than
  7619. sending and receiving radio tables (@pxref{Radio tables}) @footnote{You
  7620. need to load the @code{org-export-latex.el} package to use radio lists
  7621. since the relevant code is there for now.}. As for radio tables, you
  7622. can insert radio lists templates in HTML, La@TeX{} and Texinfo modes by
  7623. calling @code{org-list-insert-radio-list}.
  7624. Here are the differences with radio tables:
  7625. @itemize @minus
  7626. @item
  7627. Use @code{ORGLST} instead of @code{ORGTBL}.
  7628. @item
  7629. The available translation functions for radio lists don't take
  7630. parameters.
  7631. @item
  7632. `C-c C-c' will work when pressed on the first item of the list.
  7633. @end itemize
  7634. Here is a La@TeX{} example. Let's say that you have this in your
  7635. La@TeX{} file:
  7636. @example
  7637. % BEGIN RECEIVE ORGLST to-buy
  7638. % END RECEIVE ORGLST to-buy
  7639. \begin@{comment@}
  7640. #+ORGLIST: SEND to-buy orgtbl-to-latex
  7641. - a new house
  7642. - a new computer
  7643. + a new keyboard
  7644. + a new mouse
  7645. - a new life
  7646. \end@{comment@}
  7647. @end example
  7648. Pressing `C-c C-c' on @code{a new house} and will insert the converted
  7649. La@TeX{} list between the two marker lines.
  7650. @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Extensions and Hacking
  7651. @section Dynamic blocks
  7652. @cindex dynamic blocks
  7653. Org documents can contain @emph{dynamic blocks}. These are
  7654. specially marked regions that are updated by some user-written function.
  7655. A good example for such a block is the clock table inserted by the
  7656. command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
  7657. Dynamic block are enclosed by a BEGIN-END structure that assigns a name
  7658. to the block and can also specify parameters for the function producing
  7659. the content of the block.
  7660. @example
  7661. #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
  7662. #+END:
  7663. @end example
  7664. Dynamic blocks are updated with the following commands
  7665. @table @kbd
  7666. @kindex C-c C-x C-u
  7667. @item C-c C-x C-u
  7668. Update dynamic block at point.
  7669. @kindex C-u C-c C-x C-u
  7670. @item C-u C-c C-x C-u
  7671. Update all dynamic blocks in the current file.
  7672. @end table
  7673. Updating a dynamic block means to remove all the text between BEGIN and
  7674. END, parse the BEGIN line for parameters and then call the specific
  7675. writer function for this block to insert the new content. If you want
  7676. to use the original content in the writer function, you can use the
  7677. extra parameter @code{:content}.
  7678. For a block with name @code{myblock}, the writer function is
  7679. @code{org-dblock-write:myblock} with as only parameter a property list
  7680. with the parameters given in the begin line. Here is a trivial example
  7681. of a block that keeps track of when the block update function was last
  7682. run:
  7683. @example
  7684. #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
  7685. #+END:
  7686. @end example
  7687. @noindent
  7688. The corresponding block writer function could look like this:
  7689. @lisp
  7690. (defun org-dblock-write:block-update-time (params)
  7691. (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
  7692. (insert "Last block update at: "
  7693. (format-time-string fmt (current-time)))))
  7694. @end lisp
  7695. If you want to make sure that all dynamic blocks are always up-to-date,
  7696. you could add the function @code{org-update-all-dblocks} to a hook, for
  7697. example @code{before-save-hook}. @code{org-update-all-dblocks} is
  7698. written in a way that is does nothing in buffers that are not in
  7699. @code{org-mode}.
  7700. @node Special agenda views, Using the property API, Dynamic blocks, Extensions and Hacking
  7701. @section Special agenda views
  7702. @cindex agenda views, user-defined
  7703. Org provides a special hook that can be used to narrow down the
  7704. selection made by any of the agenda views. You may specify a function
  7705. that is used at each match to verify if the match should indeed be part
  7706. of the agenda view, and if not, how much should be skipped.
  7707. Let's say you want to produce a list of projects that contain a WAITING
  7708. tag anywhere in the project tree. Let's further assume that you have
  7709. marked all tree headings that define a project with the TODO keyword
  7710. PROJECT. In this case you would run a TODO search for the keyword
  7711. PROJECT, but skip the match unless there is a WAITING tag anywhere in
  7712. the subtree belonging to the project line.
  7713. To achieve this, you must write a function that searches the subtree for
  7714. the tag. If the tag is found, the function must return @code{nil} to
  7715. indicate that this match should not be skipped. If there is no such
  7716. tag, return the location of the end of the subtree, to indicate that
  7717. search should continue from there.
  7718. @lisp
  7719. (defun my-skip-unless-waiting ()
  7720. "Skip trees that are not waiting"
  7721. (let ((subtree-end (save-excursion (org-end-of-subtree t))))
  7722. (if (re-search-forward ":waiting:" subtree-end t)
  7723. nil ; tag found, do not skip
  7724. subtree-end))) ; tag not found, continue after end of subtree
  7725. @end lisp
  7726. Now you may use this function in an agenda custom command, for example
  7727. like this:
  7728. @lisp
  7729. (org-add-agenda-custom-command
  7730. '("b" todo "PROJECT"
  7731. ((org-agenda-skip-function 'my-org-waiting-projects)
  7732. (org-agenda-overriding-header "Projects waiting for something: "))))
  7733. @end lisp
  7734. Note that this also binds @code{org-agenda-overriding-header} to get a
  7735. meaningful header in the agenda view.
  7736. A general way to create custom searches is to base them on a search for
  7737. entries with a certain level limit. If you want to study all entries with
  7738. your custom search function, simply do a search for @samp{LEVEL>0}, and then
  7739. use @code{org-agenda-skip-function} to select the entries you really want to
  7740. have.
  7741. You may also put a Lisp form into @code{org-agenda-skip-function}. In
  7742. particular, you may use the functions @code{org-agenda-skip-entry-if}
  7743. and @code{org-agenda-skip-subtree-if} in this form, for example:
  7744. @table @code
  7745. @item '(org-agenda-skip-entry-if 'scheduled)
  7746. Skip current entry if it has been scheduled.
  7747. @item '(org-agenda-skip-entry-if 'notscheduled)
  7748. Skip current entry if it has not been scheduled.
  7749. @item '(org-agenda-skip-entry-if 'deadline)
  7750. Skip current entry if it has a deadline.
  7751. @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
  7752. Skip current entry if it has a deadline, or if it is scheduled.
  7753. @item '(org-agenda-skip-entry 'regexp "regular expression")
  7754. Skip current entry if the regular expression matches in the entry.
  7755. @item '(org-agenda-skip-entry 'notregexp "regular expression")
  7756. Skip current entry unless the regular expression matches.
  7757. @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
  7758. Same as above, but check and skip the entire subtree.
  7759. @end table
  7760. Therefore we could also have written the search for WAITING projects
  7761. like this, even without defining a special function:
  7762. @lisp
  7763. (org-add-agenda-custom-command
  7764. '("b" todo "PROJECT"
  7765. ((org-agenda-skip-function '(org-agenda-skip-subtree-if
  7766. 'regexp ":waiting:"))
  7767. (org-agenda-overriding-header "Projects waiting for something: "))))
  7768. @end lisp
  7769. @node Using the property API, , Special agenda views, Extensions and Hacking
  7770. @section Using the property API
  7771. @cindex API, for properties
  7772. @cindex properties, API
  7773. Here is a description of the functions that can be used to work with
  7774. properties.
  7775. @defun org-entry-properties &optional pom which
  7776. Get all properties of the entry at point-or-marker POM.
  7777. This includes the TODO keyword, the tags, time strings for deadline,
  7778. scheduled, and clocking, and any additional properties defined in the
  7779. entry. The return value is an alist, keys may occur multiple times
  7780. if the property key was used several times.
  7781. POM may also be nil, in which case the current entry is used.
  7782. If WHICH is nil or `all', get all properties. If WHICH is
  7783. `special' or `standard', only get that subclass.
  7784. @end defun
  7785. @defun org-entry-get pom property &optional inherit
  7786. Get value of PROPERTY for entry at point-or-marker POM. By default,
  7787. this only looks at properties defined locally in the entry. If INHERIT
  7788. is non-nil and the entry does not have the property, then also check
  7789. higher levels of the hierarchy. If INHERIT is the symbol
  7790. @code{selective}, use inheritance if and only if the setting of
  7791. @code{org-use-property-inheritance} selects PROPERTY for inheritance.
  7792. @end defun
  7793. @defun org-entry-delete pom property
  7794. Delete the property PROPERTY from entry at point-or-marker POM.
  7795. @end defun
  7796. @defun org-entry-put pom property value
  7797. Set PROPERTY to VALUE for entry at point-or-marker POM.
  7798. @end defun
  7799. @defun org-buffer-property-keys &optional include-specials
  7800. Get all property keys in the current buffer.
  7801. @end defun
  7802. @defun org-insert-property-drawer
  7803. Insert a property drawer at point.
  7804. @end defun
  7805. @defun org-entry-add-to-multivalued-property pom property value
  7806. Treat the value of the property PROPERTY as a whitespace-separated list of
  7807. values and make sure that VALUE is in this list.
  7808. @end defun
  7809. @defun org-entry-remove-from-multivalued-property pom property value
  7810. Treat the value of the property PROPERTY as a whitespace-separated list of
  7811. values and make sure that VALUE is @emph{not} in this list.
  7812. @end defun
  7813. @defun org-entry-member-in-multivalued-property pom property value
  7814. Treat the value of the property PROPERTY as a whitespace-separated list of
  7815. values and check if VALUE is in this list.
  7816. @end defun
  7817. @node History and Acknowledgments, Main Index, Extensions and Hacking, Top
  7818. @appendix History and Acknowledgments
  7819. @cindex acknowledgments
  7820. @cindex history
  7821. @cindex thanks
  7822. Org was borne in 2003, out of frustration over the user interface
  7823. of the Emacs Outline mode. I was trying to organize my notes and
  7824. projects, and using Emacs seemed to be the natural way to go. However,
  7825. having to remember eleven different commands with two or three keys per
  7826. command, only to hide and show parts of the outline tree, that seemed
  7827. entirely unacceptable to me. Also, when using outlines to take notes, I
  7828. constantly want to restructure the tree, organizing it parallel to my
  7829. thoughts and plans. @emph{Visibility cycling} and @emph{structure
  7830. editing} were originally implemented in the package
  7831. @file{outline-magic.el}, but quickly moved to the more general
  7832. @file{org.el}. As this environment became comfortable for project
  7833. planning, the next step was adding @emph{TODO entries}, basic @emph{time
  7834. stamps}, and @emph{table support}. These areas highlight the two main
  7835. goals that Org still has today: To create a new, outline-based,
  7836. plain text mode with innovative and intuitive editing features, and to
  7837. incorporate project planning functionality directly into a notes file.
  7838. A special thanks goes to @i{Bastien Guerry} who has not only writen a large
  7839. number of extensions to Org (most of them integrated into the core by now),
  7840. but has also helped the development and maintenance of Org so much that he
  7841. should be considered co-author of this package.
  7842. Since the first release, literally thousands of emails to me or on
  7843. @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
  7844. reports, feedback, new ideas, and sometimes patches and add-on code.
  7845. Many thanks to everyone who has helped to improve this package. I am
  7846. trying to keep here a list of the people who had significant influence
  7847. in shaping one or more aspects of Org. The list may not be
  7848. complete, if I have forgotten someone, please accept my apologies and
  7849. let me know.
  7850. @itemize @bullet
  7851. @item
  7852. @i{Russel Adams} came up with the idea for drawers.
  7853. @item
  7854. @i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
  7855. @item
  7856. @i{Alex Bochannek} provided a patch for rounding time stamps.
  7857. @item
  7858. @i{Charles Cave}'s suggestion sparked the implementation of templates
  7859. for Remember.
  7860. @item
  7861. @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
  7862. specified time.
  7863. @item
  7864. @i{Gregory Chernov} patched support for lisp forms into table
  7865. calculations and improved XEmacs compatibility, in particular by porting
  7866. @file{nouline.el} to XEmacs.
  7867. @item
  7868. @i{Sacha Chua} suggested to copy some linking code from Planner.
  7869. @item
  7870. @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
  7871. came up with the idea of properties, and that there should be an API for
  7872. them.
  7873. @item
  7874. @i{Kees Dullemond} used to edit projects lists directly in HTML and so
  7875. inspired some of the early development, including HTML export. He also
  7876. asked for a way to narrow wide table columns.
  7877. @item
  7878. @i{Christian Egli} converted the documentation into Texinfo format,
  7879. patched CSS formatting into the HTML exporter, and inspired the agenda.
  7880. @item
  7881. @i{David Emery} provided a patch for custom CSS support in exported
  7882. HTML agendas.
  7883. @item
  7884. @i{Nic Ferrier} contributed mailcap and XOXO support.
  7885. @item
  7886. @i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
  7887. @item
  7888. @i{John Foerch} figured out how to make incremental search show context
  7889. around a match in a hidden outline tree.
  7890. @item
  7891. @i{Niels Giesen} had the idea to automatically archive DONE trees.
  7892. @item
  7893. @i{Bastien Guerry} wrote the La@TeX{} exporter and @file{org-bibtex.el}, and
  7894. has been prolific with patches, ideas, and bug reports.
  7895. @item
  7896. @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
  7897. @item
  7898. @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
  7899. task state change logging, and the clocktable. His clear explanations have
  7900. been critical when we started to adopt the GIT version control system.
  7901. @item
  7902. @i{Phil Jackson} wrote @file{org-irc.el}.
  7903. @item
  7904. @i{Scott Jaderholm} proposed footnotes, control over whitespace between
  7905. folded entries, and column view for properties.
  7906. @item
  7907. @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
  7908. @item
  7909. @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
  7910. provided frequent feedback and some patches.
  7911. @item
  7912. @i{Jason F. McBrayer} suggested agenda export to CSV format.
  7913. @item
  7914. @i{Max Mikhanosha} came up with the idea of refiling.
  7915. @item
  7916. @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
  7917. basis.
  7918. @item
  7919. @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
  7920. happy.
  7921. @item
  7922. @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file
  7923. and to be able to quickly restrict the agenda to a subtree.
  7924. @item
  7925. @i{Todd Neal} provided patches for links to Info files and elisp forms.
  7926. @item
  7927. @i{Tim O'Callaghan} suggested in-file links, search options for general
  7928. file links, and TAGS.
  7929. @item
  7930. @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
  7931. into Japanese.
  7932. @item
  7933. @i{Oliver Oppitz} suggested multi-state TODO items.
  7934. @item
  7935. @i{Scott Otterson} sparked the introduction of descriptive text for
  7936. links, among other things.
  7937. @item
  7938. @i{Pete Phillips} helped during the development of the TAGS feature, and
  7939. provided frequent feedback.
  7940. @item
  7941. @i{T.V. Raman} reported bugs and suggested improvements.
  7942. @item
  7943. @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
  7944. control.
  7945. @item
  7946. @i{Kevin Rogers} contributed code to access VM files on remote hosts.
  7947. @item
  7948. @i{Sebastian Rose} wrote @file{org-info.js}, a Java script for displaying
  7949. webpages derived from Org using an Info-like, or a folding interface with
  7950. single key navigation.
  7951. @item
  7952. @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
  7953. conflict with @file{allout.el}.
  7954. @item
  7955. @i{Jason Riedy} generalized the send-receive mechanism for orgtbl tables with
  7956. extensive patches.
  7957. @item
  7958. @i{Philip Rooke} created the Org reference card, provided lots
  7959. of feedback, developed and applied standards to the Org documentation and
  7960. wrote the manual for the contributed packages.
  7961. @item
  7962. @i{Christian Schlauer} proposed angular brackets around links, among
  7963. other things.
  7964. @item
  7965. Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
  7966. @file{organizer-mode.el}.
  7967. @item
  7968. @i{Ilya Shlyakhter} proposed the Archive Sibling.
  7969. @item
  7970. @i{Daniel Sinder} came up with the idea of internal archiving by locking
  7971. subtrees.
  7972. @item
  7973. @i{Dale Smith} proposed link abbreviations.
  7974. @item
  7975. @i{Adam Spiers} asked for global linking commands and inspired the link
  7976. extension system. support mairix.
  7977. @item
  7978. @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
  7979. chapter about publishing.
  7980. @item
  7981. @i{J@"urgen Vollmer} contributed code generating the table of contents
  7982. in HTML output.
  7983. @item
  7984. @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
  7985. keyword.
  7986. @item
  7987. @i{David Wainberg} suggested archiving, and improvements to the linking
  7988. system.
  7989. @item
  7990. @i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
  7991. @file{muse.el}, which have similar goals as Org. Initially the development
  7992. of Org was fully independent because I was not aware of the existence of
  7993. these packages. But with time I have accasionally looked at John's code and
  7994. learned a lot from it. John has also contributed a number of great ideas and
  7995. patches directly to Org, including the file @code{org-mac-message.el}'
  7996. @item
  7997. @i{Carsten Wimmer} suggested some changes and helped fix a bug in
  7998. linking to Gnus.
  7999. @item
  8000. @i{Roland Winkler} requested additional key bindings to make Org
  8001. work on a tty.
  8002. @item
  8003. @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
  8004. and contributed various ideas and code snippets.
  8005. @end itemize
  8006. @node Main Index, Key Index, History and Acknowledgments, Top
  8007. @unnumbered The Main Index
  8008. @printindex cp
  8009. @node Key Index, , Main Index, Top
  8010. @unnumbered Key Index
  8011. @printindex ky
  8012. @bye
  8013. @ignore
  8014. arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
  8015. @end ignore
  8016. @c Local variables:
  8017. @c ispell-local-dictionary: "en_US-w_accents"
  8018. @c ispell-local-pdict: "./.aspell.org.pws"
  8019. @c fill-column: 77
  8020. @c End: