org.texi 567 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975
  1. \input texinfo
  2. @c %**start of header
  3. @setfilename ../../info/org
  4. @settitle The Org Manual
  5. @set VERSION 6.35g
  6. @set DATE April 2010
  7. @c Version and Contact Info
  8. @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
  9. @set AUTHOR Carsten Dominik
  10. @set MAINTAINER Carsten Dominik
  11. @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
  12. @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
  13. @c %**end of header
  14. @finalout
  15. @c Macro definitions
  16. @iftex
  17. @c @hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}
  18. @end iftex
  19. @macro Ie {}
  20. I.e.,
  21. @end macro
  22. @macro ie {}
  23. i.e.,
  24. @end macro
  25. @macro Eg {}
  26. E.g.,
  27. @end macro
  28. @macro eg {}
  29. e.g.,
  30. @end macro
  31. @c Subheadings inside a table.
  32. @macro tsubheading{text}
  33. @ifinfo
  34. @subsubheading \text\
  35. @end ifinfo
  36. @ifnotinfo
  37. @item @b{\text\}
  38. @end ifnotinfo
  39. @end macro
  40. @copying
  41. This manual is for Org version @value{VERSION}.
  42. Copyright @copyright{} 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation
  43. @quotation
  44. Permission is granted to copy, distribute and/or modify this document
  45. under the terms of the GNU Free Documentation License, Version 1.3 or
  46. any later version published by the Free Software Foundation; with no
  47. Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
  48. and with the Back-Cover Texts as in (a) below. A copy of the license
  49. is included in the section entitled ``GNU Free Documentation License.''
  50. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  51. modify this GNU manual. Buying copies from the FSF supports it in
  52. developing GNU and promoting software freedom.''
  53. This document is part of a collection distributed under the GNU Free
  54. Documentation License. If you want to distribute this document
  55. separately from the collection, you can do so by adding a copy of the
  56. license to the document, as described in section 6 of the license.
  57. @end quotation
  58. @end copying
  59. @dircategory Emacs
  60. @direntry
  61. * Org Mode: (org). Outline-based notes management and organizer
  62. @end direntry
  63. @titlepage
  64. @title The Org Manual
  65. @subtitle Release @value{VERSION}
  66. @author by Carsten Dominik
  67. @c The following two commands start the copyright page.
  68. @page
  69. @vskip 0pt plus 1filll
  70. @insertcopying
  71. @end titlepage
  72. @c Output the table of contents at the beginning.
  73. @contents
  74. @ifnottex
  75. @node Top, Introduction, (dir), (dir)
  76. @top Org Mode Manual
  77. @insertcopying
  78. @end ifnottex
  79. @menu
  80. * Introduction:: Getting started
  81. * Document Structure:: A tree works like your brain
  82. * Tables:: Pure magic for quick formatting
  83. * Hyperlinks:: Notes in context
  84. * TODO Items:: Every tree branch can be a TODO item
  85. * Tags:: Tagging headlines and matching sets of tags
  86. * Properties and Columns:: Storing information about an entry
  87. * Dates and Times:: Making items useful for planning
  88. * Capture - Refile - Archive:: The ins and outs for projects
  89. * Agenda Views:: Collecting information into views
  90. * Markup:: Prepare text for rich export
  91. * Exporting:: Sharing and publishing of notes
  92. * Publishing:: Create a web site of linked Org files
  93. * Working With Source Code:: Using Org for literate programming, reproducible research and code evaluation.
  94. * Miscellaneous:: All the rest which did not fit elsewhere
  95. * Hacking:: How to hack your way around
  96. * MobileOrg:: Viewing and capture on a mobile device
  97. * History and Acknowledgments:: How Org came into being
  98. * Main Index:: An index of Org's concepts and features
  99. * Key Index:: Key bindings and where they are described
  100. * Variable Index:: Variables mentioned in the manual
  101. @detailmenu
  102. --- The Detailed Node Listing ---
  103. Introduction
  104. * Summary:: Brief summary of what Org does
  105. * Installation:: How to install a downloaded version of Org
  106. * Activation:: How to activate Org for certain buffers
  107. * Feedback:: Bug reports, ideas, patches etc.
  108. * Conventions:: Type-setting conventions in the manual
  109. Document Structure
  110. * Outlines:: Org is based on Outline mode
  111. * Headlines:: How to typeset Org tree headlines
  112. * Visibility cycling:: Show and hide, much simplified
  113. * Motion:: Jumping to other headlines
  114. * Structure editing:: Changing sequence and level of headlines
  115. * Sparse trees:: Matches embedded in context
  116. * Plain lists:: Additional structure within an entry
  117. * Drawers:: Tucking stuff away
  118. * Blocks:: Folding blocks
  119. * Footnotes:: How footnotes are defined in Org's syntax
  120. * Orgstruct mode:: Structure editing outside Org
  121. Tables
  122. * Built-in table editor:: Simple tables
  123. * Column width and alignment:: Overrule the automatic settings
  124. * Column groups:: Grouping to trigger vertical lines
  125. * Orgtbl mode:: The table editor as minor mode
  126. * The spreadsheet:: The table editor has spreadsheet capabilities
  127. * Org-Plot:: Plotting from org tables
  128. The spreadsheet
  129. * References:: How to refer to another field or range
  130. * Formula syntax for Calc:: Using Calc to compute stuff
  131. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  132. * Field formulas:: Formulas valid for a single field
  133. * Column formulas:: Formulas valid for an entire column
  134. * Editing and debugging formulas:: Fixing formulas
  135. * Updating the table:: Recomputing all dependent fields
  136. * Advanced features:: Field names, parameters and automatic recalc
  137. Hyperlinks
  138. * Link format:: How links in Org are formatted
  139. * Internal links:: Links to other places in the current file
  140. * External links:: URL-like links to the world
  141. * Handling links:: Creating, inserting and following
  142. * Using links outside Org:: Linking from my C source code?
  143. * Link abbreviations:: Shortcuts for writing complex links
  144. * Search options:: Linking to a specific location
  145. * Custom searches:: When the default search is not enough
  146. Internal links
  147. * Radio targets:: Make targets trigger links in plain text
  148. TODO Items
  149. * TODO basics:: Marking and displaying TODO entries
  150. * TODO extensions:: Workflow and assignments
  151. * Progress logging:: Dates and notes for progress
  152. * Priorities:: Some things are more important than others
  153. * Breaking down tasks:: Splitting a task into manageable pieces
  154. * Checkboxes:: Tick-off lists
  155. Extended use of TODO keywords
  156. * Workflow states:: From TODO to DONE in steps
  157. * TODO types:: I do this, Fred does the rest
  158. * Multiple sets in one file:: Mixing it all, and still finding your way
  159. * Fast access to TODO states:: Single letter selection of a state
  160. * Per-file keywords:: Different files, different requirements
  161. * Faces for TODO keywords:: Highlighting states
  162. * TODO dependencies:: When one task needs to wait for others
  163. Progress logging
  164. * Closing items:: When was this entry marked DONE?
  165. * Tracking TODO state changes:: When did the status change?
  166. * Tracking your habits:: How consistent have you been?
  167. Tags
  168. * Tag inheritance:: Tags use the tree structure of the outline
  169. * Setting tags:: How to assign tags to a headline
  170. * Tag searches:: Searching for combinations of tags
  171. Properties and Columns
  172. * Property syntax:: How properties are spelled out
  173. * Special properties:: Access to other Org mode features
  174. * Property searches:: Matching property values
  175. * Property inheritance:: Passing values down the tree
  176. * Column view:: Tabular viewing and editing
  177. * Property API:: Properties for Lisp programmers
  178. Column view
  179. * Defining columns:: The COLUMNS format property
  180. * Using column view:: How to create and use column view
  181. * Capturing column view:: A dynamic block for column view
  182. Defining columns
  183. * Scope of column definitions:: Where defined, where valid?
  184. * Column attributes:: Appearance and content of a column
  185. Dates and Times
  186. * Timestamps:: Assigning a time to a tree entry
  187. * Creating timestamps:: Commands which insert timestamps
  188. * Deadlines and scheduling:: Planning your work
  189. * Clocking work time:: Tracking how long you spend on a task
  190. * Resolving idle time:: Resolving time if you've been idle
  191. * Effort estimates:: Planning work effort in advance
  192. * Relative timer:: Notes with a running timer
  193. Creating timestamps
  194. * The date/time prompt:: How Org mode helps you entering date and time
  195. * Custom time format:: Making dates look different
  196. Deadlines and scheduling
  197. * Inserting deadline/schedule:: Planning items
  198. * Repeated tasks:: Items that show up again and again
  199. Capture - Refile - Archive
  200. * Remember:: Capture new tasks/ideas with little interruption
  201. * Attachments:: Add files to tasks.
  202. * RSS Feeds:: Getting input from RSS feeds
  203. * Protocols:: External (e.g. Browser) access to Emacs and Org
  204. * Refiling notes:: Moving a tree from one place to another
  205. * Archiving:: What to do with finished projects
  206. Remember
  207. * Setting up Remember for Org:: Some code for .emacs to get things going
  208. * Remember templates:: Define the outline of different note types
  209. * Storing notes:: Directly get the note to where it belongs
  210. Archiving
  211. * Moving subtrees:: Moving a tree to an archive file
  212. * Internal archiving:: Switch off a tree but keep i in the file
  213. Agenda Views
  214. * Agenda files:: Files being searched for agenda information
  215. * Agenda dispatcher:: Keyboard access to agenda views
  216. * Built-in agenda views:: What is available out of the box?
  217. * Presentation and sorting:: How agenda items are prepared for display
  218. * Agenda commands:: Remote editing of Org trees
  219. * Custom agenda views:: Defining special searches and views
  220. * Exporting Agenda Views:: Writing a view to a file
  221. * Agenda column view:: Using column view for collected entries
  222. The built-in agenda views
  223. * Weekly/daily agenda:: The calendar page with current tasks
  224. * Global TODO list:: All unfinished action items
  225. * Matching tags and properties:: Structured information with fine-tuned search
  226. * Timeline:: Time-sorted view for single file
  227. * Search view:: Find entries by searching for text
  228. * Stuck projects:: Find projects you need to review
  229. Presentation and sorting
  230. * Categories:: Not all tasks are equal
  231. * Time-of-day specifications:: How the agenda knows the time
  232. * Sorting of agenda items:: The order of things
  233. Custom agenda views
  234. * Storing searches:: Type once, use often
  235. * Block agenda:: All the stuff you need in a single buffer
  236. * Setting Options:: Changing the rules
  237. Markup for rich export
  238. * Structural markup elements:: The basic structure as seen by the exporter
  239. * Images and tables:: Tables and Images will be included
  240. * Literal examples:: Source code examples with special formatting
  241. * Include files:: Include additional files into a document
  242. * Index entries::
  243. * Macro replacement:: Use macros to create complex output
  244. * Embedded LaTeX:: LaTeX can be freely used inside Org documents
  245. Structural markup elements
  246. * Document title:: Where the title is taken from
  247. * Headings and sections:: The document structure as seen by the exporter
  248. * Table of contents:: The if and where of the table of contents
  249. * Initial text:: Text before the first heading?
  250. * Lists:: Lists
  251. * Paragraphs:: Paragraphs
  252. * Footnote markup:: Footnotes
  253. * Emphasis and monospace:: Bold, italic, etc.
  254. * Horizontal rules:: Make a line
  255. * Comment lines:: What will *not* be exported
  256. Embedded La@TeX{}
  257. * Special symbols:: Greek letters and other symbols
  258. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  259. * LaTeX fragments:: Complex formulas made easy
  260. * Previewing LaTeX fragments:: What will this snippet look like?
  261. * CDLaTeX mode:: Speed up entering of formulas
  262. Exporting
  263. * Selective export:: Using tags to select and exclude trees
  264. * Export options:: Per-file export settings
  265. * The export dispatcher:: How to access exporter commands
  266. * ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
  267. * HTML export:: Exporting to HTML
  268. * LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
  269. * DocBook export:: Exporting to DocBook
  270. * Freemind export:: Exporting to Freemind mind maps
  271. * XOXO export:: Exporting to XOXO
  272. * iCalendar export:: Exporting in iCalendar format
  273. HTML export
  274. * HTML Export commands:: How to invoke HTML export
  275. * Quoting HTML tags:: Using direct HTML in Org mode
  276. * Links in HTML export:: How links will be interpreted and formatted
  277. * Tables in HTML export:: How to modify the formatting of tables
  278. * Images in HTML export:: How to insert figures into HTML output
  279. * Text areas in HTML export:: An alternative way to show an example
  280. * CSS support:: Changing the appearance of the output
  281. * Javascript support:: Info and Folding in a web browser
  282. La@TeX{} and PDF export
  283. * LaTeX/PDF export commands:: Which key invokes which commands
  284. * Header and sectioning:: Setting up the export file structure
  285. * Quoting LaTeX code:: Incorporating literal La@TeX{} code
  286. * Tables in LaTeX export:: Options for exporting tables to La@TeX{}
  287. * Images in LaTeX export:: How to insert figures into La@TeX{} output
  288. * Beamer class export:: Turning the file into a presentation
  289. DocBook export
  290. * DocBook export commands:: How to invoke DocBook export
  291. * Quoting DocBook code:: Incorporating DocBook code in Org files
  292. * Recursive sections:: Recursive sections in DocBook
  293. * Tables in DocBook export:: Tables are exported as HTML tables
  294. * Images in DocBook export:: How to insert figures into DocBook output
  295. * Special characters:: How to handle special characters
  296. Publishing
  297. * Configuration:: Defining projects
  298. * Uploading files:: How to get files up on the server
  299. * Sample configuration:: Example projects
  300. * Triggering publication:: Publication commands
  301. Configuration
  302. * Project alist:: The central configuration variable
  303. * Sources and destinations:: From here to there
  304. * Selecting files:: What files are part of the project?
  305. * Publishing action:: Setting the function doing the publishing
  306. * Publishing options:: Tweaking HTML export
  307. * Publishing links:: Which links keep working after publishing?
  308. * Sitemap:: Generating a list of all pages
  309. * Generating an index:: An index that reaches across pages
  310. Sample configuration
  311. * Simple example:: One-component publishing
  312. * Complex example:: A multi-component publishing example
  313. Miscellaneous
  314. * Completion:: M-TAB knows what you need
  315. * Speed keys:: Electic commands at the beginning of a headline
  316. * Customization:: Adapting Org to your taste
  317. * In-buffer settings:: Overview of the #+KEYWORDS
  318. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  319. * Clean view:: Getting rid of leading stars in the outline
  320. * TTY keys:: Using Org on a tty
  321. * Interaction:: Other Emacs packages
  322. Interaction with other packages
  323. * Cooperation:: Packages Org cooperates with
  324. * Conflicts:: Packages that lead to conflicts
  325. Hacking
  326. * Hooks:: Who to reach into Org's internals
  327. * Add-on packages:: Available extensions
  328. * Adding hyperlink types:: New custom link types
  329. * Context-sensitive commands:: How to add functionality to such commands
  330. * Tables in arbitrary syntax:: Orgtbl for La@TeX{} and other programs
  331. * Dynamic blocks:: Automatically filled blocks
  332. * Special agenda views:: Customized views
  333. * Extracting agenda information:: Postprocessing of agenda information
  334. * Using the property API:: Writing programs that use entry properties
  335. * Using the mapping API:: Mapping over all or selected entries
  336. Tables and lists in arbitrary syntax
  337. * Radio tables:: Sending and receiving radio tables
  338. * A LaTeX example:: Step by step, almost a tutorial
  339. * Translator functions:: Copy and modify
  340. * Radio lists:: Doing the same for lists
  341. MobileOrg
  342. * Setting up the staging area:: Where to interact with the mobile device
  343. * Pushing to MobileOrg:: Uploading Org files and agendas
  344. * Pulling from MobileOrg:: Integrating captured and flagged items
  345. @end detailmenu
  346. @end menu
  347. @node Introduction, Document Structure, Top, Top
  348. @chapter Introduction
  349. @cindex introduction
  350. @menu
  351. * Summary:: Brief summary of what Org does
  352. * Installation:: How to install a downloaded version of Org
  353. * Activation:: How to activate Org for certain buffers
  354. * Feedback:: Bug reports, ideas, patches etc.
  355. * Conventions:: Type-setting conventions in the manual
  356. @end menu
  357. @node Summary, Installation, Introduction, Introduction
  358. @section Summary
  359. @cindex summary
  360. Org is a mode for keeping notes, maintaining TODO lists, and doing
  361. project planning with a fast and effective plain-text system.
  362. Org develops organizational tasks around NOTES files that contain
  363. lists or information about projects as plain text. Org is
  364. implemented on top of Outline mode, which makes it possible to keep the
  365. content of large files well structured. Visibility cycling and
  366. structure editing help to work with the tree. Tables are easily created
  367. with a built-in table editor. Org supports TODO items, deadlines,
  368. timestamps, and scheduling. It dynamically compiles entries into an
  369. agenda that utilizes and smoothly integrates much of the Emacs calendar
  370. and diary. Plain text URL-like links connect to websites, emails,
  371. Usenet messages, BBDB entries, and any files related to the projects.
  372. For printing and sharing of notes, an Org file can be exported as a
  373. structured ASCII file, as HTML, or (TODO and agenda items only) as an
  374. iCalendar file. It can also serve as a publishing tool for a set of
  375. linked web pages.
  376. An important design aspect that distinguishes Org from, for example,
  377. Planner/Muse is that it encourages you to store every piece of information
  378. only once. In Planner, you have project pages, day pages and possibly
  379. other files, duplicating some information such as tasks. In Org,
  380. you only have notes files. In your notes you mark entries as tasks, and
  381. label them with tags and timestamps. All necessary lists, like a
  382. schedule for the day, the agenda for a meeting, tasks lists selected by
  383. tags, etc., are created dynamically when you need them.
  384. Org keeps simple things simple. When first fired up, it should
  385. feel like a straightforward, easy to use outliner. Complexity is not
  386. imposed, but a large amount of functionality is available when you need
  387. it. Org is a toolbox and can be used in different ways, for
  388. example as:
  389. @example
  390. @r{@bullet{} an outline extension with visibility cycling and structure editing}
  391. @r{@bullet{} an ASCII system and table editor for taking structured notes}
  392. @r{@bullet{} an ASCII table editor with spreadsheet-like capabilities}
  393. @r{@bullet{} a TODO list editor}
  394. @r{@bullet{} a full agenda and planner with deadlines and work scheduling}
  395. @pindex GTD, Getting Things Done
  396. @r{@bullet{} an environment to implement David Allen's GTD system}
  397. @r{@bullet{} a basic database application}
  398. @r{@bullet{} a simple hypertext system, with HTML and La@TeX{} export}
  399. @r{@bullet{} a publishing tool to create a set of interlinked webpages}
  400. @r{@bullet{} an environment for literate programming}
  401. @end example
  402. Org's automatic, context-sensitive table editor with spreadsheet
  403. capabilities can be integrated into any major mode by activating the
  404. minor Orgtbl mode. Using a translation step, it can be used to maintain
  405. tables in arbitrary file types, for example in La@TeX{}. The structure
  406. editing and list creation capabilities can be used outside Org with
  407. the minor Orgstruct mode.
  408. @cindex FAQ
  409. There is a website for Org which provides links to the newest
  410. version of Org, as well as additional information, frequently asked
  411. questions (FAQ), links to tutorials, etc@. This page is located at
  412. @uref{http://orgmode.org}.
  413. @page
  414. @node Installation, Activation, Summary, Introduction
  415. @section Installation
  416. @cindex installation
  417. @cindex XEmacs
  418. @b{Important:} @i{If you are using a version of Org that is part of the Emacs
  419. distribution or an XEmacs package, please skip this section and go directly
  420. to @ref{Activation}.}
  421. If you have downloaded Org from the Web, either as a distribution @file{.zip}
  422. or @file{.tar} file, or as a Git archive, you must take the following steps
  423. to install it: go into the unpacked Org distribution directory and edit the
  424. top section of the file @file{Makefile}. You must set the name of the Emacs
  425. binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
  426. directories where local Lisp and Info files are kept. If you don't have
  427. access to the system-wide directories, you can simply run Org directly from
  428. the distribution directory by adding the @file{lisp} subdirectory to the
  429. Emacs load path. To do this, add the following line to @file{.emacs}:
  430. @example
  431. (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
  432. @end example
  433. @noindent
  434. If you plan to use code from the @file{contrib} subdirectory, do a similar
  435. step for this directory:
  436. @example
  437. (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
  438. @end example
  439. @sp 2
  440. @cartouche
  441. XEmacs users now need to install the file @file{noutline.el} from
  442. the @file{xemacs} sub-directory of the Org distribution. Use the
  443. command:
  444. @example
  445. make install-noutline
  446. @end example
  447. @end cartouche
  448. @sp 2
  449. @noindent Now byte-compile the Lisp files with the shell command:
  450. @example
  451. make
  452. @end example
  453. @noindent If you are running Org from the distribution directory, this is
  454. all. If you want to install Org into the system directories, use (as
  455. administrator)
  456. @example
  457. make install
  458. @end example
  459. Installing Info files is system dependent, because of differences in the
  460. @file{install-info} program. In Debian it copies the info files into the
  461. correct directory and modifies the info directory file. In many other
  462. systems, the files need to be copied to the correct directory separately, and
  463. @file{install-info} then only modifies the directory file. Check your system
  464. documentation to find out which of the following commands you need:
  465. @example
  466. make install-info
  467. make install-info-debian
  468. @end example
  469. Then add the following line to @file{.emacs}. It is needed so that
  470. Emacs can autoload functions that are located in files not immediately loaded
  471. when Org-mode starts.
  472. @lisp
  473. (require 'org-install)
  474. @end lisp
  475. Do not forget to activate Org as described in the following section.
  476. @page
  477. @node Activation, Feedback, Installation, Introduction
  478. @section Activation
  479. @cindex activation
  480. @cindex autoload
  481. @cindex global key bindings
  482. @cindex key bindings, global
  483. @iftex
  484. @b{Important:} @i{If you use copy-and-paste to copy Lisp code from the
  485. PDF documentation as viewed by some PDF viewers to your @file{.emacs} file, the
  486. single-quote character comes out incorrectly and the code will not work.
  487. You need to fix the single-quotes by hand, or copy from Info
  488. documentation.}
  489. @end iftex
  490. Add the following lines to your @file{.emacs} file. The last three lines
  491. define @emph{global} keys for the commands @command{org-store-link},
  492. @command{org-agenda}, and @command{org-iswitchb}---please choose suitable
  493. keys yourself.
  494. @lisp
  495. ;; The following lines are always needed. Choose your own keys.
  496. (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  497. (global-set-key "\C-cl" 'org-store-link)
  498. (global-set-key "\C-ca" 'org-agenda)
  499. (global-set-key "\C-cb" 'org-iswitchb)
  500. @end lisp
  501. Furthermore, you must activate @code{font-lock-mode} in Org
  502. buffers, because significant functionality depends on font-locking being
  503. active. You can do this with either one of the following two lines
  504. (XEmacs users must use the second option):
  505. @lisp
  506. (global-font-lock-mode 1) ; for all buffers
  507. (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
  508. @end lisp
  509. @cindex Org mode, turning on
  510. With this setup, all files with extension @samp{.org} will be put
  511. into Org mode. As an alternative, make the first line of a file look
  512. like this:
  513. @example
  514. MY PROJECTS -*- mode: org; -*-
  515. @end example
  516. @vindex org-insert-mode-line-in-empty-file
  517. @noindent which will select Org mode for this buffer no matter what
  518. the file's name is. See also the variable
  519. @code{org-insert-mode-line-in-empty-file}.
  520. Many commands in Org work on the region if the region is @i{active}. To make
  521. use of this, you need to have @code{transient-mark-mode}
  522. (@code{zmacs-regions} in XEmacs) turned on. In Emacs 23 this is the default,
  523. in Emacs 22 you need to do this yourself with
  524. @lisp
  525. (transient-mark-mode 1)
  526. @end lisp
  527. @noindent If you do not like @code{transient-mark-mode}, you can create an
  528. active region by using the mouse to select a region, or pressing
  529. @kbd{C-@key{SPC}} twice before moving the cursor.
  530. @node Feedback, Conventions, Activation, Introduction
  531. @section Feedback
  532. @cindex feedback
  533. @cindex bug reports
  534. @cindex maintainer
  535. @cindex author
  536. If you find problems with Org, or if you have questions, remarks, or ideas
  537. about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}.
  538. If you are not a member of the mailing list, your mail will be passed to the
  539. list after a moderator has approved it.
  540. For bug reports, please provide as much information as possible, including
  541. the version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org
  542. (@kbd{M-x org-version @key{RET}}), as well as the Org related setup in
  543. @file{.emacs}. The easiest way to do this is to use the command
  544. @example
  545. @kbd{M-x org-submit-bug-report}
  546. @end example
  547. @noindent which will put all this information into an Emacs mail buffer so
  548. that you only need to add your description. If you re not sending the Email
  549. from within Emacs, please copy and paste the content into your Email program.
  550. If an error occurs, a backtrace can be very useful (see below on how to
  551. create one). Often a small example file helps, along with clear information
  552. about:
  553. @enumerate
  554. @item What exactly did you do?
  555. @item What did you expect to happen?
  556. @item What happened instead?
  557. @end enumerate
  558. @noindent Thank you for helping to improve this mode.
  559. @subsubheading How to create a useful backtrace
  560. @cindex backtrace of an error
  561. If working with Org produces an error with a message you don't
  562. understand, you may have hit a bug. The best way to report this is by
  563. providing, in addition to what was mentioned above, a @emph{backtrace}.
  564. This is information from the built-in debugger about where and how the
  565. error occurred. Here is how to produce a useful backtrace:
  566. @enumerate
  567. @item
  568. Reload uncompiled versions of all Org-mode Lisp files. The backtrace
  569. contains much more information if it is produced with uncompiled code.
  570. To do this, use
  571. @example
  572. C-u M-x org-reload RET
  573. @end example
  574. @noindent
  575. or select @code{Org -> Refresh/Reload -> Reload Org uncompiled} from the
  576. menu.
  577. @item
  578. Go to the @code{Options} menu and select @code{Enter Debugger on Error}
  579. (XEmacs has this option in the @code{Troubleshooting} sub-menu).
  580. @item
  581. Do whatever you have to do to hit the error. Don't forget to
  582. document the steps you take.
  583. @item
  584. When you hit the error, a @file{*Backtrace*} buffer will appear on the
  585. screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
  586. attach it to your bug report.
  587. @end enumerate
  588. @node Conventions, , Feedback, Introduction
  589. @section Typesetting conventions used in this manual
  590. Org uses three types of keywords: TODO keywords, tags, and property
  591. names. In this manual we use the following conventions:
  592. @table @code
  593. @item TODO
  594. @itemx WAITING
  595. TODO keywords are written with all capitals, even if they are
  596. user-defined.
  597. @item boss
  598. @itemx ARCHIVE
  599. User-defined tags are written in lowercase; built-in tags with special
  600. meaning are written with all capitals.
  601. @item Release
  602. @itemx PRIORITY
  603. User-defined properties are capitalized; built-in properties with
  604. special meaning are written with all capitals.
  605. @end table
  606. @node Document Structure, Tables, Introduction, Top
  607. @chapter Document Structure
  608. @cindex document structure
  609. @cindex structure of document
  610. Org is based on Outline mode and provides flexible commands to
  611. edit the structure of the document.
  612. @menu
  613. * Outlines:: Org is based on Outline mode
  614. * Headlines:: How to typeset Org tree headlines
  615. * Visibility cycling:: Show and hide, much simplified
  616. * Motion:: Jumping to other headlines
  617. * Structure editing:: Changing sequence and level of headlines
  618. * Sparse trees:: Matches embedded in context
  619. * Plain lists:: Additional structure within an entry
  620. * Drawers:: Tucking stuff away
  621. * Blocks:: Folding blocks
  622. * Footnotes:: How footnotes are defined in Org's syntax
  623. * Orgstruct mode:: Structure editing outside Org
  624. @end menu
  625. @node Outlines, Headlines, Document Structure, Document Structure
  626. @section Outlines
  627. @cindex outlines
  628. @cindex Outline mode
  629. Org is implemented on top of Outline mode. Outlines allow a
  630. document to be organized in a hierarchical structure, which (at least
  631. for me) is the best representation of notes and thoughts. An overview
  632. of this structure is achieved by folding (hiding) large parts of the
  633. document to show only the general document structure and the parts
  634. currently being worked on. Org greatly simplifies the use of
  635. outlines by compressing the entire show/hide functionality into a single
  636. command, @command{org-cycle}, which is bound to the @key{TAB} key.
  637. @node Headlines, Visibility cycling, Outlines, Document Structure
  638. @section Headlines
  639. @cindex headlines
  640. @cindex outline tree
  641. @vindex org-special-ctrl-a/e
  642. Headlines define the structure of an outline tree. The headlines in
  643. Org start with one or more stars, on the left margin@footnote{See
  644. the variable @code{org-special-ctrl-a/e} to configure special behavior
  645. of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
  646. @example
  647. * Top level headline
  648. ** Second level
  649. *** 3rd level
  650. some text
  651. *** 3rd level
  652. more text
  653. * Another top level headline
  654. @end example
  655. @noindent Some people find the many stars too noisy and would prefer an
  656. outline that has whitespace followed by a single star as headline
  657. starters. @ref{Clean view}, describes a setup to realize this.
  658. @vindex org-cycle-separator-lines
  659. An empty line after the end of a subtree is considered part of it and
  660. will be hidden when the subtree is folded. However, if you leave at
  661. least two empty lines, one empty line will remain visible after folding
  662. the subtree, in order to structure the collapsed view. See the
  663. variable @code{org-cycle-separator-lines} to modify this behavior.
  664. @node Visibility cycling, Motion, Headlines, Document Structure
  665. @section Visibility cycling
  666. @cindex cycling, visibility
  667. @cindex visibility cycling
  668. @cindex trees, visibility
  669. @cindex show hidden text
  670. @cindex hide text
  671. Outlines make it possible to hide parts of the text in the buffer.
  672. Org uses just two commands, bound to @key{TAB} and
  673. @kbd{S-@key{TAB}} to change the visibility in the buffer.
  674. @cindex subtree visibility states
  675. @cindex subtree cycling
  676. @cindex folded, subtree visibility state
  677. @cindex children, subtree visibility state
  678. @cindex subtree, subtree visibility state
  679. @table @kbd
  680. @kindex @key{TAB}
  681. @item @key{TAB}
  682. @emph{Subtree cycling}: Rotate current subtree among the states
  683. @example
  684. ,-> FOLDED -> CHILDREN -> SUBTREE --.
  685. '-----------------------------------'
  686. @end example
  687. @vindex org-cycle-emulate-tab
  688. @vindex org-cycle-global-at-bob
  689. The cursor must be on a headline for this to work@footnote{see, however,
  690. the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
  691. beginning of the buffer and the first line is not a headline, then
  692. @key{TAB} actually runs global cycling (see below)@footnote{see the
  693. option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
  694. argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
  695. @cindex global visibility states
  696. @cindex global cycling
  697. @cindex overview, global visibility state
  698. @cindex contents, global visibility state
  699. @cindex show all, global visibility state
  700. @kindex S-@key{TAB}
  701. @item S-@key{TAB}
  702. @itemx C-u @key{TAB}
  703. @emph{Global cycling}: Rotate the entire buffer among the states
  704. @example
  705. ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
  706. '--------------------------------------'
  707. @end example
  708. When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
  709. CONTENTS view up to headlines of level N will be shown. Note that inside
  710. tables, @kbd{S-@key{TAB}} jumps to the previous field.
  711. @cindex show all, command
  712. @kindex C-u C-u C-u @key{TAB}
  713. @item C-u C-u C-u @key{TAB}
  714. Show all, including drawers.
  715. @kindex C-c C-r
  716. @item C-c C-r
  717. Reveal context around point, showing the current entry, the following heading
  718. and the hierarchy above. Useful for working near a location that has been
  719. exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
  720. (@pxref{Agenda commands}). With a prefix argument show, on each
  721. level, all sibling headings. With double prefix arg, also show the entire
  722. subtree of the parent.
  723. @kindex C-c C-x b
  724. @item C-c C-x b
  725. Show the current subtree in an indirect buffer@footnote{The indirect
  726. buffer
  727. @ifinfo
  728. (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
  729. @end ifinfo
  730. @ifnotinfo
  731. (see the Emacs manual for more information about indirect buffers)
  732. @end ifnotinfo
  733. will contain the entire buffer, but will be narrowed to the current
  734. tree. Editing the indirect buffer will also change the original buffer,
  735. but without affecting visibility in that buffer.}. With a numeric
  736. prefix argument N, go up to level N and then take that tree. If N is
  737. negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
  738. the previously used indirect buffer.
  739. @end table
  740. @vindex org-startup-folded
  741. @cindex @code{overview}, STARTUP keyword
  742. @cindex @code{content}, STARTUP keyword
  743. @cindex @code{showall}, STARTUP keyword
  744. @cindex @code{showeverything}, STARTUP keyword
  745. When Emacs first visits an Org file, the global state is set to
  746. OVERVIEW, i.e. only the top level headlines are visible. This can be
  747. configured through the variable @code{org-startup-folded}, or on a
  748. per-file basis by adding one of the following lines anywhere in the
  749. buffer:
  750. @example
  751. #+STARTUP: overview
  752. #+STARTUP: content
  753. #+STARTUP: showall
  754. #+STARTUP: showeverything
  755. @end example
  756. @cindex property, VISIBILITY
  757. @noindent
  758. Furthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties
  759. and Columns}) will get their visibility adapted accordingly. Allowed values
  760. for this property are @code{folded}, @code{children}, @code{content}, and
  761. @code{all}.
  762. @table @kbd
  763. @kindex C-u C-u @key{TAB}
  764. @item C-u C-u @key{TAB}
  765. Switch back to the startup visibility of the buffer, i.e. whatever is
  766. requested by startup options and @samp{VISIBILITY} properties in individual
  767. entries.
  768. @end table
  769. @node Motion, Structure editing, Visibility cycling, Document Structure
  770. @section Motion
  771. @cindex motion, between headlines
  772. @cindex jumping, to headlines
  773. @cindex headline navigation
  774. The following commands jump to other headlines in the buffer.
  775. @table @kbd
  776. @kindex C-c C-n
  777. @item C-c C-n
  778. Next heading.
  779. @kindex C-c C-p
  780. @item C-c C-p
  781. Previous heading.
  782. @kindex C-c C-f
  783. @item C-c C-f
  784. Next heading same level.
  785. @kindex C-c C-b
  786. @item C-c C-b
  787. Previous heading same level.
  788. @kindex C-c C-u
  789. @item C-c C-u
  790. Backward to higher level heading.
  791. @kindex C-c C-j
  792. @item C-c C-j
  793. Jump to a different place without changing the current outline
  794. visibility. Shows the document structure in a temporary buffer, where
  795. you can use the following keys to find your destination:
  796. @vindex org-goto-auto-isearch
  797. @example
  798. @key{TAB} @r{Cycle visibility.}
  799. @key{down} / @key{up} @r{Next/previous visible headline.}
  800. @key{RET} @r{Select this location.}
  801. @kbd{/} @r{Do a Sparse-tree search}
  802. @r{The following keys work if you turn off @code{org-goto-auto-isearch}}
  803. n / p @r{Next/previous visible headline.}
  804. f / b @r{Next/previous headline same level.}
  805. u @r{One level up.}
  806. 0-9 @r{Digit argument.}
  807. q @r{Quit}
  808. @end example
  809. @vindex org-goto-interface
  810. @noindent
  811. See also the variable @code{org-goto-interface}.
  812. @end table
  813. @node Structure editing, Sparse trees, Motion, Document Structure
  814. @section Structure editing
  815. @cindex structure editing
  816. @cindex headline, promotion and demotion
  817. @cindex promotion, of subtrees
  818. @cindex demotion, of subtrees
  819. @cindex subtree, cut and paste
  820. @cindex pasting, of subtrees
  821. @cindex cutting, of subtrees
  822. @cindex copying, of subtrees
  823. @cindex sorting, of subtrees
  824. @cindex subtrees, cut and paste
  825. @table @kbd
  826. @kindex M-@key{RET}
  827. @item M-@key{RET}
  828. @vindex org-M-RET-may-split-line
  829. Insert new heading with same level as current. If the cursor is in a
  830. plain list item, a new item is created (@pxref{Plain lists}). To force
  831. creation of a new headline, use a prefix argument, or first press @key{RET}
  832. to get to the beginning of the next line. When this command is used in
  833. the middle of a line, the line is split and the rest of the line becomes
  834. the new headline@footnote{If you do not want the line to be split,
  835. customize the variable @code{org-M-RET-may-split-line}.}. If the
  836. command is used at the beginning of a headline, the new headline is
  837. created before the current line. If at the beginning of any other line,
  838. the content of that line is made the new heading. If the command is
  839. used at the end of a folded subtree (i.e. behind the ellipses at the end
  840. of a headline), then a headline like the current one will be inserted
  841. after the end of the subtree.
  842. @kindex C-@key{RET}
  843. @item C-@key{RET}
  844. Just like @kbd{M-@key{RET}}, except when adding a new heading below the
  845. current heading, the new heading is placed after the body instead of before
  846. it. This command works from anywhere in the entry.
  847. @kindex M-S-@key{RET}
  848. @item M-S-@key{RET}
  849. @vindex org-treat-insert-todo-heading-as-state-change
  850. Insert new TODO entry with same level as current heading. See also the
  851. variable @code{org-treat-insert-todo-heading-as-state-change}.
  852. @kindex C-S-@key{RET}
  853. @item C-S-@key{RET}
  854. Insert new TODO entry with same level as current heading. Like
  855. @kbd{C-@key{RET}}, the new headline will be inserted after the current
  856. subtree.
  857. @kindex @key{TAB}
  858. @item @key{TAB} @r{in new, empty entry}
  859. In a new entry with no text yet, the first @key{TAB} demotes the entry to
  860. become a child of the previous one. The next @key{TAB} makes it a parent,
  861. and so on, all the way to top level. Yet another @key{TAB}, and you are back
  862. to the initial level.
  863. @kindex M-@key{left}
  864. @item M-@key{left}
  865. Promote current heading by one level.
  866. @kindex M-@key{right}
  867. @item M-@key{right}
  868. Demote current heading by one level.
  869. @kindex M-S-@key{left}
  870. @item M-S-@key{left}
  871. Promote the current subtree by one level.
  872. @kindex M-S-@key{right}
  873. @item M-S-@key{right}
  874. Demote the current subtree by one level.
  875. @kindex M-S-@key{up}
  876. @item M-S-@key{up}
  877. Move subtree up (swap with previous subtree of same
  878. level).
  879. @kindex M-S-@key{down}
  880. @item M-S-@key{down}
  881. Move subtree down (swap with next subtree of same level).
  882. @kindex C-c C-x C-w
  883. @item C-c C-x C-w
  884. Kill subtree, i.e. remove it from buffer but save in kill ring.
  885. With a numeric prefix argument N, kill N sequential subtrees.
  886. @kindex C-c C-x M-w
  887. @item C-c C-x M-w
  888. Copy subtree to kill ring. With a numeric prefix argument N, copy the N
  889. sequential subtrees.
  890. @kindex C-c C-x C-y
  891. @item C-c C-x C-y
  892. Yank subtree from kill ring. This does modify the level of the subtree to
  893. make sure the tree fits in nicely at the yank position. The yank level can
  894. also be specified with a numeric prefix argument, or by yanking after a
  895. headline marker like @samp{****}.
  896. @kindex C-y
  897. @item C-y
  898. @vindex org-yank-adjusted-subtrees
  899. @vindex org-yank-folded-subtrees
  900. Depending on the variables @code{org-yank-adjusted-subtrees} and
  901. @code{org-yank-folded-subtrees}, Org's internal @code{yank} command will
  902. paste subtrees folded and in a clever way, using the same command as @kbd{C-c
  903. C-x C-y}. With the default settings, no level adjustment will take place,
  904. but the yanked tree will be folded unless doing so would swallow text
  905. previously visible. Any prefix argument to this command will force a normal
  906. @code{yank} to be executed, with the prefix passed along. A good way to
  907. force a normal yank is @kbd{C-u C-y}. If you use @code{yank-pop} after a
  908. yank, it will yank previous kill items plainly, without adjustment and
  909. folding.
  910. @kindex C-c C-x c
  911. @item C-c C-x c
  912. Clone a subtree by making a number of sibling copies of it. You will be
  913. prompted for the number of copies to make, and you can also specify if any
  914. timestamps in the entry should be shifted. This can be useful, for example,
  915. to create a number of tasks related to a series of lectures to prepare. For
  916. more details, see the docstring of the command
  917. @code{org-clone-subtree-with-time-shift}.
  918. @kindex C-c C-w
  919. @item C-c C-w
  920. Refile entry or region to a different location. @xref{Refiling notes}.
  921. @kindex C-c ^
  922. @item C-c ^
  923. Sort same-level entries. When there is an active region, all entries in the
  924. region will be sorted. Otherwise the children of the current headline are
  925. sorted. The command prompts for the sorting method, which can be
  926. alphabetically, numerically, by time (first timestamp with active preferred,
  927. creation time, scheduled time, deadline time), by priority, by TODO keyword
  928. (in the sequence the keywords have been defined in the setup) or by the value
  929. of a property. Reverse sorting is possible as well. You can also supply
  930. your own function to extract the sorting key. With a @kbd{C-u} prefix,
  931. sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes, duplicate
  932. entries will also be removed.
  933. @kindex C-x n s
  934. @item C-x n s
  935. Narrow buffer to current subtree.
  936. @kindex C-x n w
  937. @item C-x n w
  938. Widen buffer to remove narrowing.
  939. @kindex C-c *
  940. @item C-c *
  941. Turn a normal line or plain list item into a headline (so that it becomes a
  942. subheading at its location). Also turn a headline into a normal line by
  943. removing the stars. If there is an active region, turn all lines in the
  944. region into headlines. If the first line in the region was an item, turn
  945. only the item lines into headlines. Finally, if the first line is a
  946. headline, remove the stars from all headlines in the region.
  947. @end table
  948. @cindex region, active
  949. @cindex active region
  950. @cindex transient mark mode
  951. When there is an active region (Transient Mark mode), promotion and
  952. demotion work on all headlines in the region. To select a region of
  953. headlines, it is best to place both point and mark at the beginning of a
  954. line, mark at the beginning of the first headline, and point at the line
  955. just after the last headline to change. Note that when the cursor is
  956. inside a table (@pxref{Tables}), the Meta-Cursor keys have different
  957. functionality.
  958. @node Sparse trees, Plain lists, Structure editing, Document Structure
  959. @section Sparse trees
  960. @cindex sparse trees
  961. @cindex trees, sparse
  962. @cindex folding, sparse trees
  963. @cindex occur, command
  964. @vindex org-show-hierarchy-above
  965. @vindex org-show-following-heading
  966. @vindex org-show-siblings
  967. @vindex org-show-entry-below
  968. An important feature of Org mode is the ability to construct @emph{sparse
  969. trees} for selected information in an outline tree, so that the entire
  970. document is folded as much as possible, but the selected information is made
  971. visible along with the headline structure above it@footnote{See also the
  972. variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
  973. @code{org-show-siblings}, and @code{org-show-entry-below} for detailed
  974. control on how much context is shown around each match.}. Just try it out
  975. and you will see immediately how it works.
  976. Org mode contains several commands creating such trees, all these
  977. commands can be accessed through a dispatcher:
  978. @table @kbd
  979. @kindex C-c /
  980. @item C-c /
  981. This prompts for an extra key to select a sparse-tree creating command.
  982. @kindex C-c / r
  983. @item C-c / r
  984. @vindex org-remove-highlights-with-change
  985. Occur. Prompts for a regexp and shows a sparse tree with all matches. If
  986. the match is in a headline, the headline is made visible. If the match is in
  987. the body of an entry, headline and body are made visible. In order to
  988. provide minimal context, also the full hierarchy of headlines above the match
  989. is shown, as well as the headline following the match. Each match is also
  990. highlighted; the highlights disappear when the buffer is changed by an
  991. editing command@footnote{This depends on the option
  992. @code{org-remove-highlights-with-change}}, or by pressing @kbd{C-c C-c}.
  993. When called with a @kbd{C-u} prefix argument, previous highlights are kept,
  994. so several calls to this command can be stacked.
  995. @end table
  996. @noindent
  997. @vindex org-agenda-custom-commands
  998. For frequently used sparse trees of specific search strings, you can
  999. use the variable @code{org-agenda-custom-commands} to define fast
  1000. keyboard access to specific sparse trees. These commands will then be
  1001. accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
  1002. For example:
  1003. @lisp
  1004. (setq org-agenda-custom-commands
  1005. '(("f" occur-tree "FIXME")))
  1006. @end lisp
  1007. @noindent will define the key @kbd{C-c a f} as a shortcut for creating
  1008. a sparse tree matching the string @samp{FIXME}.
  1009. The other sparse tree commands select headings based on TODO keywords,
  1010. tags, or properties and will be discussed later in this manual.
  1011. @kindex C-c C-e v
  1012. @cindex printing sparse trees
  1013. @cindex visible text, printing
  1014. To print a sparse tree, you can use the Emacs command
  1015. @code{ps-print-buffer-with-faces} which does not print invisible parts
  1016. of the document @footnote{This does not work under XEmacs, because
  1017. XEmacs uses selective display for outlining, not text properties.}.
  1018. Or you can use the command @kbd{C-c C-e v} to export only the visible
  1019. part of the document and print the resulting file.
  1020. @node Plain lists, Drawers, Sparse trees, Document Structure
  1021. @section Plain lists
  1022. @cindex plain lists
  1023. @cindex lists, plain
  1024. @cindex lists, ordered
  1025. @cindex ordered lists
  1026. Within an entry of the outline tree, hand-formatted lists can provide
  1027. additional structure. They also provide a way to create lists of
  1028. checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
  1029. and the HTML exporter (@pxref{Exporting}) parses and formats them.
  1030. Org knows ordered lists, unordered lists, and description lists.
  1031. @itemize @bullet
  1032. @item
  1033. @emph{Unordered} list items start with @samp{-}, @samp{+}, or
  1034. @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
  1035. they will be seen as top-level headlines. Also, when you are hiding leading
  1036. stars to get a clean outline view, plain list items starting with a star are
  1037. visually indistinguishable from true headlines. In short: even though
  1038. @samp{*} is supported, it may be better to not use it for plain list items.}
  1039. as bullets.
  1040. @item
  1041. @emph{Ordered} list items start with a numeral followed by either a period or
  1042. a right parenthesis, such as @samp{1.} or @samp{1)}.
  1043. @item
  1044. @emph{Description} list items are unordered list items, and contain the
  1045. separator @samp{ :: } to separate the description @emph{term} from the
  1046. description.
  1047. @end itemize
  1048. @vindex org-empty-line-terminates-plain-lists
  1049. Items belonging to the same list must have the same indentation on the first
  1050. line. In particular, if an ordered list reaches number @samp{10.}, then the
  1051. 2--digit numbers must be written left-aligned with the other numbers in the
  1052. list. Indentation also determines the end of a list item. It ends before
  1053. the next line that is indented like the bullet/number, or less. Empty lines
  1054. are part of the previous item, so you can have several paragraphs in one
  1055. item. If you would like an empty line to terminate all currently open plain
  1056. lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
  1057. Here is an example:
  1058. @example
  1059. @group
  1060. ** Lord of the Rings
  1061. My favorite scenes are (in this order)
  1062. 1. The attack of the Rohirrim
  1063. 2. Eowyn's fight with the witch king
  1064. + this was already my favorite scene in the book
  1065. + I really like Miranda Otto.
  1066. 3. Peter Jackson being shot by Legolas
  1067. - on DVD only
  1068. He makes a really funny face when it happens.
  1069. But in the end, no individual scenes matter but the film as a whole.
  1070. Important actors in this film are:
  1071. - @b{Elijah Wood} :: He plays Frodo
  1072. - @b{Sean Austin} :: He plays Sam, Frodo's friend. I still remember
  1073. him very well from his role as Mikey Walsh in @i{The Goonies}.
  1074. @end group
  1075. @end example
  1076. Org supports these lists by tuning filling and wrapping commands to deal with
  1077. them correctly@footnote{Org only changes the filling settings for Emacs. For
  1078. XEmacs, you should use Kyle E. Jones' @file{filladapt.el}. To turn this on,
  1079. put into @file{.emacs}: @code{(require 'filladapt)}}, and by exporting them
  1080. properly (@pxref{Exporting}). Since indentation is what governs the
  1081. structure of these lists, many structural constructs like @code{#+BEGIN_...}
  1082. blocks can be indented to signal that they should be part of a list item.
  1083. The following commands act on items when the cursor is in the first line
  1084. of an item (the line with the bullet or number).
  1085. @table @kbd
  1086. @kindex @key{TAB}
  1087. @item @key{TAB}
  1088. @vindex org-cycle-include-plain-lists
  1089. Items can be folded just like headline levels. Normally this works only if
  1090. the cursor is on a plain list item. For more details, see the variable
  1091. @code{org-cycle-include-plain-lists}. to @code{integrate}, plain list items
  1092. will be treated like low-level. The level of an item is then given by the
  1093. indentation of the bullet/number. Items are always subordinate to real
  1094. headlines, however; the hierarchies remain completely separated.
  1095. If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
  1096. fixes the indentation of the current line in a heuristic way.
  1097. @kindex M-@key{RET}
  1098. @item M-@key{RET}
  1099. @vindex org-M-RET-may-split-line
  1100. Insert new item at current level. With a prefix argument, force a new
  1101. heading (@pxref{Structure editing}). If this command is used in the middle
  1102. of a line, the line is @emph{split} and the rest of the line becomes the new
  1103. item@footnote{If you do not want the line to be split, customize the variable
  1104. @code{org-M-RET-may-split-line}.}. If this command is executed in the
  1105. @emph{whitespace before a bullet or number}, the new item is created
  1106. @emph{before} the current item. If the command is executed in the white
  1107. space before the text that is part of an item but does not contain the
  1108. bullet, a bullet is added to the current line.
  1109. @kindex M-S-@key{RET}
  1110. @item M-S-@key{RET}
  1111. Insert a new item with a checkbox (@pxref{Checkboxes}).
  1112. @kindex @key{TAB}
  1113. @item @key{TAB} @r{in new, empty item}
  1114. In a new item with no text yet, the first @key{TAB} demotes the item to
  1115. become a child of the previous one. The next @key{TAB} makes it a parent,
  1116. and so on, all the way to the left margin. Yet another @key{TAB}, and you
  1117. are back to the initial level.
  1118. @kindex S-@key{up}
  1119. @kindex S-@key{down}
  1120. @item S-@key{up}
  1121. @itemx S-@key{down}
  1122. @cindex shift-selection-mode
  1123. @vindex org-support-shift-select
  1124. Jump to the previous/next item in the current list, but only if
  1125. @code{org-support-shift-select} is off. If not, you can still use paragraph
  1126. jumping commands like @kbd{C-@key{up}} and @kbd{C-@key{down}} to quite
  1127. similar effect.
  1128. @kindex M-S-@key{up}
  1129. @kindex M-S-@key{down}
  1130. @item M-S-@key{up}
  1131. @itemx M-S-@key{down}
  1132. Move the item including subitems up/down (swap with previous/next item
  1133. of same indentation). If the list is ordered, renumbering is
  1134. automatic.
  1135. @kindex M-S-@key{left}
  1136. @kindex M-S-@key{right}
  1137. @item M-S-@key{left}
  1138. @itemx M-S-@key{right}
  1139. Decrease/increase the indentation of the item, including subitems.
  1140. Initially, the item tree is selected based on current indentation.
  1141. When these commands are executed several times in direct succession,
  1142. the initially selected region is used, even if the new indentation
  1143. would imply a different hierarchy. To use the new hierarchy, break
  1144. the command chain with a cursor motion or so.
  1145. @kindex C-c C-c
  1146. @item C-c C-c
  1147. If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
  1148. state of the checkbox. If not, this command makes sure that all the
  1149. items on this list level use the same bullet. Furthermore, if this is
  1150. an ordered list, make sure the numbering is OK.
  1151. @kindex C-c -
  1152. @item C-c -
  1153. Cycle the entire list level through the different itemize/enumerate bullets
  1154. (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}). With a numeric prefix
  1155. argument N, select the Nth bullet from this list. If there is an active
  1156. region when calling this, all lines will be converted to list items. If the
  1157. first line already was a list item, any item markers will be removed from the
  1158. list. Finally, even without an active region, a normal line will be
  1159. converted into a list item.
  1160. @kindex C-c *
  1161. @item C-c *
  1162. Turn a plain list item into a headline (so that it becomes a subheading at
  1163. its location). @xref{Structure editing}, for a detailed explanation.
  1164. @kindex S-@key{left}
  1165. @kindex S-@key{right}
  1166. @item S-@key{left}/@key{right}
  1167. @vindex org-support-shift-select
  1168. This command also cycles bullet styles when the cursor in on the bullet or
  1169. anywhere in an item line, details depending on
  1170. @code{org-support-shift-select}.
  1171. @kindex C-c ^
  1172. @item C-c ^
  1173. Sort the plain list. You will be prompted for the sorting method:
  1174. numerically, alphabetically, by time, or by custom function.
  1175. @end table
  1176. @node Drawers, Blocks, Plain lists, Document Structure
  1177. @section Drawers
  1178. @cindex drawers
  1179. @cindex #+DRAWERS
  1180. @cindex visibility cycling, drawers
  1181. @vindex org-drawers
  1182. Sometimes you want to keep information associated with an entry, but you
  1183. normally don't want to see it. For this, Org mode has @emph{drawers}.
  1184. Drawers need to be configured with the variable
  1185. @code{org-drawers}@footnote{You can define drawers on a per-file basis
  1186. with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
  1187. look like this:
  1188. @example
  1189. ** This is a headline
  1190. Still outside the drawer
  1191. :DRAWERNAME:
  1192. This is inside the drawer.
  1193. :END:
  1194. After the drawer.
  1195. @end example
  1196. Visibility cycling (@pxref{Visibility cycling}) on the headline will hide and
  1197. show the entry, but keep the drawer collapsed to a single line. In order to
  1198. look inside the drawer, you need to move the cursor to the drawer line and
  1199. press @key{TAB} there. Org mode uses the @code{PROPERTIES} drawer for
  1200. storing properties (@pxref{Properties and Columns}), and you can also arrange
  1201. for state change notes (@pxref{Tracking TODO state changes}) and clock times
  1202. (@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}. If you
  1203. want to store a quick note in the LOGBOOK drawer, in a similar way as this is
  1204. done by state changes, use
  1205. @table @kbd
  1206. @kindex C-c C-z
  1207. @item C-c C-z
  1208. Add a time-stamped note to the LOGBOOK drawer.
  1209. @end table
  1210. @node Blocks, Footnotes, Drawers, Document Structure
  1211. @section Blocks
  1212. @vindex org-hide-block-startup
  1213. @cindex blocks, folding
  1214. Org-mode uses begin...end blocks for various purposes from including source
  1215. code examples (@pxref{Literal examples}) to capturing time logging
  1216. information (@pxref{Clocking work time}). These blocks can be folded and
  1217. unfolded by pressing TAB in the begin line. You can also get all blocks
  1218. folded at startup by configuring the variable @code{org-hide-block-startup}
  1219. or on a per-file basis by using
  1220. @cindex @code{hideblocks}, STARTUP keyword
  1221. @cindex @code{nohideblocks}, STARTUP keyword
  1222. @example
  1223. #+STARTUP: hideblocks
  1224. #+STARTUP: nohideblocks
  1225. @end example
  1226. @node Footnotes, Orgstruct mode, Blocks, Document Structure
  1227. @section Footnotes
  1228. @cindex footnotes
  1229. Org mode supports the creation of footnotes. In contrast to the
  1230. @file{footnote.el} package, Org mode's footnotes are designed for work on a
  1231. larger document, not only for one-off documents like emails. The basic
  1232. syntax is similar to the one used by @file{footnote.el}, i.e. a footnote is
  1233. defined in a paragraph that is started by a footnote marker in square
  1234. brackets in column 0, no indentation allowed. If you need a paragraph break
  1235. inside a footnote, use the La@TeX{} idiom @samp{\par}. The footnote reference
  1236. is simply the marker in square brackets, inside text. For example:
  1237. @example
  1238. The Org homepage[fn:1] now looks a lot better than it used to.
  1239. ...
  1240. [fn:1] The link is: http://orgmode.org
  1241. @end example
  1242. Org mode extends the number-based syntax to @emph{named} footnotes and
  1243. optional inline definition. Using plain numbers as markers (as
  1244. @file{footnote.el} does) is supported for backward compatibility, but not
  1245. encouraged because of possible conflicts with La@TeX{} snippets (@pxref{Embedded
  1246. LaTeX}). Here are the valid references:
  1247. @table @code
  1248. @item [1]
  1249. A plain numeric footnote marker. Compatible with @file{footnote.el}, but not
  1250. recommended because somthing like @samp{[1]} could easily be part of a code
  1251. snippet.
  1252. @item [fn:name]
  1253. A named footnote reference, where @code{name} is a unique label word, or, for
  1254. simplicity of automatic creation, a number.
  1255. @item [fn:: This is the inline definition of this footnote]
  1256. A La@TeX{}-like anonymous footnote where the definition is given directly at the
  1257. reference point.
  1258. @item [fn:name: a definition]
  1259. An inline definition of a footnote, which also specifies a name for the note.
  1260. Since Org allows multiple references to the same note, you can then use
  1261. @code{[fn:name]} to create additional references.
  1262. @end table
  1263. @vindex org-footnote-auto-label
  1264. Footnote labels can be created automatically, or you can create names yourself.
  1265. This is handled by the variable @code{org-footnote-auto-label} and its
  1266. corresponding @code{#+STARTUP} keywords, see the docstring of that variable
  1267. for details.
  1268. @noindent The following command handles footnotes:
  1269. @table @kbd
  1270. @kindex C-c C-x f
  1271. @item C-c C-x f
  1272. The footnote action command.
  1273. When the cursor is on a footnote reference, jump to the definition. When it
  1274. is at a definition, jump to the (first) reference.
  1275. @vindex org-footnote-define-inline
  1276. @vindex org-footnote-section
  1277. @vindex org-footnote-auto-adjust
  1278. Otherwise, create a new footnote. Depending on the variable
  1279. @code{org-footnote-define-inline}@footnote{The corresponding in-buffer
  1280. setting is: @code{#+STARTUP: fninline} or @code{#+STARTUP: nofninline}}, the
  1281. definition will be placed right into the text as part of the reference, or
  1282. separately into the location determined by the variable
  1283. @code{org-footnote-section}.
  1284. When this command is called with a prefix argument, a menu of additional
  1285. options is offered:
  1286. @example
  1287. s @r{Sort the footnote definitions by reference sequence. During editing,}
  1288. @r{Org makes no effort to sort footnote definitions into a particular}
  1289. @r{sequence. If you want them sorted, use this command, which will}
  1290. @r{also move entries according to @code{org-footnote-section}. Automatic}
  1291. @r{sorting after each insertion/deletion can be configured using the}
  1292. @r{variable @code{org-footnote-auto-adjust}.}
  1293. r @r{Renumber the simple @code{fn:N} footnotes. Automatic renumbering}
  1294. @r{after each insertion/deletion can be configured using the variable}
  1295. @r{@code{org-footnote-auto-adjust}.}
  1296. S @r{Short for first @code{r}, then @code{s} action.}
  1297. n @r{Normalize the footnotes by collecting all definitions (including}
  1298. @r{inline definitions) into a special section, and then numbering them}
  1299. @r{in sequence. The references will then also be numbers. This is}
  1300. @r{meant to be the final step before finishing a document (e.g. sending}
  1301. @r{off an email). The exporters do this automatically, and so could}
  1302. @r{something like @code{message-send-hook}.}
  1303. d @r{Delete the footnote at point, and all definitions of and references}
  1304. @r{to it.}
  1305. @end example
  1306. Depending on the variable @code{org-footnote-auto-adjust}@footnote{the
  1307. corresponding in-buffer options are @code{fnadjust} and @code{nofnadjust}.},
  1308. renumbering and sorting footnotes can be automatic after each insertion or
  1309. deletion.
  1310. @kindex C-c C-c
  1311. @item C-c C-c
  1312. If the cursor is on a footnote reference, jump to the definition. If it is a
  1313. the definition, jump back to the reference. When called at a footnote
  1314. location with a prefix argument, offer the same menu as @kbd{C-c C-x f}.
  1315. @kindex C-c C-o
  1316. @kindex mouse-1
  1317. @kindex mouse-2
  1318. @item C-c C-o @r{or} mouse-1/2
  1319. Footnote labels are also links to the corresponding definition/reference, and
  1320. you can use the usual commands to follow these links.
  1321. @end table
  1322. @node Orgstruct mode, , Footnotes, Document Structure
  1323. @section The Orgstruct minor mode
  1324. @cindex Orgstruct mode
  1325. @cindex minor mode for structure editing
  1326. If you like the intuitive way the Org mode structure editing and list
  1327. formatting works, you might want to use these commands in other modes like
  1328. Text mode or Mail mode as well. The minor mode @code{orgstruct-mode} makes
  1329. this possible. Toggle the mode with @kbd{M-x orgstruct-mode}, or
  1330. turn it on by default, for example in Mail mode, with one of:
  1331. @lisp
  1332. (add-hook 'mail-mode-hook 'turn-on-orgstruct)
  1333. (add-hook 'mail-mode-hook 'turn-on-orgstruct++)
  1334. @end lisp
  1335. When this mode is active and the cursor is on a line that looks to Org like a
  1336. headline or the first line of a list item, most structure editing commands
  1337. will work, even if the same keys normally have different functionality in the
  1338. major mode you are using. If the cursor is not in one of those special
  1339. lines, Orgstruct mode lurks silently in the shadow. When you use
  1340. @code{orgstruct++-mode}, Org will also export indentation and autofill
  1341. settings into that mode, and detect item context after the first line of an
  1342. item.
  1343. @node Tables, Hyperlinks, Document Structure, Top
  1344. @chapter Tables
  1345. @cindex tables
  1346. @cindex editing tables
  1347. Org comes with a fast and intuitive table editor. Spreadsheet-like
  1348. calculations are supported in connection with the Emacs @file{calc}
  1349. package
  1350. @ifinfo
  1351. (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
  1352. @end ifinfo
  1353. @ifnotinfo
  1354. (see the Emacs Calculator manual for more information about the Emacs
  1355. calculator).
  1356. @end ifnotinfo
  1357. @menu
  1358. * Built-in table editor:: Simple tables
  1359. * Column width and alignment:: Overrule the automatic settings
  1360. * Column groups:: Grouping to trigger vertical lines
  1361. * Orgtbl mode:: The table editor as minor mode
  1362. * The spreadsheet:: The table editor has spreadsheet capabilities
  1363. * Org-Plot:: Plotting from org tables
  1364. @end menu
  1365. @node Built-in table editor, Column width and alignment, Tables, Tables
  1366. @section The built-in table editor
  1367. @cindex table editor, built-in
  1368. Org makes it easy to format tables in plain ASCII. Any line with
  1369. @samp{|} as the first non-whitespace character is considered part of a
  1370. table. @samp{|} is also the column separator. A table might look like
  1371. this:
  1372. @example
  1373. | Name | Phone | Age |
  1374. |-------+-------+-----|
  1375. | Peter | 1234 | 17 |
  1376. | Anna | 4321 | 25 |
  1377. @end example
  1378. A table is re-aligned automatically each time you press @key{TAB} or
  1379. @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
  1380. the next field (@key{RET} to the next row) and creates new table rows
  1381. at the end of the table or before horizontal lines. The indentation
  1382. of the table is set by the first line. Any line starting with
  1383. @samp{|-} is considered as a horizontal separator line and will be
  1384. expanded on the next re-align to span the whole table width. So, to
  1385. create the above table, you would only type
  1386. @example
  1387. |Name|Phone|Age|
  1388. |-
  1389. @end example
  1390. @noindent and then press @key{TAB} to align the table and start filling in
  1391. fields. Even faster would be to type @code{|Name|Phone|Age} followed by
  1392. @kbd{C-c @key{RET}}.
  1393. @vindex org-enable-table-editor
  1394. @vindex org-table-auto-blank-field
  1395. When typing text into a field, Org treats @key{DEL},
  1396. @key{Backspace}, and all character keys in a special way, so that
  1397. inserting and deleting avoids shifting other fields. Also, when
  1398. typing @emph{immediately after the cursor was moved into a new field
  1399. with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
  1400. field is automatically made blank. If this behavior is too
  1401. unpredictable for you, configure the variables
  1402. @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
  1403. @table @kbd
  1404. @tsubheading{Creation and conversion}
  1405. @kindex C-c |
  1406. @item C-c |
  1407. Convert the active region to table. If every line contains at least one
  1408. TAB character, the function assumes that the material is tab separated.
  1409. If every line contains a comma, comma-separated values (CSV) are assumed.
  1410. If not, lines are split at whitespace into fields. You can use a prefix
  1411. argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
  1412. C-u} forces TAB, and a numeric argument N indicates that at least N
  1413. consecutive spaces, or alternatively a TAB will be the separator.
  1414. @*
  1415. If there is no active region, this command creates an empty Org
  1416. table. But it's easier just to start typing, like
  1417. @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
  1418. @tsubheading{Re-aligning and field motion}
  1419. @kindex C-c C-c
  1420. @item C-c C-c
  1421. Re-align the table without moving the cursor.
  1422. @c
  1423. @kindex @key{TAB}
  1424. @item @key{TAB}
  1425. Re-align the table, move to the next field. Creates a new row if
  1426. necessary.
  1427. @c
  1428. @kindex S-@key{TAB}
  1429. @item S-@key{TAB}
  1430. Re-align, move to previous field.
  1431. @c
  1432. @kindex @key{RET}
  1433. @item @key{RET}
  1434. Re-align the table and move down to next row. Creates a new row if
  1435. necessary. At the beginning or end of a line, @key{RET} still does
  1436. NEWLINE, so it can be used to split a table.
  1437. @c
  1438. @kindex M-a
  1439. @item M-a
  1440. Move to beginning of the current table field, or on to the previous field.
  1441. @kindex M-e
  1442. @item M-e
  1443. Move to end of the current table field, or on to the next field.
  1444. @tsubheading{Column and row editing}
  1445. @kindex M-@key{left}
  1446. @kindex M-@key{right}
  1447. @item M-@key{left}
  1448. @itemx M-@key{right}
  1449. Move the current column left/right.
  1450. @c
  1451. @kindex M-S-@key{left}
  1452. @item M-S-@key{left}
  1453. Kill the current column.
  1454. @c
  1455. @kindex M-S-@key{right}
  1456. @item M-S-@key{right}
  1457. Insert a new column to the left of the cursor position.
  1458. @c
  1459. @kindex M-@key{up}
  1460. @kindex M-@key{down}
  1461. @item M-@key{up}
  1462. @itemx M-@key{down}
  1463. Move the current row up/down.
  1464. @c
  1465. @kindex M-S-@key{up}
  1466. @item M-S-@key{up}
  1467. Kill the current row or horizontal line.
  1468. @c
  1469. @kindex M-S-@key{down}
  1470. @item M-S-@key{down}
  1471. Insert a new row above the current row. With a prefix argument, the line is
  1472. created below the current one.
  1473. @c
  1474. @kindex C-c -
  1475. @item C-c -
  1476. Insert a horizontal line below current row. With a prefix argument, the line
  1477. is created above the current line.
  1478. @c
  1479. @kindex C-c @key{RET}
  1480. @item C-c @key{RET}
  1481. Insert a horizontal line below current row, and move the cursor into the row
  1482. below that line.
  1483. @c
  1484. @kindex C-c ^
  1485. @item C-c ^
  1486. Sort the table lines in the region. The position of point indicates the
  1487. column to be used for sorting, and the range of lines is the range
  1488. between the nearest horizontal separator lines, or the entire table. If
  1489. point is before the first column, you will be prompted for the sorting
  1490. column. If there is an active region, the mark specifies the first line
  1491. and the sorting column, while point should be in the last line to be
  1492. included into the sorting. The command prompts for the sorting type
  1493. (alphabetically, numerically, or by time). When called with a prefix
  1494. argument, alphabetic sorting will be case-sensitive.
  1495. @tsubheading{Regions}
  1496. @kindex C-c C-x M-w
  1497. @item C-c C-x M-w
  1498. Copy a rectangular region from a table to a special clipboard. Point and
  1499. mark determine edge fields of the rectangle. If there is no active region,
  1500. copy just the current field. The process ignores horizontal separator lines.
  1501. @c
  1502. @kindex C-c C-x C-w
  1503. @item C-c C-x C-w
  1504. Copy a rectangular region from a table to a special clipboard, and
  1505. blank all fields in the rectangle. So this is the ``cut'' operation.
  1506. @c
  1507. @kindex C-c C-x C-y
  1508. @item C-c C-x C-y
  1509. Paste a rectangular region into a table.
  1510. The upper left corner ends up in the current field. All involved fields
  1511. will be overwritten. If the rectangle does not fit into the present table,
  1512. the table is enlarged as needed. The process ignores horizontal separator
  1513. lines.
  1514. @c
  1515. @kindex M-@key{RET}
  1516. @itemx M-@kbd{RET}
  1517. Wrap several fields in a column like a paragraph. If there is an active
  1518. region, and both point and mark are in the same column, the text in the
  1519. column is wrapped to minimum width for the given number of lines. A numeric
  1520. prefix argument may be used to change the number of desired lines. If there
  1521. is no region, the current field is split at the cursor position and the text
  1522. fragment to the right of the cursor is prepended to the field one line
  1523. down. If there is no region, but you specify a prefix argument, the current
  1524. field is made blank, and the content is appended to the field above.
  1525. @tsubheading{Calculations}
  1526. @cindex formula, in tables
  1527. @cindex calculations, in tables
  1528. @cindex region, active
  1529. @cindex active region
  1530. @cindex transient mark mode
  1531. @kindex C-c +
  1532. @item C-c +
  1533. Sum the numbers in the current column, or in the rectangle defined by
  1534. the active region. The result is shown in the echo area and can
  1535. be inserted with @kbd{C-y}.
  1536. @c
  1537. @kindex S-@key{RET}
  1538. @item S-@key{RET}
  1539. @vindex org-table-copy-increment
  1540. When current field is empty, copy from first non-empty field above. When not
  1541. empty, copy current field down to next row and move cursor along with it.
  1542. Depending on the variable @code{org-table-copy-increment}, integer field
  1543. values will be incremented during copy. Integers that are too large will not
  1544. be incremented. Also, a @code{0} prefix argument temporarily disables the
  1545. increment. This key is also used by shift-selection and related modes
  1546. (@pxref{Conflicts}).
  1547. @tsubheading{Miscellaneous}
  1548. @kindex C-c `
  1549. @item C-c `
  1550. Edit the current field in a separate window. This is useful for fields that
  1551. are not fully visible (@pxref{Column width and alignment}). When called with
  1552. a @kbd{C-u} prefix, just make the full field visible, so that it can be
  1553. edited in place.
  1554. @c
  1555. @item M-x org-table-import
  1556. Import a file as a table. The table should be TAB or whitespace
  1557. separated. Use, for example, to import a spreadsheet table or data
  1558. from a database, because these programs generally can write
  1559. TAB-separated text files. This command works by inserting the file into
  1560. the buffer and then converting the region to a table. Any prefix
  1561. argument is passed on to the converter, which uses it to determine the
  1562. separator.
  1563. @item C-c |
  1564. Tables can also be imported by pasting tabular text into the Org
  1565. buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
  1566. @kbd{C-c |} command (see above under @i{Creation and conversion}).
  1567. @c
  1568. @item M-x org-table-export
  1569. @vindex org-table-export-default-format
  1570. Export the table, by default as a TAB-separated file. Use for data
  1571. exchange with, for example, spreadsheet or database programs. The format
  1572. used to export the file can be configured in the variable
  1573. @code{org-table-export-default-format}. You may also use properties
  1574. @code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
  1575. name and the format for table export in a subtree. Org supports quite
  1576. general formats for exported tables. The exporter format is the same as the
  1577. format used by Orgtbl radio tables, see @ref{Translator functions}, for a
  1578. detailed description.
  1579. @end table
  1580. If you don't like the automatic table editor because it gets in your
  1581. way on lines which you would like to start with @samp{|}, you can turn
  1582. it off with
  1583. @lisp
  1584. (setq org-enable-table-editor nil)
  1585. @end lisp
  1586. @noindent Then the only table command that still works is
  1587. @kbd{C-c C-c} to do a manual re-align.
  1588. @node Column width and alignment, Column groups, Built-in table editor, Tables
  1589. @section Column width and alignment
  1590. @cindex narrow columns in tables
  1591. @cindex alignment in tables
  1592. The width of columns is automatically determined by the table editor. And
  1593. also the alignment of a column is determined automatically from the fraction
  1594. of number-like versus non-number fields in the column.
  1595. Sometimes a single field or a few fields need to carry more text, leading to
  1596. inconveniently wide columns. Or maybe you want to make a table with several
  1597. columns having a fixed width, regardless of content. To set@footnote{This
  1598. feature does not work on XEmacs.} the width of a column, one field anywhere
  1599. in the column may contain just the string @samp{<N>} where @samp{N} is an
  1600. integer specifying the width of the column in characters. The next re-align
  1601. will then set the width of this column to this value.
  1602. @example
  1603. @group
  1604. |---+------------------------------| |---+--------|
  1605. | | | | | <6> |
  1606. | 1 | one | | 1 | one |
  1607. | 2 | two | ----\ | 2 | two |
  1608. | 3 | This is a long chunk of text | ----/ | 3 | This=> |
  1609. | 4 | four | | 4 | four |
  1610. |---+------------------------------| |---+--------|
  1611. @end group
  1612. @end example
  1613. @noindent
  1614. Fields that are wider become clipped and end in the string @samp{=>}.
  1615. Note that the full text is still in the buffer, it is only invisible.
  1616. To see the full text, hold the mouse over the field---a tool-tip window
  1617. will show the full content. To edit such a field, use the command
  1618. @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
  1619. open a new window with the full field. Edit it and finish with @kbd{C-c
  1620. C-c}.
  1621. @vindex org-startup-align-all-tables
  1622. When visiting a file containing a table with narrowed columns, the
  1623. necessary character hiding has not yet happened, and the table needs to
  1624. be aligned before it looks nice. Setting the option
  1625. @code{org-startup-align-all-tables} will realign all tables in a file
  1626. upon visiting, but also slow down startup. You can also set this option
  1627. on a per-file basis with:
  1628. @example
  1629. #+STARTUP: align
  1630. #+STARTUP: noalign
  1631. @end example
  1632. If you would like to overrule the automatic alignment of number-rich columns
  1633. to the right and of string-rich column to the left, you and use @samp{<r>} or
  1634. @samp{<l>} in a similar fashion. You may also combine alignment and field
  1635. width like this: @samp{<l10>}.
  1636. @node Column groups, Orgtbl mode, Column width and alignment, Tables
  1637. @section Column groups
  1638. @cindex grouping columns in tables
  1639. When Org exports tables, it does so by default without vertical
  1640. lines because that is visually more satisfying in general. Occasionally
  1641. however, vertical lines can be useful to structure a table into groups
  1642. of columns, much like horizontal lines can do for groups of rows. In
  1643. order to specify column groups, you can use a special row where the
  1644. first field contains only @samp{/}. The further fields can either
  1645. contain @samp{<} to indicate that this column should start a group,
  1646. @samp{>} to indicate the end of a column, or @samp{<>} to make a column
  1647. a group of its own. Boundaries between column groups will upon export be
  1648. marked with vertical lines. Here is an example:
  1649. @example
  1650. | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1651. |---+----+-----+-----+-----+---------+------------|
  1652. | / | <> | < | | > | < | > |
  1653. | # | 1 | 1 | 1 | 1 | 1 | 1 |
  1654. | # | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
  1655. | # | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
  1656. |---+----+-----+-----+-----+---------+------------|
  1657. #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2)))
  1658. @end example
  1659. It is also sufficient to just insert the column group starters after
  1660. every vertical line you'd like to have:
  1661. @example
  1662. | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1663. |----+-----+-----+-----+---------+------------|
  1664. | / | < | | | < | |
  1665. @end example
  1666. @node Orgtbl mode, The spreadsheet, Column groups, Tables
  1667. @section The Orgtbl minor mode
  1668. @cindex Orgtbl mode
  1669. @cindex minor mode for tables
  1670. If you like the intuitive way the Org table editor works, you
  1671. might also want to use it in other modes like Text mode or Mail mode.
  1672. The minor mode Orgtbl mode makes this possible. You can always toggle
  1673. the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
  1674. example in mail mode, use
  1675. @lisp
  1676. (add-hook 'mail-mode-hook 'turn-on-orgtbl)
  1677. @end lisp
  1678. Furthermore, with some special setup, it is possible to maintain tables
  1679. in arbitrary syntax with Orgtbl mode. For example, it is possible to
  1680. construct La@TeX{} tables with the underlying ease and power of
  1681. Orgtbl mode, including spreadsheet capabilities. For details, see
  1682. @ref{Tables in arbitrary syntax}.
  1683. @node The spreadsheet, Org-Plot, Orgtbl mode, Tables
  1684. @section The spreadsheet
  1685. @cindex calculations, in tables
  1686. @cindex spreadsheet capabilities
  1687. @cindex @file{calc} package
  1688. The table editor makes use of the Emacs @file{calc} package to implement
  1689. spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
  1690. derive fields from other fields. While fully featured, Org's implementation
  1691. is not identical to other spreadsheets. For example, Org knows the concept
  1692. of a @emph{column formula} that will be applied to all non-header fields in a
  1693. column without having to copy the formula to each relevant field. There is
  1694. also a formula debugger, and a formula editor with features for highlighting
  1695. fields in the table corresponding to the references at the point in the
  1696. formula, moving these references by arrow keys
  1697. @menu
  1698. * References:: How to refer to another field or range
  1699. * Formula syntax for Calc:: Using Calc to compute stuff
  1700. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  1701. * Field formulas:: Formulas valid for a single field
  1702. * Column formulas:: Formulas valid for an entire column
  1703. * Editing and debugging formulas:: Fixing formulas
  1704. * Updating the table:: Recomputing all dependent fields
  1705. * Advanced features:: Field names, parameters and automatic recalc
  1706. @end menu
  1707. @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
  1708. @subsection References
  1709. @cindex references
  1710. To compute fields in the table from other fields, formulas must
  1711. reference other fields or ranges. In Org, fields can be referenced
  1712. by name, by absolute coordinates, and by relative coordinates. To find
  1713. out what the coordinates of a field are, press @kbd{C-c ?} in that
  1714. field, or press @kbd{C-c @}} to toggle the display of a grid.
  1715. @subsubheading Field references
  1716. @cindex field references
  1717. @cindex references, to fields
  1718. Formulas can reference the value of another field in two ways. Like in
  1719. any other spreadsheet, you may reference fields with a letter/number
  1720. combination like @code{B3}, meaning the 2nd field in the 3rd row.
  1721. @c Such references are always fixed to that field, they don't change
  1722. @c when you copy and paste a formula to a different field. So
  1723. @c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
  1724. @noindent
  1725. Org also uses another, more general operator that looks like this:
  1726. @example
  1727. @@@var{row}$@var{column}
  1728. @end example
  1729. @noindent
  1730. Column references can be absolute like @samp{1}, @samp{2},...@samp{@var{N}},
  1731. or relative to the current column like @samp{+1} or @samp{-2}.
  1732. The row specification only counts data lines and ignores horizontal
  1733. separator lines (hlines). You can use absolute row numbers
  1734. @samp{1}...@samp{@var{N}}, and row numbers relative to the current row like
  1735. @samp{+3} or @samp{-1}. Or specify the row relative to one of the
  1736. hlines: @samp{I} refers to the first hline@footnote{Note that only
  1737. hlines are counted that @emph{separate} table lines. If the table
  1738. starts with a hline above the header, it does not count.}, @samp{II} to
  1739. the second, etc@. @samp{-I} refers to the first such line above the
  1740. current line, @samp{+I} to the first such line below the current line.
  1741. You can also write @samp{III+2} which is the second data line after the
  1742. third hline in the table.
  1743. @samp{0} refers to the current row and column. Also, if you omit
  1744. either the column or the row part of the reference, the current
  1745. row/column is implied.
  1746. Org's references with @emph{unsigned} numbers are fixed references
  1747. in the sense that if you use the same reference in the formula for two
  1748. different fields, the same field will be referenced each time.
  1749. Org's references with @emph{signed} numbers are floating
  1750. references because the same reference operator can reference different
  1751. fields depending on the field being calculated by the formula.
  1752. As a special case, references like @samp{$LR5} and @samp{$LR12} can be used
  1753. to refer in a stable way to the 5th and 12th field in the last row of the
  1754. table.
  1755. Here are a few examples:
  1756. @example
  1757. @@2$3 @r{2nd row, 3rd column}
  1758. C2 @r{same as previous}
  1759. $5 @r{column 5 in the current row}
  1760. E& @r{same as previous}
  1761. @@2 @r{current column, row 2}
  1762. @@-1$-3 @r{the field one row up, three columns to the left}
  1763. @@-I$2 @r{field just under hline above current row, column 2}
  1764. @end example
  1765. @subsubheading Range references
  1766. @cindex range references
  1767. @cindex references, to ranges
  1768. You may reference a rectangular range of fields by specifying two field
  1769. references connected by two dots @samp{..}. If both fields are in the
  1770. current row, you may simply use @samp{$2..$7}, but if at least one field
  1771. is in a different row, you need to use the general @code{@@row$column}
  1772. format at least for the first field (i.e the reference must start with
  1773. @samp{@@} in order to be interpreted correctly). Examples:
  1774. @example
  1775. $1..$3 @r{First three fields in the current row.}
  1776. $P..$Q @r{Range, using column names (see under Advanced)}
  1777. @@2$1..@@4$3 @r{6 fields between these two fields.}
  1778. A2..C4 @r{Same as above.}
  1779. @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
  1780. @end example
  1781. @noindent Range references return a vector of values that can be fed
  1782. into Calc vector functions. Empty fields in ranges are normally
  1783. suppressed, so that the vector contains only the non-empty fields (but
  1784. see the @samp{E} mode switch below). If there are no non-empty fields,
  1785. @samp{[0]} is returned to avoid syntax errors in formulas.
  1786. @subsubheading Field coordinates in formulas
  1787. @cindex field coordinates
  1788. @cindex coordinates, of field
  1789. @cindex row, of field coordinates
  1790. @cindex column, of field coordinates
  1791. For Calc formulas and Lisp formulas @code{@@#} and @code{$#} can be used to
  1792. get the row or column number of the field where the formula result goes.
  1793. The traditional Lisp formula equivalents are @code{org-table-current-dline}
  1794. and @code{org-table-current-column}. Examples:
  1795. @example
  1796. if(@@# % 2, $#, string("")) @r{column number on odd lines only}
  1797. $3 = remote(FOO, @@@@#$2) @r{copy column 2 from table FOO into}
  1798. @r{column 3 of the current table}
  1799. @end example
  1800. @noindent For the second example, table FOO must have at least as many rows
  1801. as the current table. Inefficient@footnote{The computation time scales as
  1802. O(N^2) because table FOO is parsed for each field to be copied.} for large
  1803. number of rows.
  1804. @subsubheading Named references
  1805. @cindex named references
  1806. @cindex references, named
  1807. @cindex name, of column or field
  1808. @cindex constants, in calculations
  1809. @cindex #+CONSTANTS
  1810. @vindex org-table-formula-constants
  1811. @samp{$name} is interpreted as the name of a column, parameter or
  1812. constant. Constants are defined globally through the variable
  1813. @code{org-table-formula-constants}, and locally (for the file) through a
  1814. line like
  1815. @example
  1816. #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
  1817. @end example
  1818. @noindent
  1819. @vindex constants-unit-system
  1820. @pindex constants.el
  1821. Also properties (@pxref{Properties and Columns}) can be used as
  1822. constants in table formulas: for a property @samp{:Xyz:} use the name
  1823. @samp{$PROP_Xyz}, and the property will be searched in the current
  1824. outline entry and in the hierarchy above it. If you have the
  1825. @file{constants.el} package, it will also be used to resolve constants,
  1826. including natural constants like @samp{$h} for Planck's constant, and
  1827. units like @samp{$km} for kilometers@footnote{@file{constants.el} can
  1828. supply the values of constants in two different unit systems, @code{SI}
  1829. and @code{cgs}. Which one is used depends on the value of the variable
  1830. @code{constants-unit-system}. You can use the @code{#+STARTUP} options
  1831. @code{constSI} and @code{constcgs} to set this value for the current
  1832. buffer.}. Column names and parameters can be specified in special table
  1833. lines. These are described below, see @ref{Advanced features}. All
  1834. names must start with a letter, and further consist of letters and
  1835. numbers.
  1836. @subsubheading Remote references
  1837. @cindex remote references
  1838. @cindex references, remote
  1839. @cindex references, to a different table
  1840. @cindex name, of column or field
  1841. @cindex constants, in calculations
  1842. @cindex #+TBLNAME
  1843. You may also reference constants, fields and ranges from a different table,
  1844. either in the current file or even in a different file. The syntax is
  1845. @example
  1846. remote(NAME-OR-ID,REF)
  1847. @end example
  1848. @noindent
  1849. where NAME can be the name of a table in the current file as set by a
  1850. @code{#+TBLNAME: NAME} line before the table. It can also be the ID of an
  1851. entry, even in a different file, and the reference then refers to the first
  1852. table in that entry. REF is an absolute field or range reference as
  1853. described above for example @code{@@3$3} or @code{$somename}, valid in the
  1854. referenced table.
  1855. @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
  1856. @subsection Formula syntax for Calc
  1857. @cindex formula syntax, Calc
  1858. @cindex syntax, of formulas
  1859. A formula can be any algebraic expression understood by the Emacs
  1860. @file{Calc} package. @b{Note that @file{calc} has the
  1861. non-standard convention that @samp{/} has lower precedence than
  1862. @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
  1863. evaluation by @code{calc-eval} (@pxref{Calling Calc from
  1864. Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
  1865. Emacs Calc Manual}),
  1866. @c FIXME: The link to the Calc manual in HTML does not work.
  1867. variable substitution takes place according to the rules described above.
  1868. @cindex vectors, in table calculations
  1869. The range vectors can be directly fed into the Calc vector functions
  1870. like @samp{vmean} and @samp{vsum}.
  1871. @cindex format specifier
  1872. @cindex mode, for @file{calc}
  1873. @vindex org-calc-default-modes
  1874. A formula can contain an optional mode string after a semicolon. This
  1875. string consists of flags to influence Calc and other modes during
  1876. execution. By default, Org uses the standard Calc modes (precision
  1877. 12, angular units degrees, fraction and symbolic modes off). The display
  1878. format, however, has been changed to @code{(float 8)} to keep tables
  1879. compact. The default settings can be configured using the variable
  1880. @code{org-calc-default-modes}.
  1881. @example
  1882. p20 @r{set the internal Calc calculation precision to 20 digits}
  1883. n3 s3 e2 f4 @r{Normal, scientific, engineering, or fixed}
  1884. @r{format of the result of Calc passed back to Org.}
  1885. @r{Calc formatting is unlimited in precision as}
  1886. @r{long as the Calc calculation precision is greater.}
  1887. D R @r{angle modes: degrees, radians}
  1888. F S @r{fraction and symbolic modes}
  1889. N @r{interpret all fields as numbers, use 0 for non-numbers}
  1890. T @r{force text interpretation}
  1891. E @r{keep empty fields in ranges}
  1892. L @r{literal}
  1893. @end example
  1894. @noindent
  1895. Unless you use large integer numbers or high-precision-calculation
  1896. and -display for floating point numbers you may alternatively provide a
  1897. @code{printf} format specifier to reformat the Calc result after it has been
  1898. passed back to Org instead of letting Calc already do the
  1899. formatting@footnote{The @code{printf} reformatting is limited in precision
  1900. because the value passed to it is converted into an @code{integer} or
  1901. @code{double}. The @code{integer} is limited in size by truncating the
  1902. signed value to 32 bits. The @code{double} is limited in precision to 64
  1903. bits overall which leaves approximately 16 significant decimal digits.}.
  1904. A few examples:
  1905. @example
  1906. $1+$2 @r{Sum of first and second field}
  1907. $1+$2;%.2f @r{Same, format result to two decimals}
  1908. exp($2)+exp($1) @r{Math functions can be used}
  1909. $0;%.1f @r{Reformat current cell to 1 decimal}
  1910. ($3-32)*5/9 @r{Degrees F -> C conversion}
  1911. $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
  1912. tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
  1913. sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
  1914. vmean($2..$7) @r{Compute column range mean, using vector function}
  1915. vmean($2..$7);EN @r{Same, but treat empty fields as 0}
  1916. taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
  1917. @end example
  1918. Calc also contains a complete set of logical operations. For example
  1919. @example
  1920. if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
  1921. @end example
  1922. @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
  1923. @subsection Emacs Lisp forms as formulas
  1924. @cindex Lisp forms, as table formulas
  1925. It is also possible to write a formula in Emacs Lisp; this can be useful
  1926. for string manipulation and control structures, if Calc's
  1927. functionality is not enough. If a formula starts with a single-quote
  1928. followed by an opening parenthesis, then it is evaluated as a Lisp form.
  1929. The evaluation should return either a string or a number. Just as with
  1930. @file{calc} formulas, you can specify modes and a printf format after a
  1931. semicolon. With Emacs Lisp forms, you need to be conscious about the way
  1932. field references are interpolated into the form. By default, a
  1933. reference will be interpolated as a Lisp string (in double-quotes)
  1934. containing the field. If you provide the @samp{N} mode switch, all
  1935. referenced elements will be numbers (non-number fields will be zero) and
  1936. interpolated as Lisp numbers, without quotes. If you provide the
  1937. @samp{L} flag, all fields will be interpolated literally, without quotes.
  1938. I.e., if you want a reference to be interpreted as a string by the Lisp
  1939. form, enclose the reference operator itself in double-quotes, like
  1940. @code{"$3"}. Ranges are inserted as space-separated fields, so you can
  1941. embed them in list or vector syntax. A few examples, note how the
  1942. @samp{N} mode is used when we do computations in Lisp.
  1943. @example
  1944. @r{Swap the first two characters of the content of column 1}
  1945. '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
  1946. @r{Add columns 1 and 2, equivalent to Calc's @code{$1+$2}}
  1947. '(+ $1 $2);N
  1948. @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
  1949. '(apply '+ '($1..$4));N
  1950. @end example
  1951. @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
  1952. @subsection Field formulas
  1953. @cindex field formula
  1954. @cindex formula, for individual table field
  1955. To assign a formula to a particular field, type it directly into the
  1956. field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
  1957. press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
  1958. the field, the formula will be stored as the formula for this field,
  1959. evaluated, and the current field replaced with the result.
  1960. @cindex #+TBLFM
  1961. Formulas are stored in a special line starting with @samp{#+TBLFM:}
  1962. directly below the table. If you typed the equation in the 4th field of
  1963. the 3rd data line in the table, the formula will look like
  1964. @samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
  1965. with the appropriate commands, @i{absolute references} (but not relative
  1966. ones) in stored formulas are modified in order to still reference the
  1967. same field. Of course this is not true if you edit the table structure
  1968. with normal editing commands---then you must fix the equations yourself.
  1969. The left-hand side of a formula may also be a named field (@pxref{Advanced
  1970. features}), or a last-row reference like @samp{$LR3}.
  1971. Instead of typing an equation into the field, you may also use the
  1972. following command
  1973. @table @kbd
  1974. @kindex C-u C-c =
  1975. @item C-u C-c =
  1976. Install a new formula for the current field. The command prompts for a
  1977. formula with default taken from the @samp{#+TBLFM:} line, applies
  1978. it to the current field, and stores it.
  1979. @end table
  1980. @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
  1981. @subsection Column formulas
  1982. @cindex column formula
  1983. @cindex formula, for table column
  1984. Often in a table, the same formula should be used for all fields in a
  1985. particular column. Instead of having to copy the formula to all fields
  1986. in that column, Org allows you to assign a single formula to an entire
  1987. column. If the table contains horizontal separator hlines, everything
  1988. before the first such line is considered part of the table @emph{header}
  1989. and will not be modified by column formulas.
  1990. To assign a formula to a column, type it directly into any field in the
  1991. column, preceded by an equal sign, like @samp{=$1+$2}. When you press
  1992. @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the field,
  1993. the formula will be stored as the formula for the current column, evaluated
  1994. and the current field replaced with the result. If the field contains only
  1995. @samp{=}, the previously stored formula for this column is used. For each
  1996. column, Org will only remember the most recently used formula. In the
  1997. @samp{#+TBLFM:} line, column formulas will look like @samp{$4=$1+$2}. The left-hand
  1998. side of a column formula cannot currently be the name of column, it
  1999. must be the numeric column reference.
  2000. Instead of typing an equation into the field, you may also use the
  2001. following command:
  2002. @table @kbd
  2003. @kindex C-c =
  2004. @item C-c =
  2005. Install a new formula for the current column and replace current field with
  2006. the result of the formula. The command prompts for a formula, with default
  2007. taken from the @samp{#+TBLFM} line, applies it to the current field and
  2008. stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
  2009. will apply it to that many consecutive fields in the current column.
  2010. @end table
  2011. @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
  2012. @subsection Editing and debugging formulas
  2013. @cindex formula editing
  2014. @cindex editing, of table formulas
  2015. @vindex org-table-use-standard-references
  2016. You can edit individual formulas in the minibuffer or directly in the
  2017. field. Org can also prepare a special buffer with all active
  2018. formulas of a table. When offering a formula for editing, Org
  2019. converts references to the standard format (like @code{B3} or @code{D&})
  2020. if possible. If you prefer to only work with the internal format (like
  2021. @code{@@3$2} or @code{$4}), configure the variable
  2022. @code{org-table-use-standard-references}.
  2023. @table @kbd
  2024. @kindex C-c =
  2025. @kindex C-u C-c =
  2026. @item C-c =
  2027. @itemx C-u C-c =
  2028. Edit the formula associated with the current column/field in the
  2029. minibuffer. See @ref{Column formulas}, and @ref{Field formulas}.
  2030. @kindex C-u C-u C-c =
  2031. @item C-u C-u C-c =
  2032. Re-insert the active formula (either a
  2033. field formula, or a column formula) into the current field, so that you
  2034. can edit it directly in the field. The advantage over editing in the
  2035. minibuffer is that you can use the command @kbd{C-c ?}.
  2036. @kindex C-c ?
  2037. @item C-c ?
  2038. While editing a formula in a table field, highlight the field(s)
  2039. referenced by the reference at the cursor position in the formula.
  2040. @kindex C-c @}
  2041. @item C-c @}
  2042. Toggle the display of row and column numbers for a table, using
  2043. overlays. These are updated each time the table is aligned; you can
  2044. force it with @kbd{C-c C-c}.
  2045. @kindex C-c @{
  2046. @item C-c @{
  2047. Toggle the formula debugger on and off. See below.
  2048. @kindex C-c '
  2049. @item C-c '
  2050. Edit all formulas for the current table in a special buffer, where the
  2051. formulas will be displayed one per line. If the current field has an
  2052. active formula, the cursor in the formula editor will mark it.
  2053. While inside the special buffer, Org will automatically highlight
  2054. any field or range reference at the cursor position. You may edit,
  2055. remove and add formulas, and use the following commands:
  2056. @table @kbd
  2057. @kindex C-c C-c
  2058. @kindex C-x C-s
  2059. @item C-c C-c
  2060. @itemx C-x C-s
  2061. Exit the formula editor and store the modified formulas. With @kbd{C-u}
  2062. prefix, also apply the new formulas to the entire table.
  2063. @kindex C-c C-q
  2064. @item C-c C-q
  2065. Exit the formula editor without installing changes.
  2066. @kindex C-c C-r
  2067. @item C-c C-r
  2068. Toggle all references in the formula editor between standard (like
  2069. @code{B3}) and internal (like @code{@@3$2}).
  2070. @kindex @key{TAB}
  2071. @item @key{TAB}
  2072. Pretty-print or indent Lisp formula at point. When in a line containing
  2073. a Lisp formula, format the formula according to Emacs Lisp rules.
  2074. Another @key{TAB} collapses the formula back again. In the open
  2075. formula, @key{TAB} re-indents just like in Emacs Lisp mode.
  2076. @kindex M-@key{TAB}
  2077. @item M-@key{TAB}
  2078. Complete Lisp symbols, just like in Emacs Lisp mode.
  2079. @kindex S-@key{up}
  2080. @kindex S-@key{down}
  2081. @kindex S-@key{left}
  2082. @kindex S-@key{right}
  2083. @item S-@key{up}/@key{down}/@key{left}/@key{right}
  2084. Shift the reference at point. For example, if the reference is
  2085. @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
  2086. This also works for relative references and for hline references.
  2087. @kindex M-S-@key{up}
  2088. @kindex M-S-@key{down}
  2089. @item M-S-@key{up}/@key{down}
  2090. Move the test line for column formulas in the Org buffer up and
  2091. down.
  2092. @kindex M-@key{up}
  2093. @kindex M-@key{down}
  2094. @item M-@key{up}/@key{down}
  2095. Scroll the window displaying the table.
  2096. @kindex C-c @}
  2097. @item C-c @}
  2098. Turn the coordinate grid in the table on and off.
  2099. @end table
  2100. @end table
  2101. Making a table field blank does not remove the formula associated with
  2102. the field, because that is stored in a different line (the @samp{#+TBLFM}
  2103. line)---during the next recalculation the field will be filled again.
  2104. To remove a formula from a field, you have to give an empty reply when
  2105. prompted for the formula, or to edit the @samp{#+TBLFM} line.
  2106. @kindex C-c C-c
  2107. You may edit the @samp{#+TBLFM} directly and re-apply the changed
  2108. equations with @kbd{C-c C-c} in that line or with the normal
  2109. recalculation commands in the table.
  2110. @subsubheading Debugging formulas
  2111. @cindex formula debugging
  2112. @cindex debugging, of table formulas
  2113. When the evaluation of a formula leads to an error, the field content
  2114. becomes the string @samp{#ERROR}. If you would like see what is going
  2115. on during variable substitution and calculation in order to find a bug,
  2116. turn on formula debugging in the @code{Tbl} menu and repeat the
  2117. calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
  2118. field. Detailed information will be displayed.
  2119. @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
  2120. @subsection Updating the table
  2121. @cindex recomputing table fields
  2122. @cindex updating, table
  2123. Recalculation of a table is normally not automatic, but needs to be
  2124. triggered by a command. See @ref{Advanced features}, for a way to make
  2125. recalculation at least semi-automatic.
  2126. In order to recalculate a line of a table or the entire table, use the
  2127. following commands:
  2128. @table @kbd
  2129. @kindex C-c *
  2130. @item C-c *
  2131. Recalculate the current row by first applying the stored column formulas
  2132. from left to right, and all field formulas in the current row.
  2133. @c
  2134. @kindex C-u C-c *
  2135. @item C-u C-c *
  2136. @kindex C-u C-c C-c
  2137. @itemx C-u C-c C-c
  2138. Recompute the entire table, line by line. Any lines before the first
  2139. hline are left alone, assuming that these are part of the table header.
  2140. @c
  2141. @kindex C-u C-u C-c *
  2142. @kindex C-u C-u C-c C-c
  2143. @item C-u C-u C-c *
  2144. @itemx C-u C-u C-c C-c
  2145. Iterate the table by recomputing it until no further changes occur.
  2146. This may be necessary if some computed fields use the value of other
  2147. fields that are computed @i{later} in the calculation sequence.
  2148. @end table
  2149. @node Advanced features, , Updating the table, The spreadsheet
  2150. @subsection Advanced features
  2151. If you want the recalculation of fields to happen automatically, or if
  2152. you want to be able to assign @i{names} to fields and columns, you need
  2153. to reserve the first column of the table for special marking characters.
  2154. @table @kbd
  2155. @kindex C-#
  2156. @item C-#
  2157. Rotate the calculation mark in first column through the states @samp{ },
  2158. @samp{#}, @samp{*}, @samp{!}, @samp{$}. When there is an active region,
  2159. change all marks in the region.
  2160. @end table
  2161. Here is an example of a table that collects exam results of students and
  2162. makes use of these features:
  2163. @example
  2164. @group
  2165. |---+---------+--------+--------+--------+-------+------|
  2166. | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
  2167. |---+---------+--------+--------+--------+-------+------|
  2168. | ! | | P1 | P2 | P3 | Tot | |
  2169. | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
  2170. | ^ | | m1 | m2 | m3 | mt | |
  2171. |---+---------+--------+--------+--------+-------+------|
  2172. | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
  2173. | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
  2174. |---+---------+--------+--------+--------+-------+------|
  2175. | | Average | | | | 29.7 | |
  2176. | ^ | | | | | at | |
  2177. | $ | max=50 | | | | | |
  2178. |---+---------+--------+--------+--------+-------+------|
  2179. #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
  2180. @end group
  2181. @end example
  2182. @noindent @b{Important}: please note that for these special tables,
  2183. recalculating the table with @kbd{C-u C-c *} will only affect rows that
  2184. are marked @samp{#} or @samp{*}, and fields that have a formula assigned
  2185. to the field itself. The column formulas are not applied in rows with
  2186. empty first field.
  2187. @cindex marking characters, tables
  2188. The marking characters have the following meaning:
  2189. @table @samp
  2190. @item !
  2191. The fields in this line define names for the columns, so that you may
  2192. refer to a column as @samp{$Tot} instead of @samp{$6}.
  2193. @item ^
  2194. This row defines names for the fields @emph{above} the row. With such
  2195. a definition, any formula in the table may use @samp{$m1} to refer to
  2196. the value @samp{10}. Also, if you assign a formula to a names field, it
  2197. will be stored as @samp{$name=...}.
  2198. @item _
  2199. Similar to @samp{^}, but defines names for the fields in the row
  2200. @emph{below}.
  2201. @item $
  2202. Fields in this row can define @emph{parameters} for formulas. For
  2203. example, if a field in a @samp{$} row contains @samp{max=50}, then
  2204. formulas in this table can refer to the value 50 using @samp{$max}.
  2205. Parameters work exactly like constants, only that they can be defined on
  2206. a per-table basis.
  2207. @item #
  2208. Fields in this row are automatically recalculated when pressing
  2209. @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
  2210. is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
  2211. lines will be left alone by this command.
  2212. @item *
  2213. Selects this line for global recalculation with @kbd{C-u C-c *}, but
  2214. not for automatic recalculation. Use this when automatic
  2215. recalculation slows down editing too much.
  2216. @item
  2217. Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
  2218. All lines that should be recalculated should be marked with @samp{#}
  2219. or @samp{*}.
  2220. @item /
  2221. Do not export this line. Useful for lines that contain the narrowing
  2222. @samp{<N>} markers or column group markers.
  2223. @end table
  2224. Finally, just to whet your appetite for what can be done with the
  2225. fantastic @file{calc.el} package, here is a table that computes the Taylor
  2226. series of degree @code{n} at location @code{x} for a couple of
  2227. functions.
  2228. @example
  2229. @group
  2230. |---+-------------+---+-----+--------------------------------------|
  2231. | | Func | n | x | Result |
  2232. |---+-------------+---+-----+--------------------------------------|
  2233. | # | exp(x) | 1 | x | 1 + x |
  2234. | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
  2235. | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
  2236. | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
  2237. | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
  2238. | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
  2239. |---+-------------+---+-----+--------------------------------------|
  2240. #+TBLFM: $5=taylor($2,$4,$3);n3
  2241. @end group
  2242. @end example
  2243. @node Org-Plot, , The spreadsheet, Tables
  2244. @section Org-Plot
  2245. @cindex graph, in tables
  2246. @cindex plot tables using gnuplot
  2247. @cindex #+PLOT
  2248. Org-Plot can produce 2D and 3D graphs of information stored in org tables
  2249. using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
  2250. @uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html}. To see
  2251. this in action, ensure that you have both Gnuplot and Gnuplot mode installed
  2252. on your system, then call @code{org-plot/gnuplot} on the following table.
  2253. @example
  2254. @group
  2255. #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
  2256. | Sede | Max cites | H-index |
  2257. |-----------+-----------+---------|
  2258. | Chile | 257.72 | 21.39 |
  2259. | Leeds | 165.77 | 19.68 |
  2260. | Sao Paolo | 71.00 | 11.50 |
  2261. | Stockholm | 134.19 | 14.33 |
  2262. | Morelia | 257.56 | 17.67 |
  2263. @end group
  2264. @end example
  2265. Notice that Org Plot is smart enough to apply the table's headers as labels.
  2266. Further control over the labels, type, content, and appearance of plots can
  2267. be exercised through the @code{#+PLOT:} lines preceding a table. See below
  2268. for a complete list of Org-plot options. For more information and examples
  2269. see the Org-plot tutorial at
  2270. @uref{http://orgmode.org/worg/org-tutorials/org-plot.php}.
  2271. @subsubheading Plot Options
  2272. @table @code
  2273. @item set
  2274. Specify any @command{gnuplot} option to be set when graphing.
  2275. @item title
  2276. Specify the title of the plot.
  2277. @item ind
  2278. Specify which column of the table to use as the @code{x} axis.
  2279. @item deps
  2280. Specify the columns to graph as a Lisp style list, surrounded by parentheses
  2281. and separated by spaces for example @code{dep:(3 4)} to graph the third and
  2282. fourth columns (defaults to graphing all other columns aside from the @code{ind}
  2283. column).
  2284. @item type
  2285. Specify whether the plot will be @code{2d}, @code{3d}, or @code{grid}.
  2286. @item with
  2287. Specify a @code{with} option to be inserted for every col being plotted
  2288. (e.g. @code{lines}, @code{points}, @code{boxes}, @code{impulses}, etc...).
  2289. Defaults to @code{lines}.
  2290. @item file
  2291. If you want to plot to a file, specify @code{"@var{path/to/desired/output-file}"}.
  2292. @item labels
  2293. List of labels to be used for the deps (defaults to the column headers if
  2294. they exist).
  2295. @item line
  2296. Specify an entire line to be inserted in the Gnuplot script.
  2297. @item map
  2298. When plotting @code{3d} or @code{grid} types, set this to @code{t} to graph a
  2299. flat mapping rather than a @code{3d} slope.
  2300. @item timefmt
  2301. Specify format of Org-mode timestamps as they will be parsed by Gnuplot.
  2302. Defaults to @samp{%Y-%m-%d-%H:%M:%S}.
  2303. @item script
  2304. If you want total control, you can specify a script file (place the file name
  2305. between double-quotes) which will be used to plot. Before plotting, every
  2306. instance of @code{$datafile} in the specified script will be replaced with
  2307. the path to the generated data file. Note: even if you set this option, you
  2308. may still want to specify the plot type, as that can impact the content of
  2309. the data file.
  2310. @end table
  2311. @node Hyperlinks, TODO Items, Tables, Top
  2312. @chapter Hyperlinks
  2313. @cindex hyperlinks
  2314. Like HTML, Org provides links inside a file, external links to
  2315. other files, Usenet articles, emails, and much more.
  2316. @menu
  2317. * Link format:: How links in Org are formatted
  2318. * Internal links:: Links to other places in the current file
  2319. * External links:: URL-like links to the world
  2320. * Handling links:: Creating, inserting and following
  2321. * Using links outside Org:: Linking from my C source code?
  2322. * Link abbreviations:: Shortcuts for writing complex links
  2323. * Search options:: Linking to a specific location
  2324. * Custom searches:: When the default search is not enough
  2325. @end menu
  2326. @node Link format, Internal links, Hyperlinks, Hyperlinks
  2327. @section Link format
  2328. @cindex link format
  2329. @cindex format, of links
  2330. Org will recognize plain URL-like links and activate them as
  2331. clickable links. The general link format, however, looks like this:
  2332. @example
  2333. [[link][description]] @r{or alternatively} [[link]]
  2334. @end example
  2335. @noindent
  2336. Once a link in the buffer is complete (all brackets present), Org
  2337. will change the display so that @samp{description} is displayed instead
  2338. of @samp{[[link][description]]} and @samp{link} is displayed instead of
  2339. @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
  2340. which by default is an underlined face. You can directly edit the
  2341. visible part of a link. Note that this can be either the @samp{link}
  2342. part (if there is no description) or the @samp{description} part. To
  2343. edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
  2344. cursor on the link.
  2345. If you place the cursor at the beginning or just behind the end of the
  2346. displayed text and press @key{BACKSPACE}, you will remove the
  2347. (invisible) bracket at that location. This makes the link incomplete
  2348. and the internals are again displayed as plain text. Inserting the
  2349. missing bracket hides the link internals again. To show the
  2350. internal structure of all links, use the menu entry
  2351. @code{Org->Hyperlinks->Literal links}.
  2352. @node Internal links, External links, Link format, Hyperlinks
  2353. @section Internal links
  2354. @cindex internal links
  2355. @cindex links, internal
  2356. @cindex targets, for links
  2357. @cindex property, CUSTOM_ID
  2358. If the link does not look like a URL, it is considered to be internal in the
  2359. current file. The most important case is a link like
  2360. @samp{[[#my-custom-id]]} which will link to the entry with the
  2361. @code{CUSTOM_ID} property @samp{my-custom-id}. Such custom IDs are very good
  2362. for HTML export (@pxref{HTML export}) where they produce pretty section
  2363. links. You are responsible yourself to make sure these custom IDs are unique
  2364. in a file.
  2365. Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]}
  2366. lead to a text search in the current file.
  2367. The link can be followed with @kbd{C-c C-o} when the cursor is on the link,
  2368. or with a mouse click (@pxref{Handling links}). Links to custom IDs will
  2369. point to the corresponding headline. The preferred match for a text link is
  2370. a @i{dedicated target}: the same string in double angular brackets. Targets
  2371. may be located anywhere; sometimes it is convenient to put them into a
  2372. comment line. For example
  2373. @example
  2374. # <<My Target>>
  2375. @end example
  2376. @noindent In HTML export (@pxref{HTML export}), such targets will become
  2377. named anchors for direct access through @samp{http} links@footnote{Note that
  2378. text before the first headline is usually not exported, so the first such
  2379. target should be after the first headline, or in the line directly before the
  2380. first headline.}.
  2381. If no dedicated target exists, Org will search for the words in the link. In
  2382. the above example the search would be for @samp{my target}. Links starting
  2383. with a star like @samp{*My Target} restrict the search to
  2384. headlines@footnote{To insert a link targeting a headline, in-buffer
  2385. completion can be used. Just type a star followed by a few optional letters
  2386. into the buffer and press @kbd{M-@key{TAB}}. All headlines in the current
  2387. buffer will be offered as completions. @xref{Handling links}, for more
  2388. commands creating links.}. When searching, Org mode will first try an
  2389. exact match, but then move on to more and more lenient searches. For
  2390. example, the link @samp{[[*My Targets]]} will find any of the following:
  2391. @example
  2392. ** My targets
  2393. ** TODO my targets are bright
  2394. ** my 20 targets are
  2395. @end example
  2396. Following a link pushes a mark onto Org's own mark ring. You can
  2397. return to the previous position with @kbd{C-c &}. Using this command
  2398. several times in direct succession goes back to positions recorded
  2399. earlier.
  2400. @menu
  2401. * Radio targets:: Make targets trigger links in plain text
  2402. @end menu
  2403. @node Radio targets, , Internal links, Internal links
  2404. @subsection Radio targets
  2405. @cindex radio targets
  2406. @cindex targets, radio
  2407. @cindex links, radio targets
  2408. Org can automatically turn any occurrences of certain target names
  2409. in normal text into a link. So without explicitly creating a link, the
  2410. text connects to the target radioing its position. Radio targets are
  2411. enclosed by triple angular brackets. For example, a target @samp{<<<My
  2412. Target>>>} causes each occurrence of @samp{my target} in normal text to
  2413. become activated as a link. The Org file is scanned automatically
  2414. for radio targets only when the file is first loaded into Emacs. To
  2415. update the target list during editing, press @kbd{C-c C-c} with the
  2416. cursor on or at a target.
  2417. @node External links, Handling links, Internal links, Hyperlinks
  2418. @section External links
  2419. @cindex links, external
  2420. @cindex external links
  2421. @cindex links, external
  2422. @cindex Gnus links
  2423. @cindex BBDB links
  2424. @cindex IRC links
  2425. @cindex URL links
  2426. @cindex file links
  2427. @cindex VM links
  2428. @cindex RMAIL links
  2429. @cindex WANDERLUST links
  2430. @cindex MH-E links
  2431. @cindex USENET links
  2432. @cindex SHELL links
  2433. @cindex Info links
  2434. @cindex Elisp links
  2435. Org supports links to files, websites, Usenet and email messages,
  2436. BBDB database entries and links to both IRC conversations and their
  2437. logs. External links are URL-like locators. They start with a short
  2438. identifying string followed by a colon. There can be no space after
  2439. the colon. The following list shows examples for each link type.
  2440. @example
  2441. http://www.astro.uva.nl/~dominik @r{on the web}
  2442. file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
  2443. /home/dominik/images/jupiter.jpg @r{same as above}
  2444. file:papers/last.pdf @r{file, relative path}
  2445. ./papers/last.pdf @r{same as above}
  2446. file:/myself@@some.where:papers/last.pdf @r{file, path on remote machine}
  2447. /myself@@some.where:papers/last.pdf @r{same as above}
  2448. file:sometextfile::NNN @r{file with line number to jump to}
  2449. file:projects.org @r{another Org file}
  2450. file:projects.org::some words @r{text search in Org file}
  2451. file:projects.org::*task title @r{heading search in Org file}
  2452. docview:papers/last.pdf::NNN @r{open file in doc-view mode at page NNN}
  2453. id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID}
  2454. news:comp.emacs @r{Usenet link}
  2455. mailto:adent@@galaxy.net @r{Mail link}
  2456. vm:folder @r{VM folder link}
  2457. vm:folder#id @r{VM message link}
  2458. vm://myself@@some.where.org/folder#id @r{VM on remote machine}
  2459. wl:folder @r{WANDERLUST folder link}
  2460. wl:folder#id @r{WANDERLUST message link}
  2461. mhe:folder @r{MH-E folder link}
  2462. mhe:folder#id @r{MH-E message link}
  2463. rmail:folder @r{RMAIL folder link}
  2464. rmail:folder#id @r{RMAIL message link}
  2465. gnus:group @r{Gnus group link}
  2466. gnus:group#id @r{Gnus article link}
  2467. bbdb:R.*Stallman @r{BBDB link (with regexp)}
  2468. irc:/irc.com/#emacs/bob @r{IRC link}
  2469. shell:ls *.org @r{A shell command}
  2470. elisp:org-agenda @r{Interactive Elisp command}
  2471. elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate}
  2472. @end example
  2473. A link should be enclosed in double brackets and may contain a
  2474. descriptive text to be displayed instead of the URL (@pxref{Link
  2475. format}), for example:
  2476. @example
  2477. [[http://www.gnu.org/software/emacs/][GNU Emacs]]
  2478. @end example
  2479. @noindent
  2480. If the description is a file name or URL that points to an image, HTML
  2481. export (@pxref{HTML export}) will inline the image as a clickable
  2482. button. If there is no description at all and the link points to an
  2483. image,
  2484. that image will be inlined into the exported HTML file.
  2485. @cindex square brackets, around links
  2486. @cindex plain text external links
  2487. Org also finds external links in the normal text and activates them
  2488. as links. If spaces must be part of the link (for example in
  2489. @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
  2490. about the end of the link, enclose them in square brackets.
  2491. @node Handling links, Using links outside Org, External links, Hyperlinks
  2492. @section Handling links
  2493. @cindex links, handling
  2494. Org provides methods to create a link in the correct syntax, to
  2495. insert it into an Org file, and to follow the link.
  2496. @table @kbd
  2497. @kindex C-c l
  2498. @cindex storing links
  2499. @item C-c l
  2500. Store a link to the current location. This is a @emph{global} command (you
  2501. must create the key binding yourself) which can be used in any buffer to
  2502. create a link. The link will be stored for later insertion into an Org
  2503. buffer (see below). What kind of link will be created depends on the current
  2504. buffer:
  2505. @b{Org-mode buffers}@*
  2506. For Org files, if there is a @samp{<<target>>} at the cursor, the link points
  2507. to the target. Otherwise it points to the current headline, which will also
  2508. be the description.
  2509. @vindex org-link-to-org-use-id
  2510. @cindex property, CUSTOM_ID
  2511. @cindex property, ID
  2512. If the headline has a @code{CUSTOM_ID} property, a link to this custom ID
  2513. will be stored. In addition or alternatively (depending on the value of
  2514. @code{org-link-to-org-use-id}), a globally unique @code{ID} property will be
  2515. created and/or used to construct a link. So using this command in Org
  2516. buffers will potentially create two links: a human-readable from the custom
  2517. ID, and one that is globally unique and works even if the entry is moved from
  2518. file to file. Later, when inserting the link, you need to decide which one
  2519. to use.
  2520. @b{Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus}@*
  2521. Pretty much all Emacs mail clients are supported. The link will point to the
  2522. current article, or, in some GNUS buffers, to the group. The description is
  2523. constructed from the author and the subject.
  2524. @b{Web browsers: W3 and W3M}@*
  2525. Here the link will be the current URL, with the page title as description.
  2526. @b{Contacts: BBDB}@*
  2527. Links created in a BBDB buffer will point to the current entry.
  2528. @b{Chat: IRC}@*
  2529. @vindex org-irc-link-to-logs
  2530. For IRC links, if you set the variable @code{org-irc-link-to-logs} to
  2531. @code{t}, a @samp{file:/} style link to the relevant point in the logs for
  2532. the current conversation is created. Otherwise an @samp{irc:/} style link to
  2533. the user/channel/server under the point will be stored.
  2534. @b{Other files}@*
  2535. For any other files, the link will point to the file, with a search string
  2536. (@pxref{Search options}) pointing to the contents of the current line. If
  2537. there is an active region, the selected words will form the basis of the
  2538. search string. If the automatically created link is not working correctly or
  2539. accurately enough, you can write custom functions to select the search string
  2540. and to do the search for particular file types---see @ref{Custom searches}.
  2541. The key binding @kbd{C-c l} is only a suggestion---see @ref{Installation}.
  2542. @b{Agenda view}@*
  2543. When the cursor is in an agenda view, the created link points to the
  2544. entry referenced by the current line.
  2545. @c
  2546. @kindex C-c C-l
  2547. @cindex link completion
  2548. @cindex completion, of links
  2549. @cindex inserting links
  2550. @item C-c C-l
  2551. @vindex org-keep-stored-link-after-insertion
  2552. Insert a link@footnote{ Note that you don't have to use this command to
  2553. insert a link. Links in Org are plain text, and you can type or paste them
  2554. straight into the buffer. By using this command, the links are automatically
  2555. enclosed in double brackets, and you will be asked for the optional
  2556. descriptive text.}. This prompts for a link to be inserted into the buffer.
  2557. You can just type a link, using text for an internal link, or one of the link
  2558. type prefixes mentioned in the examples above. The link will be inserted
  2559. into the buffer@footnote{After insertion of a stored link, the link will be
  2560. removed from the list of stored links. To keep it in the list later use, use
  2561. a triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
  2562. @code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
  2563. If some text was selected when this command is called, the selected text
  2564. becomes the default description.
  2565. @b{Inserting stored links}@*
  2566. All links stored during the
  2567. current session are part of the history for this prompt, so you can access
  2568. them with @key{up} and @key{down} (or @kbd{M-p/n}).
  2569. @b{Completion support}@* Completion with @key{TAB} will help you to insert
  2570. valid link prefixes like @samp{http:} or @samp{ftp:}, including the prefixes
  2571. defined through link abbreviations (@pxref{Link abbreviations}). If you
  2572. press @key{RET} after inserting only the @var{prefix}, Org will offer
  2573. specific completion support for some link types@footnote{This works by
  2574. calling a special function @code{org-PREFIX-complete-link}.} For
  2575. example, if you type @kbd{file @key{RET}}, file name completion (alternative
  2576. access: @kbd{C-u C-c C-l}, see below) will be offered, and after @kbd{bbdb
  2577. @key{RET}} you can complete contact names.
  2578. @kindex C-u C-c C-l
  2579. @cindex file name completion
  2580. @cindex completion, of file names
  2581. @item C-u C-c C-l
  2582. When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
  2583. a file will be inserted and you may use file name completion to select
  2584. the name of the file. The path to the file is inserted relative to the
  2585. directory of the current Org file, if the linked file is in the current
  2586. directory or in a sub-directory of it, or if the path is written relative
  2587. to the current directory using @samp{../}. Otherwise an absolute path
  2588. is used, if possible with @samp{~/} for your home directory. You can
  2589. force an absolute path with two @kbd{C-u} prefixes.
  2590. @c
  2591. @item C-c C-l @r{(with cursor on existing link)}
  2592. When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
  2593. link and description parts of the link.
  2594. @c
  2595. @cindex following links
  2596. @kindex C-c C-o
  2597. @kindex RET
  2598. @item C-c C-o @r{or} @key{RET}
  2599. @vindex org-file-apps
  2600. Open link at point. This will launch a web browser for URLs (using
  2601. @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
  2602. the corresponding links, and execute the command in a shell link. When the
  2603. cursor is on an internal link, this commands runs the corresponding search.
  2604. When the cursor is on a TAG list in a headline, it creates the corresponding
  2605. TAGS view. If the cursor is on a timestamp, it compiles the agenda for that
  2606. date. Furthermore, it will visit text and remote files in @samp{file:} links
  2607. with Emacs and select a suitable application for local non-text files.
  2608. Classification of files is based on file extension only. See option
  2609. @code{org-file-apps}. If you want to override the default application and
  2610. visit the file with Emacs, use a @kbd{C-u} prefix. If you want to avoid
  2611. opening in Emacs, use a @kbd{C-u C-u} prefix.@*
  2612. If the cursor is on a headline, but not on a link, offer all links in the
  2613. headline and entry text.
  2614. @c
  2615. @kindex mouse-2
  2616. @kindex mouse-1
  2617. @item mouse-2
  2618. @itemx mouse-1
  2619. On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
  2620. would. Under Emacs 22, @kbd{mouse-1} will also follow a link.
  2621. @c
  2622. @kindex mouse-3
  2623. @item mouse-3
  2624. @vindex org-display-internal-link-with-indirect-buffer
  2625. Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
  2626. internal links to be displayed in another window@footnote{See the
  2627. variable @code{org-display-internal-link-with-indirect-buffer}}.
  2628. @c
  2629. @cindex mark ring
  2630. @kindex C-c %
  2631. @item C-c %
  2632. Push the current position onto the mark ring, to be able to return
  2633. easily. Commands following an internal link do this automatically.
  2634. @c
  2635. @cindex links, returning to
  2636. @kindex C-c &
  2637. @item C-c &
  2638. Jump back to a recorded position. A position is recorded by the
  2639. commands following internal links, and by @kbd{C-c %}. Using this
  2640. command several times in direct succession moves through a ring of
  2641. previously recorded positions.
  2642. @c
  2643. @kindex C-c C-x C-n
  2644. @kindex C-c C-x C-p
  2645. @cindex links, finding next/previous
  2646. @item C-c C-x C-n
  2647. @itemx C-c C-x C-p
  2648. Move forward/backward to the next link in the buffer. At the limit of
  2649. the buffer, the search fails once, and then wraps around. The key
  2650. bindings for this are really too long, you might want to bind this also
  2651. to @kbd{C-n} and @kbd{C-p}
  2652. @lisp
  2653. (add-hook 'org-load-hook
  2654. (lambda ()
  2655. (define-key 'org-mode-map "\C-n" 'org-next-link)
  2656. (define-key 'org-mode-map "\C-p" 'org-previous-link)))
  2657. @end lisp
  2658. @end table
  2659. @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
  2660. @section Using links outside Org
  2661. You can insert and follow links that have Org syntax not only in
  2662. Org, but in any Emacs buffer. For this, you should create two
  2663. global commands, like this (please select suitable global keys
  2664. yourself):
  2665. @lisp
  2666. (global-set-key "\C-c L" 'org-insert-link-global)
  2667. (global-set-key "\C-c o" 'org-open-at-point-global)
  2668. @end lisp
  2669. @node Link abbreviations, Search options, Using links outside Org, Hyperlinks
  2670. @section Link abbreviations
  2671. @cindex link abbreviations
  2672. @cindex abbreviation, links
  2673. Long URLs can be cumbersome to type, and often many similar links are
  2674. needed in a document. For this you can use link abbreviations. An
  2675. abbreviated link looks like this
  2676. @example
  2677. [[linkword:tag][description]]
  2678. @end example
  2679. @noindent
  2680. @vindex org-link-abbrev-alist
  2681. where the tag is optional. The @i{linkword} must be a word; letter, numbers,
  2682. @samp{-}, and @samp{_} are allowed here. Abbreviations are resolved
  2683. according to the information in the variable @code{org-link-abbrev-alist}
  2684. that relates the linkwords to replacement text. Here is an example:
  2685. @lisp
  2686. @group
  2687. (setq org-link-abbrev-alist
  2688. '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
  2689. ("google" . "http://www.google.com/search?q=")
  2690. ("ads" . "http://adsabs.harvard.edu/cgi-bin/
  2691. nph-abs_connect?author=%s&db_key=AST")))
  2692. @end group
  2693. @end lisp
  2694. If the replacement text contains the string @samp{%s}, it will be
  2695. replaced with the tag. Otherwise the tag will be appended to the string
  2696. in order to create the link. You may also specify a function that will
  2697. be called with the tag as the only argument to create the link.
  2698. With the above setting, you could link to a specific bug with
  2699. @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
  2700. @code{[[google:OrgMode]]} and find out what the Org author is
  2701. doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
  2702. If you need special abbreviations just for a single Org buffer, you
  2703. can define them in the file with
  2704. @cindex #+LINK
  2705. @example
  2706. #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
  2707. #+LINK: google http://www.google.com/search?q=%s
  2708. @end example
  2709. @noindent
  2710. In-buffer completion (@pxref{Completion}) can be used after @samp{[} to
  2711. complete link abbreviations. You may also define a function
  2712. @code{org-PREFIX-complete-link} that implements special (e.g. completion)
  2713. support for inserting such a link with @kbd{C-c C-l}. Such a function should
  2714. not accept any arguments, and return the full link with prefix.
  2715. @node Search options, Custom searches, Link abbreviations, Hyperlinks
  2716. @section Search options in file links
  2717. @cindex search option in file links
  2718. @cindex file links, searching
  2719. File links can contain additional information to make Emacs jump to a
  2720. particular location in the file when following a link. This can be a
  2721. line number or a search option after a double@footnote{For backward
  2722. compatibility, line numbers can also follow a single colon.} colon. For
  2723. example, when the command @kbd{C-c l} creates a link (@pxref{Handling
  2724. links}) to a file, it encodes the words in the current line as a search
  2725. string that can be used to find this line back later when following the
  2726. link with @kbd{C-c C-o}.
  2727. Here is the syntax of the different ways to attach a search to a file
  2728. link, together with an explanation:
  2729. @example
  2730. [[file:~/code/main.c::255]]
  2731. [[file:~/xx.org::My Target]]
  2732. [[file:~/xx.org::*My Target]]
  2733. [[file:~/xx.org::#my-custom-id]]
  2734. [[file:~/xx.org::/regexp/]]
  2735. @end example
  2736. @table @code
  2737. @item 255
  2738. Jump to line 255.
  2739. @item My Target
  2740. Search for a link target @samp{<<My Target>>}, or do a text search for
  2741. @samp{my target}, similar to the search in internal links, see
  2742. @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
  2743. link will become an HTML reference to the corresponding named anchor in
  2744. the linked file.
  2745. @item *My Target
  2746. In an Org file, restrict search to headlines.
  2747. @item #my-custom-id
  2748. Link to a heading with a @code{CUSTOM_ID} property
  2749. @item /regexp/
  2750. Do a regular expression search for @code{regexp}. This uses the Emacs
  2751. command @code{occur} to list all matches in a separate window. If the
  2752. target file is in Org mode, @code{org-occur} is used to create a
  2753. sparse tree with the matches.
  2754. @c If the target file is a directory,
  2755. @c @code{grep} will be used to search all files in the directory.
  2756. @end table
  2757. As a degenerate case, a file link with an empty file name can be used
  2758. to search the current file. For example, @code{[[file:::find me]]} does
  2759. a search for @samp{find me} in the current file, just as
  2760. @samp{[[find me]]} would.
  2761. @node Custom searches, , Search options, Hyperlinks
  2762. @section Custom Searches
  2763. @cindex custom search strings
  2764. @cindex search strings, custom
  2765. The default mechanism for creating search strings and for doing the
  2766. actual search related to a file link may not work correctly in all
  2767. cases. For example, Bib@TeX{} database files have many entries like
  2768. @samp{year="1993"} which would not result in good search strings,
  2769. because the only unique identification for a Bib@TeX{} entry is the
  2770. citation key.
  2771. @vindex org-create-file-search-functions
  2772. @vindex org-execute-file-search-functions
  2773. If you come across such a problem, you can write custom functions to set
  2774. the right search string for a particular file type, and to do the search
  2775. for the string in the file. Using @code{add-hook}, these functions need
  2776. to be added to the hook variables
  2777. @code{org-create-file-search-functions} and
  2778. @code{org-execute-file-search-functions}. See the docstring for these
  2779. variables for more information. Org actually uses this mechanism
  2780. for Bib@TeX{} database files, and you can use the corresponding code as
  2781. an implementation example. See the file @file{org-bibtex.el}.
  2782. @node TODO Items, Tags, Hyperlinks, Top
  2783. @chapter TODO Items
  2784. @cindex TODO items
  2785. Org mode does not maintain TODO lists as separate documents@footnote{Of
  2786. course, you can make a document that contains only long lists of TODO items,
  2787. but this is not required.}. Instead, TODO items are an integral part of the
  2788. notes file, because TODO items usually come up while taking notes! With Org
  2789. mode, simply mark any entry in a tree as being a TODO item. In this way,
  2790. information is not duplicated, and the entire context from which the TODO
  2791. item emerged is always present.
  2792. Of course, this technique for managing TODO items scatters them
  2793. throughout your notes file. Org mode compensates for this by providing
  2794. methods to give you an overview of all the things that you have to do.
  2795. @menu
  2796. * TODO basics:: Marking and displaying TODO entries
  2797. * TODO extensions:: Workflow and assignments
  2798. * Progress logging:: Dates and notes for progress
  2799. * Priorities:: Some things are more important than others
  2800. * Breaking down tasks:: Splitting a task into manageable pieces
  2801. * Checkboxes:: Tick-off lists
  2802. @end menu
  2803. @node TODO basics, TODO extensions, TODO Items, TODO Items
  2804. @section Basic TODO functionality
  2805. Any headline becomes a TODO item when it starts with the word
  2806. @samp{TODO}, for example:
  2807. @example
  2808. *** TODO Write letter to Sam Fortune
  2809. @end example
  2810. @noindent
  2811. The most important commands to work with TODO entries are:
  2812. @table @kbd
  2813. @kindex C-c C-t
  2814. @cindex cycling, of TODO states
  2815. @item C-c C-t
  2816. Rotate the TODO state of the current item among
  2817. @example
  2818. ,-> (unmarked) -> TODO -> DONE --.
  2819. '--------------------------------'
  2820. @end example
  2821. The same rotation can also be done ``remotely'' from the timeline and
  2822. agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
  2823. @kindex C-u C-c C-t
  2824. @item C-u C-c C-t
  2825. Select a specific keyword using completion or (if it has been set up)
  2826. the fast selection interface. For the latter, you need to assign keys
  2827. to TODO states, see @ref{Per-file keywords}, and @ref{Setting tags}, for
  2828. more information.
  2829. @kindex S-@key{right}
  2830. @kindex S-@key{left}
  2831. @vindex org-treat-S-cursor-todo-selection-as-state-change
  2832. @item S-@key{right}
  2833. @itemx S-@key{left}
  2834. Select the following/preceding TODO state, similar to cycling. Useful
  2835. mostly if more than two TODO states are possible (@pxref{TODO
  2836. extensions}). See also @ref{Conflicts}, for a discussion of the interaction
  2837. with @code{shift-selection-mode}. See also the variable
  2838. @code{org-treat-S-cursor-todo-selection-as-state-change}.
  2839. @kindex C-c C-v
  2840. @kindex C-c / t
  2841. @cindex sparse tree, for TODO
  2842. @item C-c C-v
  2843. @itemx C-c / t
  2844. @vindex org-todo-keywords
  2845. View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds the
  2846. entire buffer, but shows all TODO items and the headings hierarchy above
  2847. them. With a prefix argument, search for a specific TODO. You will be
  2848. prompted for the keyword, and you can also give a list of keywords like
  2849. @code{KWD1|KWD2|...} to list entries that match any one of these keywords.
  2850. With numeric prefix argument N, show the tree for the Nth keyword in the
  2851. variable @code{org-todo-keywords}. With two prefix arguments, find all TODO
  2852. and DONE entries.
  2853. @kindex C-c a t
  2854. @item C-c a t
  2855. Show the global TODO list. Collects the TODO items from all agenda
  2856. files (@pxref{Agenda Views}) into a single buffer. The new buffer will
  2857. be in @code{agenda-mode}, which provides commands to examine and
  2858. manipulate the TODO entries from the new buffer (@pxref{Agenda
  2859. commands}). @xref{Global TODO list}, for more information.
  2860. @kindex S-M-@key{RET}
  2861. @item S-M-@key{RET}
  2862. Insert a new TODO entry below the current one.
  2863. @end table
  2864. @noindent
  2865. @vindex org-todo-state-tags-triggers
  2866. Changing a TODO state can also trigger tag changes. See the docstring of the
  2867. option @code{org-todo-state-tags-triggers} for details.
  2868. @node TODO extensions, Progress logging, TODO basics, TODO Items
  2869. @section Extended use of TODO keywords
  2870. @cindex extended TODO keywords
  2871. @vindex org-todo-keywords
  2872. By default, marked TODO entries have one of only two states: TODO and
  2873. DONE. Org mode allows you to classify TODO items in more complex ways
  2874. with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
  2875. special setup, the TODO keyword system can work differently in different
  2876. files.
  2877. Note that @i{tags} are another way to classify headlines in general and
  2878. TODO items in particular (@pxref{Tags}).
  2879. @menu
  2880. * Workflow states:: From TODO to DONE in steps
  2881. * TODO types:: I do this, Fred does the rest
  2882. * Multiple sets in one file:: Mixing it all, and still finding your way
  2883. * Fast access to TODO states:: Single letter selection of a state
  2884. * Per-file keywords:: Different files, different requirements
  2885. * Faces for TODO keywords:: Highlighting states
  2886. * TODO dependencies:: When one task needs to wait for others
  2887. @end menu
  2888. @node Workflow states, TODO types, TODO extensions, TODO extensions
  2889. @subsection TODO keywords as workflow states
  2890. @cindex TODO workflow
  2891. @cindex workflow states as TODO keywords
  2892. You can use TODO keywords to indicate different @emph{sequential} states
  2893. in the process of working on an item, for example@footnote{Changing
  2894. this variable only becomes effective after restarting Org mode in a
  2895. buffer.}:
  2896. @lisp
  2897. (setq org-todo-keywords
  2898. '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
  2899. @end lisp
  2900. The vertical bar separates the TODO keywords (states that @emph{need
  2901. action}) from the DONE states (which need @emph{no further action}). If
  2902. you don't provide the separator bar, the last state is used as the DONE
  2903. state.
  2904. @cindex completion, of TODO keywords
  2905. With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
  2906. to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
  2907. also use a numeric prefix argument to quickly select a specific state. For
  2908. example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
  2909. Or you can use @kbd{S-@key{left}} to go backward through the sequence. If you
  2910. define many keywords, you can use in-buffer completion
  2911. (@pxref{Completion}) or even a special one-key selection scheme
  2912. (@pxref{Fast access to TODO states}) to insert these words into the
  2913. buffer. Changing a TODO state can be logged with a timestamp, see
  2914. @ref{Tracking TODO state changes}, for more information.
  2915. @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
  2916. @subsection TODO keywords as types
  2917. @cindex TODO types
  2918. @cindex names as TODO keywords
  2919. @cindex types as TODO keywords
  2920. The second possibility is to use TODO keywords to indicate different
  2921. @emph{types} of action items. For example, you might want to indicate
  2922. that items are for ``work'' or ``home''. Or, when you work with several
  2923. people on a single project, you might want to assign action items
  2924. directly to persons, by using their names as TODO keywords. This would
  2925. be set up like this:
  2926. @lisp
  2927. (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
  2928. @end lisp
  2929. In this case, different keywords do not indicate a sequence, but rather
  2930. different types. So the normal work flow would be to assign a task to a
  2931. person, and later to mark it DONE. Org mode supports this style by adapting
  2932. the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
  2933. @kbd{t} command in the timeline and agenda buffers.}. When used several
  2934. times in succession, it will still cycle through all names, in order to first
  2935. select the right type for a task. But when you return to the item after some
  2936. time and execute @kbd{C-c C-t} again, it will switch from any name directly
  2937. to DONE. Use prefix arguments or completion to quickly select a specific
  2938. name. You can also review the items of a specific TODO type in a sparse tree
  2939. by using a numeric prefix to @kbd{C-c C-v}. For example, to see all things
  2940. Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect Lucy's items
  2941. from all agenda files into a single buffer, you would use the numeric prefix
  2942. argument as well when creating the global TODO list: @kbd{C-3 C-c t}.
  2943. @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
  2944. @subsection Multiple keyword sets in one file
  2945. @cindex TODO keyword sets
  2946. Sometimes you may want to use different sets of TODO keywords in
  2947. parallel. For example, you may want to have the basic
  2948. @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
  2949. separate state indicating that an item has been canceled (so it is not
  2950. DONE, but also does not require action). Your setup would then look
  2951. like this:
  2952. @lisp
  2953. (setq org-todo-keywords
  2954. '((sequence "TODO" "|" "DONE")
  2955. (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
  2956. (sequence "|" "CANCELED")))
  2957. @end lisp
  2958. The keywords should all be different, this helps Org mode to keep track
  2959. of which subsequence should be used for a given entry. In this setup,
  2960. @kbd{C-c C-t} only operates within a subsequence, so it switches from
  2961. @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
  2962. (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
  2963. select the correct sequence. Besides the obvious ways like typing a
  2964. keyword or using completion, you may also apply the following commands:
  2965. @table @kbd
  2966. @kindex C-S-@key{right}
  2967. @kindex C-S-@key{left}
  2968. @kindex C-u C-u C-c C-t
  2969. @item C-u C-u C-c C-t
  2970. @itemx C-S-@key{right}
  2971. @itemx C-S-@key{left}
  2972. These keys jump from one TODO subset to the next. In the above example,
  2973. @kbd{C-u C-u C-c C-t} or @kbd{C-S-@key{right}} would jump from @code{TODO} or
  2974. @code{DONE} to @code{REPORT}, and any of the words in the second row to
  2975. @code{CANCELED}. Note that the @kbd{C-S-} key binding conflict with
  2976. @code{shift-selection-mode} (@pxref{Conflicts}).
  2977. @kindex S-@key{right}
  2978. @kindex S-@key{left}
  2979. @item S-@key{right}
  2980. @itemx S-@key{left}
  2981. @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through @emph{all}
  2982. keywords from all sets, so for example @kbd{S-@key{<right>}} would switch
  2983. from @code{DONE} to @code{REPORT} in the example above. See also
  2984. @ref{Conflicts}, for a discussion of the interaction with
  2985. @code{shift-selection-mode}.
  2986. @end table
  2987. @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
  2988. @subsection Fast access to TODO states
  2989. If you would like to quickly change an entry to an arbitrary TODO state
  2990. instead of cycling through the states, you can set up keys for
  2991. single-letter access to the states. This is done by adding the section
  2992. key after each keyword, in parentheses. For example:
  2993. @lisp
  2994. (setq org-todo-keywords
  2995. '((sequence "TODO(t)" "|" "DONE(d)")
  2996. (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
  2997. (sequence "|" "CANCELED(c)")))
  2998. @end lisp
  2999. @vindex org-fast-tag-selection-include-todo
  3000. If you then press @code{C-c C-t} followed by the selection key, the entry
  3001. will be switched to this state. @key{SPC} can be used to remove any TODO
  3002. keyword from an entry.@footnote{Check also the variable
  3003. @code{org-fast-tag-selection-include-todo}, it allows you to change the TODO
  3004. state through the tags interface (@pxref{Setting tags}), in case you like to
  3005. mingle the two concepts. Note that this means you need to come up with
  3006. unique keys across both sets of keywords.}
  3007. @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
  3008. @subsection Setting up keywords for individual files
  3009. @cindex keyword options
  3010. @cindex per-file keywords
  3011. @cindex #+TODO
  3012. @cindex #+TYP_TODO
  3013. @cindex #+SEQ_TODO
  3014. It can be very useful to use different aspects of the TODO mechanism in
  3015. different files. For file-local settings, you need to add special lines
  3016. to the file which set the keywords and interpretation for that file
  3017. only. For example, to set one of the two examples discussed above, you
  3018. need one of the following lines, starting in column zero anywhere in the
  3019. file:
  3020. @example
  3021. #+TODO: TODO FEEDBACK VERIFY | DONE CANCELED
  3022. @end example
  3023. @noindent (you may also write @code{#+SEQ_TODO} to be explicit about the
  3024. interpretation, but it means the same as @code{#+TODO}), or
  3025. @example
  3026. #+TYP_TODO: Fred Sara Lucy Mike | DONE
  3027. @end example
  3028. A setup for using several sets in parallel would be:
  3029. @example
  3030. #+TODO: TODO | DONE
  3031. #+TODO: REPORT BUG KNOWNCAUSE | FIXED
  3032. #+TODO: | CANCELED
  3033. @end example
  3034. @cindex completion, of option keywords
  3035. @kindex M-@key{TAB}
  3036. @noindent To make sure you are using the correct keyword, type
  3037. @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
  3038. @cindex DONE, final TODO keyword
  3039. Remember that the keywords after the vertical bar (or the last keyword
  3040. if no bar is there) must always mean that the item is DONE (although you
  3041. may use a different word). After changing one of these lines, use
  3042. @kbd{C-c C-c} with the cursor still in the line to make the changes
  3043. known to Org mode@footnote{Org mode parses these lines only when
  3044. Org mode is activated after visiting a file. @kbd{C-c C-c} with the
  3045. cursor in a line starting with @samp{#+} is simply restarting Org mode
  3046. for the current buffer.}.
  3047. @node Faces for TODO keywords, TODO dependencies, Per-file keywords, TODO extensions
  3048. @subsection Faces for TODO keywords
  3049. @cindex faces, for TODO keywords
  3050. @vindex org-todo @r{(face)}
  3051. @vindex org-done @r{(face)}
  3052. @vindex org-todo-keyword-faces
  3053. Org mode highlights TODO keywords with special faces: @code{org-todo}
  3054. for keywords indicating that an item still has to be acted upon, and
  3055. @code{org-done} for keywords indicating that an item is finished. If
  3056. you are using more than 2 different states, you might want to use
  3057. special faces for some of them. This can be done using the variable
  3058. @code{org-todo-keyword-faces}. For example:
  3059. @lisp
  3060. @group
  3061. (setq org-todo-keyword-faces
  3062. '(("TODO" . org-warning) ("STARTED" . "yellow")
  3063. ("CANCELED" . (:foreground "blue" :weight bold))))
  3064. @end group
  3065. @end lisp
  3066. While using a list with face properties as shown for CANCELED @emph{should}
  3067. work, this does not aways seem to be the case. If necessary, define a
  3068. special face and use that. A string is interpreted as a color. The variable
  3069. @code{org-faces-easy-properties} determines if that color is interpreted as a
  3070. foreground or a background color.
  3071. @node TODO dependencies, , Faces for TODO keywords, TODO extensions
  3072. @subsection TODO dependencies
  3073. @cindex TODO dependencies
  3074. @cindex dependencies, of TODO states
  3075. @vindex org-enforce-todo-dependencies
  3076. @cindex property, ORDERED
  3077. The structure of Org files (hierarchy and lists) makes it easy to define TODO
  3078. dependencies. Usually, a parent TODO task should not be marked DONE until
  3079. all subtasks (defined as children tasks) are marked as DONE. And sometimes
  3080. there is a logical sequence to a number of (sub)tasks, so that one task
  3081. cannot be acted upon before all siblings above it are done. If you customize
  3082. the variable @code{org-enforce-todo-dependencies}, Org will block entries
  3083. from changing state to DONE while they have children that are not DONE.
  3084. Furthermore, if an entry has a property @code{ORDERED}, each of its children
  3085. will be blocked until all earlier siblings are marked DONE. Here is an
  3086. example:
  3087. @example
  3088. * TODO Blocked until (two) is done
  3089. ** DONE one
  3090. ** TODO two
  3091. * Parent
  3092. :PROPERTIES:
  3093. :ORDERED: t
  3094. :END:
  3095. ** TODO a
  3096. ** TODO b, needs to wait for (a)
  3097. ** TODO c, needs to wait for (a) and (b)
  3098. @end example
  3099. @table @kbd
  3100. @kindex C-c C-x o
  3101. @item C-c C-x o
  3102. @vindex org-track-ordered-property-with-tag
  3103. @cindex property, ORDERED
  3104. Toggle the @code{ORDERED} property of the current entry. A property is used
  3105. for this behavior because this should be local to the current entry, not
  3106. inherited like a tag. However, if you would like to @i{track} the value of
  3107. this property with a tag for better visibility, customize the variable
  3108. @code{org-track-ordered-property-with-tag}.
  3109. @kindex C-u C-u C-u C-c C-t
  3110. @item C-u C-u C-u C-c C-t
  3111. Change TODO state, circumventing any state blocking.
  3112. @end table
  3113. @vindex org-agenda-dim-blocked-tasks
  3114. If you set the variable @code{org-agenda-dim-blocked-tasks}, TODO entries
  3115. that cannot be closed because of such dependencies will be shown in a dimmed
  3116. font or even made invisible in agenda views (@pxref{Agenda Views}).
  3117. @cindex checkboxes and TODO dependencies
  3118. @vindex org-enforce-todo-dependencies
  3119. You can also block changes of TODO states by looking at checkboxes
  3120. (@pxref{Checkboxes}). If you set the variable
  3121. @code{org-enforce-todo-checkbox-dependencies}, an entry that has unchecked
  3122. checkboxes will be blocked from switching to DONE.
  3123. If you need more complex dependency structures, for example dependencies
  3124. between entries in different trees or files, check out the contributed
  3125. module @file{org-depend.el}.
  3126. @page
  3127. @node Progress logging, Priorities, TODO extensions, TODO Items
  3128. @section Progress logging
  3129. @cindex progress logging
  3130. @cindex logging, of progress
  3131. Org mode can automatically record a timestamp and possibly a note when
  3132. you mark a TODO item as DONE, or even each time you change the state of
  3133. a TODO item. This system is highly configurable, settings can be on a
  3134. per-keyword basis and can be localized to a file or even a subtree. For
  3135. information on how to clock working time for a task, see @ref{Clocking
  3136. work time}.
  3137. @menu
  3138. * Closing items:: When was this entry marked DONE?
  3139. * Tracking TODO state changes:: When did the status change?
  3140. * Tracking your habits:: How consistent have you been?
  3141. @end menu
  3142. @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
  3143. @subsection Closing items
  3144. The most basic logging is to keep track of @emph{when} a certain TODO
  3145. item was finished. This is achieved with@footnote{The corresponding
  3146. in-buffer setting is: @code{#+STARTUP: logdone}}.
  3147. @lisp
  3148. (setq org-log-done 'time)
  3149. @end lisp
  3150. @noindent
  3151. Then each time you turn an entry from a TODO (not-done) state into any
  3152. of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
  3153. just after the headline. If you turn the entry back into a TODO item
  3154. through further state cycling, that line will be removed again. If you
  3155. want to record a note along with the timestamp, use@footnote{The
  3156. corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
  3157. @lisp
  3158. (setq org-log-done 'note)
  3159. @end lisp
  3160. @noindent
  3161. You will then be prompted for a note, and that note will be stored below
  3162. the entry with a @samp{Closing Note} heading.
  3163. In the timeline (@pxref{Timeline}) and in the agenda
  3164. (@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
  3165. display the TODO items with a @samp{CLOSED} timestamp on each day,
  3166. giving you an overview of what has been done.
  3167. @node Tracking TODO state changes, Tracking your habits, Closing items, Progress logging
  3168. @subsection Tracking TODO state changes
  3169. @cindex drawer, for state change recording
  3170. @vindex org-log-states-order-reversed
  3171. @vindex org-log-into-drawer
  3172. @cindex property, LOG_INTO_DRAWER
  3173. When TODO keywords are used as workflow states (@pxref{Workflow states}), you
  3174. might want to keep track of when a state change occurred and maybe take a
  3175. note about this change. You can either record just a timestamp, or a
  3176. time-stamped note for a change. These records will be inserted after the
  3177. headline as an itemized list, newest first@footnote{See the variable
  3178. @code{org-log-states-order-reversed}}. When taking a lot of notes, you might
  3179. want to get the notes out of the way into a drawer (@pxref{Drawers}).
  3180. Customize the variable @code{org-log-into-drawer} to get this
  3181. behavior---the recommended drawer for this is called @code{LOGBOOK}. You can
  3182. also overrule the setting of this variable for a subtree by setting a
  3183. @code{LOG_INTO_DRAWER} property.
  3184. Since it is normally too much to record a note for every state, Org mode
  3185. expects configuration on a per-keyword basis for this. This is achieved by
  3186. adding special markers @samp{!} (for a timestamp) and @samp{@@} (for a note)
  3187. in parentheses after each keyword. For example, with the setting
  3188. @lisp
  3189. (setq org-todo-keywords
  3190. '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
  3191. @end lisp
  3192. @noindent
  3193. @vindex org-log-done
  3194. you not only define global TODO keywords and fast access keys, but also
  3195. request that a time is recorded when the entry is set to
  3196. DONE@footnote{It is possible that Org mode will record two timestamps
  3197. when you are using both @code{org-log-done} and state change logging.
  3198. However, it will never prompt for two notes---if you have configured
  3199. both, the state change recording note will take precedence and cancel
  3200. the @samp{Closing Note}.}, and that a note is recorded when switching to
  3201. WAIT or CANCELED. The setting for WAIT is even more special: the
  3202. @samp{!} after the slash means that in addition to the note taken when
  3203. entering the state, a timestamp should be recorded when @i{leaving} the
  3204. WAIT state, if and only if the @i{target} state does not configure
  3205. logging for entering it. So it has no effect when switching from WAIT
  3206. to DONE, because DONE is configured to record a timestamp only. But
  3207. when switching from WAIT back to TODO, the @samp{/!} in the WAIT
  3208. setting now triggers a timestamp even though TODO has no logging
  3209. configured.
  3210. You can use the exact same syntax for setting logging preferences local
  3211. to a buffer:
  3212. @example
  3213. #+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
  3214. @end example
  3215. @cindex property, LOGGING
  3216. In order to define logging settings that are local to a subtree or a
  3217. single item, define a LOGGING property in this entry. Any non-empty
  3218. LOGGING property resets all logging settings to nil. You may then turn
  3219. on logging for this specific tree using STARTUP keywords like
  3220. @code{lognotedone} or @code{logrepeat}, as well as adding state specific
  3221. settings like @code{TODO(!)}. For example
  3222. @example
  3223. * TODO Log each state with only a time
  3224. :PROPERTIES:
  3225. :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
  3226. :END:
  3227. * TODO Only log when switching to WAIT, and when repeating
  3228. :PROPERTIES:
  3229. :LOGGING: WAIT(@@) logrepeat
  3230. :END:
  3231. * TODO No logging at all
  3232. :PROPERTIES:
  3233. :LOGGING: nil
  3234. :END:
  3235. @end example
  3236. @node Tracking your habits, , Tracking TODO state changes, Progress logging
  3237. @subsection Tracking your habits
  3238. @cindex habits
  3239. Org has the ability to track the consistency of a special category of TODOs,
  3240. called ``habits''. A habit has the following properties:
  3241. @enumerate
  3242. @item
  3243. You have enabled the @code{habits} module by customizing the variable
  3244. @code{org-modules}.
  3245. @item
  3246. The habit is a TODO, with a TODO keyword representing an open state.
  3247. @item
  3248. The property @code{STYLE} is set to the value @code{habit}.
  3249. @item
  3250. The TODO has a scheduled date, with a @code{.+} style repeat interval.
  3251. @item
  3252. The TODO may also have minimum and maximum ranges specified by using the
  3253. syntax @samp{.+2d/3d}, which says that you want to do the task at least every
  3254. three days, but at most every two days.
  3255. @item
  3256. You must also have state logging for the @code{DONE} state enabled, in order
  3257. for historical data to be represented in the consistency graph. If it's not
  3258. enabled it's not an error, but the consistency graphs will be largely
  3259. meaningless.
  3260. @end enumerate
  3261. To give you an idea of what the above rules look like in action, here's an
  3262. actual habit with some history:
  3263. @example
  3264. ** TODO Shave
  3265. SCHEDULED: <2009-10-17 Sat .+2d/4d>
  3266. - State "DONE" from "TODO" [2009-10-15 Thu]
  3267. - State "DONE" from "TODO" [2009-10-12 Mon]
  3268. - State "DONE" from "TODO" [2009-10-10 Sat]
  3269. - State "DONE" from "TODO" [2009-10-04 Sun]
  3270. - State "DONE" from "TODO" [2009-10-02 Fri]
  3271. - State "DONE" from "TODO" [2009-09-29 Tue]
  3272. - State "DONE" from "TODO" [2009-09-25 Fri]
  3273. - State "DONE" from "TODO" [2009-09-19 Sat]
  3274. - State "DONE" from "TODO" [2009-09-16 Wed]
  3275. - State "DONE" from "TODO" [2009-09-12 Sat]
  3276. :PROPERTIES:
  3277. :STYLE: habit
  3278. :LAST_REPEAT: [2009-10-19 Mon 00:36]
  3279. :END:
  3280. @end example
  3281. What this habit says is: I want to shave at most every 2 days (given by the
  3282. @code{SCHEDULED} date and repeat interval) and at least every 4 days. If
  3283. today is the 15th, then the habit first appears in the agenda on Oct 17,
  3284. after the minimum of 2 days has elapsed, and will appear overdue on Oct 19,
  3285. after four days have elapsed.
  3286. What's really useful about habits is that they are displayed along with a
  3287. consistency graph, to show how consistent you've been at getting that task
  3288. done in the past. This graph shows every day that the task was done over the
  3289. past three weeks, with colors for each day. The colors used are:
  3290. @table @code
  3291. @item Blue
  3292. If the task wasn't to be done yet on that day.
  3293. @item Green
  3294. If the task could have been done on that day.
  3295. @item Yellow
  3296. If the task was going to be overdue the next day.
  3297. @item Red
  3298. If the task was overdue on that day.
  3299. @end table
  3300. In addition to coloring each day, the day is also marked with an asterix if
  3301. the task was actually done that day, and an exclamation mark to show where
  3302. the current day falls in the graph.
  3303. There are several configuration variables that can be used to change the way
  3304. habits are displayed in the agenda.
  3305. @table @code
  3306. @item org-habit-graph-column
  3307. The buffer column at which the consistency graph should be drawn. This will
  3308. overwrite any text in that column, so it's a good idea to keep your habits'
  3309. titles brief and to the point.
  3310. @item org-habit-preceding-days
  3311. The amount of history, in days before today, to appear in consistency graphs.
  3312. @item org-habit-following-days
  3313. The number of days after today that will appear in consistency graphs.
  3314. @item org-habit-show-habits-only-for-today
  3315. If non-nil, only show habits in today's agenda view. This is set to true by
  3316. default.
  3317. @end table
  3318. Lastly, pressing @kbd{K} in the agenda buffer will cause habits to
  3319. temporarily be disabled and they won't appear at all. Press @kbd{K} again to
  3320. bring them back. They are also subject to tag filtering, if you have habits
  3321. which should only be done in certain contexts, for example.
  3322. @node Priorities, Breaking down tasks, Progress logging, TODO Items
  3323. @section Priorities
  3324. @cindex priorities
  3325. If you use Org mode extensively, you may end up enough TODO items that
  3326. it starts to make sense to prioritize them. Prioritizing can be done by
  3327. placing a @emph{priority cookie} into the headline of a TODO item, like
  3328. this
  3329. @example
  3330. *** TODO [#A] Write letter to Sam Fortune
  3331. @end example
  3332. @noindent
  3333. @vindex org-priority-faces
  3334. By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
  3335. @samp{C}. @samp{A} is the highest priority. An entry without a cookie is
  3336. treated as priority @samp{B}. Priorities make a difference only in the
  3337. agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have no
  3338. inherent meaning to Org mode. The cookies can be highlighted with special
  3339. faces by customizing the variable @code{org-priority-faces}.
  3340. Priorities can be attached to any outline tree entries; they do not need
  3341. to be TODO items.
  3342. @table @kbd
  3343. @kindex @kbd{C-c ,}
  3344. @item @kbd{C-c ,}
  3345. Set the priority of the current headline. The command prompts for a
  3346. priority character @samp{A}, @samp{B} or @samp{C}. When you press
  3347. @key{SPC} instead, the priority cookie is removed from the headline.
  3348. The priorities can also be changed ``remotely'' from the timeline and
  3349. agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
  3350. @c
  3351. @kindex S-@key{up}
  3352. @kindex S-@key{down}
  3353. @item S-@key{up}
  3354. @itemx S-@key{down}
  3355. @vindex org-priority-start-cycle-with-default
  3356. Increase/decrease priority of current headline@footnote{See also the option
  3357. @code{org-priority-start-cycle-with-default}.}. Note that these keys are
  3358. also used to modify timestamps (@pxref{Creating timestamps}). See also
  3359. @ref{Conflicts}, for a discussion of the interaction with
  3360. @code{shift-selection-mode}.
  3361. @end table
  3362. @vindex org-highest-priority
  3363. @vindex org-lowest-priority
  3364. @vindex org-default-priority
  3365. You can change the range of allowed priorities by setting the variables
  3366. @code{org-highest-priority}, @code{org-lowest-priority}, and
  3367. @code{org-default-priority}. For an individual buffer, you may set
  3368. these values (highest, lowest, default) like this (please make sure that
  3369. the highest priority is earlier in the alphabet than the lowest
  3370. priority):
  3371. @cindex #+PRIORITIES
  3372. @example
  3373. #+PRIORITIES: A C B
  3374. @end example
  3375. @node Breaking down tasks, Checkboxes, Priorities, TODO Items
  3376. @section Breaking tasks down into subtasks
  3377. @cindex tasks, breaking down
  3378. @cindex statistics, for TODO items
  3379. @vindex org-agenda-todo-list-sublevels
  3380. It is often advisable to break down large tasks into smaller, manageable
  3381. subtasks. You can do this by creating an outline tree below a TODO item,
  3382. with detailed subtasks on the tree@footnote{To keep subtasks out of the
  3383. global TODO list, see the @code{org-agenda-todo-list-sublevels}.}. To keep
  3384. the overview over the fraction of subtasks that are already completed, insert
  3385. either @samp{[/]} or @samp{[%]} anywhere in the headline. These cookies will
  3386. be updates each time the todo status of a child changes, or when pressing
  3387. @kbd{C-c C-c} on the cookie. For example:
  3388. @example
  3389. * Organize Party [33%]
  3390. ** TODO Call people [1/2]
  3391. *** TODO Peter
  3392. *** DONE Sarah
  3393. ** TODO Buy food
  3394. ** DONE Talk to neighbor
  3395. @end example
  3396. @cindex property, COOKIE_DATA
  3397. If a heading has both checkboxes and TODO children below it, the meaning of
  3398. the statistics cookie become ambiguous. Set the property
  3399. @code{COOKIE_DATA} to either @samp{checkbox} or @samp{todo} to resolve
  3400. this issue.
  3401. @vindex org-hierarchical-todo-statistics
  3402. If you would like to have the statistics cookie count any TODO entries in the
  3403. subtree (not just direct children), configure the variable
  3404. @code{org-hierarchical-todo-statistics}. To do this for a single subtree,
  3405. include the word @samp{recursive} into the value of the @code{COOKIE_DATA}
  3406. property.
  3407. @example
  3408. * Parent capturing statistics [2/20]
  3409. :PROPERTIES:
  3410. :COOKIE_DATA: todo recursive
  3411. :END:
  3412. @end example
  3413. If you would like a TODO entry to automatically change to DONE
  3414. when all children are done, you can use the following setup:
  3415. @example
  3416. (defun org-summary-todo (n-done n-not-done)
  3417. "Switch entry to DONE when all subentries are done, to TODO otherwise."
  3418. (let (org-log-done org-log-states) ; turn off logging
  3419. (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
  3420. (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
  3421. @end example
  3422. Another possibility is the use of checkboxes to identify (a hierarchy of) a
  3423. large number of subtasks (@pxref{Checkboxes}).
  3424. @node Checkboxes, , Breaking down tasks, TODO Items
  3425. @section Checkboxes
  3426. @cindex checkboxes
  3427. Every item in a plain list (@pxref{Plain lists}) can be made into a
  3428. checkbox by starting it with the string @samp{[ ]}. This feature is
  3429. similar to TODO items (@pxref{TODO Items}), but is more lightweight.
  3430. Checkboxes are not included into the global TODO list, so they are often
  3431. great to split a task into a number of simple steps. Or you can use
  3432. them in a shopping list. To toggle a checkbox, use @kbd{C-c C-c}, or
  3433. use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}).
  3434. Here is an example of a checkbox list.
  3435. @example
  3436. * TODO Organize party [2/4]
  3437. - [-] call people [1/3]
  3438. - [ ] Peter
  3439. - [X] Sarah
  3440. - [ ] Sam
  3441. - [X] order food
  3442. - [ ] think about what music to play
  3443. - [X] talk to the neighbors
  3444. @end example
  3445. Checkboxes work hierarchically, so if a checkbox item has children that
  3446. are checkboxes, toggling one of the children checkboxes will make the
  3447. parent checkbox reflect if none, some, or all of the children are
  3448. checked.
  3449. @cindex statistics, for checkboxes
  3450. @cindex checkbox statistics
  3451. @cindex property, COOKIE_DATA
  3452. @vindex org-hierarchical-checkbox-statistics
  3453. The @samp{[2/4]} and @samp{[1/3]} in the first and second line are cookies
  3454. indicating how many checkboxes present in this entry have been checked off,
  3455. and the total number of checkboxes present. This can give you an idea on how
  3456. many checkboxes remain, even without opening a folded entry. The cookies can
  3457. be placed into a headline or into (the first line of) a plain list item.
  3458. Each cookie covers checkboxes of direct children structurally below the
  3459. headline/item on which the cookie appears@footnote{Set the variable
  3460. @code{org-hierarchical-checkbox-statistics} if you want such cookies to
  3461. represent the all checkboxes below the cookie, not just the direct
  3462. children.}. You have to insert the cookie yourself by typing either
  3463. @samp{[/]} or @samp{[%]}. With @samp{[/]} you get an @samp{n out of m}
  3464. result, as in the examples above. With @samp{[%]} you get information about
  3465. the percentage of checkboxes checked (in the above example, this would be
  3466. @samp{[50%]} and @samp{[33%]}, respectively). In a headline, a cookie can
  3467. count either checkboxes below the heading or TODO states of children, and it
  3468. will display whatever was changed last. Set the property @code{COOKIE_DATA}
  3469. to either @samp{checkbox} or @samp{todo} to resolve this issue.
  3470. @cindex blocking, of checkboxes
  3471. @cindex checkbox blocking
  3472. @cindex property, ORDERED
  3473. If the current outline node has an @code{ORDERED} property, checkboxes must
  3474. be checked off in sequence, and an error will be thrown if you try to check
  3475. off a box while there are unchecked boxes above it.
  3476. @noindent The following commands work with checkboxes:
  3477. @table @kbd
  3478. @kindex C-c C-c
  3479. @item C-c C-c
  3480. Toggle checkbox status or (with prefix arg) checkbox presence at point. With
  3481. double prefix argument, set it to @samp{[-]}, which is considered to be an
  3482. intermediate state.
  3483. @kindex C-c C-x C-b
  3484. @item C-c C-x C-b
  3485. Toggle checkbox status or (with prefix arg) checkbox presence at point. With
  3486. double prefix argument, set it to @samp{[-]}, which is considered to be an
  3487. intermediate state.
  3488. @itemize @minus
  3489. @item
  3490. If there is an active region, toggle the first checkbox in the region
  3491. and set all remaining boxes to the same status as the first. With a prefix
  3492. arg, add or remove the checkbox for all items in the region.
  3493. @item
  3494. If the cursor is in a headline, toggle checkboxes in the region between
  3495. this headline and the next (so @emph{not} the entire subtree).
  3496. @item
  3497. If there is no active region, just toggle the checkbox at point.
  3498. @end itemize
  3499. @kindex M-S-@key{RET}
  3500. @item M-S-@key{RET}
  3501. Insert a new item with a checkbox.
  3502. This works only if the cursor is already in a plain list item
  3503. (@pxref{Plain lists}).
  3504. @kindex C-c C-x o
  3505. @item C-c C-x o
  3506. @vindex org-track-ordered-property-with-tag
  3507. @cindex property, ORDERED
  3508. Toggle the @code{ORDERED} property of the entry, to toggle if checkboxes must
  3509. be checked off in sequence. A property is used for this behavior because
  3510. this should be local to the current entry, not inherited like a tag.
  3511. However, if you would like to @i{track} the value of this property with a tag
  3512. for better visibility, customize the variable
  3513. @code{org-track-ordered-property-with-tag}.
  3514. @kindex C-c #
  3515. @item C-c #
  3516. Update the statistics cookie in the current outline entry. When called with
  3517. a @kbd{C-u} prefix, update the entire file. Checkbox statistic cookies are
  3518. updated automatically if you toggle checkboxes with @kbd{C-c C-c} and make
  3519. new ones with @kbd{M-S-@key{RET}}. TODO statistics cookies update when
  3520. changing TODO states. If you delete boxes/entries or add/change them by
  3521. hand, use this command to get things back into sync. Or simply toggle any
  3522. entry twice (checkboxes with @kbd{C-c C-c}).
  3523. @end table
  3524. @node Tags, Properties and Columns, TODO Items, Top
  3525. @chapter Tags
  3526. @cindex tags
  3527. @cindex headline tagging
  3528. @cindex matching, tags
  3529. @cindex sparse tree, tag based
  3530. An excellent way to implement labels and contexts for cross-correlating
  3531. information is to assign @i{tags} to headlines. Org mode has extensive
  3532. support for tags.
  3533. @vindex org-tag-faces
  3534. Every headline can contain a list of tags; they occur at the end of the
  3535. headline. Tags are normal words containing letters, numbers, @samp{_}, and
  3536. @samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
  3537. @samp{:work:}. Several tags can be specified, as in @samp{:work:urgent:}.
  3538. Tags will by default be in bold face with the same color as the headline.
  3539. You may specify special faces for specific tags using the variable
  3540. @code{org-tag-faces}, in much the same way as you can for TODO keywords
  3541. (@pxref{Faces for TODO keywords}).
  3542. @menu
  3543. * Tag inheritance:: Tags use the tree structure of the outline
  3544. * Setting tags:: How to assign tags to a headline
  3545. * Tag searches:: Searching for combinations of tags
  3546. @end menu
  3547. @node Tag inheritance, Setting tags, Tags, Tags
  3548. @section Tag inheritance
  3549. @cindex tag inheritance
  3550. @cindex inheritance, of tags
  3551. @cindex sublevels, inclusion into tags match
  3552. @i{Tags} make use of the hierarchical structure of outline trees. If a
  3553. heading has a certain tag, all subheadings will inherit the tag as
  3554. well. For example, in the list
  3555. @example
  3556. * Meeting with the French group :work:
  3557. ** Summary by Frank :boss:notes:
  3558. *** TODO Prepare slides for him :action:
  3559. @end example
  3560. @noindent
  3561. the final heading will have the tags @samp{:work:}, @samp{:boss:},
  3562. @samp{:notes:}, and @samp{:action:} even though the final heading is not
  3563. explicitly marked with those tags. You can also set tags that all entries in
  3564. a file should inherit just as if these tags were defined in a hypothetical
  3565. level zero that surrounds the entire file. Use a line like this@footnote{As
  3566. with all these in-buffer settings, pressing @kbd{C-c C-c} activates any
  3567. changes in the line.}:
  3568. @cindex #+FILETAGS
  3569. @example
  3570. #+FILETAGS: :Peter:Boss:Secret:
  3571. @end example
  3572. @noindent
  3573. @vindex org-use-tag-inheritance
  3574. @vindex org-tags-exclude-from-inheritance
  3575. To limit tag inheritance to specific tags, or to turn it off entirely, use
  3576. the variables @code{org-use-tag-inheritance} and
  3577. @code{org-tags-exclude-from-inheritance}.
  3578. @vindex org-tags-match-list-sublevels
  3579. When a headline matches during a tags search while tag inheritance is turned
  3580. on, all the sublevels in the same tree will (for a simple match form) match
  3581. as well@footnote{This is only true if the search does not involve more
  3582. complex tests including properties (@pxref{Property searches}).}. The list
  3583. of matches may then become very long. If you only want to see the first tags
  3584. match in a subtree, configure the variable
  3585. @code{org-tags-match-list-sublevels} (not recommended).
  3586. @node Setting tags, Tag searches, Tag inheritance, Tags
  3587. @section Setting tags
  3588. @cindex setting tags
  3589. @cindex tags, setting
  3590. @kindex M-@key{TAB}
  3591. Tags can simply be typed into the buffer at the end of a headline.
  3592. After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
  3593. also a special command for inserting tags:
  3594. @table @kbd
  3595. @kindex C-c C-q
  3596. @item C-c C-q
  3597. @cindex completion, of tags
  3598. @vindex org-tags-column
  3599. Enter new tags for the current headline. Org mode will either offer
  3600. completion or a special single-key interface for setting tags, see
  3601. below. After pressing @key{RET}, the tags will be inserted and aligned
  3602. to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
  3603. tags in the current buffer will be aligned to that column, just to make
  3604. things look nice. TAGS are automatically realigned after promotion,
  3605. demotion, and TODO state changes (@pxref{TODO basics}).
  3606. @kindex C-c C-c
  3607. @item C-c C-c
  3608. When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
  3609. @end table
  3610. @vindex org-tag-alist
  3611. Org will support tag insertion based on a @emph{list of tags}. By
  3612. default this list is constructed dynamically, containing all tags
  3613. currently used in the buffer. You may also globally specify a hard list
  3614. of tags with the variable @code{org-tag-alist}. Finally you can set
  3615. the default tags for a given file with lines like
  3616. @cindex #+TAGS
  3617. @example
  3618. #+TAGS: @@work @@home @@tennisclub
  3619. #+TAGS: laptop car pc sailboat
  3620. @end example
  3621. If you have globally defined your preferred set of tags using the
  3622. variable @code{org-tag-alist}, but would like to use a dynamic tag list
  3623. in a specific file, add an empty TAGS option line to that file:
  3624. @example
  3625. #+TAGS:
  3626. @end example
  3627. @vindex org-tag-persistent-alist
  3628. If you have a preferred set of tags that you would like to use in every file,
  3629. in addition to those defined on a per-file basis by TAGS option lines, then
  3630. you may specify a list of tags with the variable
  3631. @code{org-tag-persistent-alist}. You may turn this off on a per-file basis
  3632. by adding a STARTUP option line to that file:
  3633. @example
  3634. #+STARTUP: noptag
  3635. @end example
  3636. By default Org mode uses the standard minibuffer completion facilities for
  3637. entering tags. However, it also implements another, quicker, tag selection
  3638. method called @emph{fast tag selection}. This allows you to select and
  3639. deselect tags with just a single key press. For this to work well you should
  3640. assign unique letters to most of your commonly used tags. You can do this
  3641. globally by configuring the variable @code{org-tag-alist} in your
  3642. @file{.emacs} file. For example, you may find the need to tag many items in
  3643. different files with @samp{:@@home:}. In this case you can set something
  3644. like:
  3645. @lisp
  3646. (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
  3647. @end lisp
  3648. @noindent If the tag is only relevant to the file you are working on, then you
  3649. can instead set the TAGS option line as:
  3650. @example
  3651. #+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
  3652. @end example
  3653. @noindent The tags interface will show the available tags in a splash
  3654. window. If you want to start a new line after a specific tag, insert
  3655. @samp{\n} into the tag list
  3656. @example
  3657. #+TAGS: @@work(w) @@home(h) @@tennisclub(t) \n laptop(l) pc(p)
  3658. @end example
  3659. @noindent or write them in two lines:
  3660. @example
  3661. #+TAGS: @@work(w) @@home(h) @@tennisclub(t)
  3662. #+TAGS: laptop(l) pc(p)
  3663. @end example
  3664. @noindent
  3665. You can also group together tags that are mutually exclusive by using
  3666. braces, as in:
  3667. @example
  3668. #+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
  3669. @end example
  3670. @noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
  3671. and @samp{@@tennisclub} should be selected. Multiple such groups are allowed.
  3672. @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
  3673. these lines to activate any changes.
  3674. @noindent
  3675. To set these mutually exclusive groups in the variable @code{org-tags-alist},
  3676. you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
  3677. of the braces. Similarly, you can use @code{:newline} to indicate a line
  3678. break. The previous example would be set globally by the following
  3679. configuration:
  3680. @lisp
  3681. (setq org-tag-alist '((:startgroup . nil)
  3682. ("@@work" . ?w) ("@@home" . ?h)
  3683. ("@@tennisclub" . ?t)
  3684. (:endgroup . nil)
  3685. ("laptop" . ?l) ("pc" . ?p)))
  3686. @end lisp
  3687. If at least one tag has a selection key then pressing @kbd{C-c C-c} will
  3688. automatically present you with a special interface, listing inherited tags,
  3689. the tags of the current headline, and a list of all valid tags with
  3690. corresponding keys@footnote{Keys will automatically be assigned to tags which
  3691. have no configured keys.}. In this interface, you can use the following
  3692. keys:
  3693. @table @kbd
  3694. @item a-z...
  3695. Pressing keys assigned to tags will add or remove them from the list of
  3696. tags in the current line. Selecting a tag in a group of mutually
  3697. exclusive tags will turn off any other tags from that group.
  3698. @kindex @key{TAB}
  3699. @item @key{TAB}
  3700. Enter a tag in the minibuffer, even if the tag is not in the predefined
  3701. list. You will be able to complete on all tags present in the buffer.
  3702. @kindex @key{SPC}
  3703. @item @key{SPC}
  3704. Clear all tags for this line.
  3705. @kindex @key{RET}
  3706. @item @key{RET}
  3707. Accept the modified set.
  3708. @item C-g
  3709. Abort without installing changes.
  3710. @item q
  3711. If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
  3712. @item !
  3713. Turn off groups of mutually exclusive tags. Use this to (as an
  3714. exception) assign several tags from such a group.
  3715. @item C-c
  3716. Toggle auto-exit after the next change (see below).
  3717. If you are using expert mode, the first @kbd{C-c} will display the
  3718. selection window.
  3719. @end table
  3720. @noindent
  3721. This method lets you assign tags to a headline with very few keys. With
  3722. the above setup, you could clear the current tags and set @samp{@@home},
  3723. @samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
  3724. C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to
  3725. @samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
  3726. alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
  3727. @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
  3728. @key{RET} @key{RET}}.
  3729. @vindex org-fast-tag-selection-single-key
  3730. If you find that most of the time you need only a single key press to
  3731. modify your list of tags, set the variable
  3732. @code{org-fast-tag-selection-single-key}. Then you no longer have to
  3733. press @key{RET} to exit fast tag selection---it will immediately exit
  3734. after the first change. If you then occasionally need more keys, press
  3735. @kbd{C-c} to turn off auto-exit for the current tag selection process
  3736. (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
  3737. C-c}). If you set the variable to the value @code{expert}, the special
  3738. window is not even shown for single-key tag selection, it comes up only
  3739. when you press an extra @kbd{C-c}.
  3740. @vindex org-complete-tags-always-offer-all-agenda-tags
  3741. As said before, when setting tags and @code{org-tag-alist} is nil, then the
  3742. list of tags in the current buffer is used. Normally, this behavior is very
  3743. convenient, except in org remember buffers (@pxref{Remember}), because there
  3744. are no tags that can be calculated dynamically. Here, you most probably want
  3745. to have completion for all tags in all agenda files. This can be done by
  3746. setting @code{org-complete-tags-always-offer-all-agenda-tags} to non-nil in
  3747. those buffers.
  3748. @lisp
  3749. (add-hook 'org-remember-mode-hook
  3750. (lambda ()
  3751. (set (make-local-variable
  3752. 'org-complete-tags-always-offer-all-agenda-tags)
  3753. t)))
  3754. @end lisp
  3755. Of course, you can also set it to @code{t} globally if you always want to
  3756. have completion of all tags in all agenda files.
  3757. @node Tag searches, , Setting tags, Tags
  3758. @section Tag searches
  3759. @cindex tag searches
  3760. @cindex searching for tags
  3761. Once a system of tags has been set up, it can be used to collect related
  3762. information into special lists.
  3763. @table @kbd
  3764. @kindex C-c \
  3765. @kindex C-c / m
  3766. @item C-c \
  3767. @itemx C-c / m
  3768. Create a sparse tree with all headlines matching a tags search. With a
  3769. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  3770. @kindex C-c a m
  3771. @item C-c a m
  3772. Create a global list of tag matches from all agenda files.
  3773. @xref{Matching tags and properties}.
  3774. @kindex C-c a M
  3775. @item C-c a M
  3776. @vindex org-tags-match-list-sublevels
  3777. Create a global list of tag matches from all agenda files, but check
  3778. only TODO items and force checking subitems (see variable
  3779. @code{org-tags-match-list-sublevels}).
  3780. @end table
  3781. These commands all prompt for a match string which allows basic Boolean logic
  3782. like @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and
  3783. @samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entries
  3784. which are tagged, like @samp{Kathy} or @samp{Sally}. The full syntax of the search
  3785. string is rich and allows also matching against TODO keywords, entry levels
  3786. and properties. For a complete description with many examples, see
  3787. @ref{Matching tags and properties}.
  3788. @node Properties and Columns, Dates and Times, Tags, Top
  3789. @chapter Properties and Columns
  3790. @cindex properties
  3791. Properties are a set of key-value pairs associated with an entry. There
  3792. are two main applications for properties in Org mode. First, properties
  3793. are like tags, but with a value. Second, you can use properties to
  3794. implement (very basic) database capabilities in an Org buffer. For
  3795. an example of the first application, imagine maintaining a file where
  3796. you document bugs and plan releases for a piece of software. Instead of
  3797. using tags like @code{:release_1:}, @code{:release_2:}, one can use a
  3798. property, say @code{:Release:}, that in different subtrees has different
  3799. values, such as @code{1.0} or @code{2.0}. For an example of the second
  3800. application of properties, imagine keeping track of your music CDs,
  3801. where properties could be things such as the album, artist, date of
  3802. release, number of tracks, and so on.
  3803. Properties can be conveniently edited and viewed in column view
  3804. (@pxref{Column view}).
  3805. @menu
  3806. * Property syntax:: How properties are spelled out
  3807. * Special properties:: Access to other Org mode features
  3808. * Property searches:: Matching property values
  3809. * Property inheritance:: Passing values down the tree
  3810. * Column view:: Tabular viewing and editing
  3811. * Property API:: Properties for Lisp programmers
  3812. @end menu
  3813. @node Property syntax, Special properties, Properties and Columns, Properties and Columns
  3814. @section Property syntax
  3815. @cindex property syntax
  3816. @cindex drawer, for properties
  3817. Properties are key-value pairs. They need to be inserted into a special
  3818. drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
  3819. is specified on a single line, with the key (surrounded by colons)
  3820. first, and the value after it. Here is an example:
  3821. @example
  3822. * CD collection
  3823. ** Classic
  3824. *** Goldberg Variations
  3825. :PROPERTIES:
  3826. :Title: Goldberg Variations
  3827. :Composer: J.S. Bach
  3828. :Artist: Glen Gould
  3829. :Publisher: Deutsche Grammophon
  3830. :NDisks: 1
  3831. :END:
  3832. @end example
  3833. You may define the allowed values for a particular property @samp{:Xyz:}
  3834. by setting a property @samp{:Xyz_ALL:}. This special property is
  3835. @emph{inherited}, so if you set it in a level 1 entry, it will apply to
  3836. the entire tree. When allowed values are defined, setting the
  3837. corresponding property becomes easier and is less prone to typing
  3838. errors. For the example with the CD collection, we can predefine
  3839. publishers and the number of disks in a box like this:
  3840. @example
  3841. * CD collection
  3842. :PROPERTIES:
  3843. :NDisks_ALL: 1 2 3 4
  3844. :Publisher_ALL: "Deutsche Grammophon" Philips EMI
  3845. :END:
  3846. @end example
  3847. If you want to set properties that can be inherited by any entry in a
  3848. file, use a line like
  3849. @cindex property, _ALL
  3850. @cindex #+PROPERTY
  3851. @example
  3852. #+PROPERTY: NDisks_ALL 1 2 3 4
  3853. @end example
  3854. @vindex org-global-properties
  3855. Property values set with the global variable
  3856. @code{org-global-properties} can be inherited by all entries in all
  3857. Org files.
  3858. @noindent
  3859. The following commands help to work with properties:
  3860. @table @kbd
  3861. @kindex M-@key{TAB}
  3862. @item M-@key{TAB}
  3863. After an initial colon in a line, complete property keys. All keys used
  3864. in the current file will be offered as possible completions.
  3865. @kindex C-c C-x p
  3866. @item C-c C-x p
  3867. Set a property. This prompts for a property name and a value. If
  3868. necessary, the property drawer is created as well.
  3869. @item M-x org-insert-property-drawer
  3870. Insert a property drawer into the current entry. The drawer will be
  3871. inserted early in the entry, but after the lines with planning
  3872. information like deadlines.
  3873. @kindex C-c C-c
  3874. @item C-c C-c
  3875. With the cursor in a property drawer, this executes property commands.
  3876. @item C-c C-c s
  3877. Set a property in the current entry. Both the property and the value
  3878. can be inserted using completion.
  3879. @kindex S-@key{right}
  3880. @kindex S-@key{left}
  3881. @item S-@key{left}/@key{right}
  3882. Switch property at point to the next/previous allowed value.
  3883. @item C-c C-c d
  3884. Remove a property from the current entry.
  3885. @item C-c C-c D
  3886. Globally remove a property, from all entries in the current file.
  3887. @item C-c C-c c
  3888. Compute the property at point, using the operator and scope from the
  3889. nearest column format definition.
  3890. @end table
  3891. @node Special properties, Property searches, Property syntax, Properties and Columns
  3892. @section Special properties
  3893. @cindex properties, special
  3894. Special properties provide an alternative access method to Org mode
  3895. features, like the TODO state or the priority of an entry, discussed in the
  3896. previous chapters. This interface exists so that you can include
  3897. these states in a column view (@pxref{Column view}), or to use them in
  3898. queries. The following property names are special and should not be
  3899. used as keys in the properties drawer:
  3900. @cindex property, special, TODO
  3901. @cindex property, special, TAGS
  3902. @cindex property, special, ALLTAGS
  3903. @cindex property, special, CATEGORY
  3904. @cindex property, special, PRIORITY
  3905. @cindex property, special, DEADLINE
  3906. @cindex property, special, SCHEDULED
  3907. @cindex property, special, CLOSED
  3908. @cindex property, special, TIMESTAMP
  3909. @cindex property, special, TIMESTAMP_IA
  3910. @cindex property, special, CLOCKSUM
  3911. @cindex property, special, BLOCKED
  3912. @c guessing that ITEM is needed in this area; also, should this list be sorted?
  3913. @cindex property, special, ITEM
  3914. @example
  3915. TODO @r{The TODO keyword of the entry.}
  3916. TAGS @r{The tags defined directly in the headline.}
  3917. ALLTAGS @r{All tags, including inherited ones.}
  3918. CATEGORY @r{The category of an entry.}
  3919. PRIORITY @r{The priority of the entry, a string with a single letter.}
  3920. DEADLINE @r{The deadline time string, without the angular brackets.}
  3921. SCHEDULED @r{The scheduling timestamp, without the angular brackets.}
  3922. CLOSED @r{When was this entry closed?}
  3923. TIMESTAMP @r{The first keyword-less timestamp in the entry.}
  3924. TIMESTAMP_IA @r{The first inactive timestamp in the entry.}
  3925. CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
  3926. @r{must be run first to compute the values.}
  3927. BLOCKED @r{"t" if task is currently blocked by children or siblings}
  3928. ITEM @r{The content of the entry.}
  3929. @end example
  3930. @node Property searches, Property inheritance, Special properties, Properties and Columns
  3931. @section Property searches
  3932. @cindex properties, searching
  3933. @cindex searching, of properties
  3934. To create sparse trees and special lists with selection based on properties,
  3935. the same commands are used as for tag searches (@pxref{Tag searches}).
  3936. @table @kbd
  3937. @kindex C-c \
  3938. @kindex C-c / m
  3939. @item C-c \
  3940. @itemx C-c / m
  3941. Create a sparse tree with all matching entries. With a
  3942. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  3943. @kindex C-c a m
  3944. @item C-c a m
  3945. Create a global list of tag/property matches from all agenda files.
  3946. @xref{Matching tags and properties}.
  3947. @kindex C-c a M
  3948. @item C-c a M
  3949. @vindex org-tags-match-list-sublevels
  3950. Create a global list of tag matches from all agenda files, but check
  3951. only TODO items and force checking of subitems (see variable
  3952. @code{org-tags-match-list-sublevels}).
  3953. @end table
  3954. The syntax for the search string is described in @ref{Matching tags and
  3955. properties}.
  3956. There is also a special command for creating sparse trees based on a
  3957. single property:
  3958. @table @kbd
  3959. @kindex C-c / p
  3960. @item C-c / p
  3961. Create a sparse tree based on the value of a property. This first
  3962. prompts for the name of a property, and then for a value. A sparse tree
  3963. is created with all entries that define this property with the given
  3964. value. If you enclose the value into curly braces, it is interpreted as
  3965. a regular expression and matched against the property values.
  3966. @end table
  3967. @node Property inheritance, Column view, Property searches, Properties and Columns
  3968. @section Property Inheritance
  3969. @cindex properties, inheritance
  3970. @cindex inheritance, of properties
  3971. @vindex org-use-property-inheritance
  3972. The outline structure of Org-mode documents lends itself for an
  3973. inheritance model of properties: if the parent in a tree has a certain
  3974. property, the children can inherit this property. Org mode does not
  3975. turn this on by default, because it can slow down property searches
  3976. significantly and is often not needed. However, if you find inheritance
  3977. useful, you can turn it on by setting the variable
  3978. @code{org-use-property-inheritance}. It may be set to @code{t} to make
  3979. all properties inherited from the parent, to a list of properties
  3980. that should be inherited, or to a regular expression that matches
  3981. inherited properties.
  3982. Org mode has a few properties for which inheritance is hard-coded, at
  3983. least for the special applications for which they are used:
  3984. @cindex property, COLUMNS
  3985. @table @code
  3986. @item COLUMNS
  3987. The @code{:COLUMNS:} property defines the format of column view
  3988. (@pxref{Column view}). It is inherited in the sense that the level
  3989. where a @code{:COLUMNS:} property is defined is used as the starting
  3990. point for a column view table, independently of the location in the
  3991. subtree from where columns view is turned on.
  3992. @item CATEGORY
  3993. @cindex property, CATEGORY
  3994. For agenda view, a category set through a @code{:CATEGORY:} property
  3995. applies to the entire subtree.
  3996. @item ARCHIVE
  3997. @cindex property, ARCHIVE
  3998. For archiving, the @code{:ARCHIVE:} property may define the archive
  3999. location for the entire subtree (@pxref{Moving subtrees}).
  4000. @item LOGGING
  4001. @cindex property, LOGGING
  4002. The LOGGING property may define logging settings for an entry or a
  4003. subtree (@pxref{Tracking TODO state changes}).
  4004. @end table
  4005. @node Column view, Property API, Property inheritance, Properties and Columns
  4006. @section Column view
  4007. A great way to view and edit properties in an outline tree is
  4008. @emph{column view}. In column view, each outline node is turned into a
  4009. table row. Columns in this table provide access to properties of the
  4010. entries. Org mode implements columns by overlaying a tabular structure
  4011. over the headline of each item. While the headlines have been turned
  4012. into a table row, you can still change the visibility of the outline
  4013. tree. For example, you get a compact table by switching to CONTENTS
  4014. view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
  4015. is active), but you can still open, read, and edit the entry below each
  4016. headline. Or, you can switch to column view after executing a sparse
  4017. tree command and in this way get a table only for the selected items.
  4018. Column view also works in agenda buffers (@pxref{Agenda Views}) where
  4019. queries have collected selected items, possibly from a number of files.
  4020. @menu
  4021. * Defining columns:: The COLUMNS format property
  4022. * Using column view:: How to create and use column view
  4023. * Capturing column view:: A dynamic block for column view
  4024. @end menu
  4025. @node Defining columns, Using column view, Column view, Column view
  4026. @subsection Defining columns
  4027. @cindex column view, for properties
  4028. @cindex properties, column view
  4029. Setting up a column view first requires defining the columns. This is
  4030. done by defining a column format line.
  4031. @menu
  4032. * Scope of column definitions:: Where defined, where valid?
  4033. * Column attributes:: Appearance and content of a column
  4034. @end menu
  4035. @node Scope of column definitions, Column attributes, Defining columns, Defining columns
  4036. @subsubsection Scope of column definitions
  4037. To define a column format for an entire file, use a line like
  4038. @cindex #+COLUMNS
  4039. @example
  4040. #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  4041. @end example
  4042. To specify a format that only applies to a specific tree, add a
  4043. @code{:COLUMNS:} property to the top node of that tree, for example:
  4044. @example
  4045. ** Top node for columns view
  4046. :PROPERTIES:
  4047. :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  4048. :END:
  4049. @end example
  4050. If a @code{:COLUMNS:} property is present in an entry, it defines columns
  4051. for the entry itself, and for the entire subtree below it. Since the
  4052. column definition is part of the hierarchical structure of the document,
  4053. you can define columns on level 1 that are general enough for all
  4054. sublevels, and more specific columns further down, when you edit a
  4055. deeper part of the tree.
  4056. @node Column attributes, , Scope of column definitions, Defining columns
  4057. @subsubsection Column attributes
  4058. A column definition sets the attributes of a column. The general
  4059. definition looks like this:
  4060. @example
  4061. %[@var{width}]@var{property}[(@var{title})][@{@var{summary-type}@}]
  4062. @end example
  4063. @noindent
  4064. Except for the percent sign and the property name, all items are
  4065. optional. The individual parts have the following meaning:
  4066. @example
  4067. @var{width} @r{An integer specifying the width of the column in characters.}
  4068. @r{If omitted, the width will be determined automatically.}
  4069. @var{property} @r{The property that should be edited in this column.}
  4070. @r{Special properties representing meta data are allowed here}
  4071. @r{as well (@pxref{Special properties})}
  4072. (title) @r{The header text for the column. If omitted, the}
  4073. @r{property name is used.}
  4074. @{@var{summary-type}@} @r{The summary type. If specified, the column values for}
  4075. @r{parent nodes are computed from the children.}
  4076. @r{Supported summary types are:}
  4077. @{+@} @r{Sum numbers in this column.}
  4078. @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.}
  4079. @{$@} @r{Currency, short for @samp{+;%.2f}.}
  4080. @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
  4081. @{X@} @r{Checkbox status, @samp{[X]} if all children are @samp{[X]}.}
  4082. @{X/@} @r{Checkbox status, @samp{[n/m]}.}
  4083. @{X%@} @r{Checkbox status, @samp{[n%]}.}
  4084. @{min@} @r{Smallest number in column.}
  4085. @{max@} @r{Largest number.}
  4086. @{mean@} @r{Arithmetic mean of numbers.}
  4087. @{:min@} @r{Smallest time value in column.}
  4088. @{:max@} @r{Largest time value.}
  4089. @{:mean@} @r{Arithmetic mean of time values.}
  4090. @{@@min@} @r{Minimum age (in days/hours/mins/seconds).}
  4091. @{@@max@} @r{Maximum age (in days/hours/mins/seconds).}
  4092. @{@@mean@} @r{Arithmetic mean of ages (in days/hours/mins/seconds).}
  4093. @end example
  4094. @noindent
  4095. Be aware that you can only have one summary type for any property you
  4096. include. Subsequent columns referencing the same property will all display the
  4097. same summary information.
  4098. Here is an example for a complete columns definition, along with allowed
  4099. values.
  4100. @example
  4101. :COLUMNS: %25ITEM %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.}
  4102. %10Time_Estimate@{:@} %CLOCKSUM
  4103. :Owner_ALL: Tammy Mark Karl Lisa Don
  4104. :Status_ALL: "In progress" "Not started yet" "Finished" ""
  4105. :Approved_ALL: "[ ]" "[X]"
  4106. @end example
  4107. @noindent
  4108. The first column, @samp{%25ITEM}, means the first 25 characters of the
  4109. item itself, i.e. of the headline. You probably always should start the
  4110. column definition with the @samp{ITEM} specifier. The other specifiers
  4111. create columns @samp{Owner} with a list of names as allowed values, for
  4112. @samp{Status} with four different possible values, and for a checkbox
  4113. field @samp{Approved}. When no width is given after the @samp{%}
  4114. character, the column will be exactly as wide as it needs to be in order
  4115. to fully display all values. The @samp{Approved} column does have a
  4116. modified title (@samp{Approved?}, with a question mark). Summaries will
  4117. be created for the @samp{Time_Estimate} column by adding time duration
  4118. expressions like HH:MM, and for the @samp{Approved} column, by providing
  4119. an @samp{[X]} status if all children have been checked. The
  4120. @samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
  4121. in the subtree.
  4122. @node Using column view, Capturing column view, Defining columns, Column view
  4123. @subsection Using column view
  4124. @table @kbd
  4125. @tsubheading{Turning column view on and off}
  4126. @kindex C-c C-x C-c
  4127. @item C-c C-x C-c
  4128. @vindex org-columns-default-format
  4129. Turn on column view. If the cursor is before the first headline in the file,
  4130. column view is turned on for the entire file, using the @code{#+COLUMNS}
  4131. definition. If the cursor is somewhere inside the outline, this command
  4132. searches the hierarchy, up from point, for a @code{:COLUMNS:} property that
  4133. defines a format. When one is found, the column view table is established
  4134. for the tree starting at the entry that contains the @code{:COLUMNS:}
  4135. property. If no such property is found, the format is taken from the
  4136. @code{#+COLUMNS} line or from the variable @code{org-columns-default-format},
  4137. and column view is established for the current entry and its subtree.
  4138. @kindex r
  4139. @item r
  4140. Recreate the column view, to include recent changes made in the buffer.
  4141. @kindex g
  4142. @item g
  4143. Same as @kbd{r}.
  4144. @kindex q
  4145. @item q
  4146. Exit column view.
  4147. @tsubheading{Editing values}
  4148. @item @key{left} @key{right} @key{up} @key{down}
  4149. Move through the column view from field to field.
  4150. @kindex S-@key{left}
  4151. @kindex S-@key{right}
  4152. @item S-@key{left}/@key{right}
  4153. Switch to the next/previous allowed value of the field. For this, you
  4154. have to have specified allowed values for a property.
  4155. @item 1..9,0
  4156. Directly select the nth allowed value, @kbd{0} selects the 10th value.
  4157. @kindex n
  4158. @kindex p
  4159. @itemx n / p
  4160. Same as @kbd{S-@key{left}/@key{right}}
  4161. @kindex e
  4162. @item e
  4163. Edit the property at point. For the special properties, this will
  4164. invoke the same interface that you normally use to change that
  4165. property. For example, when editing a TAGS property, the tag completion
  4166. or fast selection interface will pop up.
  4167. @kindex C-c C-c
  4168. @item C-c C-c
  4169. When there is a checkbox at point, toggle it.
  4170. @kindex v
  4171. @item v
  4172. View the full value of this property. This is useful if the width of
  4173. the column is smaller than that of the value.
  4174. @kindex a
  4175. @item a
  4176. Edit the list of allowed values for this property. If the list is found
  4177. in the hierarchy, the modified values is stored there. If no list is
  4178. found, the new value is stored in the first entry that is part of the
  4179. current column view.
  4180. @tsubheading{Modifying the table structure}
  4181. @kindex <
  4182. @kindex >
  4183. @item < / >
  4184. Make the column narrower/wider by one character.
  4185. @kindex S-M-@key{right}
  4186. @item S-M-@key{right}
  4187. Insert a new column, to the left of the current column.
  4188. @kindex S-M-@key{left}
  4189. @item S-M-@key{left}
  4190. Delete the current column.
  4191. @end table
  4192. @node Capturing column view, , Using column view, Column view
  4193. @subsection Capturing column view
  4194. Since column view is just an overlay over a buffer, it cannot be
  4195. exported or printed directly. If you want to capture a column view, use
  4196. a @code{columnview} dynamic block (@pxref{Dynamic blocks}). The frame
  4197. of this block looks like this:
  4198. @cindex #+BEGIN, columnview
  4199. @example
  4200. * The column view
  4201. #+BEGIN: columnview :hlines 1 :id "label"
  4202. #+END:
  4203. @end example
  4204. @noindent This dynamic block has the following parameters:
  4205. @table @code
  4206. @item :id
  4207. This is the most important parameter. Column view is a feature that is
  4208. often localized to a certain (sub)tree, and the capture block might be
  4209. at a different location in the file. To identify the tree whose view to
  4210. capture, you can use 4 values:
  4211. @cindex property, ID
  4212. @example
  4213. local @r{use the tree in which the capture block is located}
  4214. global @r{make a global view, including all headings in the file}
  4215. "file:@var{path-to-file}"
  4216. @r{run column view at the top of this file}
  4217. "@var{ID}" @r{call column view in the tree that has an @code{:ID:}}
  4218. @r{property with the value @i{label}. You can use}
  4219. @r{@kbd{M-x org-id-copy} to create a globally unique ID for}
  4220. @r{the current entry and copy it to the kill-ring.}
  4221. @end example
  4222. @item :hlines
  4223. When @code{t}, insert an hline after every line. When a number @var{N}, insert
  4224. an hline before each headline with level @code{<= @var{N}}.
  4225. @item :vlines
  4226. When set to @code{t}, force column groups to get vertical lines.
  4227. @item :maxlevel
  4228. When set to a number, don't capture entries below this level.
  4229. @item :skip-empty-rows
  4230. When set to @code{t}, skip rows where the only non-empty specifier of the
  4231. column view is @code{ITEM}.
  4232. @end table
  4233. @noindent
  4234. The following commands insert or update the dynamic block:
  4235. @table @kbd
  4236. @kindex C-c C-x i
  4237. @item C-c C-x i
  4238. Insert a dynamic block capturing a column view. You will be prompted
  4239. for the scope or ID of the view.
  4240. @kindex C-c C-c
  4241. @item C-c C-c
  4242. @kindex C-c C-x C-u
  4243. @itemx C-c C-x C-u
  4244. Update dynamic block at point. The cursor needs to be in the
  4245. @code{#+BEGIN} line of the dynamic block.
  4246. @kindex C-u C-c C-x C-u
  4247. @item C-u C-c C-x C-u
  4248. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  4249. you have several clock table blocks in a buffer.
  4250. @end table
  4251. You can add formulas to the column view table and you may add plotting
  4252. instructions in front of the table---these will survive an update of the
  4253. block. If there is a @code{#+TBLFM:} after the table, the table will
  4254. actually be recalculated automatically after an update.
  4255. An alternative way to capture and process property values into a table is
  4256. provided by Eric Schulte's @file{org-collector.el} which is a contributed
  4257. package@footnote{Contributed packages are not part of Emacs, but are
  4258. distributed with the main distribution of Org (visit
  4259. @uref{http://orgmode.org}).}. It provides a general API to collect
  4260. properties from entries in a certain scope, and arbitrary Lisp expressions to
  4261. process these values before inserting them into a table or a dynamic block.
  4262. @node Property API, , Column view, Properties and Columns
  4263. @section The Property API
  4264. @cindex properties, API
  4265. @cindex API, for properties
  4266. There is a full API for accessing and changing properties. This API can
  4267. be used by Emacs Lisp programs to work with properties and to implement
  4268. features based on them. For more information see @ref{Using the
  4269. property API}.
  4270. @node Dates and Times, Capture - Refile - Archive, Properties and Columns, Top
  4271. @chapter Dates and Times
  4272. @cindex dates
  4273. @cindex times
  4274. @cindex timestamp
  4275. @cindex date stamp
  4276. To assist project planning, TODO items can be labeled with a date and/or
  4277. a time. The specially formatted string carrying the date and time
  4278. information is called a @emph{timestamp} in Org mode. This may be a
  4279. little confusing because timestamp is often used as indicating when
  4280. something was created or last changed. However, in Org mode this term
  4281. is used in a much wider sense.
  4282. @menu
  4283. * Timestamps:: Assigning a time to a tree entry
  4284. * Creating timestamps:: Commands which insert timestamps
  4285. * Deadlines and scheduling:: Planning your work
  4286. * Clocking work time:: Tracking how long you spend on a task
  4287. * Resolving idle time:: Resolving time if you've been idle
  4288. * Effort estimates:: Planning work effort in advance
  4289. * Relative timer:: Notes with a running timer
  4290. @end menu
  4291. @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
  4292. @section Timestamps, deadlines, and scheduling
  4293. @cindex timestamps
  4294. @cindex ranges, time
  4295. @cindex date stamps
  4296. @cindex deadlines
  4297. @cindex scheduling
  4298. A timestamp is a specification of a date (possibly with a time or a range of
  4299. times) in a special format, either @samp{<2003-09-16 Tue>} or
  4300. @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
  4301. 12:00-12:30>}@footnote{This is inspired by the standard ISO 8601 date/time
  4302. format. To use an alternative format, see @ref{Custom time format}.}. A
  4303. timestamp can appear anywhere in the headline or body of an Org tree entry.
  4304. Its presence causes entries to be shown on specific dates in the agenda
  4305. (@pxref{Weekly/daily agenda}). We distinguish:
  4306. @table @var
  4307. @item Plain timestamp; Event; Appointment
  4308. @cindex timestamp
  4309. A simple timestamp just assigns a date/time to an item. This is just
  4310. like writing down an appointment or event in a paper agenda. In the
  4311. timeline and agenda displays, the headline of an entry associated with a
  4312. plain timestamp will be shown exactly on that date.
  4313. @example
  4314. * Meet Peter at the movies <2006-11-01 Wed 19:15>
  4315. * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
  4316. @end example
  4317. @item Timestamp with repeater interval
  4318. @cindex timestamp, with repeater interval
  4319. A timestamp may contain a @emph{repeater interval}, indicating that it
  4320. applies not only on the given date, but again and again after a certain
  4321. interval of N days (d), weeks (w), months (m), or years (y). The
  4322. following will show up in the agenda every Wednesday:
  4323. @example
  4324. * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
  4325. @end example
  4326. @item Diary-style sexp entries
  4327. For more complex date specifications, Org mode supports using the
  4328. special sexp diary entries implemented in the Emacs calendar/diary
  4329. package. For example
  4330. @example
  4331. * The nerd meeting on every 2nd Thursday of the month
  4332. <%%(diary-float t 4 2)>
  4333. @end example
  4334. @item Time/Date range
  4335. @cindex timerange
  4336. @cindex date range
  4337. Two timestamps connected by @samp{--} denote a range. The headline
  4338. will be shown on the first and last day of the range, and on any dates
  4339. that are displayed and fall in the range. Here is an example:
  4340. @example
  4341. ** Meeting in Amsterdam
  4342. <2004-08-23 Mon>--<2004-08-26 Thu>
  4343. @end example
  4344. @item Inactive timestamp
  4345. @cindex timestamp, inactive
  4346. @cindex inactive timestamp
  4347. Just like a plain timestamp, but with square brackets instead of
  4348. angular ones. These timestamps are inactive in the sense that they do
  4349. @emph{not} trigger an entry to show up in the agenda.
  4350. @example
  4351. * Gillian comes late for the fifth time [2006-11-01 Wed]
  4352. @end example
  4353. @end table
  4354. @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
  4355. @section Creating timestamps
  4356. @cindex creating timestamps
  4357. @cindex timestamps, creating
  4358. For Org mode to recognize timestamps, they need to be in the specific
  4359. format. All commands listed below produce timestamps in the correct
  4360. format.
  4361. @table @kbd
  4362. @kindex C-c .
  4363. @item C-c .
  4364. Prompt for a date and insert a corresponding timestamp. When the cursor is
  4365. at an existing timestamp in the buffer, the command is used to modify this
  4366. timestamp instead of inserting a new one. When this command is used twice in
  4367. succession, a time range is inserted.
  4368. @c
  4369. @kindex C-c !
  4370. @item C-c !
  4371. Like @kbd{C-c .}, but insert an inactive timestamp that will not cause
  4372. an agenda entry.
  4373. @c
  4374. @kindex C-u C-c .
  4375. @kindex C-u C-c !
  4376. @item C-u C-c .
  4377. @itemx C-u C-c !
  4378. @vindex org-time-stamp-rounding-minutes
  4379. Like @kbd{C-c .} and @kbd{C-c !}, but use the alternative format which
  4380. contains date and time. The default time can be rounded to multiples of 5
  4381. minutes, see the option @code{org-time-stamp-rounding-minutes}.
  4382. @c
  4383. @kindex C-c <
  4384. @item C-c <
  4385. Insert a timestamp corresponding to the cursor date in the Calendar.
  4386. @c
  4387. @kindex C-c >
  4388. @item C-c >
  4389. Access the Emacs calendar for the current date. If there is a
  4390. timestamp in the current line, go to the corresponding date
  4391. instead.
  4392. @c
  4393. @kindex C-c C-o
  4394. @item C-c C-o
  4395. Access the agenda for the date given by the timestamp or -range at
  4396. point (@pxref{Weekly/daily agenda}).
  4397. @c
  4398. @kindex S-@key{left}
  4399. @kindex S-@key{right}
  4400. @item S-@key{left}
  4401. @itemx S-@key{right}
  4402. Change date at cursor by one day. These key bindings conflict with
  4403. shift-selection and related modes (@pxref{Conflicts}).
  4404. @c
  4405. @kindex S-@key{up}
  4406. @kindex S-@key{down}
  4407. @item S-@key{up}
  4408. @itemx S-@key{down}
  4409. Change the item under the cursor in a timestamp. The cursor can be on a
  4410. year, month, day, hour or minute. When the timestamp contains a time range
  4411. like @samp{15:30-16:30}, modifying the first time will also shift the second,
  4412. shifting the time block with constant length. To change the length, modify
  4413. the second time. Note that if the cursor is in a headline and not at a
  4414. timestamp, these same keys modify the priority of an item.
  4415. (@pxref{Priorities}). The key bindings also conflict with shift-selection and
  4416. related modes (@pxref{Conflicts}).
  4417. @c
  4418. @kindex C-c C-y
  4419. @cindex evaluate time range
  4420. @item C-c C-y
  4421. Evaluate a time range by computing the difference between start and end.
  4422. With a prefix argument, insert result after the time range (in a table: into
  4423. the following column).
  4424. @end table
  4425. @menu
  4426. * The date/time prompt:: How Org mode helps you entering date and time
  4427. * Custom time format:: Making dates look different
  4428. @end menu
  4429. @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
  4430. @subsection The date/time prompt
  4431. @cindex date, reading in minibuffer
  4432. @cindex time, reading in minibuffer
  4433. @vindex org-read-date-prefer-future
  4434. When Org mode prompts for a date/time, the default is shown in default
  4435. date/time format, and the prompt therefore seems to ask for a specific
  4436. format. But it will in fact accept any string containing some date and/or
  4437. time information, and it is really smart about interpreting your input. You
  4438. can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
  4439. copied from an email message. Org mode will find whatever information is in
  4440. there and derive anything you have not specified from the @emph{default date
  4441. and time}. The default is usually the current date and time, but when
  4442. modifying an existing timestamp, or when entering the second stamp of a
  4443. range, it is taken from the stamp in the buffer. When filling in
  4444. information, Org mode assumes that most of the time you will want to enter a
  4445. date in the future: if you omit the month/year and the given day/month is
  4446. @i{before} today, it will assume that you mean a future date@footnote{See the
  4447. variable @code{org-read-date-prefer-future}. You may set that variable to
  4448. the symbol @code{time} to even make a time before now shift the date to
  4449. tomorrow.}. If the date has been automatically shifted into the future, the
  4450. time prompt will show this with @samp{(=>F).}
  4451. For example, let's assume that today is @b{June 13, 2006}. Here is how
  4452. various inputs will be interpreted, the items filled in by Org mode are
  4453. in @b{bold}.
  4454. @example
  4455. 3-2-5 --> 2003-02-05
  4456. 2/5/3 --> 2003-02-05
  4457. 14 --> @b{2006}-@b{06}-14
  4458. 12 --> @b{2006}-@b{07}-12
  4459. 2/5 --> @b{2003}-02-05
  4460. Fri --> nearest Friday (defaultdate or later)
  4461. sep 15 --> @b{2006}-09-15
  4462. feb 15 --> @b{2007}-02-15
  4463. sep 12 9 --> 2009-09-12
  4464. 12:45 --> @b{2006}-@b{06}-@b{13} 12:45
  4465. 22 sept 0:34 --> @b{2006}-09-22 0:34
  4466. w4 --> ISO week for of the current year @b{2006}
  4467. 2012 w4 fri --> Friday of ISO week 4 in 2012
  4468. 2012-w04-5 --> Same as above
  4469. @end example
  4470. Furthermore you can specify a relative date by giving, as the
  4471. @emph{first} thing in the input: a plus/minus sign, a number and a
  4472. letter ([dwmy]) to indicate change in days, weeks, months, or years. With a
  4473. single plus or minus, the date is always relative to today. With a
  4474. double plus or minus, it is relative to the default date. If instead of
  4475. a single letter, you use the abbreviation of day name, the date will be
  4476. the nth such day. E.g.
  4477. @example
  4478. +0 --> today
  4479. . --> today
  4480. +4d --> four days from today
  4481. +4 --> same as above
  4482. +2w --> two weeks from today
  4483. ++5 --> five days from default date
  4484. +2tue --> second Tuesday from now.
  4485. @end example
  4486. @vindex parse-time-months
  4487. @vindex parse-time-weekdays
  4488. The function understands English month and weekday abbreviations. If
  4489. you want to use unabbreviated names and/or other languages, configure
  4490. the variables @code{parse-time-months} and @code{parse-time-weekdays}.
  4491. @cindex calendar, for selecting date
  4492. @vindex org-popup-calendar-for-date-prompt
  4493. Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
  4494. you don't need/want the calendar, configure the variable
  4495. @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
  4496. prompt, either by clicking on a date in the calendar, or by pressing
  4497. @key{RET}, the date selected in the calendar will be combined with the
  4498. information entered at the prompt. You can control the calendar fully
  4499. from the minibuffer:
  4500. @kindex <
  4501. @kindex >
  4502. @kindex mouse-1
  4503. @kindex S-@key{right}
  4504. @kindex S-@key{left}
  4505. @kindex S-@key{down}
  4506. @kindex S-@key{up}
  4507. @kindex M-S-@key{right}
  4508. @kindex M-S-@key{left}
  4509. @kindex @key{RET}
  4510. @example
  4511. > / < @r{Scroll calendar forward/backward by one month.}
  4512. mouse-1 @r{Select date by clicking on it.}
  4513. S-@key{right}/@key{left} @r{One day forward/backward.}
  4514. S-@key{down}/@key{up} @r{One week forward/backward.}
  4515. M-S-@key{right}/@key{left} @r{One month forward/backward.}
  4516. @key{RET} @r{Choose date in calendar.}
  4517. @end example
  4518. @vindex org-read-date-display-live
  4519. The actions of the date/time prompt may seem complex, but I assure you they
  4520. will grow on you, and you will start getting annoyed by pretty much any other
  4521. way of entering a date/time out there. To help you understand what is going
  4522. on, the current interpretation of your input will be displayed live in the
  4523. minibuffer@footnote{If you find this distracting, turn the display of with
  4524. @code{org-read-date-display-live}.}.
  4525. @node Custom time format, , The date/time prompt, Creating timestamps
  4526. @subsection Custom time format
  4527. @cindex custom date/time format
  4528. @cindex time format, custom
  4529. @cindex date format, custom
  4530. @vindex org-display-custom-times
  4531. @vindex org-time-stamp-custom-formats
  4532. Org mode uses the standard ISO notation for dates and times as it is
  4533. defined in ISO 8601. If you cannot get used to this and require another
  4534. representation of date and time to keep you happy, you can get it by
  4535. customizing the variables @code{org-display-custom-times} and
  4536. @code{org-time-stamp-custom-formats}.
  4537. @table @kbd
  4538. @kindex C-c C-x C-t
  4539. @item C-c C-x C-t
  4540. Toggle the display of custom formats for dates and times.
  4541. @end table
  4542. @noindent
  4543. Org mode needs the default format for scanning, so the custom date/time
  4544. format does not @emph{replace} the default format---instead it is put
  4545. @emph{over} the default format using text properties. This has the
  4546. following consequences:
  4547. @itemize @bullet
  4548. @item
  4549. You cannot place the cursor onto a timestamp anymore, only before or
  4550. after.
  4551. @item
  4552. The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
  4553. each component of a timestamp. If the cursor is at the beginning of
  4554. the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
  4555. just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
  4556. time will be changed by one minute.
  4557. @item
  4558. If the timestamp contains a range of clock times or a repeater, these
  4559. will not be overlayed, but remain in the buffer as they were.
  4560. @item
  4561. When you delete a timestamp character-by-character, it will only
  4562. disappear from the buffer after @emph{all} (invisible) characters
  4563. belonging to the ISO timestamp have been removed.
  4564. @item
  4565. If the custom timestamp format is longer than the default and you are
  4566. using dates in tables, table alignment will be messed up. If the custom
  4567. format is shorter, things do work as expected.
  4568. @end itemize
  4569. @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
  4570. @section Deadlines and scheduling
  4571. A timestamp may be preceded by special keywords to facilitate planning:
  4572. @table @var
  4573. @item DEADLINE
  4574. @cindex DEADLINE keyword
  4575. Meaning: the task (most likely a TODO item, though not necessarily) is supposed
  4576. to be finished on that date.
  4577. @vindex org-deadline-warning-days
  4578. On the deadline date, the task will be listed in the agenda. In
  4579. addition, the agenda for @emph{today} will carry a warning about the
  4580. approaching or missed deadline, starting
  4581. @code{org-deadline-warning-days} before the due date, and continuing
  4582. until the entry is marked DONE. An example:
  4583. @example
  4584. *** TODO write article about the Earth for the Guide
  4585. The editor in charge is [[bbdb:Ford Prefect]]
  4586. DEADLINE: <2004-02-29 Sun>
  4587. @end example
  4588. You can specify a different lead time for warnings for a specific
  4589. deadlines using the following syntax. Here is an example with a warning
  4590. period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
  4591. @item SCHEDULED
  4592. @cindex SCHEDULED keyword
  4593. Meaning: you are planning to start working on that task on the given
  4594. date.
  4595. @vindex org-agenda-skip-scheduled-if-done
  4596. The headline will be listed under the given date@footnote{It will still
  4597. be listed on that date after it has been marked DONE. If you don't like
  4598. this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
  4599. addition, a reminder that the scheduled date has passed will be present
  4600. in the compilation for @emph{today}, until the entry is marked DONE.
  4601. I.e. the task will automatically be forwarded until completed.
  4602. @example
  4603. *** TODO Call Trillian for a date on New Years Eve.
  4604. SCHEDULED: <2004-12-25 Sat>
  4605. @end example
  4606. @noindent
  4607. @b{Important:} Scheduling an item in Org mode should @i{not} be
  4608. understood in the same way that we understand @i{scheduling a meeting}.
  4609. Setting a date for a meeting is just a simple appointment, you should
  4610. mark this entry with a simple plain timestamp, to get this item shown
  4611. on the date where it applies. This is a frequent misunderstanding by
  4612. Org users. In Org mode, @i{scheduling} means setting a date when you
  4613. want to start working on an action item.
  4614. @end table
  4615. You may use timestamps with repeaters in scheduling and deadline
  4616. entries. Org mode will issue early and late warnings based on the
  4617. assumption that the timestamp represents the @i{nearest instance} of
  4618. the repeater. However, the use of diary sexp entries like
  4619. @c
  4620. @code{<%%(diary-float t 42)>}
  4621. @c
  4622. in scheduling and deadline timestamps is limited. Org mode does not
  4623. know enough about the internals of each sexp function to issue early and
  4624. late warnings. However, it will show the item on each day where the
  4625. sexp entry matches.
  4626. @menu
  4627. * Inserting deadline/schedule:: Planning items
  4628. * Repeated tasks:: Items that show up again and again
  4629. @end menu
  4630. @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
  4631. @subsection Inserting deadlines or schedules
  4632. The following commands allow you to quickly insert a deadline or to schedule
  4633. an item:
  4634. @table @kbd
  4635. @c
  4636. @kindex C-c C-d
  4637. @item C-c C-d
  4638. Insert @samp{DEADLINE} keyword along with a stamp. The insertion will happen
  4639. in the line directly following the headline. When called with a prefix arg,
  4640. an existing deadline will be removed from the entry. Depending on the
  4641. variable @code{org-log-redeadline}@footnote{with corresponding
  4642. @code{#+STARTUP} keywords @code{logredeadline}, @code{lognoteredeadline},
  4643. and @code{nologredeadline}}, a note will be taken when changing an existing
  4644. deadline.
  4645. @c FIXME Any CLOSED timestamp will be removed.????????
  4646. @c
  4647. @kindex C-c C-s
  4648. @item C-c C-s
  4649. Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
  4650. happen in the line directly following the headline. Any CLOSED timestamp
  4651. will be removed. When called with a prefix argument, remove the scheduling
  4652. date from the entry. Depending on the variable
  4653. @code{org-log-reschedule}@footnote{with corresponding @code{#+STARTUP}
  4654. keywords @code{logredeadline}, @code{lognoteredeadline}, and
  4655. @code{nologredeadline}}, a note will be taken when changing an existing
  4656. scheduling time.
  4657. @c
  4658. @kindex C-c C-x C-k
  4659. @kindex k a
  4660. @kindex k s
  4661. @item C-c C-x C-k
  4662. Mark the current entry for agenda action. After you have marked the entry
  4663. like this, you can open the agenda or the calendar to find an appropriate
  4664. date. With the cursor on the selected date, press @kbd{k s} or @kbd{k d} to
  4665. schedule the marked item.
  4666. @c
  4667. @kindex C-c / d
  4668. @cindex sparse tree, for deadlines
  4669. @item C-c / d
  4670. @vindex org-deadline-warning-days
  4671. Create a sparse tree with all deadlines that are either past-due, or
  4672. which will become due within @code{org-deadline-warning-days}.
  4673. With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
  4674. prefix, check that many days. For example, @kbd{C-1 C-c / d} shows
  4675. all deadlines due tomorrow.
  4676. @c
  4677. @kindex C-c / b
  4678. @item C-c / b
  4679. Sparse tree for deadlines and scheduled items before a given date.
  4680. @c
  4681. @kindex C-c / a
  4682. @item C-c / a
  4683. Sparse tree for deadlines and scheduled items after a given date.
  4684. @end table
  4685. @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
  4686. @subsection Repeated tasks
  4687. @cindex tasks, repeated
  4688. @cindex repeated tasks
  4689. Some tasks need to be repeated again and again. Org mode helps to
  4690. organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
  4691. or plain timestamp. In the following example
  4692. @example
  4693. ** TODO Pay the rent
  4694. DEADLINE: <2005-10-01 Sat +1m>
  4695. @end example
  4696. @noindent
  4697. the @code{+1m} is a repeater; the intended interpretation is that the task
  4698. has a deadline on <2005-10-01> and repeats itself every (one) month starting
  4699. from that time. If you need both a repeater and a special warning period in
  4700. a deadline entry, the repeater should come first and the warning period last:
  4701. @code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
  4702. Deadlines and scheduled items produce entries in the agenda when they
  4703. are over-due, so it is important to be able to mark such an entry as
  4704. completed once you have done so. When you mark a DEADLINE or a SCHEDULE
  4705. with the TODO keyword DONE, it will no longer produce entries in the
  4706. agenda. The problem with this is, however, that then also the
  4707. @emph{next} instance of the repeated entry will not be active. Org mode
  4708. deals with this in the following way: When you try to mark such an entry
  4709. DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
  4710. timestamp by the repeater interval, and immediately set the entry state
  4711. back to TODO. In the example above, setting the state to DONE would
  4712. actually switch the date like this:
  4713. @example
  4714. ** TODO Pay the rent
  4715. DEADLINE: <2005-11-01 Tue +1m>
  4716. @end example
  4717. @vindex org-log-repeat
  4718. A timestamp@footnote{You can change this using the option
  4719. @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
  4720. @code{lognoterepeat}, and @code{nologrepeat}. With @code{lognoterepeat}, you
  4721. will also be prompted for a note.} will be added under the deadline, to keep
  4722. a record that you actually acted on the previous instance of this deadline.
  4723. As a consequence of shifting the base date, this entry will no longer be
  4724. visible in the agenda when checking past dates, but all future instances
  4725. will be visible.
  4726. With the @samp{+1m} cookie, the date shift will always be exactly one
  4727. month. So if you have not paid the rent for three months, marking this
  4728. entry DONE will still keep it as an overdue deadline. Depending on the
  4729. task, this may not be the best way to handle it. For example, if you
  4730. forgot to call you father for 3 weeks, it does not make sense to call
  4731. him 3 times in a single day to make up for it. Finally, there are tasks
  4732. like changing batteries which should always repeat a certain time
  4733. @i{after} the last time you did it. For these tasks, Org mode has
  4734. special repeaters markers with @samp{++} and @samp{.+}. For example:
  4735. @example
  4736. ** TODO Call Father
  4737. DEADLINE: <2008-02-10 Sun ++1w>
  4738. Marking this DONE will shift the date by at least one week,
  4739. but also by as many weeks as it takes to get this date into
  4740. the future. However, it stays on a Sunday, even if you called
  4741. and marked it done on Saturday.
  4742. ** TODO Check the batteries in the smoke detectors
  4743. DEADLINE: <2005-11-01 Tue .+1m>
  4744. Marking this DONE will shift the date to one month after
  4745. today.
  4746. @end example
  4747. You may have both scheduling and deadline information for a specific
  4748. task---just make sure that the repeater intervals on both are the same.
  4749. An alternative to using a repeater is to create a number of copies of a task
  4750. subtree, with dates shifted in each copy. The command @kbd{C-c C-x c} was
  4751. created for this purpose, it is described in @ref{Structure editing}.
  4752. @node Clocking work time, Resolving idle time, Deadlines and scheduling, Dates and Times
  4753. @section Clocking work time
  4754. Org mode allows you to clock the time you spend on specific tasks in a
  4755. project. When you start working on an item, you can start the clock.
  4756. When you stop working on that task, or when you mark the task done, the
  4757. clock is stopped and the corresponding time interval is recorded. It
  4758. also computes the total time spent on each subtree of a project. And it
  4759. remembers a history or tasks recently clocked, to that you can jump quickly
  4760. between a number of tasks absorbing your time.
  4761. To save the clock history across Emacs sessions, use
  4762. @lisp
  4763. (setq org-clock-persist 'history)
  4764. (org-clock-persistence-insinuate)
  4765. @end lisp
  4766. When you clock into a new task after resuming Emacs, the incomplete
  4767. clock@footnote{To resume the clock under the assumption that you have worked
  4768. on this task while outside Emacs, use @code{(setq org-clock-persist t)}.}
  4769. will be found (@pxref{Resolving idle time}) and you will be prompted about
  4770. what to do with it.
  4771. @table @kbd
  4772. @kindex C-c C-x C-i
  4773. @item C-c C-x C-i
  4774. @vindex org-clock-into-drawer
  4775. Start the clock on the current item (clock-in). This inserts the CLOCK
  4776. keyword together with a timestamp. If this is not the first clocking of
  4777. this item, the multiple CLOCK lines will be wrapped into a
  4778. @code{:LOGBOOK:} drawer (see also the variable
  4779. @code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument,
  4780. select the task from a list of recently clocked tasks. With two @kbd{C-u
  4781. C-u} prefixes, clock into the task at point and mark it as the default task.
  4782. The default task will always be available when selecting a clocking task,
  4783. with letter @kbd{d}.@*
  4784. @cindex property: CLOCK_MODELINE_TOTAL
  4785. @cindex property: LAST_REPEAT
  4786. @vindex org-clock-modeline-total
  4787. While the clock is running, the current clocking time is shown in the mode
  4788. line, along with the title of the task. The clock time shown will be all
  4789. time ever clocked for this task and its children. If the task has an effort
  4790. estimate (@pxref{Effort estimates}), the mode line displays the current
  4791. clocking time against it@footnote{To add an effort estimate ``on the fly'',
  4792. hook a function doing this to @code{org-clock-in-prepare-hook}.} If the task
  4793. is a repeating one (@pxref{Repeated tasks}), only the time since the last
  4794. reset of the task @footnote{as recorded by the @code{LAST_REPEAT} property}
  4795. will be shown. More control over what time is shown can be exercised with
  4796. the @code{CLOCK_MODELINE_TOTAL} property. It may have the values
  4797. @code{current} to show only the current clocking instance, @code{today} to
  4798. show all time clocked on this tasks today (see also the variable
  4799. @code{org-extend-today-until}), @code{all} to include all time, or
  4800. @code{auto} which is the default@footnote{See also the variable
  4801. @code{org-clock-modeline-total}.}.@* Clicking with @kbd{mouse-1} onto the
  4802. mode line entry will pop up a menu with clocking options.
  4803. @kindex C-c C-x C-o
  4804. @item C-c C-x C-o
  4805. @vindex org-log-note-clock-out
  4806. Stop the clock (clock-out). This inserts another timestamp at the same
  4807. location where the clock was last started. It also directly computes
  4808. the resulting time in inserts it after the time range as @samp{=>
  4809. HH:MM}. See the variable @code{org-log-note-clock-out} for the
  4810. possibility to record an additional note together with the clock-out
  4811. timestamp@footnote{The corresponding in-buffer setting is:
  4812. @code{#+STARTUP: lognoteclock-out}}.
  4813. @kindex C-c C-x C-e
  4814. @item C-c C-x C-e
  4815. Update the effort estimate for the current clock task.
  4816. @kindex C-c C-y
  4817. @kindex C-c C-c
  4818. @item C-c C-y @ @ @r{or}@ @ C-c C-c
  4819. Recompute the time interval after changing one of the timestamps. This
  4820. is only necessary if you edit the timestamps directly. If you change
  4821. them with @kbd{S-@key{cursor}} keys, the update is automatic.
  4822. @kindex C-c C-t
  4823. @item C-c C-t
  4824. Changing the TODO state of an item to DONE automatically stops the clock
  4825. if it is running in this same item.
  4826. @kindex C-c C-x C-x
  4827. @item C-c C-x C-x
  4828. Cancel the current clock. This is useful if a clock was started by
  4829. mistake, or if you ended up working on something else.
  4830. @kindex C-c C-x C-j
  4831. @item C-c C-x C-j
  4832. Jump to the entry that contains the currently running clock. With a
  4833. @kbd{C-u} prefix arg, select the target task from a list of recently clocked
  4834. tasks.
  4835. @kindex C-c C-x C-d
  4836. @item C-c C-x C-d
  4837. @vindex org-remove-highlights-with-change
  4838. Display time summaries for each subtree in the current buffer. This
  4839. puts overlays at the end of each headline, showing the total time
  4840. recorded under that heading, including the time of any subheadings. You
  4841. can use visibility cycling to study the tree, but the overlays disappear
  4842. when you change the buffer (see variable
  4843. @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
  4844. @kindex C-c C-x C-r
  4845. @item C-c C-x C-r
  4846. Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
  4847. report as an Org-mode table into the current file. When the cursor is
  4848. at an existing clock table, just update it. When called with a prefix
  4849. argument, jump to the first clock report in the current document and
  4850. update it.
  4851. @cindex #+BEGIN, clocktable
  4852. @example
  4853. #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
  4854. #+END: clocktable
  4855. @end example
  4856. @noindent
  4857. If such a block already exists at point, its content is replaced by the
  4858. new table. The @samp{BEGIN} line can specify options:
  4859. @example
  4860. :maxlevel @r{Maximum level depth to which times are listed in the table.}
  4861. :emphasize @r{When @code{t}, emphasize level one and level two items.}
  4862. :scope @r{The scope to consider. This can be any of the following:}
  4863. nil @r{the current buffer or narrowed region}
  4864. file @r{the full current buffer}
  4865. subtree @r{the subtree where the clocktable is located}
  4866. tree@var{N} @r{the surrounding level @var{N} tree, for example @code{tree3}}
  4867. tree @r{the surrounding level 1 tree}
  4868. agenda @r{all agenda files}
  4869. ("file"..) @r{scan these files}
  4870. file-with-archives @r{current file and its archives}
  4871. agenda-with-archives @r{all agenda files, including archives}
  4872. :block @r{The time block to consider. This block is specified either}
  4873. @r{absolute, or relative to the current time and may be any of}
  4874. @r{these formats:}
  4875. 2007-12-31 @r{New year eve 2007}
  4876. 2007-12 @r{December 2007}
  4877. 2007-W50 @r{ISO-week 50 in 2007}
  4878. 2007 @r{the year 2007}
  4879. today, yesterday, today-@var{N} @r{a relative day}
  4880. thisweek, lastweek, thisweek-@var{N} @r{a relative week}
  4881. thismonth, lastmonth, thismonth-@var{N} @r{a relative month}
  4882. thisyear, lastyear, thisyear-@var{N} @r{a relative year}
  4883. @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
  4884. :tstart @r{A time string specifying when to start considering times.}
  4885. :tend @r{A time string specifying when to stop considering times.}
  4886. :step @r{@code{week} or @code{day}, to split the table into chunks.}
  4887. @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
  4888. :link @r{Link the item headlines in the table to their origins.}
  4889. :formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
  4890. @r{As a special case, @samp{:formula %} adds a column with % time.}
  4891. @r{If you do not specify a formula here, any existing formula.}
  4892. @r{below the clock table will survive updates and be evaluated.}
  4893. :timestamp @r{A timestamp for the entry, when available. Look for SCHEDULED,}
  4894. @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
  4895. @end example
  4896. To get a clock summary of the current level 1 tree, for the current
  4897. day, you could write
  4898. @example
  4899. #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
  4900. #+END: clocktable
  4901. @end example
  4902. @noindent
  4903. and to use a specific time range you could write@footnote{Note that all
  4904. parameters must be specified in a single line---the line is broken here
  4905. only to fit it into the manual.}
  4906. @example
  4907. #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
  4908. :tend "<2006-08-10 Thu 12:00>"
  4909. #+END: clocktable
  4910. @end example
  4911. A summary of the current subtree with % times would be
  4912. @example
  4913. #+BEGIN: clocktable :scope subtree :link t :formula %
  4914. #+END: clocktable
  4915. @end example
  4916. @kindex C-c C-c
  4917. @item C-c C-c
  4918. @kindex C-c C-x C-u
  4919. @itemx C-c C-x C-u
  4920. Update dynamic block at point. The cursor needs to be in the
  4921. @code{#+BEGIN} line of the dynamic block.
  4922. @kindex C-u C-c C-x C-u
  4923. @item C-u C-c C-x C-u
  4924. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  4925. you have several clock table blocks in a buffer.
  4926. @kindex S-@key{left}
  4927. @kindex S-@key{right}
  4928. @item S-@key{left}
  4929. @itemx S-@key{right}
  4930. Shift the current @code{:block} interval and update the table. The cursor
  4931. needs to be in the @code{#+BEGIN: clocktable} line for this command. If
  4932. @code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
  4933. @end table
  4934. The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
  4935. the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
  4936. worked on or closed during a day.
  4937. @node Resolving idle time, Effort estimates, Clocking work time, Dates and Times
  4938. @section Resolving idle time
  4939. @cindex resolve idle time
  4940. @cindex idle, resolve, dangling
  4941. If you clock in on a work item, and then walk away from your
  4942. computer---perhaps to take a phone call---you often need to ``resolve'' the
  4943. time you were away by either subtracting it from the current clock, or
  4944. applying it to another one.
  4945. @vindex org-clock-idle-time
  4946. By customizing the variable @code{org-clock-idle-time} to some integer, such
  4947. as 10 or 15, Emacs can alert you when you get back to your computer after
  4948. being idle for that many minutes@footnote{On computers using Mac OS X,
  4949. idleness is based on actual user idleness, not just Emacs' idle time. For
  4950. X11, you can install a utility program @file{x11idle.c}, available in the
  4951. UTILITIES directory of the Org git distribution, to get the same general
  4952. treatment of idleness. On other systems, idle time refers to Emacs idle time
  4953. only.}, and ask what you want to do with the idle time. There will be a
  4954. question waiting for you when you get back, indicating how much idle time has
  4955. passed (constantly updated with the current amount), as well as a set of
  4956. choices to correct the discrepancy:
  4957. @table @kbd
  4958. @item k
  4959. To keep some or all of the minutes and stay clocked in, press @kbd{k}. Org
  4960. will ask how many of the minutes to keep. Press @key{RET} to keep them all,
  4961. effectively changing nothing, or enter a number to keep that many minutes.
  4962. @item K
  4963. If you use the shift key and press @kbd{K}, it will keep however many minutes
  4964. you request and then immediately clock out of that task. If you keep all of
  4965. the minutes, this is the same as just clocking out of the current task.
  4966. @item s
  4967. To keep none of the minutes, use @kbd{s} to subtract all the away time from
  4968. the clock, and then check back in from the moment you returned.
  4969. @item S
  4970. To keep none of the minutes and just clock out at the start of the away time,
  4971. use the shift key and press @kbd{S}. Remember that using shift will always
  4972. leave you clocked out, no matter which option you choose.
  4973. @item C
  4974. To cancel the clock altogether, use @kbd{C}. Note that if instead of
  4975. cancelling you subtract the away time, and the resulting clock amount is less
  4976. than a minute, the clock will still be cancelled rather than clutter up the
  4977. log with an empty entry.
  4978. @end table
  4979. What if you subtracted those away minutes from the current clock, and now
  4980. want to apply them to a new clock? Simply clock in to any task immediately
  4981. after the subtraction. Org will notice that you have subtracted time ``on
  4982. the books'', so to speak, and will ask if you want to apply those minutes to
  4983. the next task you clock in on.
  4984. There is one other instance when this clock resolution magic occurs. Say you
  4985. were clocked in and hacking away, and suddenly your cat chased a mouse who
  4986. scared a hamster that crashed into your UPS's power button! You suddenly
  4987. lose all your buffers, but thanks to auto-save you still have your recent Org
  4988. mode changes, including your last clock in.
  4989. If you restart Emacs and clock into any task, Org will notice that you have a
  4990. dangling clock which was never clocked out from your last session. Using
  4991. that clock's starting time as the beginning of the unaccounted-for period,
  4992. Org will ask how you want to resolve that time. The logic and behavior is
  4993. identical to dealing with away time due to idleness, it's just happening due
  4994. to a recovery event rather than a set amount of idle time.
  4995. You can also check all the files visited by your Org agenda for dangling
  4996. clocks at any time using @kbd{M-x org-resolve-clocks}.
  4997. @node Effort estimates, Relative timer, Resolving idle time, Dates and Times
  4998. @section Effort estimates
  4999. @cindex effort estimates
  5000. @cindex property, Effort
  5001. @vindex org-effort-property
  5002. If you want to plan your work in a very detailed way, or if you need to
  5003. produce offers with quotations of the estimated work effort, you may want to
  5004. assign effort estimates to entries. If you are also clocking your work, you
  5005. may later want to compare the planned effort with the actual working time, a
  5006. great way to improve planning estimates. Effort estimates are stored in a
  5007. special property @samp{Effort}@footnote{You may change the property being
  5008. used with the variable @code{org-effort-property}.}. You can set the effort
  5009. for an entry with the following commands:
  5010. @table @kbd
  5011. @kindex C-c C-x e
  5012. @item C-c C-x e
  5013. Set the effort estimate for the current entry. With a numeric prefix
  5014. argument, set it to the NTH allowed value (see below). This command is also
  5015. accessible from the agenda with the @kbd{e} key.
  5016. @kindex C-c C-x C-e
  5017. @item C-c C-x C-e
  5018. Modify the effort estimate of the item currently being clocked.
  5019. @end table
  5020. Clearly the best way to work with effort estimates is through column view
  5021. (@pxref{Column view}). You should start by setting up discrete values for
  5022. effort estimates, and a @code{COLUMNS} format that displays these values
  5023. together with clock sums (if you want to clock your time). For a specific
  5024. buffer you can use
  5025. @example
  5026. #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
  5027. #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
  5028. @end example
  5029. @noindent
  5030. @vindex org-global-properties
  5031. @vindex org-columns-default-format
  5032. or, even better, you can set up these values globally by customizing the
  5033. variables @code{org-global-properties} and @code{org-columns-default-format}.
  5034. In particular if you want to use this setup also in the agenda, a global
  5035. setup may be advised.
  5036. The way to assign estimates to individual items is then to switch to column
  5037. mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
  5038. value. The values you enter will immediately be summed up in the hierarchy.
  5039. In the column next to it, any clocked time will be displayed.
  5040. @vindex org-agenda-columns-add-appointments-to-effort-sum
  5041. If you switch to column view in the daily/weekly agenda, the effort column
  5042. will summarize the estimated work effort for each day@footnote{Please note
  5043. the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
  5044. column view}).}, and you can use this to find space in your schedule. To get
  5045. an overview of the entire part of the day that is committed, you can set the
  5046. option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
  5047. appointments on a day that take place over a specified time interval will
  5048. then also be added to the load estimate of the day.
  5049. Effort estimates can be used in secondary agenda filtering that is triggered
  5050. with the @kbd{/} key in the agenda (@pxref{Agenda commands}). If you have
  5051. these estimates defined consistently, two or three key presses will narrow
  5052. down the list to stuff that fits into an available time slot.
  5053. @node Relative timer, , Effort estimates, Dates and Times
  5054. @section Taking notes with a relative timer
  5055. @cindex relative timer
  5056. When taking notes during, for example, a meeting or a video viewing, it can
  5057. be useful to have access to times relative to a starting time. Org provides
  5058. such a relative timer and make it easy to create timed notes.
  5059. @table @kbd
  5060. @kindex C-c C-x .
  5061. @item C-c C-x .
  5062. Insert a relative time into the buffer. The first time you use this, the
  5063. timer will be started. When called with a prefix argument, the timer is
  5064. restarted.
  5065. @kindex C-c C-x -
  5066. @item C-c C-x -
  5067. Insert a description list item with the current relative time. With a prefix
  5068. argument, first reset the timer to 0.
  5069. @kindex M-@key{RET}
  5070. @item M-@key{RET}
  5071. Once the timer list is started, you can also use @kbd{M-@key{RET}} to insert
  5072. new timer items.
  5073. @kindex C-c C-x ,
  5074. @item C-c C-x ,
  5075. Pause the timer, or continue it if it is already paused.
  5076. @c removed the sentence because it is redundant to the following item
  5077. @kindex C-u C-c C-x ,
  5078. @item C-u C-c C-x ,
  5079. Stop the timer. After this, you can only start a new timer, not continue the
  5080. old one. This command also removes the timer from the mode line.
  5081. @kindex C-c C-x 0
  5082. @item C-c C-x 0
  5083. Reset the timer without inserting anything into the buffer. By default, the
  5084. timer is reset to 0. When called with a @kbd{C-u} prefix, reset the timer to
  5085. specific starting offset. The user is prompted for the offset, with a
  5086. default taken from a timer string at point, if any, So this can be used to
  5087. restart taking notes after a break in the process. When called with a double
  5088. prefix argument @kbd{C-c C-u}, change all timer strings in the active region
  5089. by a certain amount. This can be used to fix timer strings if the timer was
  5090. not started at exactly the right moment.
  5091. @end table
  5092. @node Capture - Refile - Archive, Agenda Views, Dates and Times, Top
  5093. @chapter Capture - Refile - Archive
  5094. @cindex capture
  5095. An important part of any organization system is the ability to quickly
  5096. capture new ideas and tasks, and to associate reference material with them.
  5097. Org uses the @file{remember.el} package to create tasks, and stores files
  5098. related to a task (@i{attachments}) in a special directory. Once in the
  5099. system, tasks and projects need to be moved around. Moving completed project
  5100. trees to an archive file keeps the system compact and fast.
  5101. @menu
  5102. * Remember:: Capture new tasks/ideas with little interruption
  5103. * Attachments:: Add files to tasks.
  5104. * RSS Feeds:: Getting input from RSS feeds
  5105. * Protocols:: External (e.g. Browser) access to Emacs and Org
  5106. * Refiling notes:: Moving a tree from one place to another
  5107. * Archiving:: What to do with finished projects
  5108. @end menu
  5109. @node Remember, Attachments, Capture - Refile - Archive, Capture - Refile - Archive
  5110. @section Remember
  5111. @cindex @file{remember.el}
  5112. The Remember package by John Wiegley lets you store quick notes with little
  5113. interruption of your work flow. It is an excellent way to add new notes and
  5114. tasks to Org files. The @code{remember.el} package is part of Emacs 23, not
  5115. Emacs 22. See @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for
  5116. more information.
  5117. Org significantly expands the possibilities of Remember: you may define
  5118. templates for different note types, and associate target files and headlines
  5119. with specific templates. It also allows you to select the location where a
  5120. note should be stored interactively, on the fly.
  5121. @menu
  5122. * Setting up Remember for Org:: Some code for .emacs to get things going
  5123. * Remember templates:: Define the outline of different note types
  5124. * Storing notes:: Directly get the note to where it belongs
  5125. @end menu
  5126. @node Setting up Remember for Org, Remember templates, Remember, Remember
  5127. @subsection Setting up Remember for Org
  5128. The following customization will tell Remember to use Org files as
  5129. target, and to create annotations compatible with Org links.
  5130. @example
  5131. (org-remember-insinuate)
  5132. (setq org-directory "~/path/to/my/orgfiles/")
  5133. (setq org-default-notes-file (concat org-directory "/notes.org"))
  5134. (define-key global-map "\C-cr" 'org-remember)
  5135. @end example
  5136. @noindent
  5137. The last line binds the command @code{org-remember} to a global
  5138. key@footnote{Please select your own key, @kbd{C-c r} is only a
  5139. suggestion.}. @code{org-remember} basically just calls Remember,
  5140. but it makes a few things easier: if there is an active region, it will
  5141. automatically copy the region into the Remember buffer. It also allows
  5142. to jump to the buffer and location where Remember notes are being
  5143. stored: just call @code{org-remember} with a prefix argument. If you
  5144. use two prefix arguments, Org jumps to the location where the last
  5145. remember note was stored.
  5146. The Remember buffer will actually use @code{org-mode} as its major mode, so
  5147. that all editing features of Org mode are available. In addition to this, a
  5148. minor mode @code{org-remember-mode} is turned on, for the single purpose that
  5149. you can use its keymap @code{org-remember-mode-map} to overwrite some of
  5150. Org mode's key bindings.
  5151. You can also call @code{org-remember} in a special way from the agenda,
  5152. using the @kbd{k r} key combination. With this access, any timestamps
  5153. inserted by the selected Remember template (see below) will default to
  5154. the cursor date in the agenda, rather than to the current date.
  5155. @node Remember templates, Storing notes, Setting up Remember for Org, Remember
  5156. @subsection Remember templates
  5157. @cindex templates, for Remember
  5158. In combination with Org, you can use templates to generate
  5159. different types of Remember notes. For example, if you would like
  5160. to use one template to create general TODO entries, another one for
  5161. journal entries, and a third one for collecting random ideas, you could
  5162. use:
  5163. @example
  5164. (setq org-remember-templates
  5165. '(("Todo" ?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
  5166. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
  5167. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  5168. @end example
  5169. @vindex org-remember-default-headline
  5170. @vindex org-directory
  5171. @noindent In these entries, the first string is just a name, and the
  5172. character specifies how to select the template. It is useful if the
  5173. character is also the first letter of the name. The next string specifies
  5174. the template. Two more (optional) strings give the file in which, and the
  5175. headline under which, the new note should be stored. The file (if not
  5176. present or @code{nil}) defaults to @code{org-default-notes-file}, the heading
  5177. to @code{org-remember-default-headline}. If the file name is not an absolute
  5178. path, it will be interpreted relative to @code{org-directory}.
  5179. The heading can also be the symbols @code{top} or @code{bottom} to send notes
  5180. as level 1 entries to the beginning or end of the file, respectively. It may
  5181. also be the symbol @code{date-tree}. Then, a tree with year on level 1,
  5182. month on level 2 and day on level three will be build in the file, and the
  5183. entry will be filed into the tree under the current date@footnote{If the file
  5184. contains an entry with a @code{DATE_TREE} property, the entire date tree will
  5185. be build under that entry.}
  5186. An optional sixth element specifies the contexts in which the user can select
  5187. the template. This element can be a list of major modes or a function.
  5188. @code{org-remember} will first check whether the function returns @code{t} or
  5189. if we are in any of the listed major modes, and exclude templates for which
  5190. this condition is not fulfilled. Templates that do not specify this element
  5191. at all, or that use @code{nil} or @code{t} as a value will always be
  5192. selectable.
  5193. So for example:
  5194. @example
  5195. (setq org-remember-templates
  5196. '(("Bug" ?b "* BUG %?\n %i\n %a" "~/org/BUGS.org" "Bugs" (emacs-lisp-mode))
  5197. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org" "X" my-check)
  5198. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  5199. @end example
  5200. @noindent
  5201. The first template will only be available when invoking @code{org-remember}
  5202. from an buffer in @code{emacs-lisp-mode}. The second template will only be
  5203. available when the function @code{my-check} returns @code{t}. The third
  5204. template will be proposed in any context.
  5205. When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
  5206. something, Org will prompt for a key to select the template (if you have
  5207. more than one template) and then prepare the buffer like
  5208. @example
  5209. * TODO
  5210. [[file:@var{link to where you called remember}]]
  5211. @end example
  5212. @noindent
  5213. During expansion of the template, special @kbd{%}-escapes@footnote{If you
  5214. need one of these sequences literally, escape the @kbd{%} with a backslash.}
  5215. allow dynamic insertion of content:
  5216. @example
  5217. %^@{@var{prompt}@} @r{prompt the user for a string and replace this sequence with it.}
  5218. @r{You may specify a default value and a completion table with}
  5219. @r{%^@{prompt|default|completion2|completion3...@}}
  5220. @r{The arrow keys access a prompt-specific history.}
  5221. %a @r{annotation, normally the link created with @code{org-store-link}}
  5222. %A @r{like @code{%a}, but prompt for the description part}
  5223. %i @r{initial content, the region when remember is called with C-u.}
  5224. @r{The entire text will be indented like @code{%i} itself.}
  5225. %t @r{timestamp, date only}
  5226. %T @r{timestamp with date and time}
  5227. %u, %U @r{like the above, but inactive timestamps}
  5228. %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
  5229. @r{You may define a prompt like @code{%^@{Birthday@}t}}
  5230. %n @r{user name (taken from @code{user-full-name})}
  5231. %c @r{Current kill ring head.}
  5232. %x @r{Content of the X clipboard.}
  5233. %^C @r{Interactive selection of which kill or clip to use.}
  5234. %^L @r{Like @code{%^C}, but insert as link.}
  5235. %^g @r{prompt for tags, with completion on tags in target file.}
  5236. %k @r{title of currently clocked task}
  5237. %K @r{link to currently clocked task}
  5238. %^G @r{prompt for tags, with completion all tags in all agenda files.}
  5239. %^@{@var{prop}@}p @r{Prompt the user for a value for property @var{prop}}
  5240. %:keyword @r{specific information for certain link types, see below}
  5241. %[@var{file}] @r{insert the contents of the file given by @var{file}}
  5242. %(@var{sexp}) @r{evaluate Elisp @var{sexp} and replace with the result}
  5243. %! @r{immediately store note after completing the template}
  5244. @r{(skipping the @kbd{C-c C-c} that normally triggers storing)}
  5245. %& @r{jump to target location immediately after storing note}
  5246. @end example
  5247. @noindent
  5248. For specific link types, the following keywords will be
  5249. defined@footnote{If you define your own link types (@pxref{Adding
  5250. hyperlink types}), any property you store with
  5251. @code{org-store-link-props} can be accessed in remember templates in a
  5252. similar way.}:
  5253. @vindex org-from-is-user-regexp
  5254. @example
  5255. Link type | Available keywords
  5256. -------------------+----------------------------------------------
  5257. bbdb | %:name %:company
  5258. bbdb | %::server %:port %:nick
  5259. vm, wl, mh, rmail | %:type %:subject %:message-id
  5260. | %:from %:fromname %:fromaddress
  5261. | %:to %:toname %:toaddress
  5262. | %: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}.}}
  5263. gnus | %:group, @r{for messages also all email fields}
  5264. w3, w3m | %:url
  5265. info | %:file %:node
  5266. calendar | %:date"
  5267. @end example
  5268. @noindent
  5269. To place the cursor after template expansion use:
  5270. @example
  5271. %? @r{After completing the template, position cursor here.}
  5272. @end example
  5273. @noindent
  5274. If you change your mind about which template to use, call
  5275. @code{org-remember} in the remember buffer. You may then select a new
  5276. template that will be filled with the previous context information.
  5277. @node Storing notes, , Remember templates, Remember
  5278. @subsection Storing notes
  5279. @vindex org-remember-clock-out-on-exit
  5280. When you are finished preparing a note with Remember, you have to press
  5281. @kbd{C-c C-c} to file the note away. If you have started the clock in the
  5282. Remember buffer, you will first be asked if you want to clock out
  5283. now@footnote{To avoid this query, configure the variable
  5284. @code{org-remember-clock-out-on-exit}.}. If you answer @kbd{n}, the clock
  5285. will continue to run after the note was filed away.
  5286. The handler will then store the note in the file and under the headline
  5287. specified in the template, or it will use the default file and headline. The
  5288. window configuration will be restored, sending you back to the working
  5289. context before the call to Remember. To re-use the location found during the
  5290. last call to Remember, exit the Remember buffer with @kbd{C-0 C-c C-c},
  5291. i.e. specify a zero prefix argument to @kbd{C-c C-c}. Another special case
  5292. is @kbd{C-2 C-c C-c} which files the note as a child of the currently clocked
  5293. item, and @kbd{C-3 C-c C-c} files as a sibling of the currently clocked item.
  5294. @vindex org-remember-store-without-prompt
  5295. If you want to store the note directly to a different place, use
  5296. @kbd{C-1 C-c C-c} instead to exit Remember@footnote{Configure the
  5297. variable @code{org-remember-store-without-prompt} to make this behavior
  5298. the default.}. The handler will then first prompt for a target file---if
  5299. you press @key{RET}, the value specified for the template is used.
  5300. Then the command offers the headings tree of the selected file, with the
  5301. cursor position at the default headline (if you specified one in the
  5302. template). You can either immediately press @key{RET} to get the note
  5303. placed there. Or you can use the following keys to find a different
  5304. location:
  5305. @example
  5306. @key{TAB} @r{Cycle visibility.}
  5307. @key{down} / @key{up} @r{Next/previous visible headline.}
  5308. n / p @r{Next/previous visible headline.}
  5309. f / b @r{Next/previous headline same level.}
  5310. u @r{One level up.}
  5311. @c 0-9 @r{Digit argument.}
  5312. @end example
  5313. @noindent
  5314. Pressing @key{RET} or @key{left} or @key{right}
  5315. then leads to the following result.
  5316. @vindex org-reverse-note-order
  5317. @multitable @columnfractions 0.2 0.15 0.65
  5318. @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
  5319. @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
  5320. @item @tab @tab depending on @code{org-reverse-note-order}.
  5321. @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
  5322. @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
  5323. @item @tab @tab depending on @code{org-reverse-note-order}.
  5324. @item not on headline @tab @key{RET}
  5325. @tab at cursor position, level taken from context.
  5326. @end multitable
  5327. Before inserting the text into a tree, the function ensures that the text has
  5328. a headline, i.e. a first line that starts with a @samp{*}. If not, a
  5329. headline is constructed from the current date. If you have indented the text
  5330. of the note below the headline, the indentation will be adapted if inserting
  5331. the note into the tree requires demotion from level 1.
  5332. @node Attachments, RSS Feeds, Remember, Capture - Refile - Archive
  5333. @section Attachments
  5334. @cindex attachments
  5335. @vindex org-attach-directory
  5336. It is often useful to associate reference material with an outline node/task.
  5337. Small chunks of plain text can simply be stored in the subtree of a project.
  5338. Hyperlinks (@pxref{Hyperlinks}) can be used to establish associations with
  5339. files that live elsewhere on your computer or in the cloud, like emails or
  5340. source code files belonging to a project. Another method is @i{attachments},
  5341. which are files located in a directory belonging to an outline node. Org
  5342. uses directories named by the unique ID of each entry. These directories are
  5343. located in the @file{data} directory which lives in the same directory where
  5344. your Org file lives@footnote{If you move entries or Org files from one
  5345. directory to another, you may want to configure @code{org-attach-directory}
  5346. to contain an absolute path.}. If you initialize this directory with
  5347. @code{git init}, Org will automatically commit changes when it sees them.
  5348. The attachment system has been contributed to Org by John Wiegley.
  5349. In cases where it seems better to do so, you can also attach a directory of your
  5350. choice to an entry. You can also make children inherit the attachment
  5351. directory from a parent, so that an entire subtree uses the same attached
  5352. directory.
  5353. @noindent The following commands deal with attachments.
  5354. @table @kbd
  5355. @kindex C-c C-a
  5356. @item C-c C-a
  5357. The dispatcher for commands related to the attachment system. After these
  5358. keys, a list of commands is displayed and you need to press an additional key
  5359. to select a command:
  5360. @table @kbd
  5361. @kindex C-c C-a a
  5362. @item a
  5363. @vindex org-attach-method
  5364. Select a file and move it into the task's attachment directory. The file
  5365. will be copied, moved, or linked, depending on @code{org-attach-method}.
  5366. Note that hard links are not supported on all systems.
  5367. @kindex C-c C-a c
  5368. @kindex C-c C-a m
  5369. @kindex C-c C-a l
  5370. @item c/m/l
  5371. Attach a file using the copy/move/link method.
  5372. Note that hard links are not supported on all systems.
  5373. @kindex C-c C-a n
  5374. @item n
  5375. Create a new attachment as an Emacs buffer.
  5376. @kindex C-c C-a z
  5377. @item z
  5378. Synchronize the current task with its attachment directory, in case you added
  5379. attachments yourself.
  5380. @kindex C-c C-a o
  5381. @item o
  5382. @vindex org-file-apps
  5383. Open current task's attachment. If there are more than one, prompt for a
  5384. file name first. Opening will follow the rules set by @code{org-file-apps}.
  5385. For more details, see the information on following hyperlinks
  5386. (@pxref{Handling links}).
  5387. @kindex C-c C-a O
  5388. @item O
  5389. Also open the attachment, but force opening the file in Emacs.
  5390. @kindex C-c C-a f
  5391. @item f
  5392. Open the current task's attachment directory.
  5393. @kindex C-c C-a F
  5394. @item F
  5395. Also open the directory, but force using @command{dired} in Emacs.
  5396. @kindex C-c C-a d
  5397. @item d
  5398. Select and delete a single attachment.
  5399. @kindex C-c C-a D
  5400. @item D
  5401. Delete all of a task's attachments. A safer way is to open the directory in
  5402. @command{dired} and delete from there.
  5403. @kindex C-c C-a s
  5404. @item C-c C-a s
  5405. @cindex property, ATTACH_DIR
  5406. Set a specific directory as the entry's attachment directory. This works by
  5407. putting the directory path into the @code{ATTACH_DIR} property.
  5408. @kindex C-c C-a i
  5409. @item C-c C-a i
  5410. @cindex property, ATTACH_DIR_INHERIT
  5411. Set the @code{ATTACH_DIR_INHERIT} property, so that children will use the
  5412. same directory for attachments as the parent does.
  5413. @end table
  5414. @end table
  5415. @node RSS Feeds, Protocols, Attachments, Capture - Refile - Archive
  5416. @section RSS feeds
  5417. @cindex RSS feeds
  5418. Org has the capability to add and change entries based on information found in
  5419. RSS feeds. You could use this to make a task out of each new podcast in a
  5420. podcast feed. Or you could use a phone-based note-creating service on the
  5421. web to import tasks into Org. To access feeds, you need to configure the
  5422. variable @code{org-feed-alist}. The docstring of this variable has detailed
  5423. information. Here is just an example:
  5424. @example
  5425. (setq org-feed-alist
  5426. '(("ReQall" "http://www.reqall.com/user/feeds/rss/a1b2c3....."
  5427. "~/org/feeds.org" "ReQall Entries")
  5428. @end example
  5429. @noindent
  5430. will configure that new items from the feed provided by @file{reqall.com}
  5431. will result in new entries in the file @file{~/org/feeds.org} under the
  5432. heading @samp{ReQall Entries}, whenever the following command is used:
  5433. @table @kbd
  5434. @kindex C-c C-x g
  5435. @item C-c C-x g
  5436. Collect items from the feeds configured in @code{org-feed-alist} and act upon
  5437. them.
  5438. @kindex C-c C-x G
  5439. @item C-c C-x G
  5440. Prompt for a feed name and go to the inbox configured for this feed.
  5441. @end table
  5442. Under the same headline, Org will create a drawer @samp{FEEDSTATUS} in which
  5443. it will store information about the status of items in the feed, to avoid
  5444. adding the same item several times. You should add @samp{FEEDSTATUS} to the
  5445. list of drawers in that file:
  5446. @example
  5447. #+DRAWERS: LOGBOOK PROPERTIES FEEDSTATUS
  5448. @end example
  5449. For more information, see @file{org-feed.el} and the docstring of
  5450. @code{org-feed-alist}.
  5451. @node Protocols, Refiling notes, RSS Feeds, Capture - Refile - Archive
  5452. @section Protocols for external access
  5453. @cindex protocols, for external access
  5454. @cindex emacsserver
  5455. You can set up Org for handling protocol calls from outside applications that
  5456. are passed to Emacs through the @file{emacsserver}. For example, you can
  5457. configure bookmarks in your web browser to send a link to the current page to
  5458. Org and create a note from it using Remember (@pxref{Remember}). Or you
  5459. could create a bookmark that will tell Emacs to open the local source file of
  5460. a remote website you are looking at with the browser. See
  5461. @uref{http://orgmode.org/worg/org-contrib/org-protocol.php} for detailed
  5462. documentation and setup instructions.
  5463. @node Refiling notes, Archiving, Protocols, Capture - Refile - Archive
  5464. @section Refiling notes
  5465. @cindex refiling notes
  5466. When reviewing the captured data, you may want to refile some of the entries
  5467. into a different list, for example into a project. Cutting, finding the
  5468. right location, and then pasting the note is cumbersome. To simplify this
  5469. process, you can use the following special command:
  5470. @table @kbd
  5471. @kindex C-c C-w
  5472. @item C-c C-w
  5473. @vindex org-reverse-note-order
  5474. @vindex org-refile-targets
  5475. @vindex org-refile-use-outline-path
  5476. @vindex org-outline-path-complete-in-steps
  5477. @vindex org-refile-allow-creating-parent-nodes
  5478. @vindex org-log-refile
  5479. Refile the entry or region at point. This command offers possible locations
  5480. for refiling the entry and lets you select one with completion. The item (or
  5481. all items in the region) is filed below the target heading as a subitem.
  5482. Depending on @code{org-reverse-note-order}, it will be either the first or
  5483. last subitem.@*
  5484. By default, all level 1 headlines in the current buffer are considered to be
  5485. targets, but you can have more complex definitions across a number of files.
  5486. See the variable @code{org-refile-targets} for details. If you would like to
  5487. select a location via a file-path-like completion along the outline path, see
  5488. the variables @code{org-refile-use-outline-path} and
  5489. @code{org-outline-path-complete-in-steps}. If you would like to be able to
  5490. create new nodes as new parents for refiling on the fly, check the
  5491. variable @code{org-refile-allow-creating-parent-nodes}.
  5492. When the variable @code{org-log-refile}@footnote{with corresponding
  5493. @code{#+STARTUP} keywords @code{logrefile}, @code{lognoterefile},
  5494. and @code{nologrefile}} is set, a time stamp or a note will be
  5495. recorded when an entry has been refiled.
  5496. @kindex C-u C-c C-w
  5497. @item C-u C-c C-w
  5498. Use the refile interface to jump to a heading.
  5499. @kindex C-u C-u C-c C-w
  5500. @item C-u C-u C-c C-w
  5501. Jump to the location where @code{org-refile} last moved a tree to.
  5502. @item C-2 C-c C-w
  5503. Refile as the child of the item currently being clocked.
  5504. @end table
  5505. @node Archiving, , Refiling notes, Capture - Refile - Archive
  5506. @section Archiving
  5507. @cindex archiving
  5508. When a project represented by a (sub)tree is finished, you may want
  5509. to move the tree out of the way and to stop it from contributing to the
  5510. agenda. Archiving is important to keep your working files compact and global
  5511. searches like the construction of agenda views fast.
  5512. @table @kbd
  5513. @kindex C-c C-x C-a
  5514. @item C-c C-x C-a
  5515. @vindex org-archive-default-command
  5516. Archive the current entry using the command specified in the variable
  5517. @code{org-archive-default-command}.
  5518. @end table
  5519. @menu
  5520. * Moving subtrees:: Moving a tree to an archive file
  5521. * Internal archiving:: Switch off a tree but keep i in the file
  5522. @end menu
  5523. @node Moving subtrees, Internal archiving, Archiving, Archiving
  5524. @subsection Moving a tree to the archive file
  5525. @cindex external archiving
  5526. The most common archiving action is to move a project tree to another file,
  5527. the archive file.
  5528. @table @kbd
  5529. @kindex C-c $
  5530. @kindex C-c C-x C-s
  5531. @item C-c C-x C-s@ @r{or short} @ C-c $
  5532. @vindex org-archive-location
  5533. Archive the subtree starting at the cursor position to the location
  5534. given by @code{org-archive-location}.
  5535. @kindex C-u C-c C-x C-s
  5536. @item C-u C-c C-x C-s
  5537. Check if any direct children of the current headline could be moved to
  5538. the archive. To do this, each subtree is checked for open TODO entries.
  5539. If none are found, the command offers to move it to the archive
  5540. location. If the cursor is @emph{not} on a headline when this command
  5541. is invoked, the level 1 trees will be checked.
  5542. @end table
  5543. @cindex archive locations
  5544. The default archive location is a file in the same directory as the
  5545. current file, with the name derived by appending @file{_archive} to the
  5546. current file name. For information and examples on how to change this,
  5547. see the documentation string of the variable
  5548. @code{org-archive-location}. There is also an in-buffer option for
  5549. setting this variable, for example@footnote{For backward compatibility,
  5550. the following also works: If there are several such lines in a file,
  5551. each specifies the archive location for the text below it. The first
  5552. such line also applies to any text before its definition. However,
  5553. using this method is @emph{strongly} deprecated as it is incompatible
  5554. with the outline structure of the document. The correct method for
  5555. setting multiple archive locations in a buffer is using properties.}:
  5556. @cindex #+ARCHIVE
  5557. @example
  5558. #+ARCHIVE: %s_done::
  5559. @end example
  5560. @cindex property, ARCHIVE
  5561. @noindent
  5562. If you would like to have a special ARCHIVE location for a single entry
  5563. or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
  5564. location as the value (@pxref{Properties and Columns}).
  5565. @vindex org-archive-save-context-info
  5566. When a subtree is moved, it receives a number of special properties that
  5567. record context information like the file from where the entry came, its
  5568. outline path the archiving time etc. Configure the variable
  5569. @code{org-archive-save-context-info} to adjust the amount of information
  5570. added.
  5571. @node Internal archiving, , Moving subtrees, Archiving
  5572. @subsection Internal archiving
  5573. If you want to just switch off (for agenda views) certain subtrees without
  5574. moving them to a different file, you can use the @code{ARCHIVE tag}.
  5575. A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
  5576. its location in the outline tree, but behaves in the following way:
  5577. @itemize @minus
  5578. @item
  5579. @vindex org-cycle-open-archived-trees
  5580. It does not open when you attempt to do so with a visibility cycling
  5581. command (@pxref{Visibility cycling}). You can force cycling archived
  5582. subtrees with @kbd{C-@key{TAB}}, or by setting the option
  5583. @code{org-cycle-open-archived-trees}. Also normal outline commands like
  5584. @code{show-all} will open archived subtrees.
  5585. @item
  5586. @vindex org-sparse-tree-open-archived-trees
  5587. During sparse tree construction (@pxref{Sparse trees}), matches in
  5588. archived subtrees are not exposed, unless you configure the option
  5589. @code{org-sparse-tree-open-archived-trees}.
  5590. @item
  5591. @vindex org-agenda-skip-archived-trees
  5592. During agenda view construction (@pxref{Agenda Views}), the content of
  5593. archived trees is ignored unless you configure the option
  5594. @code{org-agenda-skip-archived-trees}, in which case these trees will always
  5595. be included. In the agenda you can press @kbd{v a} to get archives
  5596. temporarily included.
  5597. @item
  5598. @vindex org-export-with-archived-trees
  5599. Archived trees are not exported (@pxref{Exporting}), only the headline
  5600. is. Configure the details using the variable
  5601. @code{org-export-with-archived-trees}.
  5602. @item
  5603. @vindex org-columns-skip-arrchived-trees
  5604. Archived trees are excluded from column view unless the variable
  5605. @code{org-columns-skip-arrchived-trees} is configured to @code{nil}.
  5606. @end itemize
  5607. The following commands help managing the ARCHIVE tag:
  5608. @table @kbd
  5609. @kindex C-c C-x a
  5610. @item C-c C-x a
  5611. Toggle the ARCHIVE tag for the current headline. When the tag is set,
  5612. the headline changes to a shadowed face, and the subtree below it is
  5613. hidden.
  5614. @kindex C-u C-c C-x a
  5615. @item C-u C-c C-x a
  5616. Check if any direct children of the current headline should be archived.
  5617. To do this, each subtree is checked for open TODO entries. If none are
  5618. found, the command offers to set the ARCHIVE tag for the child. If the
  5619. cursor is @emph{not} on a headline when this command is invoked, the
  5620. level 1 trees will be checked.
  5621. @kindex C-@kbd{TAB}
  5622. @item C-@kbd{TAB}
  5623. Cycle a tree even if it is tagged with ARCHIVE.
  5624. @kindex C-c C-x A
  5625. @item C-c C-x A
  5626. Move the current entry to the @emph{Archive Sibling}. This is a sibling of
  5627. the entry with the heading @samp{Archive} and the tag @samp{ARCHIVE}. The
  5628. entry becomes a child of that sibling and in this way retains a lot of its
  5629. original context, including inherited tags and approximate position in the
  5630. outline.
  5631. @end table
  5632. @node Agenda Views, Markup, Capture - Refile - Archive, Top
  5633. @chapter Agenda Views
  5634. @cindex agenda views
  5635. Due to the way Org works, TODO items, time-stamped items, and
  5636. tagged headlines can be scattered throughout a file or even a number of
  5637. files. To get an overview of open action items, or of events that are
  5638. important for a particular date, this information must be collected,
  5639. sorted and displayed in an organized way.
  5640. Org can select items based on various criteria and display them
  5641. in a separate buffer. Seven different view types are provided:
  5642. @itemize @bullet
  5643. @item
  5644. an @emph{agenda} that is like a calendar and shows information
  5645. for specific dates,
  5646. @item
  5647. a @emph{TODO list} that covers all unfinished
  5648. action items,
  5649. @item
  5650. a @emph{match view}, showings headlines based on the tags, properties, and
  5651. TODO state associated with them,
  5652. @item
  5653. a @emph{timeline view} that shows all events in a single Org file,
  5654. in time-sorted view,
  5655. @item
  5656. a @emph{text search view} that shows all entries from multiple files
  5657. that contain specified keywords,
  5658. @item
  5659. a @emph{stuck projects view} showing projects that currently don't move
  5660. along, and
  5661. @item
  5662. @emph{custom views} that are special searches and combinations of different
  5663. views.
  5664. @end itemize
  5665. @noindent
  5666. The extracted information is displayed in a special @emph{agenda
  5667. buffer}. This buffer is read-only, but provides commands to visit the
  5668. corresponding locations in the original Org files, and even to
  5669. edit these files remotely.
  5670. @vindex org-agenda-window-setup
  5671. @vindex org-agenda-restore-windows-after-quit
  5672. Two variables control how the agenda buffer is displayed and whether the
  5673. window configuration is restored when the agenda exits:
  5674. @code{org-agenda-window-setup} and
  5675. @code{org-agenda-restore-windows-after-quit}.
  5676. @menu
  5677. * Agenda files:: Files being searched for agenda information
  5678. * Agenda dispatcher:: Keyboard access to agenda views
  5679. * Built-in agenda views:: What is available out of the box?
  5680. * Presentation and sorting:: How agenda items are prepared for display
  5681. * Agenda commands:: Remote editing of Org trees
  5682. * Custom agenda views:: Defining special searches and views
  5683. * Exporting Agenda Views:: Writing a view to a file
  5684. * Agenda column view:: Using column view for collected entries
  5685. @end menu
  5686. @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
  5687. @section Agenda files
  5688. @cindex agenda files
  5689. @cindex files for agenda
  5690. @vindex org-agenda-files
  5691. The information to be shown is normally collected from all @emph{agenda
  5692. files}, the files listed in the variable
  5693. @code{org-agenda-files}@footnote{If the value of that variable is not a
  5694. list, but a single file name, then the list of agenda files will be
  5695. maintained in that external file.}. If a directory is part of this list,
  5696. all files with the extension @file{.org} in this directory will be part
  5697. of the list.
  5698. Thus, even if you only work with a single Org file, that file should
  5699. be put into the list@footnote{When using the dispatcher, pressing
  5700. @kbd{<} before selecting a command will actually limit the command to
  5701. the current file, and ignore @code{org-agenda-files} until the next
  5702. dispatcher command.}. You can customize @code{org-agenda-files}, but
  5703. the easiest way to maintain it is through the following commands
  5704. @cindex files, adding to agenda list
  5705. @table @kbd
  5706. @kindex C-c [
  5707. @item C-c [
  5708. Add current file to the list of agenda files. The file is added to
  5709. the front of the list. If it was already in the list, it is moved to
  5710. the front. With a prefix argument, file is added/moved to the end.
  5711. @kindex C-c ]
  5712. @item C-c ]
  5713. Remove current file from the list of agenda files.
  5714. @kindex C-,
  5715. @kindex C-'
  5716. @item C-,
  5717. @itemx C-'
  5718. Cycle through agenda file list, visiting one file after the other.
  5719. @kindex M-x org-iswitchb
  5720. @item M-x org-iswitchb
  5721. Command to use an @code{iswitchb}-like interface to switch to and between Org
  5722. buffers.
  5723. @end table
  5724. @noindent
  5725. The Org menu contains the current list of files and can be used
  5726. to visit any of them.
  5727. If you would like to focus the agenda temporarily on a file not in
  5728. this list, or on just one file in the list, or even on only a subtree in a
  5729. file, then this can be done in different ways. For a single agenda command,
  5730. you may press @kbd{<} once or several times in the dispatcher
  5731. (@pxref{Agenda dispatcher}). To restrict the agenda scope for an
  5732. extended period, use the following commands:
  5733. @table @kbd
  5734. @kindex C-c C-x <
  5735. @item C-c C-x <
  5736. Permanently restrict the agenda to the current subtree. When with a
  5737. prefix argument, or with the cursor before the first headline in a file,
  5738. the agenda scope is set to the entire file. This restriction remains in
  5739. effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
  5740. or @kbd{>} in the agenda dispatcher. If there is a window displaying an
  5741. agenda view, the new restriction takes effect immediately.
  5742. @kindex C-c C-x >
  5743. @item C-c C-x >
  5744. Remove the permanent restriction created by @kbd{C-c C-x <}.
  5745. @end table
  5746. @noindent
  5747. When working with @file{speedbar.el}, you can use the following commands in
  5748. the Speedbar frame:
  5749. @table @kbd
  5750. @kindex <
  5751. @item < @r{in the speedbar frame}
  5752. Permanently restrict the agenda to the item---either an Org file or a subtree
  5753. in such a file---at the cursor in the Speedbar frame.
  5754. If there is a window displaying an agenda view, the new restriction takes
  5755. effect immediately.
  5756. @kindex >
  5757. @item > @r{in the speedbar frame}
  5758. Lift the restriction.
  5759. @end table
  5760. @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
  5761. @section The agenda dispatcher
  5762. @cindex agenda dispatcher
  5763. @cindex dispatching agenda commands
  5764. The views are created through a dispatcher, which should be bound to a
  5765. global key---for example @kbd{C-c a} (@pxref{Installation}). In the
  5766. following we will assume that @kbd{C-c a} is indeed how the dispatcher
  5767. is accessed and list keyboard access to commands accordingly. After
  5768. pressing @kbd{C-c a}, an additional letter is required to execute a
  5769. command. The dispatcher offers the following default commands:
  5770. @table @kbd
  5771. @item a
  5772. Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
  5773. @item t @r{/} T
  5774. Create a list of all TODO items (@pxref{Global TODO list}).
  5775. @item m @r{/} M
  5776. Create a list of headlines matching a TAGS expression (@pxref{Matching
  5777. tags and properties}).
  5778. @item L
  5779. Create the timeline view for the current buffer (@pxref{Timeline}).
  5780. @item s
  5781. Create a list of entries selected by a boolean expression of keywords
  5782. and/or regular expressions that must or must not occur in the entry.
  5783. @item /
  5784. @vindex org-agenda-text-search-extra-files
  5785. Search for a regular expression in all agenda files and additionally in
  5786. the files listed in @code{org-agenda-text-search-extra-files}. This
  5787. uses the Emacs command @code{multi-occur}. A prefix argument can be
  5788. used to specify the number of context lines for each match, default is
  5789. 1.
  5790. @item # @r{/} !
  5791. Create a list of stuck projects (@pxref{Stuck projects}).
  5792. @item <
  5793. Restrict an agenda command to the current buffer@footnote{For backward
  5794. compatibility, you can also press @kbd{1} to restrict to the current
  5795. buffer.}. After pressing @kbd{<}, you still need to press the character
  5796. selecting the command.
  5797. @item < <
  5798. If there is an active region, restrict the following agenda command to
  5799. the region. Otherwise, restrict it to the current subtree@footnote{For
  5800. backward compatibility, you can also press @kbd{0} to restrict to the
  5801. current region/subtree.}. After pressing @kbd{< <}, you still need to press the
  5802. character selecting the command.
  5803. @end table
  5804. You can also define custom commands that will be accessible through the
  5805. dispatcher, just like the default commands. This includes the
  5806. possibility to create extended agenda buffers that contain several
  5807. blocks together, for example the weekly agenda, the global TODO list and
  5808. a number of special tags matches. @xref{Custom agenda views}.
  5809. @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
  5810. @section The built-in agenda views
  5811. In this section we describe the built-in views.
  5812. @menu
  5813. * Weekly/daily agenda:: The calendar page with current tasks
  5814. * Global TODO list:: All unfinished action items
  5815. * Matching tags and properties:: Structured information with fine-tuned search
  5816. * Timeline:: Time-sorted view for single file
  5817. * Search view:: Find entries by searching for text
  5818. * Stuck projects:: Find projects you need to review
  5819. @end menu
  5820. @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
  5821. @subsection The weekly/daily agenda
  5822. @cindex agenda
  5823. @cindex weekly agenda
  5824. @cindex daily agenda
  5825. The purpose of the weekly/daily @emph{agenda} is to act like a page of a
  5826. paper agenda, showing all the tasks for the current week or day.
  5827. @table @kbd
  5828. @cindex org-agenda, command
  5829. @kindex C-c a a
  5830. @item C-c a a
  5831. @vindex org-agenda-ndays
  5832. Compile an agenda for the current week from a list of Org files. The agenda
  5833. shows the entries for each day. With a numeric prefix@footnote{For backward
  5834. compatibility, the universal prefix @kbd{C-u} causes all TODO entries to be
  5835. listed before the agenda. This feature is deprecated, use the dedicated TODO
  5836. list, or a block agenda instead (@pxref{Block agenda}).} (like @kbd{C-u 2 1
  5837. C-c a a}) you may set the number of days to be displayed (see also the
  5838. variable @code{org-agenda-ndays})
  5839. @end table
  5840. Remote editing from the agenda buffer means, for example, that you can
  5841. change the dates of deadlines and appointments from the agenda buffer.
  5842. The commands available in the Agenda buffer are listed in @ref{Agenda
  5843. commands}.
  5844. @subsubheading Calendar/Diary integration
  5845. @cindex calendar integration
  5846. @cindex diary integration
  5847. Emacs contains the calendar and diary by Edward M. Reingold. The
  5848. calendar displays a three-month calendar with holidays from different
  5849. countries and cultures. The diary allows you to keep track of
  5850. anniversaries, lunar phases, sunrise/set, recurrent appointments
  5851. (weekly, monthly) and more. In this way, it is quite complementary to
  5852. Org. It can be very useful to combine output from Org with
  5853. the diary.
  5854. In order to include entries from the Emacs diary into Org mode's
  5855. agenda, you only need to customize the variable
  5856. @lisp
  5857. (setq org-agenda-include-diary t)
  5858. @end lisp
  5859. @noindent After that, everything will happen automatically. All diary
  5860. entries including holidays, anniversaries, etc., will be included in the
  5861. agenda buffer created by Org mode. @key{SPC}, @key{TAB}, and
  5862. @key{RET} can be used from the agenda buffer to jump to the diary
  5863. file in order to edit existing diary entries. The @kbd{i} command to
  5864. insert new entries for the current date works in the agenda buffer, as
  5865. well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
  5866. Sunrise/Sunset times, show lunar phases and to convert to other
  5867. calendars, respectively. @kbd{c} can be used to switch back and forth
  5868. between calendar and agenda.
  5869. If you are using the diary only for sexp entries and holidays, it is
  5870. faster to not use the above setting, but instead to copy or even move
  5871. the entries into an Org file. Org mode evaluates diary-style sexp
  5872. entries, and does it faster because there is no overhead for first
  5873. creating the diary display. Note that the sexp entries must start at
  5874. the left margin, no whitespace is allowed before them. For example,
  5875. the following segment of an Org file will be processed and entries
  5876. will be made in the agenda:
  5877. @example
  5878. * Birthdays and similar stuff
  5879. #+CATEGORY: Holiday
  5880. %%(org-calendar-holiday) ; special function for holiday names
  5881. #+CATEGORY: Ann
  5882. %%(diary-anniversary 5 14 1956)@footnote{Note that the order of the arguments (month, day, year) depends on the setting of @code{calendar-date-style}.} Arthur Dent is %d years old
  5883. %%(diary-anniversary 10 2 1869) Mahatma Gandhi would be %d years old
  5884. @end example
  5885. @subsubheading Anniversaries from BBDB
  5886. @cindex BBDB, anniversaries
  5887. @cindex anniversaries, from BBDB
  5888. If you are using the Big Brothers Database to store your contacts, you will
  5889. very likely prefer to store anniversaries in BBDB rather than in a
  5890. separate Org or diary file. Org supports this and will show BBDB
  5891. anniversaries as part of the agenda. All you need to do is to add the
  5892. following to one your your agenda files:
  5893. @example
  5894. * Anniversaries
  5895. :PROPERTIES:
  5896. :CATEGORY: Anniv
  5897. :END
  5898. %%(org-bbdb-anniversaries)
  5899. @end example
  5900. You can then go ahead and define anniversaries for a BBDB record. Basically,
  5901. you need to press @kbd{C-o anniversary @key{RET}} with the cursor in a BBDB
  5902. record and then add the date in the format @code{YYYY-MM-DD}, followed by a
  5903. space and the class of the anniversary (@samp{birthday} or @samp{wedding}, or
  5904. a format string). If you omit the class, it will default to @samp{birthday}.
  5905. Here are a few examples, the header for the file @file{org-bbdb.el} contains
  5906. more detailed information.
  5907. @example
  5908. 1973-06-22
  5909. 1955-08-02 wedding
  5910. 2008-04-14 %s released version 6.01 of org-mode, %d years ago
  5911. @end example
  5912. After a change to BBDB, or for the first agenda display during an Emacs
  5913. session, the agenda display will suffer a short delay as Org updates its
  5914. hash with anniversaries. However, from then on things will be very fast---much
  5915. faster in fact than a long list of @samp{%%(diary-anniversary)} entries
  5916. in an Org or Diary file.
  5917. @subsubheading Appointment reminders
  5918. @cindex @file{appt.el}
  5919. @cindex appointment reminders
  5920. Org can interact with Emacs appointments notification facility. To add all
  5921. the appointments of your agenda files, use the command
  5922. @code{org-agenda-to-appt}. This command also lets you filter through the
  5923. list of your appointments and add only those belonging to a specific category
  5924. or matching a regular expression. See the docstring for details.
  5925. @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
  5926. @subsection The global TODO list
  5927. @cindex global TODO list
  5928. @cindex TODO list, global
  5929. The global TODO list contains all unfinished TODO items formatted and
  5930. collected into a single place.
  5931. @table @kbd
  5932. @kindex C-c a t
  5933. @item C-c a t
  5934. Show the global TODO list. This collects the TODO items from all
  5935. agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
  5936. @code{agenda-mode}, so there are commands to examine and manipulate
  5937. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  5938. @kindex C-c a T
  5939. @item C-c a T
  5940. @cindex TODO keyword matching
  5941. @vindex org-todo-keywords
  5942. Like the above, but allows selection of a specific TODO keyword. You
  5943. can also do this by specifying a prefix argument to @kbd{C-c a t}. With
  5944. a @kbd{C-u} prefix you are prompted for a keyword, and you may also
  5945. specify several keywords by separating them with @samp{|} as the boolean OR
  5946. operator. With a numeric prefix, the nth keyword in
  5947. @code{org-todo-keywords} is selected.
  5948. @kindex r
  5949. The @kbd{r} key in the agenda buffer regenerates it, and you can give
  5950. a prefix argument to this command to change the selected TODO keyword,
  5951. for example @kbd{3 r}. If you often need a search for a specific
  5952. keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
  5953. Matching specific TODO keywords can also be done as part of a tags
  5954. search (@pxref{Tag searches}).
  5955. @end table
  5956. Remote editing of TODO items means that you can change the state of a
  5957. TODO entry with a single key press. The commands available in the
  5958. TODO list are described in @ref{Agenda commands}.
  5959. @cindex sublevels, inclusion into TODO list
  5960. Normally the global TODO list simply shows all headlines with TODO
  5961. keywords. This list can become very long. There are two ways to keep
  5962. it more compact:
  5963. @itemize @minus
  5964. @item
  5965. @vindex org-agenda-todo-ignore-scheduled
  5966. @vindex org-agenda-todo-ignore-deadlines
  5967. @vindex org-agenda-todo-ignore-with-date
  5968. Some people view a TODO item that has been @emph{scheduled} for execution or
  5969. have a @emph{deadline} (@pxref{Timestamps}) as no longer @emph{open}.
  5970. Configure the variables @code{org-agenda-todo-ignore-scheduled},
  5971. @code{org-agenda-todo-ignore-deadlines}, and/or
  5972. @code{org-agenda-todo-ignore-with-date} to exclude such items from the
  5973. global TODO list.
  5974. @item
  5975. @vindex org-agenda-todo-list-sublevels
  5976. TODO items may have sublevels to break up the task into subtasks. In
  5977. such cases it may be enough to list only the highest level TODO headline
  5978. and omit the sublevels from the global list. Configure the variable
  5979. @code{org-agenda-todo-list-sublevels} to get this behavior.
  5980. @end itemize
  5981. @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
  5982. @subsection Matching tags and properties
  5983. @cindex matching, of tags
  5984. @cindex matching, of properties
  5985. @cindex tags view
  5986. @cindex match view
  5987. If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}),
  5988. or have properties (@pxref{Properties and Columns}), you can select headlines
  5989. based on this metadata and collect them into an agenda buffer. The match
  5990. syntax described here also applies when creating sparse trees with @kbd{C-c /
  5991. m}.
  5992. @table @kbd
  5993. @kindex C-c a m
  5994. @item C-c a m
  5995. Produce a list of all headlines that match a given set of tags. The
  5996. command prompts for a selection criterion, which is a boolean logic
  5997. expression with tags, like @samp{+work+urgent-withboss} or
  5998. @samp{work|home} (@pxref{Tags}). If you often need a specific search,
  5999. define a custom command for it (@pxref{Agenda dispatcher}).
  6000. @kindex C-c a M
  6001. @item C-c a M
  6002. @vindex org-tags-match-list-sublevels
  6003. @vindex org-agenda-tags-todo-honor-ignore-options
  6004. Like @kbd{C-c a m}, but only select headlines that are also TODO items and
  6005. force checking subitems (see variable @code{org-tags-match-list-sublevels}).
  6006. To exclude scheduled/deadline items, see the variable
  6007. @code{org-agenda-tags-todo-honor-ignore-options}. Matching specific TODO
  6008. keywords together with a tags match is also possible, see @ref{Tag searches}.
  6009. @end table
  6010. The commands available in the tags list are described in @ref{Agenda
  6011. commands}.
  6012. @subsubheading Match syntax
  6013. @cindex Boolean logic, for tag/property searches
  6014. A search string can use Boolean operators @samp{&} for AND and @samp{|} for
  6015. OR. @samp{&} binds more strongly than @samp{|}. Parentheses are currently
  6016. not implemented. Each element in the search is either a tag, a regular
  6017. expression matching tags, or an expression like @code{PROPERTY OPERATOR
  6018. VALUE} with a comparison operator, accessing a property value. Each element
  6019. may be preceded by @samp{-}, to select against it, and @samp{+} is syntactic
  6020. sugar for positive selection. The AND operator @samp{&} is optional when
  6021. @samp{+} or @samp{-} is present. Here are some examples, using only tags.
  6022. @table @samp
  6023. @item +work-boss
  6024. Select headlines tagged @samp{:work:}, but discard those also tagged
  6025. @samp{:boss:}.
  6026. @item work|laptop
  6027. Selects lines tagged @samp{:work:} or @samp{:laptop:}.
  6028. @item work|laptop+night
  6029. Like before, but require the @samp{:laptop:} lines to be tagged also
  6030. @samp{:night:}.
  6031. @end table
  6032. @cindex regular expressions, with tags search
  6033. Instead of a tag, you may also specify a regular expression enclosed in curly
  6034. braces. For example,
  6035. @samp{work+@{^boss.*@}} matches headlines that contain the tag
  6036. @samp{:work:} and any tag @i{starting} with @samp{boss}.
  6037. @cindex TODO keyword matching, with tags search
  6038. @cindex level, require for tags/property match
  6039. @cindex category, require for tags/property match
  6040. @vindex org-odd-levels-only
  6041. You may also test for properties (@pxref{Properties and Columns}) at the same
  6042. time as matching tags. The properties may be real properties, or special
  6043. properties that represent other metadata (@pxref{Special properties}). For
  6044. example, the ``property'' @code{TODO} represents the TODO keyword of the
  6045. entry. Or, the ``property'' @code{LEVEL} represents the level of an entry.
  6046. So a search @samp{+LEVEL=3+boss-TODO="DONE"} lists all level three headlines
  6047. that have the tag @samp{boss} and are @emph{not} marked with the TODO keyword
  6048. DONE. In buffers with @code{org-odd-levels-only} set, @samp{LEVEL} does not
  6049. count the number of stars, but @samp{LEVEL=2} will correspond to 3 stars etc.
  6050. Here are more examples:
  6051. @table @samp
  6052. @item work+TODO="WAITING"
  6053. Select @samp{:work:}-tagged TODO lines with the specific TODO
  6054. keyword @samp{WAITING}.
  6055. @item work+TODO="WAITING"|home+TODO="WAITING"
  6056. Waiting tasks both at work and at home.
  6057. @end table
  6058. When matching properties, a number of different operators can be used to test
  6059. the value of a property. Here is a complex example:
  6060. @example
  6061. +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \
  6062. +With=@{Sarah\|Denny@}+SCHEDULED>="<2008-10-11>"
  6063. @end example
  6064. @noindent
  6065. The type of comparison will depend on how the comparison value is written:
  6066. @itemize @minus
  6067. @item
  6068. If the comparison value is a plain number, a numerical comparison is done,
  6069. and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
  6070. @samp{>=}, and @samp{<>}.
  6071. @item
  6072. If the comparison value is enclosed in double-quotes,
  6073. a string comparison is done, and the same operators are allowed.
  6074. @item
  6075. If the comparison value is enclosed in double-quotes @emph{and} angular
  6076. brackets (like @samp{DEADLINE<="<2008-12-24 18:30>"}), both values are
  6077. assumed to be date/time specifications in the standard Org way, and the
  6078. comparison will be done accordingly. Special values that will be recognized
  6079. are @code{"<now>"} for now (including time), and @code{"<today>"}, and
  6080. @code{"<tomorrow>"} for these days at 0:00 hours, i.e. without a time
  6081. specification. Also strings like @code{"<+5d>"} or @code{"<-2m>"} with units
  6082. @code{d}, @code{w}, @code{m}, and @code{y} for day, week, month, and year,
  6083. respectively, can be used.
  6084. @item
  6085. If the comparison value is enclosed
  6086. in curly braces, a regexp match is performed, with @samp{=} meaning that the
  6087. regexp matches the property value, and @samp{<>} meaning that it does not
  6088. match.
  6089. @end itemize
  6090. So the search string in the example finds entries tagged @samp{:work:} but
  6091. not @samp{:boss:}, which also have a priority value @samp{A}, a
  6092. @samp{:Coffee:} property with the value @samp{unlimited}, an @samp{Effort}
  6093. property that is numerically smaller than 2, a @samp{:With:} property that is
  6094. matched by the regular expression @samp{Sarah\|Denny}, and that are scheduled
  6095. on or after October 11, 2008.
  6096. Accessing TODO, LEVEL, and CATEGORY during a search is fast. Accessing any
  6097. other properties will slow down the search. However, once you have paid the
  6098. price by accessing one property, testing additional properties is cheap
  6099. again.
  6100. You can configure Org mode to use property inheritance during a search, but
  6101. beware that this can slow down searches considerably. See @ref{Property
  6102. inheritance}, for details.
  6103. For backward compatibility, and also for typing speed, there is also a
  6104. different way to test TODO states in a search. For this, terminate the
  6105. tags/property part of the search string (which may include several terms
  6106. connected with @samp{|}) with a @samp{/} and then specify a Boolean
  6107. expression just for TODO keywords. The syntax is then similar to that for
  6108. tags, but should be applied with care: for example, a positive
  6109. selection on several TODO keywords cannot meaningfully be combined with
  6110. boolean AND. However, @emph{negative selection} combined with AND can be
  6111. meaningful. To make sure that only lines are checked that actually have any
  6112. TODO keyword (resulting in a speed-up), use @kbd{C-c a M}, or equivalently
  6113. start the TODO part after the slash with @samp{!}. Examples:
  6114. @table @samp
  6115. @item work/WAITING
  6116. Same as @samp{work+TODO="WAITING"}
  6117. @item work/!-WAITING-NEXT
  6118. Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
  6119. nor @samp{NEXT}
  6120. @item work/!+WAITING|+NEXT
  6121. Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
  6122. @samp{NEXT}.
  6123. @end table
  6124. @node Timeline, Search view, Matching tags and properties, Built-in agenda views
  6125. @subsection Timeline for a single file
  6126. @cindex timeline, single file
  6127. @cindex time-sorted view
  6128. The timeline summarizes all time-stamped items from a single Org mode
  6129. file in a @emph{time-sorted view}. The main purpose of this command is
  6130. to give an overview over events in a project.
  6131. @table @kbd
  6132. @kindex C-c a L
  6133. @item C-c a L
  6134. Show a time-sorted view of the Org file, with all time-stamped items.
  6135. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  6136. (scheduled or not) are also listed under the current date.
  6137. @end table
  6138. @noindent
  6139. The commands available in the timeline buffer are listed in
  6140. @ref{Agenda commands}.
  6141. @node Search view, Stuck projects, Timeline, Built-in agenda views
  6142. @subsection Search view
  6143. @cindex search view
  6144. @cindex text search
  6145. @cindex searching, for text
  6146. This agenda view is a general text search facility for Org mode entries.
  6147. It is particularly useful to find notes.
  6148. @table @kbd
  6149. @kindex C-c a s
  6150. @item C-c a s
  6151. This is a special search that lets you select entries by matching a substring
  6152. or specific words using a boolean logic.
  6153. @end table
  6154. For example, the search string @samp{computer equipment} will find entries
  6155. that contain @samp{computer equipment} as a substring. If the two words are
  6156. separated by more space or a line break, the search will still match.
  6157. Search view can also search for specific keywords in the entry, using Boolean
  6158. logic. The search string @samp{+computer +wifi -ethernet -@{8\.11[bg]@}}
  6159. will search for note entries that contain the keywords @code{computer}
  6160. and @code{wifi}, but not the keyword @code{ethernet}, and which are also
  6161. not matched by the regular expression @code{8\.11[bg]}, meaning to
  6162. exclude both 8.11b and 8.11g. The first @samp{+} is necessary to turn on
  6163. word search, other @samp{+} characters are optional. For more details, see
  6164. the docstring of the command @code{org-search-view}.
  6165. @vindex org-agenda-text-search-extra-files
  6166. Note that in addition to the agenda files, this command will also search
  6167. the files listed in @code{org-agenda-text-search-extra-files}.
  6168. @node Stuck projects, , Search view, Built-in agenda views
  6169. @subsection Stuck projects
  6170. If you are following a system like David Allen's GTD to organize your
  6171. work, one of the ``duties'' you have is a regular review to make sure
  6172. that all projects move along. A @emph{stuck} project is a project that
  6173. has no defined next actions, so it will never show up in the TODO lists
  6174. Org mode produces. During the review, you need to identify such
  6175. projects and define next actions for them.
  6176. @table @kbd
  6177. @kindex C-c a #
  6178. @item C-c a #
  6179. List projects that are stuck.
  6180. @kindex C-c a !
  6181. @item C-c a !
  6182. @vindex org-stuck-projects
  6183. Customize the variable @code{org-stuck-projects} to define what a stuck
  6184. project is and how to find it.
  6185. @end table
  6186. You almost certainly will have to configure this view before it will
  6187. work for you. The built-in default assumes that all your projects are
  6188. level-2 headlines, and that a project is not stuck if it has at least
  6189. one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
  6190. Let's assume that you, in your own way of using Org mode, identify
  6191. projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
  6192. indicate a project that should not be considered yet. Let's further
  6193. assume that the TODO keyword DONE marks finished projects, and that NEXT
  6194. and TODO indicate next actions. The tag @@SHOP indicates shopping and
  6195. is a next action even without the NEXT tag. Finally, if the project
  6196. contains the special word IGNORE anywhere, it should not be listed
  6197. either. In this case you would start by identifying eligible projects
  6198. with a tags/todo match@footnote{@xref{Tag searches}.}
  6199. @samp{+PROJECT/-MAYBE-DONE}, and then check for TODO, NEXT, @@SHOP, and
  6200. IGNORE in the subtree to identify projects that are not stuck. The
  6201. correct customization for this is
  6202. @lisp
  6203. (setq org-stuck-projects
  6204. '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
  6205. "\\<IGNORE\\>"))
  6206. @end lisp
  6207. Note that if a project is identified as non-stuck, the subtree of this entry
  6208. will still be searched for stuck projects.
  6209. @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
  6210. @section Presentation and sorting
  6211. @cindex presentation, of agenda items
  6212. @vindex org-agenda-prefix-format
  6213. Before displaying items in an agenda view, Org mode visually prepares
  6214. the items and sorts them. Each item occupies a single line. The line
  6215. starts with a @emph{prefix} that contains the @emph{category}
  6216. (@pxref{Categories}) of the item and other important information. You can
  6217. customize the prefix using the option @code{org-agenda-prefix-format}.
  6218. The prefix is followed by a cleaned-up version of the outline headline
  6219. associated with the item.
  6220. @menu
  6221. * Categories:: Not all tasks are equal
  6222. * Time-of-day specifications:: How the agenda knows the time
  6223. * Sorting of agenda items:: The order of things
  6224. @end menu
  6225. @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
  6226. @subsection Categories
  6227. @cindex category
  6228. The category is a broad label assigned to each agenda item. By default,
  6229. the category is simply derived from the file name, but you can also
  6230. specify it with a special line in the buffer, like this@footnote{For
  6231. backward compatibility, the following also works: if there are several
  6232. such lines in a file, each specifies the category for the text below it.
  6233. The first category also applies to any text before the first CATEGORY
  6234. line. However, using this method is @emph{strongly} deprecated as it is
  6235. incompatible with the outline structure of the document. The correct
  6236. method for setting multiple categories in a buffer is using a
  6237. property.}:
  6238. @example
  6239. #+CATEGORY: Thesis
  6240. @end example
  6241. @noindent
  6242. @cindex property, CATEGORY
  6243. If you would like to have a special CATEGORY for a single entry or a
  6244. (sub)tree, give the entry a @code{:CATEGORY:} property with the
  6245. special category you want to apply as the value.
  6246. @noindent
  6247. The display in the agenda buffer looks best if the category is not
  6248. longer than 10 characters.
  6249. @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
  6250. @subsection Time-of-day specifications
  6251. @cindex time-of-day specification
  6252. Org mode checks each agenda item for a time-of-day specification. The
  6253. time can be part of the timestamp that triggered inclusion into the
  6254. agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
  6255. ranges can be specified with two timestamps, like
  6256. @c
  6257. @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
  6258. In the headline of the entry itself, a time(range) may also appear as
  6259. plain text (like @samp{12:45} or a @samp{8:30-1pm}). If the agenda
  6260. integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
  6261. specifications in diary entries are recognized as well.
  6262. For agenda display, Org mode extracts the time and displays it in a
  6263. standard 24 hour format as part of the prefix. The example times in
  6264. the previous paragraphs would end up in the agenda like this:
  6265. @example
  6266. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  6267. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  6268. 19:00...... The Vogon reads his poem
  6269. 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
  6270. @end example
  6271. @cindex time grid
  6272. If the agenda is in single-day mode, or for the display of today, the
  6273. timed entries are embedded in a time grid, like
  6274. @example
  6275. 8:00...... ------------------
  6276. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  6277. 10:00...... ------------------
  6278. 12:00...... ------------------
  6279. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  6280. 14:00...... ------------------
  6281. 16:00...... ------------------
  6282. 18:00...... ------------------
  6283. 19:00...... The Vogon reads his poem
  6284. 20:00...... ------------------
  6285. 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
  6286. @end example
  6287. @vindex org-agenda-use-time-grid
  6288. @vindex org-agenda-time-grid
  6289. The time grid can be turned on and off with the variable
  6290. @code{org-agenda-use-time-grid}, and can be configured with
  6291. @code{org-agenda-time-grid}.
  6292. @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
  6293. @subsection Sorting of agenda items
  6294. @cindex sorting, of agenda items
  6295. @cindex priorities, of agenda items
  6296. Before being inserted into a view, the items are sorted. How this is
  6297. done depends on the type of view.
  6298. @itemize @bullet
  6299. @item
  6300. @vindex org-agenda-files
  6301. For the daily/weekly agenda, the items for each day are sorted. The
  6302. default order is to first collect all items containing an explicit
  6303. time-of-day specification. These entries will be shown at the beginning
  6304. of the list, as a @emph{schedule} for the day. After that, items remain
  6305. grouped in categories, in the sequence given by @code{org-agenda-files}.
  6306. Within each category, items are sorted by priority (@pxref{Priorities}),
  6307. which is composed of the base priority (2000 for priority @samp{A}, 1000
  6308. for @samp{B}, and 0 for @samp{C}), plus additional increments for
  6309. overdue scheduled or deadline items.
  6310. @item
  6311. For the TODO list, items remain in the order of categories, but within
  6312. each category, sorting takes place according to priority
  6313. (@pxref{Priorities}). The priority used for sorting derives from the
  6314. priority cookie, with additions depending on how close an item is to its due
  6315. or scheduled date.
  6316. @item
  6317. For tags matches, items are not sorted at all, but just appear in the
  6318. sequence in which they are found in the agenda files.
  6319. @end itemize
  6320. @vindex org-agenda-sorting-strategy
  6321. Sorting can be customized using the variable
  6322. @code{org-agenda-sorting-strategy}, and may also include criteria based on
  6323. the estimated effort of an entry (@pxref{Effort estimates}).
  6324. @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
  6325. @section Commands in the agenda buffer
  6326. @cindex commands, in agenda buffer
  6327. Entries in the agenda buffer are linked back to the Org file or diary
  6328. file where they originate. You are not allowed to edit the agenda
  6329. buffer itself, but commands are provided to show and jump to the
  6330. original entry location, and to edit the Org files ``remotely'' from
  6331. the agenda buffer. In this way, all information is stored only once,
  6332. removing the risk that your agenda and note files may diverge.
  6333. Some commands can be executed with mouse clicks on agenda lines. For
  6334. the other commands, the cursor needs to be in the desired line.
  6335. @table @kbd
  6336. @tsubheading{Motion}
  6337. @cindex motion commands in agenda
  6338. @kindex n
  6339. @item n
  6340. Next line (same as @key{up} and @kbd{C-p}).
  6341. @kindex p
  6342. @item p
  6343. Previous line (same as @key{down} and @kbd{C-n}).
  6344. @tsubheading{View/Go to Org file}
  6345. @kindex mouse-3
  6346. @kindex @key{SPC}
  6347. @item mouse-3
  6348. @itemx @key{SPC}
  6349. Display the original location of the item in another window.
  6350. With prefix arg, make sure that the entire entry is made visible in the
  6351. outline, not only the heading.
  6352. @c
  6353. @kindex L
  6354. @item L
  6355. Display original location and recenter that window.
  6356. @c
  6357. @kindex mouse-2
  6358. @kindex mouse-1
  6359. @kindex @key{TAB}
  6360. @item mouse-2
  6361. @itemx mouse-1
  6362. @itemx @key{TAB}
  6363. Go to the original location of the item in another window. Under Emacs
  6364. 22, @kbd{mouse-1} will also works for this.
  6365. @c
  6366. @kindex @key{RET}
  6367. @itemx @key{RET}
  6368. Go to the original location of the item and delete other windows.
  6369. @c
  6370. @kindex F
  6371. @item F
  6372. @vindex org-agenda-start-with-follow-mode
  6373. Toggle Follow mode. In Follow mode, as you move the cursor through
  6374. the agenda buffer, the other window always shows the corresponding
  6375. location in the Org file. The initial setting for this mode in new
  6376. agenda buffers can be set with the variable
  6377. @code{org-agenda-start-with-follow-mode}.
  6378. @c
  6379. @kindex C-c C-x b
  6380. @item C-c C-x b
  6381. Display the entire subtree of the current item in an indirect buffer. With a
  6382. numeric prefix argument N, go up to level N and then take that tree. If N is
  6383. negative, go up that many levels. With a @kbd{C-u} prefix, do not remove the
  6384. previously used indirect buffer.
  6385. @kindex C-c C-o
  6386. @item C-c C-o
  6387. Follow a link in the entry. This will offer a selection of any links in the
  6388. text belonging to the referenced Org node. If there is only one link, it
  6389. will be followed without a selection prompt.
  6390. @tsubheading{Change display}
  6391. @cindex display changing, in agenda
  6392. @kindex o
  6393. @item o
  6394. Delete other windows.
  6395. @c
  6396. @kindex v d
  6397. @kindex d
  6398. @kindex v w
  6399. @kindex w
  6400. @kindex v m
  6401. @kindex v y
  6402. @item v d @ @r{or short} @ d
  6403. @itemx v w @ @r{or short} @ w
  6404. @itemx v m
  6405. @itemx v y
  6406. Switch to day/week/month/year view. When switching to day or week view,
  6407. this setting becomes the default for subsequent agenda commands. Since
  6408. month and year views are slow to create, they do not become the default.
  6409. A numeric prefix argument may be used to jump directly to a specific day
  6410. of the year, ISO week, month, or year, respectively. For example,
  6411. @kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When
  6412. setting day, week, or month view, a year may be encoded in the prefix
  6413. argument as well. For example, @kbd{200712 w} will jump to week 12 in
  6414. 2007. If such a year specification has only one or two digits, it will
  6415. be mapped to the interval 1938-2037.
  6416. @c
  6417. @kindex f
  6418. @item f
  6419. @vindex org-agenda-ndays
  6420. Go forward in time to display the following @code{org-agenda-ndays} days.
  6421. For example, if the display covers a week, switch to the following week.
  6422. With prefix arg, go forward that many times @code{org-agenda-ndays} days.
  6423. @c
  6424. @kindex b
  6425. @item b
  6426. Go backward in time to display earlier dates.
  6427. @c
  6428. @kindex .
  6429. @item .
  6430. Go to today.
  6431. @c
  6432. @kindex j
  6433. @item j
  6434. Prompt for a date and go there.
  6435. @c
  6436. @kindex D
  6437. @item D
  6438. Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
  6439. @c
  6440. @kindex v l
  6441. @kindex v L
  6442. @kindex l
  6443. @item v l @ @r{or short} @ l
  6444. @vindex org-log-done
  6445. @vindex org-agenda-log-mode-items
  6446. Toggle Logbook mode. In Logbook mode, entries that were marked DONE while
  6447. logging was on (variable @code{org-log-done}) are shown in the agenda, as are
  6448. entries that have been clocked on that day. You can configure the entry
  6449. types that should be included in log mode using the variable
  6450. @code{org-agenda-log-mode-items}. When called with a @kbd{C-u} prefix, show
  6451. all possible logbook entries, including state changes. When called with two
  6452. prefix args @kbd{C-u C-u}, show only logging information, nothing else.
  6453. @kbd{v L} is equivalent to @kbd{C-u v l}.
  6454. @c
  6455. @kindex v [
  6456. @kindex [
  6457. @item v [ @ @r{or short} @ [
  6458. Include inactive timestamps into the current view. Only for weekly/daily
  6459. agenda and timeline views.
  6460. @c
  6461. @kindex v a
  6462. @kindex v A
  6463. @item v a
  6464. @itemx v A
  6465. Toggle Archives mode. In Archives mode, trees that are marked
  6466. @code{ARCHIVED} are also scanned when producing the agenda. When you use the
  6467. capital @kbd{A}, even all archive files are included. To exit archives mode,
  6468. press @kbd{v a} again.
  6469. @c
  6470. @kindex v R
  6471. @kindex R
  6472. @item v R @ @r{or short} @ R
  6473. @vindex org-agenda-start-with-clockreport-mode
  6474. Toggle Clockreport mode. In Clockreport mode, the daily/weekly agenda will
  6475. always show a table with the clocked times for the timespan and file scope
  6476. covered by the current agenda view. The initial setting for this mode in new
  6477. agenda buffers can be set with the variable
  6478. @code{org-agenda-start-with-clockreport-mode}.
  6479. @c
  6480. @kindex v E
  6481. @kindex E
  6482. @item v E @ @r{or short} @ E
  6483. @vindex org-agenda-start-with-entry-text-mode
  6484. @vindex org-agenda-entry-text-maxlines
  6485. Toggle entry text mode. In entry text mode, a number of lines from the Org
  6486. outline node referenced by an agenda line will be displayed below the line.
  6487. The maximum number of lines is given by the variable
  6488. @code{org-agenda-entry-text-maxlines}. Calling this command with a numeric
  6489. prefix argument will temporarily modify that number to the prefix value.
  6490. @c
  6491. @kindex G
  6492. @item G
  6493. @vindex org-agenda-use-time-grid
  6494. @vindex org-agenda-time-grid
  6495. Toggle the time grid on and off. See also the variables
  6496. @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
  6497. @c
  6498. @kindex r
  6499. @item r
  6500. Recreate the agenda buffer, for example to reflect the changes after
  6501. modification of the timestamps of items with @kbd{S-@key{left}} and
  6502. @kbd{S-@key{right}}. When the buffer is the global TODO list, a prefix
  6503. argument is interpreted to create a selective list for a specific TODO
  6504. keyword.
  6505. @kindex g
  6506. @item g
  6507. Same as @kbd{r}.
  6508. @c
  6509. @kindex s
  6510. @kindex C-x C-s
  6511. @item s
  6512. @itemx C-x C-s
  6513. Save all Org buffers in the current Emacs session, and also the locations of
  6514. IDs.
  6515. @c
  6516. @kindex C-c C-x C-c
  6517. @item C-c C-x C-c
  6518. @vindex org-columns-default-format
  6519. Invoke column view (@pxref{Column view}) in the agenda buffer. The column
  6520. view format is taken from the entry at point, or (if there is no entry at
  6521. point), from the first entry in the agenda view. So whatever the format for
  6522. that entry would be in the original buffer (taken from a property, from a
  6523. @code{#+COLUMNS} line, or from the default variable
  6524. @code{org-columns-default-format}), will be used in the agenda.
  6525. @kindex C-c C-x >
  6526. @item C-c C-x >
  6527. Remove the restriction lock on the agenda, if it is currently restricted to a
  6528. file or subtree (@pxref{Agenda files}).
  6529. @tsubheading{Secondary filtering and query editing}
  6530. @cindex filtering, by tag and effort, in agenda
  6531. @cindex tag filtering, in agenda
  6532. @cindex effort filtering, in agenda
  6533. @cindex query editing, in agenda
  6534. @kindex /
  6535. @item /
  6536. @vindex org-agenda-filter-preset
  6537. Filter the current agenda view with respect to a tag and/or effort estimates.
  6538. The difference between this and a custom agenda command is that filtering is
  6539. very fast, so that you can switch quickly between different filters without
  6540. having to recreate the agenda@footnote{Custom commands can preset a filter by
  6541. binding the variable @code{org-agenda-filter-preset} as an option. This
  6542. filter will then be applied to the view and persist as a basic filter through
  6543. refreshes and more secondary filtering.}
  6544. You will be prompted for a tag selection letter, SPC will mean any tag at
  6545. all. Pressing @key{TAB} at that prompt will offer use completion to select a
  6546. tag (including any tags that do not have a selection character). The command
  6547. then hides all entries that do not contain or inherit this tag. When called
  6548. with prefix arg, remove the entries that @emph{do} have the tag. A second
  6549. @kbd{/} at the prompt will turn off the filter and unhide any hidden entries.
  6550. If the first key you press is either @kbd{+} or @kbd{-}, the previous filter
  6551. will be narrowed by requiring or forbidding the selected additional tag.
  6552. Instead of pressing @kbd{+} or @kbd{-} after @kbd{/}, you can also
  6553. immediately use the @kbd{\} command.
  6554. @vindex org-sort-agenda-noeffort-is-high
  6555. In order to filter for effort estimates, you should set-up allowed
  6556. efforts globally, for example
  6557. @lisp
  6558. (setq org-global-properties
  6559. '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
  6560. @end lisp
  6561. You can then filter for an effort by first typing an operator, one of
  6562. @kbd{<}, @kbd{>}, and @kbd{=}, and then the one-digit index of an effort
  6563. estimate in your array of allowed values, where @kbd{0} means the 10th value.
  6564. The filter will then restrict to entries with effort smaller-or-equal, equal,
  6565. or larger-or-equal than the selected value. If the digits 0-9 are not used
  6566. as fast access keys to tags, you can also simply press the index digit
  6567. directly without an operator. In this case, @kbd{<} will be assumed. For
  6568. application of the operator, entries without a defined effort will be treated
  6569. according to the value of @code{org-sort-agenda-noeffort-is-high}. To filter
  6570. for tasks without effort definition, press @kbd{?} as the operator.
  6571. Org also supports automatic, context-aware tag filtering. If the variable
  6572. @code{org-agenda-auto-exclude-function} is set to a user-defined function,
  6573. that function can decide which tags should be excluded from the agenda
  6574. automatically. Once this is set, the @kbd{/} command then accepts @kbd{RET}
  6575. as a sub-option key and runs the auto exclusion logic. For example, let's
  6576. say you use a @code{Net} tag to identify tasks which need network access, an
  6577. @code{Errand} tag for errands in town, and a @code{Call} tag for making phone
  6578. calls. You could auto-exclude these tags based on the availability of the
  6579. Internet, and outside of business hours, with something like this:
  6580. @lisp
  6581. @group
  6582. (defun org-my-auto-exclude-function (tag)
  6583. (and (cond
  6584. ((string= tag "Net")
  6585. (/= 0 (call-process "/sbin/ping" nil nil nil
  6586. "-c1" "-q" "-t1" "mail.gnu.org")))
  6587. ((or (string= tag "Errand") (string= tag "Call"))
  6588. (let ((hour (nth 2 (decode-time))))
  6589. (or (< hour 8) (> hour 21)))))
  6590. (concat "-" tag)))
  6591. (setq org-agenda-auto-exclude-function 'org-my-auto-exclude-function)
  6592. @end group
  6593. @end lisp
  6594. @kindex \
  6595. @item \
  6596. Narrow the current agenda filter by an additional condition. When called with
  6597. prefix arg, remove the entries that @emph{do} have the tag, or that do match
  6598. the effort criterion. You can achieve the same effect by pressing @kbd{+} or
  6599. @kbd{-} as the first key after the @kbd{/} command.
  6600. @kindex [
  6601. @kindex ]
  6602. @kindex @{
  6603. @kindex @}
  6604. @item [ ] @{ @}
  6605. @table @i
  6606. @item @r{in} search view
  6607. add new search words (@kbd{[} and @kbd{]}) or new regular expressions
  6608. (@kbd{@{} and @kbd{@}}) to the query string. The opening bracket/brace will
  6609. add a positive search term prefixed by @samp{+}, indicating that this search
  6610. term @i{must} occur/match in the entry. The closing bracket/brace will add a
  6611. negative search term which @i{must not} occur/match in the entry for it to be
  6612. selected.
  6613. @end table
  6614. @page
  6615. @tsubheading{Remote editing}
  6616. @cindex remote editing, from agenda
  6617. @item 0-9
  6618. Digit argument.
  6619. @c
  6620. @cindex undoing remote-editing events
  6621. @cindex remote editing, undo
  6622. @kindex C-_
  6623. @item C-_
  6624. Undo a change due to a remote editing command. The change is undone
  6625. both in the agenda buffer and in the remote buffer.
  6626. @c
  6627. @kindex t
  6628. @item t
  6629. Change the TODO state of the item, both in the agenda and in the
  6630. original org file.
  6631. @c
  6632. @kindex C-S-@key{right}
  6633. @kindex C-S-@key{left}
  6634. @item C-S-@key{right}@r{/}@key{left}
  6635. Switch to the next/previous set of TODO keywords.
  6636. @c
  6637. @kindex C-k
  6638. @item C-k
  6639. @vindex org-agenda-confirm-kill
  6640. Delete the current agenda item along with the entire subtree belonging
  6641. to it in the original Org file. If the text to be deleted remotely
  6642. is longer than one line, the kill needs to be confirmed by the user. See
  6643. variable @code{org-agenda-confirm-kill}.
  6644. @c
  6645. @kindex C-c C-w
  6646. @item C-c C-w
  6647. Refile the entry at point.
  6648. @c
  6649. @kindex C-c C-x C-a
  6650. @kindex a
  6651. @item C-c C-x C-a @ @r{or short} @ a
  6652. @vindex org-archive-default-command
  6653. Archive the subtree corresponding to the entry at point using the default
  6654. archiving command set in @code{org-archive-default-command}. When using the
  6655. @code{a} key, confirmation will be required.
  6656. @c
  6657. @kindex C-c C-x a
  6658. @item C-c C-x a
  6659. Toggle the ARCHIVE tag for the current headline.
  6660. @c
  6661. @kindex C-c C-x A
  6662. @item C-c C-x A
  6663. Move the subtree corresponding to the current entry to its @emph{archive
  6664. sibling}.
  6665. @c
  6666. @kindex $
  6667. @kindex C-c C-x C-s
  6668. @item C-c C-x C-s @ @r{or short} @ $
  6669. Archive the subtree corresponding to the current headline. This means the
  6670. entry will be moved to the configured archive location, most likely a
  6671. different file.
  6672. @c
  6673. @kindex T
  6674. @item T
  6675. @vindex org-agenda-show-inherited-tags
  6676. Show all tags associated with the current item. This is useful if you have
  6677. turned off @code{org-agenda-show-inherited-tags}, but still want to see all
  6678. tags of a headline occasionally.
  6679. @c
  6680. @kindex :
  6681. @item :
  6682. Set tags for the current headline. If there is an active region in the
  6683. agenda, change a tag for all headings in the region.
  6684. @c
  6685. @kindex ,
  6686. @item ,
  6687. Set the priority for the current item. Org mode prompts for the
  6688. priority character. If you reply with @key{SPC}, the priority cookie
  6689. is removed from the entry.
  6690. @c
  6691. @kindex P
  6692. @item P
  6693. Display weighted priority of current item.
  6694. @c
  6695. @kindex +
  6696. @kindex S-@key{up}
  6697. @item +
  6698. @itemx S-@key{up}
  6699. Increase the priority of the current item. The priority is changed in
  6700. the original buffer, but the agenda is not resorted. Use the @kbd{r}
  6701. key for this.
  6702. @c
  6703. @kindex -
  6704. @kindex S-@key{down}
  6705. @item -
  6706. @itemx S-@key{down}
  6707. Decrease the priority of the current item.
  6708. @c
  6709. @kindex C-c C-z
  6710. @kindex z
  6711. @item z @ @r{or also} @ C-c C-z
  6712. @vindex org-log-into-drawer
  6713. Add a note to the entry. This note will be recorded, and then files to the
  6714. same location where state change notes are put. Depending on
  6715. @code{org-log-into-drawer}, this maybe inside a drawer.
  6716. @c
  6717. @kindex C-c C-a
  6718. @item C-c C-a
  6719. Dispatcher for all command related to attachments.
  6720. @c
  6721. @kindex C-c C-s
  6722. @item C-c C-s
  6723. Schedule this item, with prefix arg remove the scheduling timestamp
  6724. @c
  6725. @kindex C-c C-d
  6726. @item C-c C-d
  6727. Set a deadline for this item, with prefix arg remove the deadline.
  6728. @c
  6729. @kindex k
  6730. @item k
  6731. Agenda actions, to set dates for selected items to the cursor date.
  6732. This command also works in the calendar! The command prompts for an
  6733. additional key:
  6734. @example
  6735. m @r{Mark the entry at point for action. You can also make entries}
  6736. @r{in Org files with @kbd{C-c C-x C-k}.}
  6737. d @r{Set the deadline of the marked entry to the date at point.}
  6738. s @r{Schedule the marked entry at the date at point.}
  6739. r @r{Call @code{org-remember} with the cursor date as default date.}
  6740. @end example
  6741. @noindent
  6742. Press @kbd{r} afterward to refresh the agenda and see the effect of the
  6743. command.
  6744. @c
  6745. @kindex S-@key{right}
  6746. @item S-@key{right}
  6747. Change the timestamp associated with the current line by one day into the
  6748. future. With a numeric prefix argument, change it by that many days. For
  6749. example, @kbd{3 6 5 S-@key{right}} will change it by a year. With a
  6750. @kbd{C-u} prefix, change the time by one hour. If you immediately repeat the
  6751. command, it will continue to change hours even without the prefix arg. With
  6752. a double @kbd{C-u C-u} prefix, do the same for changing minutes. The stamp
  6753. is changed in the original Org file, but the change is not directly reflected
  6754. in the agenda buffer. Use @kbd{r} or @kbd{g} to update the buffer.
  6755. @c
  6756. @kindex S-@key{left}
  6757. @item S-@key{left}
  6758. Change the timestamp associated with the current line by one day
  6759. into the past.
  6760. @c
  6761. @kindex >
  6762. @item >
  6763. Change the timestamp associated with the current line. The key @kbd{>} has
  6764. been chosen, because it is the same as @kbd{S-.} on my keyboard.
  6765. @c
  6766. @kindex I
  6767. @item I
  6768. Start the clock on the current item. If a clock is running already, it
  6769. is stopped first.
  6770. @c
  6771. @kindex O
  6772. @item O
  6773. Stop the previously started clock.
  6774. @c
  6775. @kindex X
  6776. @item X
  6777. Cancel the currently running clock.
  6778. @kindex J
  6779. @item J
  6780. Jump to the running clock in another window.
  6781. @tsubheading{Bulk remote editing selected entries}
  6782. @cindex remote editing, bulk, from agenda
  6783. @kindex m
  6784. @item m
  6785. Mark the entry at point for bulk action.
  6786. @kindex u
  6787. @item u
  6788. Unmark entry for bulk action.
  6789. @kindex U
  6790. @item U
  6791. Unmark all marked entries for bulk action.
  6792. @kindex B
  6793. @item B
  6794. Bulk action: act on all marked entries in the agenda. This will prompt for
  6795. another key to select the action to be applied. The prefix arg to @kbd{B}
  6796. will be passed through to the @kbd{s} and @kbd{d} commands, to bulk-remove
  6797. these special timestamps.
  6798. @example
  6799. r @r{Prompt for a single refile target and move all entries. The entries}
  6800. @r{will no longer be in the agenda, refresh (@kbd{g}) to bring them back.}
  6801. $ @r{Archive all selected entries.}
  6802. A @r{Archive entries by moving them to their respective archive siblings.}
  6803. t @r{Change TODO state. This prompts for a single TODO keyword and}
  6804. @r{changes the state of all selected entries, bypassing blocking and}
  6805. @r{suppressing logging notes (but not time stamps).}
  6806. + @r{Add a tag to all selected entries.}
  6807. - @r{Remove a tag from all selected entries.}
  6808. s @r{Schedule all items to a new date. To shift existing schedule dates}
  6809. @r{by a fixed number of days, use something starting with double plus}
  6810. @r{at the prompt, for example @samp{++8d} or @samp{++2w}.}
  6811. d @r{Set deadline to a specific date.}
  6812. @end example
  6813. @tsubheading{Calendar commands}
  6814. @cindex calendar commands, from agenda
  6815. @kindex c
  6816. @item c
  6817. Open the Emacs calendar and move to the date at the agenda cursor.
  6818. @c
  6819. @item c
  6820. When in the calendar, compute and show the Org mode agenda for the
  6821. date at the cursor.
  6822. @c
  6823. @cindex diary entries, creating from agenda
  6824. @kindex i
  6825. @item i
  6826. @vindex org-agenda-diary-file
  6827. Insert a new entry into the diary, using the date at the cursor and (for
  6828. block entries) the date at the mark. This will add to the Emacs diary
  6829. file@footnote{This file is parsed for the agenda when
  6830. @code{org-agenda-include-diary} is set.}, in a way similar to the @kbd{i}
  6831. command in the calendar. The diary file will pop up in another window, where
  6832. you can add the entry.
  6833. If you configure @code{org-agenda-diary-file} to point to an Org-mode file,
  6834. Org will create entries (in org-mode syntax) in that file instead. Most
  6835. entries will be stored in a date-based outline tree that will later make it
  6836. easy to archive appointments from previous months/years. The tree will be
  6837. build under an entry with a @code{DATE_TREE} property, or else with years as
  6838. top-level entries. Emacs will prompt you for the entry text - if you specify
  6839. it, the entry will be created in @code{org-agenda-diary-file} without further
  6840. interaction. If you directly press @key{RET} at the prompt without typing
  6841. text, the target file will be shown in another window for you to finish the
  6842. entry there. See also the @kbd{k r} command.
  6843. @c
  6844. @kindex M
  6845. @item M
  6846. Show the phases of the moon for the three months around current date.
  6847. @c
  6848. @kindex S
  6849. @item S
  6850. Show sunrise and sunset times. The geographical location must be set
  6851. with calendar variables, see the documentation for the Emacs calendar.
  6852. @c
  6853. @kindex C
  6854. @item C
  6855. Convert the date at cursor into many other cultural and historic
  6856. calendars.
  6857. @c
  6858. @kindex H
  6859. @item H
  6860. Show holidays for three months around the cursor date.
  6861. @item M-x org-export-icalendar-combine-agenda-files
  6862. Export a single iCalendar file containing entries from all agenda files.
  6863. This is a globally available command, and also available in the agenda menu.
  6864. @tsubheading{Exporting to a file}
  6865. @kindex C-x C-w
  6866. @item C-x C-w
  6867. @cindex exporting agenda views
  6868. @cindex agenda views, exporting
  6869. @vindex org-agenda-exporter-settings
  6870. Write the agenda view to a file. Depending on the extension of the selected
  6871. file name, the view will be exported as HTML (extension @file{.html} or
  6872. @file{.htm}), Postscript (extension @file{.ps}), PDF (extension @file{.pdf}),
  6873. and plain text (any other extension). When called with a @kbd{C-u} prefix
  6874. argument, immediately open the newly created file. Use the variable
  6875. @code{org-agenda-exporter-settings} to set options for @file{ps-print} and
  6876. for @file{htmlize} to be used during export.
  6877. @tsubheading{Quit and Exit}
  6878. @kindex q
  6879. @item q
  6880. Quit agenda, remove the agenda buffer.
  6881. @c
  6882. @kindex x
  6883. @cindex agenda files, removing buffers
  6884. @item x
  6885. Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
  6886. for the compilation of the agenda. Buffers created by the user to
  6887. visit Org files will not be removed.
  6888. @end table
  6889. @node Custom agenda views, Exporting Agenda Views, Agenda commands, Agenda Views
  6890. @section Custom agenda views
  6891. @cindex custom agenda views
  6892. @cindex agenda views, custom
  6893. Custom agenda commands serve two purposes: to store and quickly access
  6894. frequently used TODO and tags searches, and to create special composite
  6895. agenda buffers. Custom agenda commands will be accessible through the
  6896. dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
  6897. @menu
  6898. * Storing searches:: Type once, use often
  6899. * Block agenda:: All the stuff you need in a single buffer
  6900. * Setting Options:: Changing the rules
  6901. @end menu
  6902. @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
  6903. @subsection Storing searches
  6904. The first application of custom searches is the definition of keyboard
  6905. shortcuts for frequently used searches, either creating an agenda
  6906. buffer, or a sparse tree (the latter covering of course only the current
  6907. buffer).
  6908. @kindex C-c a C
  6909. @vindex org-agenda-custom-commands
  6910. Custom commands are configured in the variable
  6911. @code{org-agenda-custom-commands}. You can customize this variable, for
  6912. example by pressing @kbd{C-c a C}. You can also directly set it with
  6913. Emacs Lisp in @file{.emacs}. The following example contains all valid
  6914. search types:
  6915. @lisp
  6916. @group
  6917. (setq org-agenda-custom-commands
  6918. '(("w" todo "WAITING")
  6919. ("W" todo-tree "WAITING")
  6920. ("u" tags "+boss-urgent")
  6921. ("v" tags-todo "+boss-urgent")
  6922. ("U" tags-tree "+boss-urgent")
  6923. ("f" occur-tree "\\<FIXME\\>")
  6924. ("h" . "HOME+Name tags searches") ; description for "h" prefix
  6925. ("hl" tags "+home+Lisa")
  6926. ("hp" tags "+home+Peter")
  6927. ("hk" tags "+home+Kim")))
  6928. @end group
  6929. @end lisp
  6930. @noindent
  6931. The initial string in each entry defines the keys you have to press
  6932. after the dispatcher command @kbd{C-c a} in order to access the command.
  6933. Usually this will be just a single character, but if you have many
  6934. similar commands, you can also define two-letter combinations where the
  6935. first character is the same in several combinations and serves as a
  6936. prefix key@footnote{You can provide a description for a prefix key by
  6937. inserting a cons cell with the prefix and the description.}. The second
  6938. parameter is the search type, followed by the string or regular
  6939. expression to be used for the matching. The example above will
  6940. therefore define:
  6941. @table @kbd
  6942. @item C-c a w
  6943. as a global search for TODO entries with @samp{WAITING} as the TODO
  6944. keyword
  6945. @item C-c a W
  6946. as the same search, but only in the current buffer and displaying the
  6947. results as a sparse tree
  6948. @item C-c a u
  6949. as a global tags search for headlines marked @samp{:boss:} but not
  6950. @samp{:urgent:}
  6951. @item C-c a v
  6952. as the same search as @kbd{C-c a u}, but limiting the search to
  6953. headlines that are also TODO items
  6954. @item C-c a U
  6955. as the same search as @kbd{C-c a u}, but only in the current buffer and
  6956. displaying the result as a sparse tree
  6957. @item C-c a f
  6958. to create a sparse tree (again: current buffer only) with all entries
  6959. containing the word @samp{FIXME}
  6960. @item C-c a h
  6961. as a prefix command for a HOME tags search where you have to press an
  6962. additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
  6963. Peter, or Kim) as additional tag to match.
  6964. @end table
  6965. @node Block agenda, Setting Options, Storing searches, Custom agenda views
  6966. @subsection Block agenda
  6967. @cindex block agenda
  6968. @cindex agenda, with block views
  6969. Another possibility is the construction of agenda views that comprise
  6970. the results of @emph{several} commands, each of which creates a block in
  6971. the agenda buffer. The available commands include @code{agenda} for the
  6972. daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
  6973. for the global TODO list (as constructed with @kbd{C-c a t}), and the
  6974. matching commands discussed above: @code{todo}, @code{tags}, and
  6975. @code{tags-todo}. Here are two examples:
  6976. @lisp
  6977. @group
  6978. (setq org-agenda-custom-commands
  6979. '(("h" "Agenda and Home-related tasks"
  6980. ((agenda "")
  6981. (tags-todo "home")
  6982. (tags "garden")))
  6983. ("o" "Agenda and Office-related tasks"
  6984. ((agenda "")
  6985. (tags-todo "work")
  6986. (tags "office")))))
  6987. @end group
  6988. @end lisp
  6989. @noindent
  6990. This will define @kbd{C-c a h} to create a multi-block view for stuff
  6991. you need to attend to at home. The resulting agenda buffer will contain
  6992. your agenda for the current week, all TODO items that carry the tag
  6993. @samp{home}, and also all lines tagged with @samp{garden}. Finally the
  6994. command @kbd{C-c a o} provides a similar view for office tasks.
  6995. @node Setting Options, , Block agenda, Custom agenda views
  6996. @subsection Setting options for custom commands
  6997. @cindex options, for custom agenda views
  6998. @vindex org-agenda-custom-commands
  6999. Org mode contains a number of variables regulating agenda construction
  7000. and display. The global variables define the behavior for all agenda
  7001. commands, including the custom commands. However, if you want to change
  7002. some settings just for a single custom view, you can do so. Setting
  7003. options requires inserting a list of variable names and values at the
  7004. right spot in @code{org-agenda-custom-commands}. For example:
  7005. @lisp
  7006. @group
  7007. (setq org-agenda-custom-commands
  7008. '(("w" todo "WAITING"
  7009. ((org-agenda-sorting-strategy '(priority-down))
  7010. (org-agenda-prefix-format " Mixed: ")))
  7011. ("U" tags-tree "+boss-urgent"
  7012. ((org-show-following-heading nil)
  7013. (org-show-hierarchy-above nil)))
  7014. ("N" search ""
  7015. ((org-agenda-files '("~org/notes.org"))
  7016. (org-agenda-text-search-extra-files nil)))))
  7017. @end group
  7018. @end lisp
  7019. @noindent
  7020. Now the @kbd{C-c a w} command will sort the collected entries only by
  7021. priority, and the prefix format is modified to just say @samp{ Mixed: }
  7022. instead of giving the category of the entry. The sparse tags tree of
  7023. @kbd{C-c a U} will now turn out ultra-compact, because neither the
  7024. headline hierarchy above the match, nor the headline following the match
  7025. will be shown. The command @kbd{C-c a N} will do a text search limited
  7026. to only a single file.
  7027. @vindex org-agenda-custom-commands
  7028. For command sets creating a block agenda,
  7029. @code{org-agenda-custom-commands} has two separate spots for setting
  7030. options. You can add options that should be valid for just a single
  7031. command in the set, and options that should be valid for all commands in
  7032. the set. The former are just added to the command entry, the latter
  7033. must come after the list of command entries. Going back to the block
  7034. agenda example (@pxref{Block agenda}), let's change the sorting strategy
  7035. for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
  7036. the results for GARDEN tags query in the opposite order,
  7037. @code{priority-up}. This would look like this:
  7038. @lisp
  7039. @group
  7040. (setq org-agenda-custom-commands
  7041. '(("h" "Agenda and Home-related tasks"
  7042. ((agenda)
  7043. (tags-todo "home")
  7044. (tags "garden"
  7045. ((org-agenda-sorting-strategy '(priority-up)))))
  7046. ((org-agenda-sorting-strategy '(priority-down))))
  7047. ("o" "Agenda and Office-related tasks"
  7048. ((agenda)
  7049. (tags-todo "work")
  7050. (tags "office")))))
  7051. @end group
  7052. @end lisp
  7053. As you see, the values and parentheses setting is a little complex.
  7054. When in doubt, use the customize interface to set this variable---it
  7055. fully supports its structure. Just one caveat: when setting options in
  7056. this interface, the @emph{values} are just Lisp expressions. So if the
  7057. value is a string, you need to add the double-quotes around the value
  7058. yourself.
  7059. @node Exporting Agenda Views, Agenda column view, Custom agenda views, Agenda Views
  7060. @section Exporting Agenda Views
  7061. @cindex agenda views, exporting
  7062. If you are away from your computer, it can be very useful to have a printed
  7063. version of some agenda views to carry around. Org mode can export custom
  7064. agenda views as plain text, HTML@footnote{You need to install Hrvoje Niksic's
  7065. @file{htmlize.el}.}, Postscript, PDF@footnote{To create PDF output, the
  7066. ghostscript @file{ps2pdf} utility must be installed on the system. Selecting
  7067. a PDF file with also create the postscript file.}, and iCalendar files. If
  7068. you want to do this only occasionally, use the command
  7069. @table @kbd
  7070. @kindex C-x C-w
  7071. @item C-x C-w
  7072. @cindex exporting agenda views
  7073. @cindex agenda views, exporting
  7074. @vindex org-agenda-exporter-settings
  7075. Write the agenda view to a file. Depending on the extension of the selected
  7076. file name, the view will be exported as HTML (extension @file{.html} or
  7077. @file{.htm}), Postscript (extension @file{.ps}), iCalendar (extension
  7078. @file{.ics}), or plain text (any other extension). Use the variable
  7079. @code{org-agenda-exporter-settings} to set options for @file{ps-print} and
  7080. for @file{htmlize} to be used during export, for example
  7081. @vindex org-agenda-add-entry-text-maxlines
  7082. @vindex htmlize-output-type
  7083. @vindex ps-number-of-columns
  7084. @vindex ps-landscape-mode
  7085. @lisp
  7086. (setq org-agenda-exporter-settings
  7087. '((ps-number-of-columns 2)
  7088. (ps-landscape-mode t)
  7089. (org-agenda-add-entry-text-maxlines 5)
  7090. (htmlize-output-type 'css)))
  7091. @end lisp
  7092. @end table
  7093. If you need to export certain agenda views frequently, you can associate
  7094. any custom agenda command with a list of output file names
  7095. @footnote{If you want to store standard views like the weekly agenda
  7096. or the global TODO list as well, you need to define custom commands for
  7097. them in order to be able to specify file names.}. Here is an example
  7098. that first defines custom commands for the agenda and the global
  7099. TODO list, together with a number of files to which to export them.
  7100. Then we define two block agenda commands and specify file names for them
  7101. as well. File names can be relative to the current working directory,
  7102. or absolute.
  7103. @lisp
  7104. @group
  7105. (setq org-agenda-custom-commands
  7106. '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
  7107. ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
  7108. ("h" "Agenda and Home-related tasks"
  7109. ((agenda "")
  7110. (tags-todo "home")
  7111. (tags "garden"))
  7112. nil
  7113. ("~/views/home.html"))
  7114. ("o" "Agenda and Office-related tasks"
  7115. ((agenda)
  7116. (tags-todo "work")
  7117. (tags "office"))
  7118. nil
  7119. ("~/views/office.ps" "~/calendars/office.ics"))))
  7120. @end group
  7121. @end lisp
  7122. The extension of the file name determines the type of export. If it is
  7123. @file{.html}, Org mode will use the @file{htmlize.el} package to convert
  7124. the buffer to HTML and save it to this file name. If the extension is
  7125. @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
  7126. Postscript output. If the extension is @file{.ics}, iCalendar export is
  7127. run export over all files that were used to construct the agenda, and
  7128. limit the export to entries listed in the agenda. Any other
  7129. extension produces a plain ASCII file.
  7130. The export files are @emph{not} created when you use one of those
  7131. commands interactively because this might use too much overhead.
  7132. Instead, there is a special command to produce @emph{all} specified
  7133. files in one step:
  7134. @table @kbd
  7135. @kindex C-c a e
  7136. @item C-c a e
  7137. Export all agenda views that have export file names associated with
  7138. them.
  7139. @end table
  7140. You can use the options section of the custom agenda commands to also
  7141. set options for the export commands. For example:
  7142. @lisp
  7143. (setq org-agenda-custom-commands
  7144. '(("X" agenda ""
  7145. ((ps-number-of-columns 2)
  7146. (ps-landscape-mode t)
  7147. (org-agenda-prefix-format " [ ] ")
  7148. (org-agenda-with-colors nil)
  7149. (org-agenda-remove-tags t))
  7150. ("theagenda.ps"))))
  7151. @end lisp
  7152. @noindent
  7153. This command sets two options for the Postscript exporter, to make it
  7154. print in two columns in landscape format---the resulting page can be cut
  7155. in two and then used in a paper agenda. The remaining settings modify
  7156. the agenda prefix to omit category and scheduling information, and
  7157. instead include a checkbox to check off items. We also remove the tags
  7158. to make the lines compact, and we don't want to use colors for the
  7159. black-and-white printer. Settings specified in
  7160. @code{org-agenda-exporter-settings} will also apply, but the settings
  7161. in @code{org-agenda-custom-commands} take precedence.
  7162. @noindent
  7163. From the command line you may also use
  7164. @example
  7165. emacs -f org-batch-store-agenda-views -kill
  7166. @end example
  7167. @noindent
  7168. or, if you need to modify some parameters@footnote{Quoting depends on the
  7169. system you use, please check the FAQ for examples.}
  7170. @example
  7171. emacs -eval '(org-batch-store-agenda-views \
  7172. org-agenda-ndays 30 \
  7173. org-agenda-start-day "2007-11-01" \
  7174. org-agenda-include-diary nil \
  7175. org-agenda-files (quote ("~/org/project.org")))' \
  7176. -kill
  7177. @end example
  7178. @noindent
  7179. which will create the agenda views restricted to the file
  7180. @file{~/org/project.org}, without diary entries and with a 30-day
  7181. extent.
  7182. You can also extract agenda information in a way that allows further
  7183. processing by other programs. See @ref{Extracting agenda information}, for
  7184. more information.
  7185. @node Agenda column view, , Exporting Agenda Views, Agenda Views
  7186. @section Using column view in the agenda
  7187. @cindex column view, in agenda
  7188. @cindex agenda, column view
  7189. Column view (@pxref{Column view}) is normally used to view and edit
  7190. properties embedded in the hierarchical structure of an Org file. It can be
  7191. quite useful to use column view also from the agenda, where entries are
  7192. collected by certain criteria.
  7193. @table @kbd
  7194. @kindex C-c C-x C-c
  7195. @item C-c C-x C-c
  7196. Turn on column view in the agenda.
  7197. @end table
  7198. To understand how to use this properly, it is important to realize that the
  7199. entries in the agenda are no longer in their proper outline environment.
  7200. This causes the following issues:
  7201. @enumerate
  7202. @item
  7203. @vindex org-columns-default-format
  7204. @vindex org-overriding-columns-format
  7205. Org needs to make a decision which @code{COLUMNS} format to use. Since the
  7206. entries in the agenda are collected from different files, and different files
  7207. may have different @code{COLUMNS} formats, this is a non-trivial problem.
  7208. Org first checks if the variable @code{org-overriding-columns-format} is
  7209. currently set, and if so, takes the format from there. Otherwise it takes
  7210. the format associated with the first item in the agenda, or, if that item
  7211. does not have a specific format (defined in a property, or in its file), it
  7212. uses @code{org-columns-default-format}.
  7213. @item
  7214. @cindex property, special, CLOCKSUM
  7215. If any of the columns has a summary type defined (@pxref{Column attributes}),
  7216. turning on column view in the agenda will visit all relevant agenda files and
  7217. make sure that the computations of this property are up to date. This is
  7218. also true for the special @code{CLOCKSUM} property. Org will then sum the
  7219. values displayed in the agenda. In the daily/weekly agenda, the sums will
  7220. cover a single day, in all other views they cover the entire block. It is
  7221. vital to realize that the agenda may show the same entry @emph{twice} (for
  7222. example as scheduled and as a deadline), and it may show two entries from the
  7223. same hierarchy (for example a @emph{parent} and its @emph{child}). In these
  7224. cases, the summation in the agenda will lead to incorrect results because
  7225. some values will count double.
  7226. @item
  7227. When the column view in the agenda shows the @code{CLOCKSUM}, that is always
  7228. the entire clocked time for this item. So even in the daily/weekly agenda,
  7229. the clocksum listed in column view may originate from times outside the
  7230. current view. This has the advantage that you can compare these values with
  7231. a column listing the planned total effort for a task---one of the major
  7232. applications for column view in the agenda. If you want information about
  7233. clocked time in the displayed period use clock table mode (press @kbd{R} in
  7234. the agenda).
  7235. @end enumerate
  7236. @node Markup, Exporting, Agenda Views, Top
  7237. @chapter Markup for rich export
  7238. When exporting Org-mode documents, the exporter tries to reflect the
  7239. structure of the document as accurately as possible in the backend. Since
  7240. export targets like HTML, La@TeX{}, or DocBook allow much richer formatting,
  7241. Org mode has rules on how to prepare text for rich export. This section
  7242. summarizes the markup rules used in an Org-mode buffer.
  7243. @menu
  7244. * Structural markup elements:: The basic structure as seen by the exporter
  7245. * Images and tables:: Tables and Images will be included
  7246. * Literal examples:: Source code examples with special formatting
  7247. * Include files:: Include additional files into a document
  7248. * Index entries::
  7249. * Macro replacement:: Use macros to create complex output
  7250. * Embedded LaTeX:: LaTeX can be freely used inside Org documents
  7251. @end menu
  7252. @node Structural markup elements, Images and tables, Markup, Markup
  7253. @section Structural markup elements
  7254. @menu
  7255. * Document title:: Where the title is taken from
  7256. * Headings and sections:: The document structure as seen by the exporter
  7257. * Table of contents:: The if and where of the table of contents
  7258. * Initial text:: Text before the first heading?
  7259. * Lists:: Lists
  7260. * Paragraphs:: Paragraphs
  7261. * Footnote markup:: Footnotes
  7262. * Emphasis and monospace:: Bold, italic, etc.
  7263. * Horizontal rules:: Make a line
  7264. * Comment lines:: What will *not* be exported
  7265. @end menu
  7266. @node Document title, Headings and sections, Structural markup elements, Structural markup elements
  7267. @subheading Document title
  7268. @cindex document title, markup rules
  7269. @noindent
  7270. The title of the exported document is taken from the special line
  7271. @cindex #+TITLE
  7272. @example
  7273. #+TITLE: This is the title of the document
  7274. @end example
  7275. @noindent
  7276. If this line does not exist, the title is derived from the first non-empty,
  7277. non-comment line in the buffer. If no such line exists, or if you have
  7278. turned off exporting of the text before the first headline (see below), the
  7279. title will be the file name without extension.
  7280. @cindex property, EXPORT_TITLE
  7281. If you are exporting only a subtree by marking is as the region, the heading
  7282. of the subtree will become the title of the document. If the subtree has a
  7283. property @code{EXPORT_TITLE}, that will take precedence.
  7284. @node Headings and sections, Table of contents, Document title, Structural markup elements
  7285. @subheading Headings and sections
  7286. @cindex headings and sections, markup rules
  7287. @vindex org-export-headline-levels
  7288. The outline structure of the document as described in @ref{Document
  7289. Structure}, forms the basis for defining sections of the exported document.
  7290. However, since the outline structure is also used for (for example) lists of
  7291. tasks, only the first three outline levels will be used as headings. Deeper
  7292. levels will become itemized lists. You can change the location of this
  7293. switch globally by setting the variable @code{org-export-headline-levels}, or on a
  7294. per-file basis with a line
  7295. @cindex #+OPTIONS
  7296. @example
  7297. #+OPTIONS: H:4
  7298. @end example
  7299. @node Table of contents, Initial text, Headings and sections, Structural markup elements
  7300. @subheading Table of contents
  7301. @cindex table of contents, markup rules
  7302. @vindex org-export-with-toc
  7303. The table of contents is normally inserted directly before the first headline
  7304. of the file. If you would like to get it to a different location, insert the
  7305. string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
  7306. location. The depth of the table of contents is by default the same as the
  7307. number of headline levels, but you can choose a smaller number, or turn off
  7308. the table of contents entirely, by configuring the variable
  7309. @code{org-export-with-toc}, or on a per-file basis with a line like
  7310. @example
  7311. #+OPTIONS: toc:2 (only to two levels in TOC)
  7312. #+OPTIONS: toc:nil (no TOC at all)
  7313. @end example
  7314. @node Initial text, Lists, Table of contents, Structural markup elements
  7315. @subheading Text before the first headline
  7316. @cindex text before first headline, markup rules
  7317. @cindex #+TEXT
  7318. Org mode normally exports the text before the first headline, and even uses
  7319. the first line as the document title. The text will be fully marked up. If
  7320. you need to include literal HTML, La@TeX{}, or DocBook code, use the special
  7321. constructs described below in the sections for the individual exporters.
  7322. @vindex org-export-skip-text-before-1st-heading
  7323. Some people like to use the space before the first headline for setup and
  7324. internal links and therefore would like to control the exported text before
  7325. the first headline in a different way. You can do so by setting the variable
  7326. @code{org-export-skip-text-before-1st-heading} to @code{t}. On a per-file
  7327. basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
  7328. @noindent
  7329. If you still want to have some text before the first headline, use the
  7330. @code{#+TEXT} construct:
  7331. @example
  7332. #+OPTIONS: skip:t
  7333. #+TEXT: This text will go before the *first* headline.
  7334. #+TEXT: [TABLE-OF-CONTENTS]
  7335. #+TEXT: This goes between the table of contents and the first headline
  7336. @end example
  7337. @node Lists, Paragraphs, Initial text, Structural markup elements
  7338. @subheading Lists
  7339. @cindex lists, markup rules
  7340. Plain lists as described in @ref{Plain lists}, are translated to the backend's
  7341. syntax for such lists. Most backends support unordered, ordered, and
  7342. description lists.
  7343. @node Paragraphs, Footnote markup, Lists, Structural markup elements
  7344. @subheading Paragraphs, line breaks, and quoting
  7345. @cindex paragraphs, markup rules
  7346. Paragraphs are separated by at least one empty line. If you need to enforce
  7347. a line break within a paragraph, use @samp{\\} at the end of a line.
  7348. To keep the line breaks in a region, but otherwise use normal formatting, you
  7349. can use this construct, which can also be used to format poetry.
  7350. @cindex #+BEGIN_VERSE
  7351. @example
  7352. #+BEGIN_VERSE
  7353. Great clouds overhead
  7354. Tiny black birds rise and fall
  7355. Snow covers Emacs
  7356. -- AlexSchroeder
  7357. #+END_VERSE
  7358. @end example
  7359. When quoting a passage from another document, it is customary to format this
  7360. as a paragraph that is indented on both the left and the right margin. You
  7361. can include quotations in Org-mode documents like this:
  7362. @cindex #+BEGIN_QUOTE
  7363. @example
  7364. #+BEGIN_QUOTE
  7365. Everything should be made as simple as possible,
  7366. but not any simpler -- Albert Einstein
  7367. #+END_QUOTE
  7368. @end example
  7369. If you would like to center some text, do it like this:
  7370. @cindex #+BEGIN_CENTER
  7371. @example
  7372. #+BEGIN_CENTER
  7373. Everything should be made as simple as possible, \\
  7374. but not any simpler
  7375. #+END_CENTER
  7376. @end example
  7377. @node Footnote markup, Emphasis and monospace, Paragraphs, Structural markup elements
  7378. @subheading Footnote markup
  7379. @cindex footnotes, markup rules
  7380. @cindex @file{footnote.el}
  7381. Footnotes defined in the way described in @ref{Footnotes}, will be exported by
  7382. all backends. Org allows multiple references to the same note, and
  7383. different backends support this to varying degrees.
  7384. @node Emphasis and monospace, Horizontal rules, Footnote markup, Structural markup elements
  7385. @subheading Emphasis and monospace
  7386. @cindex underlined text, markup rules
  7387. @cindex bold text, markup rules
  7388. @cindex italic text, markup rules
  7389. @cindex verbatim text, markup rules
  7390. @cindex code text, markup rules
  7391. @cindex strike-through text, markup rules
  7392. You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
  7393. and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
  7394. in the code and verbatim string is not processed for Org-mode specific
  7395. syntax, it is exported verbatim.
  7396. @node Horizontal rules, Comment lines, Emphasis and monospace, Structural markup elements
  7397. @subheading Horizontal rules
  7398. @cindex horizontal rules, markup rules
  7399. A line consisting of only dashes, and at least 5 of them, will be
  7400. exported as a horizontal line (@samp{<hr/>} in HTML).
  7401. @node Comment lines, , Horizontal rules, Structural markup elements
  7402. @subheading Comment lines
  7403. @cindex comment lines
  7404. @cindex exporting, not
  7405. @cindex #+BEGIN_COMMENT
  7406. Lines starting with @samp{#} in column zero are treated as comments and will
  7407. never be exported. If you want an indented line to be treated as a comment,
  7408. start it with @samp{#+ }. Also entire subtrees starting with the word
  7409. @samp{COMMENT} will never be exported. Finally, regions surrounded by
  7410. @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
  7411. @table @kbd
  7412. @kindex C-c ;
  7413. @item C-c ;
  7414. Toggle the COMMENT keyword at the beginning of an entry.
  7415. @end table
  7416. @node Images and tables, Literal examples, Structural markup elements, Markup
  7417. @section Images and Tables
  7418. @cindex tables, markup rules
  7419. @cindex #+CAPTION
  7420. @cindex #+LABEL
  7421. Both the native Org mode tables (@pxref{Tables}) and tables formatted with
  7422. the @file{table.el} package will be exported properly. For Org mode tables,
  7423. the lines before the first horizontal separator line will become table header
  7424. lines. You can use the following lines somewhere before the table to assign
  7425. a caption and a label for cross references, and in the text you can refer to
  7426. the object with @code{\ref@{tab:basic-data@}}:
  7427. @example
  7428. #+CAPTION: This is the caption for the next table (or link)
  7429. #+LABEL: tbl:basic-data
  7430. | ... | ...|
  7431. |-----|----|
  7432. @end example
  7433. @cindex inlined images, markup rules
  7434. Some backends (HTML, La@TeX{}, and DocBook) allow you to directly include
  7435. images into the exported document. Org does this, if a link to an image
  7436. files does not have a description part, for example @code{[[./img/a.jpg]]}.
  7437. If you wish to define a caption for the image and maybe a label for internal
  7438. cross references, you sure that the link is on a line by itself precede it
  7439. with:
  7440. @example
  7441. #+CAPTION: This is the caption for the next figure link (or table)
  7442. #+LABEL: fig:SED-HR4049
  7443. [[./img/a.jpg]]
  7444. @end example
  7445. You may also define additional attributes for the figure. As this is
  7446. backend-specific, see the sections about the individual backends for more
  7447. information.
  7448. @node Literal examples, Include files, Images and tables, Markup
  7449. @section Literal examples
  7450. @cindex literal examples, markup rules
  7451. @cindex code line references, markup rules
  7452. You can include literal examples that should not be subjected to
  7453. markup. Such examples will be typeset in monospace, so this is well suited
  7454. for source code and similar examples.
  7455. @cindex #+BEGIN_EXAMPLE
  7456. @example
  7457. #+BEGIN_EXAMPLE
  7458. Some example from a text file.
  7459. #+END_EXAMPLE
  7460. @end example
  7461. Note that such blocks may be @i{indented} in order to align nicely with
  7462. indented text and in particular with plain list structure (@pxref{Plain
  7463. lists}). For simplicity when using small examples, you can also start the
  7464. example lines with a colon followed by a space. There may also be additional
  7465. whitespace before the colon:
  7466. @example
  7467. Here is an example
  7468. : Some example from a text file.
  7469. @end example
  7470. @cindex formatting source code, markup rules
  7471. If the example is source code from a programming language, or any other text
  7472. that can be marked up by font-lock in Emacs, you can ask for the example to
  7473. look like the fontified Emacs buffer@footnote{Currently this works for the
  7474. HTML backend, and requires the @file{htmlize.el} package version 1.34 or
  7475. later. It also works for LaTeX with the listings package, if you turn on the
  7476. option @code{org-export-latex-listings} and make sure that the listings
  7477. package is included by the LaTeX header.}. This is done with the @samp{src}
  7478. block, where you also need to specify the name of the major mode that should
  7479. be used to fontify the example:
  7480. @cindex #+BEGIN_SRC
  7481. @example
  7482. #+BEGIN_SRC emacs-lisp
  7483. (defun org-xor (a b)
  7484. "Exclusive or."
  7485. (if a (not b) b))
  7486. #+END_SRC
  7487. @end example
  7488. Both in @code{example} and in @code{src} snippets, you can add a @code{-n}
  7489. switch to the end of the @code{BEGIN} line, to get the lines of the example
  7490. numbered. If you use a @code{+n} switch, the numbering from the previous
  7491. numbered snippet will be continued in the current one. In literal examples,
  7492. Org will interpret strings like @samp{(ref:name)} as labels, and use them as
  7493. targets for special hyperlinks like @code{[[(name)]]} (i.e. the reference name
  7494. enclosed in single parenthesis). In HTML, hovering the mouse over such a
  7495. link will remote-highlight the corresponding code line, which is kind of
  7496. cool.
  7497. You can also add a @code{-r} switch which @i{removes} the labels from the
  7498. source code@footnote{Adding @code{-k} to @code{-n -r} will @i{keep} the
  7499. labels in the source code while using line numbers for the links, which might
  7500. be useful to explain those in an org-mode example code.}. With the @code{-n}
  7501. switch, links to these references will be labeled by the line numbers from
  7502. the code listing, otherwise links will use the labels with no parentheses.
  7503. Here is an example:
  7504. @example
  7505. #+BEGIN_SRC emacs-lisp -n -r
  7506. (save-excursion (ref:sc)
  7507. (goto-char (point-min)) (ref:jump)
  7508. #+END_SRC
  7509. In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]]
  7510. jumps to point-min.
  7511. @end example
  7512. @vindex org-coderef-label-format
  7513. If the syntax for the label format conflicts with the language syntax, use a
  7514. @code{-l} switch to change the format, for example @samp{#+BEGIN_SRC pascal
  7515. -n -r -l "((%s))"}. See also the variable @code{org-coderef-label-format}.
  7516. HTML export also allows examples to be published as text areas, @xref{Text
  7517. areas in HTML export}.
  7518. @table @kbd
  7519. @kindex C-c '
  7520. @item C-c '
  7521. Edit the source code example at point in its native mode. This works by
  7522. switching to a temporary buffer with the source code. You need to exit by
  7523. pressing @kbd{C-c '} again@footnote{Upon exit, lines starting with @samp{*}
  7524. or @samp{#} will get a comma prepended, to keep them from being interpreted
  7525. by Org as outline nodes or special comments. These commas will be striped
  7526. for editing with @kbd{C-c '}, and also for export.}, the edited version will
  7527. then replace the old version in the Org buffer. Fixed-width regions
  7528. (where each line starts with a colon followed by a space) will be edited
  7529. using @code{artist-mode}@footnote{You may select a different-mode with the
  7530. variable @code{org-edit-fixed-width-region-mode}.} to allow creating ASCII
  7531. drawings easily. Using this command in an empty line will create a new
  7532. fixed-width region.
  7533. @kindex C-c l
  7534. @item C-c l
  7535. Calling @code{org-store-link} while editing a source code example in a
  7536. temporary buffer created with @kbd{C-c '} will prompt for a label, make sure
  7537. that it is unique in the current buffer, and insert it with the proper
  7538. formatting like @samp{(ref:label)} at the end of the current line. Then the
  7539. label is stored as a link @samp{(label)}, for retrieval with @kbd{C-c C-l}.
  7540. @end table
  7541. @node Include files, Index entries, Literal examples, Markup
  7542. @section Include files
  7543. @cindex include files, markup rules
  7544. During export, you can include the content of another file. For example, to
  7545. include your @file{.emacs} file, you could use:
  7546. @cindex #+INCLUDE
  7547. @example
  7548. #+INCLUDE: "~/.emacs" src emacs-lisp
  7549. @end example
  7550. @noindent
  7551. The optional second and third parameter are the markup (e.g. @samp{quote},
  7552. @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
  7553. language for formatting the contents. The markup is optional, if it is not
  7554. given, the text will be assumed to be in Org mode format and will be
  7555. processed normally. The include line will also allow additional keyword
  7556. parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
  7557. first line and for each following line, as well as any options accepted by
  7558. the selected markup. For example, to include a file as an item, use
  7559. @example
  7560. #+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
  7561. @end example
  7562. @table @kbd
  7563. @kindex C-c '
  7564. @item C-c '
  7565. Visit the include file at point.
  7566. @end table
  7567. @node Index entries, Macro replacement, Include files, Markup
  7568. @section Index enries
  7569. @cindex index entries, for publishing
  7570. You can specify entries that will be used for generating an index during
  7571. publishing. This is done by lines starting with @code{#+INDEX}. An entry
  7572. the contains an exclamation mark will create a sub item. See @ref{Generating
  7573. an index} for more information.
  7574. @example
  7575. * Curriculum Vitae
  7576. #+INDEX: CV
  7577. #+INDEX: Application!CV
  7578. @end example
  7579. @node Macro replacement, Embedded LaTeX, Index entries, Markup
  7580. @section Macro replacement
  7581. @cindex macro replacement, during export
  7582. @cindex #+MACRO
  7583. You can define text snippets with
  7584. @example
  7585. #+MACRO: name replacement text $1, $2 are arguments
  7586. @end example
  7587. @noindent which can be referenced anywhere in the document (even in
  7588. code examples) with @code{@{@{@{name(arg1,arg2)@}@}@}}. In addition to
  7589. defined macros, @code{@{@{@{title@}@}@}}, @code{@{@{@{author@}@}@}}, etc.,
  7590. will reference information set by the @code{#+TITLE:}, @code{#+AUTHOR:}, and
  7591. similar lines. Also, @code{@{@{@{date(@var{FORMAT})@}@}@}} and
  7592. @code{@{@{@{modification-time(@var{FORMAT})@}@}@}} refer to current date time
  7593. and to the modification time of the file being exported, respectively.
  7594. @var{FORMAT} should be a format string understood by
  7595. @code{format-time-string}.
  7596. Macro expansion takes place during export, and some people use it to
  7597. construct complex HTML code.
  7598. @node Embedded LaTeX, , Macro replacement, Markup
  7599. @section Embedded La@TeX{}
  7600. @cindex @TeX{} interpretation
  7601. @cindex La@TeX{} interpretation
  7602. Plain ASCII is normally sufficient for almost all note taking. One
  7603. exception, however, are scientific notes which need to be able to contain
  7604. mathematical symbols and the occasional formula. La@TeX{}@footnote{La@TeX{}
  7605. is a macro system based on Donald E. Knuth's @TeX{} system. Many of the
  7606. features described here as ``La@TeX{}'' are really from @TeX{}, but for
  7607. simplicity I am blurring this distinction.} is widely used to typeset
  7608. scientific documents. Org mode supports embedding La@TeX{} code into its
  7609. files, because many academics are used to reading La@TeX{} source code, and
  7610. because it can be readily processed into images for HTML production.
  7611. It is not necessary to mark La@TeX{} macros and code in any special way.
  7612. If you observe a few conventions, Org mode knows how to find it and what
  7613. to do with it.
  7614. @menu
  7615. * Special symbols:: Greek letters and other symbols
  7616. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  7617. * LaTeX fragments:: Complex formulas made easy
  7618. * Previewing LaTeX fragments:: What will this snippet look like?
  7619. * CDLaTeX mode:: Speed up entering of formulas
  7620. @end menu
  7621. @node Special symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
  7622. @subsection Special symbols
  7623. @cindex math symbols
  7624. @cindex special symbols
  7625. @cindex @TeX{} macros
  7626. @cindex La@TeX{} fragments, markup rules
  7627. @cindex HTML entities
  7628. @cindex La@TeX{} entities
  7629. You can use La@TeX{} macros to insert special symbols like @samp{\alpha} to
  7630. indicate the Greek letter, or @samp{\to} to indicate an arrow. Completion
  7631. for these macros is available, just type @samp{\} and maybe a few letters,
  7632. and press @kbd{M-@key{TAB}} to see possible completions. Unlike La@TeX{}
  7633. code, Org mode allows these macros to be present without surrounding math
  7634. delimiters, for example:
  7635. @example
  7636. Angles are written as Greek letters \alpha, \beta and \gamma.
  7637. @end example
  7638. @vindex org-html-entities
  7639. During export, these symbols will be transformed into the native format of
  7640. the exporter backend. Strings like @code{\alpha} will be exported as
  7641. @code{&alpha;} in the HTML output, and as @code{$\alpha$} in the La@TeX{}
  7642. output. Similarly, @code{\nbsp} will become @code{&nbsp;} in HTML and
  7643. @code{~} in La@TeX{}. If you need such a symbol inside a word, terminate it
  7644. like this: @samp{\Aacute@{@}stor}.
  7645. A large number of entities is provided, with names taken from both HTML and
  7646. La@TeX{}, see the variable @code{org-html-entities} for the complete list.
  7647. @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
  7648. @samp{...} are all converted into special commands creating hyphens of
  7649. different lengths or a compact set of dots.
  7650. @node Subscripts and superscripts, LaTeX fragments, Special symbols, Embedded LaTeX
  7651. @subsection Subscripts and superscripts
  7652. @cindex subscript
  7653. @cindex superscript
  7654. Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
  7655. and subscripts. Again, these can be used without embedding them in
  7656. math-mode delimiters. To increase the readability of ASCII text, it is
  7657. not necessary (but OK) to surround multi-character sub- and superscripts
  7658. with curly braces. For example
  7659. @example
  7660. The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
  7661. the sun is R_@{sun@} = 6.96 x 10^8 m.
  7662. @end example
  7663. @vindex org-export-with-sub-superscripts
  7664. To avoid interpretation as raised or lowered text, you can quote @samp{^} and
  7665. @samp{_} with a backslash: @samp{\^} and @samp{\_}. If you write a text
  7666. where the underscore is often used in a different context, Org's convention
  7667. to always interpret these as subscripts can get in your way. Configure the
  7668. variable @code{org-export-with-sub-superscripts} to globally change this
  7669. convention, or use, on a per-file basis:
  7670. @example
  7671. #+OPTIONS: ^:@{@}
  7672. @end example
  7673. @node LaTeX fragments, Previewing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
  7674. @subsection La@TeX{} fragments
  7675. @cindex La@TeX{} fragments
  7676. @vindex org-format-latex-header
  7677. With symbols, sub- and superscripts, HTML is pretty much at its end when
  7678. it comes to representing mathematical formulas@footnote{Yes, there is
  7679. MathML, but that is not yet fully supported by many browsers, and there
  7680. is no decent converter for turning La@TeX{} or ASCII representations of
  7681. formulas into MathML. So for the time being, converting formulas into
  7682. images seems the way to go.}. More complex expressions need a dedicated
  7683. formula processor. To this end, Org mode can contain arbitrary La@TeX{}
  7684. fragments. It provides commands to preview the typeset result of these
  7685. fragments, and upon export to HTML, all fragments will be converted to
  7686. images and inlined into the HTML document@footnote{The La@TeX{} export
  7687. will not use images for displaying La@TeX{} fragments but include these
  7688. fragments directly into the La@TeX{} code.}. For this to work you
  7689. need to be on a system with a working La@TeX{} installation. You also
  7690. need the @file{dvipng} program, available at
  7691. @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
  7692. will be used when processing a fragment can be configured with the
  7693. variable @code{org-format-latex-header}.
  7694. La@TeX{} fragments don't need any special marking at all. The following
  7695. snippets will be identified as La@TeX{} source code:
  7696. @itemize @bullet
  7697. @item
  7698. Environments of any kind. The only requirement is that the
  7699. @code{\begin} statement appears on a new line, preceded by only
  7700. whitespace.
  7701. @item
  7702. Text within the usual La@TeX{} math delimiters. To avoid conflicts with
  7703. currency specifications, single @samp{$} characters are only recognized as
  7704. math delimiters if the enclosed text contains at most two line breaks, is
  7705. directly attached to the @samp{$} characters with no whitespace in between,
  7706. and if the closing @samp{$} is followed by whitespace, punctuation or a dash.
  7707. For the other delimiters, there is no such restriction, so when in doubt, use
  7708. @samp{\(...\)} as inline math delimiters.
  7709. @end itemize
  7710. @noindent For example:
  7711. @example
  7712. \begin@{equation@} % arbitrary environments,
  7713. x=\sqrt@{b@} % even tables, figures
  7714. \end@{equation@} % etc
  7715. If $a^2=b$ and \( b=2 \), then the solution must be
  7716. either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
  7717. @end example
  7718. @noindent
  7719. @vindex org-format-latex-options
  7720. If you need any of the delimiter ASCII sequences for other purposes, you
  7721. can configure the option @code{org-format-latex-options} to deselect the
  7722. ones you do not wish to have interpreted by the La@TeX{} converter.
  7723. @node Previewing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
  7724. @subsection Previewing LaTeX fragments
  7725. @cindex LaTeX fragments, preview
  7726. La@TeX{} fragments can be processed to produce preview images of the
  7727. typeset expressions:
  7728. @table @kbd
  7729. @kindex C-c C-x C-l
  7730. @item C-c C-x C-l
  7731. Produce a preview image of the La@TeX{} fragment at point and overlay it
  7732. over the source code. If there is no fragment at point, process all
  7733. fragments in the current entry (between two headlines). When called
  7734. with a prefix argument, process the entire subtree. When called with
  7735. two prefix arguments, or when the cursor is before the first headline,
  7736. process the entire buffer.
  7737. @kindex C-c C-c
  7738. @item C-c C-c
  7739. Remove the overlay preview images.
  7740. @end table
  7741. @vindex org-format-latex-options
  7742. You can customize the variable @code{org-format-latex-options} to influence
  7743. some aspects of the preview. In particular, the @code{:scale} (and for HTML
  7744. export, @code{:html-scale}) property can be used to adjust the size of the
  7745. preview images.
  7746. During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
  7747. converted into images and inlined into the document if the following
  7748. setting is active:
  7749. @lisp
  7750. (setq org-export-with-LaTeX-fragments t)
  7751. @end lisp
  7752. @node CDLaTeX mode, , Previewing LaTeX fragments, Embedded LaTeX
  7753. @subsection Using CDLa@TeX{} to enter math
  7754. @cindex CDLa@TeX{}
  7755. CDLa@TeX{} mode is a minor mode that is normally used in combination with a
  7756. major La@TeX{} mode like AUC@TeX{} in order to speed-up insertion of
  7757. environments and math templates. Inside Org mode, you can make use of
  7758. some of the features of CDLa@TeX{} mode. You need to install
  7759. @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
  7760. AUC@TeX{}) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
  7761. Don't use CDLa@TeX{} mode itself under Org mode, but use the light
  7762. version @code{org-cdlatex-mode} that comes as part of Org mode. Turn it
  7763. on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
  7764. Org files with
  7765. @lisp
  7766. (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
  7767. @end lisp
  7768. When this mode is enabled, the following features are present (for more
  7769. details see the documentation of CDLa@TeX{} mode):
  7770. @itemize @bullet
  7771. @kindex C-c @{
  7772. @item
  7773. Environment templates can be inserted with @kbd{C-c @{}.
  7774. @item
  7775. @kindex @key{TAB}
  7776. The @key{TAB} key will do template expansion if the cursor is inside a
  7777. La@TeX{} fragment@footnote{Org mode has a method to test if the cursor is
  7778. inside such a fragment, see the documentation of the function
  7779. @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
  7780. expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
  7781. correctly inside the first brace. Another @key{TAB} will get you into
  7782. the second brace. Even outside fragments, @key{TAB} will expand
  7783. environment abbreviations at the beginning of a line. For example, if
  7784. you write @samp{equ} at the beginning of a line and press @key{TAB},
  7785. this abbreviation will be expanded to an @code{equation} environment.
  7786. To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
  7787. @item
  7788. @kindex _
  7789. @kindex ^
  7790. @vindex cdlatex-simplify-sub-super-scripts
  7791. Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
  7792. characters together with a pair of braces. If you use @key{TAB} to move
  7793. out of the braces, and if the braces surround only a single character or
  7794. macro, they are removed again (depending on the variable
  7795. @code{cdlatex-simplify-sub-super-scripts}).
  7796. @item
  7797. @kindex `
  7798. Pressing the backquote @kbd{`} followed by a character inserts math
  7799. macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
  7800. after the backquote, a help window will pop up.
  7801. @item
  7802. @kindex '
  7803. Pressing the single-quote @kbd{'} followed by another character modifies
  7804. the symbol before point with an accent or a font. If you wait more than
  7805. 1.5 seconds after the backquote, a help window will pop up. Character
  7806. modification will work only inside La@TeX{} fragments, outside the quote
  7807. is normal.
  7808. @end itemize
  7809. @node Exporting, Publishing, Markup, Top
  7810. @chapter Exporting
  7811. @cindex exporting
  7812. Org-mode documents can be exported into a variety of other formats. For
  7813. printing and sharing of notes, ASCII export produces a readable and simple
  7814. version of an Org file. HTML export allows you to publish a notes file on
  7815. the web, while the XOXO format provides a solid base for exchange with a
  7816. broad range of other applications. La@TeX{} export lets you use Org mode and
  7817. its structured editing functions to easily create La@TeX{} files. DocBook
  7818. export makes it possible to convert Org files to many other formats using
  7819. DocBook tools. To incorporate entries with associated times like deadlines
  7820. or appointments into a desktop calendar program like iCal, Org mode can also
  7821. produce extracts in the iCalendar format. Currently Org mode only supports
  7822. export, not import of these different formats.
  7823. Org supports export of selected regions when @code{transient-mark-mode} is
  7824. enabled (default in Emacs 23).
  7825. @menu
  7826. * Selective export:: Using tags to select and exclude trees
  7827. * Export options:: Per-file export settings
  7828. * The export dispatcher:: How to access exporter commands
  7829. * ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
  7830. * HTML export:: Exporting to HTML
  7831. * LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
  7832. * DocBook export:: Exporting to DocBook
  7833. * Freemind export:: Exporting to Freemind mind maps
  7834. * XOXO export:: Exporting to XOXO
  7835. * iCalendar export:: Exporting in iCalendar format
  7836. @end menu
  7837. @node Selective export, Export options, Exporting, Exporting
  7838. @section Selective export
  7839. @cindex export, selective by tags
  7840. @vindex org-export-select-tags
  7841. @vindex org-export-exclude-tags
  7842. You may use tags to select the parts of a document that should be exported,
  7843. or to exclude parts from export. This behavior is governed by two variables:
  7844. @code{org-export-select-tags} and @code{org-export-exclude-tags}.
  7845. Org first checks if any of the @emph{select} tags is present in the buffer.
  7846. If yes, all trees that do not carry one of these tags will be excluded. If a
  7847. selected tree is a subtree, the heading hierarchy above it will also be
  7848. selected for export, but not the text below those headings.
  7849. @noindent
  7850. If none of the select tags is found, the whole buffer will be selected for
  7851. export.
  7852. @noindent
  7853. Finally, all subtrees that are marked by any of the @emph{exclude} tags will
  7854. be removed from the export buffer.
  7855. @node Export options, The export dispatcher, Selective export, Exporting
  7856. @section Export options
  7857. @cindex options, for export
  7858. @cindex completion, of option keywords
  7859. The exporter recognizes special lines in the buffer which provide
  7860. additional information. These lines may be put anywhere in the file.
  7861. The whole set of lines can be inserted into the buffer with @kbd{C-c
  7862. C-e t}. For individual lines, a good way to make sure the keyword is
  7863. correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
  7864. (@pxref{Completion}). For a summary of other in-buffer settings not
  7865. specifically related to export, see @ref{In-buffer settings}.
  7866. In particular, note that you can place commonly-used (export) options in
  7867. a separate file which can be included using @code{#+SETUPFILE}.
  7868. @table @kbd
  7869. @kindex C-c C-e t
  7870. @item C-c C-e t
  7871. Insert template with export options, see example below.
  7872. @end table
  7873. @cindex #+TITLE
  7874. @cindex #+AUTHOR
  7875. @cindex #+DATE
  7876. @cindex #+EMAIL
  7877. @cindex #+DESCRIPTION
  7878. @cindex #+KEYWORDS
  7879. @cindex #+LANGUAGE
  7880. @cindex #+TEXT
  7881. @cindex #+OPTIONS
  7882. @cindex #+BIND
  7883. @cindex #+LINK_UP
  7884. @cindex #+LINK_HOME
  7885. @cindex #+EXPORT_SELECT_TAGS
  7886. @cindex #+EXPORT_EXCLUDE_TAGS
  7887. @cindex #+LATEX_HEADER
  7888. @vindex user-full-name
  7889. @vindex user-mail-address
  7890. @vindex org-export-default-language
  7891. @example
  7892. #+TITLE: the title to be shown (default is the buffer name)
  7893. #+AUTHOR: the author (default taken from @code{user-full-name})
  7894. #+DATE: a date, fixed, of a format string for @code{format-time-string}
  7895. #+EMAIL: his/her email address (default from @code{user-mail-address})
  7896. #+DESCRIPTION: the page description, e.g. for the XHTML meta tag
  7897. #+KEYWORDS: the page keywords, e.g. for the XHTML meta tag
  7898. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  7899. #+TEXT: Some descriptive text to be inserted at the beginning.
  7900. #+TEXT: Several lines may be given.
  7901. #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
  7902. #+BIND: lisp-var lisp-val, e.g.: org-export-latex-low-levels itemize
  7903. @r{You need to confirm using these, or configure @code{org-export-allow-BIND}}
  7904. #+LINK_UP: the ``up'' link of an exported page
  7905. #+LINK_HOME: the ``home'' link of an exported page
  7906. #+LATEX_HEADER: extra line(s) for the LaTeX header, like \usepackage@{xyz@}
  7907. #+EXPORT_SELECT_TAGS: Tags that select a tree for export
  7908. #+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
  7909. @end example
  7910. @noindent
  7911. The OPTIONS line is a compact@footnote{If you want to configure many options
  7912. this way, you can use several OPTIONS lines.} form to specify export settings. Here
  7913. you can:
  7914. @cindex headline levels
  7915. @cindex section-numbers
  7916. @cindex table of contents
  7917. @cindex line-break preservation
  7918. @cindex quoted HTML tags
  7919. @cindex fixed-width sections
  7920. @cindex tables
  7921. @cindex @TeX{}-like syntax for sub- and superscripts
  7922. @cindex footnotes
  7923. @cindex special strings
  7924. @cindex emphasized text
  7925. @cindex @TeX{} macros
  7926. @cindex La@TeX{} fragments
  7927. @cindex author info, in export
  7928. @cindex time info, in export
  7929. @example
  7930. H: @r{set the number of headline levels for export}
  7931. num: @r{turn on/off section-numbers}
  7932. toc: @r{turn on/off table of contents, or set level limit (integer)}
  7933. \n: @r{turn on/off line-break-preservation (DOES NOT WORK)}
  7934. @@: @r{turn on/off quoted HTML tags}
  7935. :: @r{turn on/off fixed-width sections}
  7936. |: @r{turn on/off tables}
  7937. ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
  7938. @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
  7939. @r{the simple @code{a_b} will be left as it is.}
  7940. -: @r{turn on/off conversion of special strings.}
  7941. f: @r{turn on/off footnotes like this[1].}
  7942. todo: @r{turn on/off inclusion of TODO keywords into exported text}
  7943. pri: @r{turn on/off priority cookies}
  7944. tags: @r{turn on/off inclusion of tags, may also be @code{not-in-toc}}
  7945. <: @r{turn on/off inclusion of any time/date stamps like DEADLINES}
  7946. *: @r{turn on/off emphasized text (bold, italic, underlined)}
  7947. TeX: @r{turn on/off simple @TeX{} macros in plain text}
  7948. LaTeX: @r{turn on/off La@TeX{} fragments}
  7949. skip: @r{turn on/off skipping the text before the first heading}
  7950. author: @r{turn on/off inclusion of author name/email into exported file}
  7951. email: @r{turn on/off inclusion of author email into exported file}
  7952. creator: @r{turn on/off inclusion of creator info into exported file}
  7953. timestamp: @r{turn on/off inclusion creation time into exported file}
  7954. d: @r{turn on/off inclusion of drawers}
  7955. @end example
  7956. @noindent
  7957. These options take effect in both the HTML and La@TeX{} export, except
  7958. for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
  7959. @code{nil} for the La@TeX{} export.
  7960. When exporting only a single subtree by selecting it with @kbd{C-c @@} before
  7961. calling an export command, the subtree can overrule some of the file's export
  7962. settings with properties @code{EXPORT_FILE_NAME}, @code{EXPORT_TITLE},
  7963. @code{EXPORT_TEXT}, @code{EXPORT_AUTHOR}, @code{EXPORT_DATE}, and
  7964. @code{EXPORT_OPTIONS}.
  7965. @node The export dispatcher, ASCII/Latin-1/UTF-8 export, Export options, Exporting
  7966. @section The export dispatcher
  7967. @cindex dispatcher, for export commands
  7968. All export commands can be reached using the export dispatcher, which is a
  7969. prefix key that prompts for an additional key specifying the command.
  7970. Normally the entire file is exported, but if there is an active region that
  7971. contains one outline tree, the first heading is used as document title and
  7972. the subtrees are exported.
  7973. @table @kbd
  7974. @kindex C-c C-e
  7975. @item C-c C-e
  7976. @vindex org-export-run-in-background
  7977. Dispatcher for export and publishing commands. Displays a help-window
  7978. listing the additional key(s) needed to launch an export or publishing
  7979. command. The prefix arg is passed through to the exporter. A double prefix
  7980. @kbd{C-u C-u} causes most commands to be executed in the background, in a
  7981. separate Emacs process@footnote{To make this behavior the default, customize
  7982. the variable @code{org-export-run-in-background}.}.
  7983. @kindex C-c C-e v
  7984. @item C-c C-e v
  7985. Like @kbd{C-c C-e}, but only export the text that is currently visible
  7986. (i.e. not hidden by outline visibility).
  7987. @kindex C-u C-u C-c C-e
  7988. @item C-u C-u C-c C-e
  7989. @vindex org-export-run-in-background
  7990. Call an the exporter, but reverse the setting of
  7991. @code{org-export-run-in-background}, i.e. request background processing if
  7992. not set, or force processing in the current Emacs process if set.
  7993. @end table
  7994. @node ASCII/Latin-1/UTF-8 export, HTML export, The export dispatcher, Exporting
  7995. @section ASCII/Latin-1/UTF-8 export
  7996. @cindex ASCII export
  7997. @cindex Latin-1 export
  7998. @cindex UTF-8 export
  7999. ASCII export produces a simple and very readable version of an Org-mode
  8000. file, containing only plain ASCII. Latin-1 and UTF-8 export augment the file
  8001. with special characters and symbols available in these encodings.
  8002. @cindex region, active
  8003. @cindex active region
  8004. @cindex transient-mark-mode
  8005. @table @kbd
  8006. @kindex C-c C-e a
  8007. @item C-c C-e a
  8008. @cindex property, EXPORT_FILE_NAME
  8009. Export as ASCII file. For an Org file, @file{myfile.org}, the ASCII file
  8010. will be @file{myfile.txt}. The file will be overwritten without
  8011. warning. If there is an active region@footnote{This requires
  8012. @code{transient-mark-mode} be turned on.}, only the region will be
  8013. exported. If the selected region is a single tree@footnote{To select the
  8014. current subtree, use @kbd{C-c @@}.}, the tree head will
  8015. become the document title. If the tree head entry has or inherits an
  8016. @code{EXPORT_FILE_NAME} property, that name will be used for the
  8017. export.
  8018. @kindex C-c C-e A
  8019. @item C-c C-e A
  8020. Export to a temporary buffer, do not create a file.
  8021. @kindex C-c C-e n
  8022. @kindex C-c C-e N
  8023. @item C-c C-e n @ @ @r{and} @ @ C-c C-e N
  8024. Like the above commands, but use Latin-1 encoding.
  8025. @kindex C-c C-e u
  8026. @kindex C-c C-e U
  8027. @item C-c C-e u @ @ @r{and} @ @ C-c C-e U
  8028. Like the above commands, but use UTF-8 encoding.
  8029. @kindex C-c C-e v a
  8030. @kindex C-c C-e v n
  8031. @kindex C-c C-e v u
  8032. @item C-c C-e v a @ @ @r{and} @ @ C-c C-e v n @ @ @r{and} @ @ C-c C-e v u
  8033. Export only the visible part of the document.
  8034. @end table
  8035. @cindex headline levels, for exporting
  8036. In the exported version, the first 3 outline levels will become
  8037. headlines, defining a general document structure. Additional levels
  8038. will be exported as itemized lists. If you want that transition to occur
  8039. at a different level, specify it with a prefix argument. For example,
  8040. @example
  8041. @kbd{C-1 C-c C-e a}
  8042. @end example
  8043. @noindent
  8044. creates only top level headlines and does the rest as items. When
  8045. headlines are converted to items, the indentation of the text following
  8046. the headline is changed to fit nicely under the item. This is done with
  8047. the assumption that the first body line indicates the base indentation of
  8048. the body text. Any indentation larger than this is adjusted to preserve
  8049. the layout relative to the first line. Should there be lines with less
  8050. indentation than the first, these are left alone.
  8051. @vindex org-export-ascii-links-to-notes
  8052. Links will be exported in a footnote-like style, with the descriptive part in
  8053. the text and the link in a note before the next heading. See the variable
  8054. @code{org-export-ascii-links-to-notes} for details and other options.
  8055. @node HTML export, LaTeX and PDF export, ASCII/Latin-1/UTF-8 export, Exporting
  8056. @section HTML export
  8057. @cindex HTML export
  8058. Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
  8059. HTML formatting, in ways similar to John Gruber's @emph{markdown}
  8060. language, but with additional support for tables.
  8061. @menu
  8062. * HTML Export commands:: How to invoke HTML export
  8063. * Quoting HTML tags:: Using direct HTML in Org mode
  8064. * Links in HTML export:: How links will be interpreted and formatted
  8065. * Tables in HTML export:: How to modify the formatting of tables
  8066. * Images in HTML export:: How to insert figures into HTML output
  8067. * Text areas in HTML export:: An alternative way to show an example
  8068. * CSS support:: Changing the appearance of the output
  8069. * Javascript support:: Info and Folding in a web browser
  8070. @end menu
  8071. @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
  8072. @subsection HTML export commands
  8073. @cindex region, active
  8074. @cindex active region
  8075. @cindex transient-mark-mode
  8076. @table @kbd
  8077. @kindex C-c C-e h
  8078. @item C-c C-e h
  8079. @cindex property, EXPORT_FILE_NAME
  8080. Export as HTML file @file{myfile.html}. For an Org file @file{myfile.org},
  8081. the ASCII file will be @file{myfile.html}. The file will be overwritten
  8082. without warning. If there is an active region@footnote{This requires
  8083. @code{transient-mark-mode} be turned on.}, only the region will be
  8084. exported. If the selected region is a single tree@footnote{To select the
  8085. current subtree, use @kbd{C-c @@}.}, the tree head will become the document
  8086. title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
  8087. property, that name will be used for the export.
  8088. @kindex C-c C-e b
  8089. @item C-c C-e b
  8090. Export as HTML file and immediately open it with a browser.
  8091. @kindex C-c C-e H
  8092. @item C-c C-e H
  8093. Export to a temporary buffer, do not create a file.
  8094. @kindex C-c C-e R
  8095. @item C-c C-e R
  8096. Export the active region to a temporary buffer. With a prefix argument, do
  8097. not produce the file header and footer, but just the plain HTML section for
  8098. the region. This is good for cut-and-paste operations.
  8099. @kindex C-c C-e v h
  8100. @kindex C-c C-e v b
  8101. @kindex C-c C-e v H
  8102. @kindex C-c C-e v R
  8103. @item C-c C-e v h
  8104. @item C-c C-e v b
  8105. @item C-c C-e v H
  8106. @item C-c C-e v R
  8107. Export only the visible part of the document.
  8108. @item M-x org-export-region-as-html
  8109. Convert the region to HTML under the assumption that it was Org-mode
  8110. syntax before. This is a global command that can be invoked in any
  8111. buffer.
  8112. @item M-x org-replace-region-by-HTML
  8113. Replace the active region (assumed to be in Org-mode syntax) by HTML
  8114. code.
  8115. @end table
  8116. @cindex headline levels, for exporting
  8117. In the exported version, the first 3 outline levels will become headlines,
  8118. defining a general document structure. Additional levels will be exported as
  8119. itemized lists. If you want that transition to occur at a different level,
  8120. specify it with a numeric prefix argument. For example,
  8121. @example
  8122. @kbd{C-2 C-c C-e b}
  8123. @end example
  8124. @noindent
  8125. creates two levels of headings and does the rest as items.
  8126. @node Quoting HTML tags, Links in HTML export, HTML Export commands, HTML export
  8127. @subsection Quoting HTML tags
  8128. Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
  8129. @samp{&gt;} in HTML export. If you want to include simple HTML tags
  8130. which should be interpreted as such, mark them with @samp{@@} as in
  8131. @samp{@@<b>bold text@@</b>}. Note that this really works only for
  8132. simple tags. For more extensive HTML that should be copied verbatim to
  8133. the exported file use either
  8134. @cindex #+HTML
  8135. @cindex #+BEGIN_HTML
  8136. @example
  8137. #+HTML: Literal HTML code for export
  8138. @end example
  8139. @noindent or
  8140. @cindex #+BEGIN_HTML
  8141. @example
  8142. #+BEGIN_HTML
  8143. All lines between these markers are exported literally
  8144. #+END_HTML
  8145. @end example
  8146. @node Links in HTML export, Tables in HTML export, Quoting HTML tags, HTML export
  8147. @subsection Links in HTML export
  8148. @cindex links, in HTML export
  8149. @cindex internal links, in HTML export
  8150. @cindex external links, in HTML export
  8151. Internal links (@pxref{Internal links}) will continue to work in HTML. This
  8152. includes automatic links created by radio targets (@pxref{Radio
  8153. targets}). Links to external files will still work if the target file is on
  8154. the same @i{relative} path as the published Org file. Links to other
  8155. @file{.org} files will be translated into HTML links under the assumption
  8156. that an HTML version also exists of the linked file, at the same relative
  8157. path. @samp{id:} links can then be used to jump to specific entries across
  8158. files. For information related to linking files while publishing them to a
  8159. publishing directory see @ref{Publishing links}.
  8160. If you want to specify attributes for links, you can do so using a special
  8161. @code{#+ATTR_HTML} line to define attributes that will be added to the
  8162. @code{<a>} or @code{<img>} tags. Here is an example that sets @code{title}
  8163. and @code{style} attributes for a link:
  8164. @cindex #+ATTR_HTML
  8165. @example
  8166. #+ATTR_HTML: title="The Org-mode homepage" style="color:red;"
  8167. [[http://orgmode.org]]
  8168. @end example
  8169. @node Tables in HTML export, Images in HTML export, Links in HTML export, HTML export
  8170. @subsection Tables
  8171. @cindex tables, in HTML
  8172. @vindex org-export-html-table-tag
  8173. Org-mode tables are exported to HTML using the table tag defined in
  8174. @code{org-export-html-table-tag}. The default setting makes tables without
  8175. cell borders and frame. If you would like to change this for individual
  8176. tables, place somthing like the following before the table:
  8177. @cindex #+CAPTION
  8178. @cindex #+ATTR_HTML
  8179. @example
  8180. #+CAPTION: This is a table with lines around and between cells
  8181. #+ATTR_HTML: border="2" rules="all" frame="all"
  8182. @end example
  8183. @node Images in HTML export, Text areas in HTML export, Tables in HTML export, HTML export
  8184. @subsection Images in HTML export
  8185. @cindex images, inline in HTML
  8186. @cindex inlining images in HTML
  8187. @vindex org-export-html-inline-images
  8188. HTML export can inline images given as links in the Org file, and
  8189. it can make an image the clickable part of a link. By
  8190. default@footnote{But see the variable
  8191. @code{org-export-html-inline-images}.}, images are inlined if a link does
  8192. not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
  8193. while @samp{[[file:myimg.jpg][the image]]} will just produce a link
  8194. @samp{the image} that points to the image. If the description part
  8195. itself is a @code{file:} link or a @code{http:} URL pointing to an
  8196. image, this image will be inlined and activated so that clicking on the
  8197. image will activate the link. For example, to include a thumbnail that
  8198. will link to a high resolution version of the image, you could use:
  8199. @example
  8200. [[file:highres.jpg][file:thumb.jpg]]
  8201. @end example
  8202. If you need to add attributes to an inlines image, use a @code{#+ATTR_HTML}.
  8203. In the example below we specify the @code{alt} and @code{title} attributes to
  8204. support text viewers and accessibility, and align it to the right.
  8205. @cindex #+CAPTION
  8206. @cindex #+ATTR_HTML
  8207. @example
  8208. #+CAPTION: A black cat stalking a spider
  8209. #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
  8210. [[./img/a.jpg]]
  8211. @end example
  8212. @noindent
  8213. and you could use @code{http} addresses just as well.
  8214. @node Text areas in HTML export, CSS support, Images in HTML export, HTML export
  8215. @subsection Text areas in HTML export
  8216. @cindex text areas, in HTML
  8217. An alternative way to publish literal code examples in HTML is to use text
  8218. areas, where the example can even be edited before pasting it into an
  8219. application. It is triggered by a @code{-t} switch at an @code{example} or
  8220. @code{src} block. Using this switch disables any options for syntax and
  8221. label highlighting, and line numbering, which may be present. You may also
  8222. use @code{-h} and @code{-w} switches to specify the height and width of the
  8223. text area, which default to the number of lines in the example, and 80,
  8224. respectively. For example
  8225. @example
  8226. #+BEGIN_EXAMPLE -t -w 40
  8227. (defun org-xor (a b)
  8228. "Exclusive or."
  8229. (if a (not b) b))
  8230. #+END_EXAMPLE
  8231. @end example
  8232. @node CSS support, Javascript support, Text areas in HTML export, HTML export
  8233. @subsection CSS support
  8234. @cindex CSS, for HTML export
  8235. @cindex HTML export, CSS
  8236. @vindex org-export-html-todo-kwd-class-prefix
  8237. @vindex org-export-html-tag-class-prefix
  8238. You can also give style information for the exported file. The HTML exporter
  8239. assigns the following special CSS classes@footnote{If the classes on TODO
  8240. keywords and tags lead to conflicts, use the variables
  8241. @code{org-export-html-todo-kwd-class-prefix} and
  8242. @code{org-export-html-tag-class-prefix} to make them unique.} to appropriate
  8243. parts of the document---your style specifications may change these, in
  8244. addition to any of the standard classes like for headlines, tables, etc.
  8245. @example
  8246. p.author @r{author information, including email}
  8247. p.date @r{publishing date}
  8248. p.creator @r{creator info, about org-mode version}
  8249. .title @r{document title}
  8250. .todo @r{TODO keywords, all not-done states}
  8251. .done @r{the DONE keywords, all stated the count as done}
  8252. .WAITING @r{each TODO keyword also uses a class named after itself}
  8253. .timestamp @r{timestamp}
  8254. .timestamp-kwd @r{keyword associated with a timestamp, like SCHEDULED}
  8255. .timestamp-wrapper @r{span around keyword plus timestamp}
  8256. .tag @r{tag in a headline}
  8257. ._HOME @r{each tag uses itself as a class, "@@" replaced by "_"}
  8258. .target @r{target for links}
  8259. .linenr @r{the line number in a code example}
  8260. .code-highlighted @r{for highlighting referenced code lines}
  8261. div.outline-N @r{div for outline level N (headline plus text))}
  8262. div.outline-text-N @r{extra div for text at outline level N}
  8263. .section-number-N @r{section number in headlines, different for each level}
  8264. div.figure @r{how to format an inlined image}
  8265. pre.src @r{formatted source code}
  8266. pre.example @r{normal example}
  8267. p.verse @r{verse paragraph}
  8268. div.footnotes @r{footnote section headline}
  8269. p.footnote @r{footnote definition paragraph, containing a footnote}
  8270. .footref @r{a footnote reference number (always a <sup>)}
  8271. .footnum @r{footnote number in footnote definition (always <sup>)}
  8272. @end example
  8273. @vindex org-export-html-style-default
  8274. @vindex org-export-html-style-include-default
  8275. @vindex org-export-html-style
  8276. @vindex org-export-html-extra
  8277. @vindex org-export-html-style-default
  8278. Each exported file contains a compact default style that defines these
  8279. classes in a basic way@footnote{This style is defined in the constant
  8280. @code{org-export-html-style-default}, which you should not modify. To turn
  8281. inclusion of these defaults off, customize
  8282. @code{org-export-html-style-include-default}}. You may overwrite these
  8283. settings, or add to them by using the variables @code{org-export-html-style}
  8284. (for Org-wide settings) and @code{org-export-html-style-extra} (for more
  8285. granular settings, like file-local settings). To set the latter variable
  8286. individually for each file, you can use
  8287. @cindex #+STYLE
  8288. @example
  8289. #+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
  8290. @end example
  8291. @noindent
  8292. For longer style definitions, you can use several such lines. You could also
  8293. directly write a @code{<style>} @code{</style>} section in this way, without
  8294. referring to an external file.
  8295. @c FIXME: More about header and footer styles
  8296. @c FIXME: Talk about links and targets.
  8297. @node Javascript support, , CSS support, HTML export
  8298. @subsection Javascript supported display of web pages
  8299. @cindex Rose, Sebastian
  8300. Sebastian Rose has written a JavaScript program especially designed to
  8301. enhance the web viewing experience of HTML files created with Org. This
  8302. program allows you to view large files in two different ways. The first one
  8303. is an @emph{Info}-like mode where each section is displayed separately and
  8304. navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
  8305. as well, press @kbd{?} for an overview of the available keys). The second
  8306. view type is a @emph{folding} view much like Org provides inside Emacs. The
  8307. script is available at @url{http://orgmode.org/org-info.js} and you can find
  8308. the documentation for it at @url{http://orgmode.org/worg/code/org-info-js/}.
  8309. We host the script at our site, but if you use it a lot, you might
  8310. not want to be dependent on @url{orgmode.org} and prefer to install a local
  8311. copy on your own web server.
  8312. To use the script, you need to make sure that the @file{org-jsinfo.el} module
  8313. gets loaded. It should be loaded by default, but you can try @kbd{M-x
  8314. customize-variable @key{RET} org-modules @key{RET}} to convince yourself that
  8315. this is indeed the case. All it then takes to make use of the program is
  8316. adding a single line to the Org file:
  8317. @cindex #+INFOJS_OPT
  8318. @example
  8319. #+INFOJS_OPT: view:info toc:nil
  8320. @end example
  8321. @noindent
  8322. If this line is found, the HTML header will automatically contain the code
  8323. needed to invoke the script. Using the line above, you can set the following
  8324. viewing options:
  8325. @example
  8326. path: @r{The path to the script. The default is to grab the script from}
  8327. @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
  8328. @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
  8329. view: @r{Initial view when website is first shown. Possible values are:}
  8330. info @r{Info-like interface with one section per page.}
  8331. overview @r{Folding interface, initially showing only top-level.}
  8332. content @r{Folding interface, starting with all headlines visible.}
  8333. showall @r{Folding interface, all headlines and text visible.}
  8334. sdepth: @r{Maximum headline level that will still become an independent}
  8335. @r{section for info and folding modes. The default is taken from}
  8336. @r{@code{org-export-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
  8337. @r{If this is smaller than in @code{org-export-headline-levels}, each}
  8338. @r{info/folding section can still contain child headlines.}
  8339. toc: @r{Should the table of content @emph{initially} be visible?}
  8340. @r{Even when @code{nil}, you can always get to the "toc" with @kbd{i}.}
  8341. tdepth: @r{The depth of the table of contents. The defaults are taken from}
  8342. @r{the variables @code{org-export-headline-levels} and @code{org-export-with-toc}.}
  8343. ftoc: @r{Does the css of the page specify a fixed position for the "toc"?}
  8344. @r{If yes, the toc will never be displayed as a section.}
  8345. ltoc: @r{Should there be short contents (children) in each section?}
  8346. @r{Make this @code{above} if the section should be above initial text.}
  8347. mouse: @r{Headings are highlighted when the mouse is over them. Should be}
  8348. @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
  8349. buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the}
  8350. @r{default), only one such button will be present.}
  8351. @end example
  8352. @noindent
  8353. @vindex org-infojs-options
  8354. @vindex org-export-html-use-infojs
  8355. You can choose default values for these options by customizing the variable
  8356. @code{org-infojs-options}. If you always want to apply the script to your
  8357. pages, configure the variable @code{org-export-html-use-infojs}.
  8358. @node LaTeX and PDF export, DocBook export, HTML export, Exporting
  8359. @section La@TeX{} and PDF export
  8360. @cindex La@TeX{} export
  8361. @cindex PDF export
  8362. @cindex Guerry, Bastien
  8363. Org mode contains a La@TeX{} exporter written by Bastien Guerry. With
  8364. further processing@footnote{The default LaTeX output is designed for
  8365. processing with pdftex or latex. It includes packages that are not
  8366. compatible with xetex and possibly luatex. See the variables
  8367. @code{org-export-latex-default-packages-alist} and
  8368. @code{org-export-latex-packages-alist}.}, this backend is also used to
  8369. produce PDF output. Since the La@TeX{} output uses @file{hyperref} to
  8370. implement links and cross references, the PDF output file will be fully
  8371. linked.
  8372. @menu
  8373. * LaTeX/PDF export commands:: Which key invokes which commands
  8374. * Header and sectioning:: Setting up the export file structure
  8375. * Quoting LaTeX code:: Incorporating literal La@TeX{} code
  8376. * Tables in LaTeX export:: Options for exporting tables to La@TeX{}
  8377. * Images in LaTeX export:: How to insert figures into La@TeX{} output
  8378. * Beamer class export:: Turning the file into a presentation
  8379. @end menu
  8380. @node LaTeX/PDF export commands, Header and sectioning, LaTeX and PDF export, LaTeX and PDF export
  8381. @subsection La@TeX{} export commands
  8382. @cindex region, active
  8383. @cindex active region
  8384. @cindex transient-mark-mode
  8385. @table @kbd
  8386. @kindex C-c C-e l
  8387. @item C-c C-e l
  8388. @cindex property EXPORT_FILE_NAME
  8389. Export as La@TeX{} file @file{myfile.tex}. For an Org file
  8390. @file{myfile.org}, the ASCII file will be @file{myfile.tex}. The file will
  8391. be overwritten without warning. If there is an active region@footnote{This
  8392. requires @code{transient-mark-mode} be turned on.}, only the region will be
  8393. exported. If the selected region is a single tree@footnote{To select the
  8394. current subtree, use @kbd{C-c @@}.}, the tree head will become the document
  8395. title. If the tree head entry has or inherits an @code{EXPORT_FILE_NAME}
  8396. property, that name will be used for the export.
  8397. @kindex C-c C-e L
  8398. @item C-c C-e L
  8399. Export to a temporary buffer, do not create a file.
  8400. @kindex C-c C-e v l
  8401. @kindex C-c C-e v L
  8402. @item C-c C-e v l
  8403. @item C-c C-e v L
  8404. Export only the visible part of the document.
  8405. @item M-x org-export-region-as-latex
  8406. Convert the region to La@TeX{} under the assumption that it was Org mode
  8407. syntax before. This is a global command that can be invoked in any
  8408. buffer.
  8409. @item M-x org-replace-region-by-latex
  8410. Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
  8411. code.
  8412. @kindex C-c C-e p
  8413. @item C-c C-e p
  8414. Export as La@TeX{} and then process to PDF.
  8415. @kindex C-c C-e d
  8416. @item C-c C-e d
  8417. Export as La@TeX{} and then process to PDF, then open the resulting PDF file.
  8418. @end table
  8419. @cindex headline levels, for exporting
  8420. @vindex org-latex-low-levels
  8421. In the exported version, the first 3 outline levels will become
  8422. headlines, defining a general document structure. Additional levels
  8423. will be exported as description lists. The exporter can ignore them or
  8424. convert them to a custom string depending on
  8425. @code{org-latex-low-levels}.
  8426. If you want that transition to occur at a different level, specify it
  8427. with a numeric prefix argument. For example,
  8428. @example
  8429. @kbd{C-2 C-c C-e l}
  8430. @end example
  8431. @noindent
  8432. creates two levels of headings and does the rest as items.
  8433. @node Header and sectioning, Quoting LaTeX code, LaTeX/PDF export commands, LaTeX and PDF export
  8434. @subsection Header and sectioning structure
  8435. @cindex La@TeX{} class
  8436. @cindex La@TeX{} sectioning structure
  8437. @cindex La@TeX{} header
  8438. @cindex header, for LaTeX files
  8439. @cindex sectioning structure, for LaTeX export
  8440. By default, the La@TeX{} output uses the class @code{article}.
  8441. @vindex org-export-latex-default-class
  8442. @vindex org-export-latex-classes
  8443. @vindex org-export-latex-default-packages-alist
  8444. @vindex org-export-latex-packages-alist
  8445. @cindex #+LATEX_HEADER
  8446. @cindex #+LATEX_CLASS
  8447. @cindex #+LATEX_CLASS_OPTIONS
  8448. @cindex property, LATEX_CLASS
  8449. @cindex property, LATEX_CLASS_OPTIONS
  8450. You can change this globally by setting a different value for
  8451. @code{org-export-latex-default-class} or locally by adding an option like
  8452. @code{#+LaTeX_CLASS: myclass} in your file, or with a @code{:LaTeX_CLASS:}
  8453. property that applies when exporting a region containing only this (sub)tree.
  8454. The class must be listed in @code{org-export-latex-classes}. This variable
  8455. defines a header template for each class@footnote{Into which the values of
  8456. @code{org-export-latex-default-packages-alist} and
  8457. @code{org-export-latex-packages-alist} are spliced.}, and allows you to
  8458. define the sectioning structure for each class. You can also define your own
  8459. classes there. @code{#+LaTeX_CLASS_OPTIONS} or a @code{LaTeX_CLASS_OPTIONS}
  8460. property can specify the options for the @code{\documentclass} macro. You
  8461. can also use @code{#+LATEX_HEADER: \usepackage@{xyz@}} to add lines to the
  8462. header. See the docstring of @code{org-export-latex-classes} for more
  8463. information.
  8464. @node Quoting LaTeX code, Tables in LaTeX export, Header and sectioning, LaTeX and PDF export
  8465. @subsection Quoting La@TeX{} code
  8466. Embedded La@TeX{} as described in @ref{Embedded LaTeX}, will be correctly
  8467. inserted into the La@TeX{} file. This includes simple macros like
  8468. @samp{\ref@{LABEL@}} to create a cross reference to a figure. Furthermore,
  8469. you can add special code that should only be present in La@TeX{} export with
  8470. the following constructs:
  8471. @cindex #+LaTeX
  8472. @cindex #+BEGIN_LaTeX
  8473. @example
  8474. #+LaTeX: Literal LaTeX code for export
  8475. @end example
  8476. @noindent or
  8477. @cindex #+BEGIN_LaTeX
  8478. @example
  8479. #+BEGIN_LaTeX
  8480. All lines between these markers are exported literally
  8481. #+END_LaTeX
  8482. @end example
  8483. @node Tables in LaTeX export, Images in LaTeX export, Quoting LaTeX code, LaTeX and PDF export
  8484. @subsection Tables in La@TeX{} export
  8485. @cindex tables, in La@TeX{} export
  8486. For La@TeX{} export of a table, you can specify a label and a caption
  8487. (@pxref{Images and tables}). You can also use the @code{ATTR_LaTeX} line to
  8488. request a longtable environment for the table, so that it may span several
  8489. pages. Finally, you can set the alignment string:
  8490. @cindex #+CAPTION
  8491. @cindex #+LABEL
  8492. @cindex #+ATTR_LaTeX
  8493. @example
  8494. #+CAPTION: A long table
  8495. #+LABEL: tbl:long
  8496. #+ATTR_LaTeX: longtable align=l|lp@{3cm@}r|l
  8497. | ..... | ..... |
  8498. | ..... | ..... |
  8499. @end example
  8500. @node Images in LaTeX export, Beamer class export, Tables in LaTeX export, LaTeX and PDF export
  8501. @subsection Images in La@TeX{} export
  8502. @cindex images, inline in La@TeX{}
  8503. @cindex inlining images in La@TeX{}
  8504. Images that are linked to without a description part in the link, like
  8505. @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]} will be inserted into the PDF
  8506. output file resulting from La@TeX{} processing. Org will use an
  8507. @code{\includegraphics} macro to insert the image. If you have specified a
  8508. caption and/or a label as described in @ref{Images and tables}, the figure
  8509. will be wrapped into a @code{figure} environment and thus become a floating
  8510. element. You can use an @code{#+ATTR_LaTeX:} line to specify the various
  8511. options that can be used in the optional argument of the
  8512. @code{\includegraphics} macro. To modify the placement option of the
  8513. @code{figure} environment, add something like @samp{placement=[h!]} to the
  8514. Attributes.
  8515. If you'd like to let text flow around the image, add the word @samp{wrap} to
  8516. the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
  8517. half of the page. To fine-tune, the @code{placement} field will be the
  8518. set of additional arguments needed by the @code{wrapfigure} environment.
  8519. Note that if you change the size of the image, you need to use compatible
  8520. settings for @code{\includegraphics} and @code{wrapfigure}.
  8521. @cindex #+CAPTION
  8522. @cindex #+LABEL
  8523. @cindex #+ATTR_LaTeX
  8524. @example
  8525. #+CAPTION: The black-body emission of the disk around HR 4049
  8526. #+LABEL: fig:SED-HR4049
  8527. #+ATTR_LaTeX: width=5cm,angle=90
  8528. [[./img/sed-hr4049.pdf]]
  8529. #+ATTR_LaTeX: width=0.38\textwidth wrap placement=@{r@}@{0.4\textwidth@}
  8530. [[./img/hst.png]]
  8531. @end example
  8532. If you need references to a label created in this way, write
  8533. @samp{\ref@{fig:SED-HR4049@}} just like in La@TeX{}.
  8534. @node Beamer class export, , Images in LaTeX export, LaTeX and PDF export
  8535. @subsection Beamer class export
  8536. The LaTeX class @file{beamer} allows to produce high quality presentations
  8537. using LaTeX and pdf processing. Org-mode has special support for turning an
  8538. Org-mode file or tree into a @file{beamer} presentation.
  8539. When the LaTeX class for the current buffer (as set with @code{#+LaTeX_CLASS:
  8540. beamer}) or subtree (set with a @code{LaTeX_CLASS} property) is
  8541. @code{beamer}, a special export mode will turn the file or tree into a beamer
  8542. presentation. Any tree with not-to-deep level nesting should in principle be
  8543. exportable as a beamer presentation. By default, the top-level entries (or
  8544. the first level below the selected subtree heading) will be turned into
  8545. frames, and the outline structure below this level will become itemize lists.
  8546. You can also configure the variable @code{org-beamer-frame-level} to a
  8547. different level - then the hierarchy above frames will produce the sectioning
  8548. structure of the presentation.
  8549. A template for useful in-buffer settings or properties can be inserted into
  8550. the buffer with @kbd{M-x org-beamer-settings-template}. Among other things,
  8551. this will install a column view format which is very handy for editing
  8552. special properties used by beamer.
  8553. You can influence the structure of the presentation using the following
  8554. properties:
  8555. @table @code
  8556. @item BEAMER_env
  8557. The environment that should be used to format this entry. Valid environments
  8558. are defined in the constant @code{org-beamer-environments-default}, and you
  8559. can define more in @code{org-beamer-environments-extra}. If this property is
  8560. set, the entry will also get a @code{:B_environment:} tag to make this
  8561. visible. This tag has no semantic meaning, it is only a visual aid.
  8562. @item BEAMER_envargs
  8563. The beamer-special arguments that should be used for the environment, like
  8564. @code{[t]} or @code{[<+->]} of @code{<2-3>}. If the @code{BEAMER_col}
  8565. property is also set, something like @code{C[t]} can be added here as well to
  8566. set an options argument for the implied @code{columns} environment.
  8567. @code{c[t]} will set an option for the implied @code{column} environment.
  8568. @item BEAMER_col
  8569. The width of a column that should start with this entry. If this property is
  8570. set, the entry will also get a @code{:BMCOL:} property to make this visible.
  8571. Also this tag is only a visual aid. When his is a plain number, it will be
  8572. interpreted as a fraction of @code{\textwidth}. Otherwise it will be assumed
  8573. that you have specified the units, like @samp{3cm}. The first such property
  8574. in a frame will start a @code{columns} environment to surround the columns.
  8575. This environment is closed when an entry has a @code{BEAMER_col} property
  8576. with value 0 or 1, or automatically at the end of the frame.
  8577. @item BEAMER_extra
  8578. Additional commands that should be inserted after the environment has been
  8579. opened. For example, when creating a frame, this can be used to specify
  8580. transitions.
  8581. @end table
  8582. Frames will automatically receive a @code{fragile} option if they contain
  8583. source code that uses the verbatim environment. Special @file{beamer}
  8584. specific code can be inserted using @code{#+BEAMER:} and
  8585. @code{#+BEGIN_beamer...#+end_beamer} constructs, similar to other export
  8586. backends, but with the difference that @code{#+LaTeX:} stuff will be included
  8587. in the presentation as well.
  8588. Outline nodes with @code{BEAMER_env} property value @samp{note} or
  8589. @samp{noteNH} will be formatted as beamer notes, i,e, they will be wrapped
  8590. into @code{\note@{...@}}. The former will include the heading as part of the
  8591. note text, the latter will ignore the heading of that node. To simplify note
  8592. generation, it is actually enough to mark the note with a @emph{tag} (either
  8593. @code{:B_note:} or @code{:B_noteNH:}) instead of creating the
  8594. @code{BEAMER_env} property.
  8595. You can turn on a special minor mode @code{org-beamer-mode} for editing
  8596. support with
  8597. @example
  8598. #+STARTUP: beamer
  8599. @end example
  8600. @table @kbd
  8601. @kindex C-c C-b
  8602. @item C-c C-b
  8603. In @code{org-beamer-mode}, this key offers fast selection of a beamer
  8604. environment or the @code{BEAMER_col} property.
  8605. @end table
  8606. Column view provides a great way to set the environment of a node and other
  8607. important parameters. Make sure you are using a COLUMN format that is geared
  8608. toward this special purpose. The command @kbd{M-x
  8609. org-beamer-settings-template} does define such a format.
  8610. Here is a simple example Org document that is intended for beamer export.
  8611. @smallexample
  8612. #+LaTeX_CLASS: beamer
  8613. #+TITLE: Example Presentation
  8614. #+AUTHOR: Carsten Dominik
  8615. #+LaTeX_CLASS_OPTIONS: [presentation]
  8616. #+BEAMER_FRAME_LEVEL: 2
  8617. #+BEAMER_HEADER_EXTRA: \usetheme@{Madrid@}\usecolortheme@{default@}
  8618. #+COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Args) %4BEAMER_col(Col) %8BEAMER_extra(Ex)
  8619. * This is the first structural section
  8620. ** Frame 1 \\ with a subtitle
  8621. *** Thanks to Eric Fraga :BMCOL:B_block:
  8622. :PROPERTIES:
  8623. :BEAMER_env: block
  8624. :BEAMER_envargs: C[t]
  8625. :BEAMER_col: 0.5
  8626. :END:
  8627. for the first viable beamer setup in Org
  8628. *** Thanks to everyone else :BMCOL:B_block:
  8629. :PROPERTIES:
  8630. :BEAMER_col: 0.5
  8631. :BEAMER_env: block
  8632. :BEAMER_envargs: <2->
  8633. :END:
  8634. for contributing to the discussion
  8635. **** This will be formatted as a beamer note :B_note:
  8636. ** Frame 2 \\ where we will not use columns
  8637. *** Request :B_block:
  8638. Please test this stuff!
  8639. :PROPERTIES:
  8640. :BEAMER_env: block
  8641. :END:
  8642. @end smallexample
  8643. For more information, see the documentation on Worg.
  8644. @node DocBook export, Freemind export, LaTeX and PDF export, Exporting
  8645. @section DocBook export
  8646. @cindex DocBook export
  8647. @cindex PDF export
  8648. @cindex Cui, Baoqui
  8649. Org contains a DocBook exporter written by Baoqiu Cui. Once an Org file is
  8650. exported to DocBook format, it can be further processed to produce other
  8651. formats, including PDF, HTML, man pages, etc., using many available DocBook
  8652. tools and stylesheets.
  8653. Currently DocBook exporter only supports DocBook V5.0.
  8654. @menu
  8655. * DocBook export commands:: How to invoke DocBook export
  8656. * Quoting DocBook code:: Incorporating DocBook code in Org files
  8657. * Recursive sections:: Recursive sections in DocBook
  8658. * Tables in DocBook export:: Tables are exported as HTML tables
  8659. * Images in DocBook export:: How to insert figures into DocBook output
  8660. * Special characters:: How to handle special characters
  8661. @end menu
  8662. @node DocBook export commands, Quoting DocBook code, DocBook export, DocBook export
  8663. @subsection DocBook export commands
  8664. @cindex region, active
  8665. @cindex active region
  8666. @cindex transient-mark-mode
  8667. @table @kbd
  8668. @kindex C-c C-e D
  8669. @item C-c C-e D
  8670. @cindex property EXPORT_FILE_NAME
  8671. Export as DocBook file. For an Org file, @file{myfile.org}, the DocBook XML
  8672. file will be @file{myfile.xml}. The file will be overwritten without
  8673. warning. If there is an active region@footnote{This requires
  8674. @code{transient-mark-mode} to be turned on}, only the region will be
  8675. exported. If the selected region is a single tree@footnote{To select the
  8676. current subtree, use @kbd{C-c @@}.}, the tree head will become the document
  8677. title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
  8678. property, that name will be used for the export.
  8679. @kindex C-c C-e V
  8680. @item C-c C-e V
  8681. Export as DocBook file, process to PDF, then open the resulting PDF file.
  8682. @vindex org-export-docbook-xslt-proc-command
  8683. @vindex org-export-docbook-xsl-fo-proc-command
  8684. Note that, in order to produce PDF output based on exported DocBook file, you
  8685. need to have XSLT processor and XSL-FO processor software installed on your
  8686. system. Check variables @code{org-export-docbook-xslt-proc-command} and
  8687. @code{org-export-docbook-xsl-fo-proc-command}.
  8688. @kindex C-c C-e v D
  8689. @item C-c C-e v D
  8690. Export only the visible part of the document.
  8691. @end table
  8692. @node Quoting DocBook code, Recursive sections, DocBook export commands, DocBook export
  8693. @subsection Quoting DocBook code
  8694. You can quote DocBook code in Org files and copy it verbatim into exported
  8695. DocBook file with the following constructs:
  8696. @cindex #+DOCBOOK
  8697. @cindex #+BEGIN_DOCBOOK
  8698. @example
  8699. #+DOCBOOK: Literal DocBook code for export
  8700. @end example
  8701. @noindent or
  8702. @cindex #+BEGIN_DOCBOOK
  8703. @example
  8704. #+BEGIN_DOCBOOK
  8705. All lines between these markers are exported by DocBook exporter
  8706. literally.
  8707. #+END_DOCBOOK
  8708. @end example
  8709. For example, you can use the following lines to include a DocBook warning
  8710. admonition. As to what this warning says, you should pay attention to the
  8711. document context when quoting DocBook code in Org files. You may make
  8712. exported DocBook XML files invalid by not quoting DocBook code correctly.
  8713. @example
  8714. #+BEGIN_DOCBOOK
  8715. <warning>
  8716. <para>You should know what you are doing when quoting DocBook XML code
  8717. in your Org file. Invalid DocBook XML file may be generated by
  8718. DocBook exporter if you are not careful!</para>
  8719. </warning>
  8720. #+END_DOCBOOK
  8721. @end example
  8722. @node Recursive sections, Tables in DocBook export, Quoting DocBook code, DocBook export
  8723. @subsection Recursive sections
  8724. @cindex DocBook recursive sections
  8725. DocBook exporter exports Org files as articles using the @code{article}
  8726. element in DocBook. Recursive sections, i.e. @code{section} elements, are
  8727. used in exported articles. Top level headlines in Org files are exported as
  8728. top level sections, and lower level headlines are exported as nested
  8729. sections. The entire structure of Org files will be exported completely, no
  8730. matter how many nested levels of headlines there are.
  8731. Using recursive sections makes it easy to port and reuse exported DocBook
  8732. code in other DocBook document types like @code{book} or @code{set}.
  8733. @node Tables in DocBook export, Images in DocBook export, Recursive sections, DocBook export
  8734. @subsection Tables in DocBook export
  8735. @cindex tables, in DocBook export
  8736. Tables in Org files are exported as HTML tables, which have been supported since
  8737. DocBook V4.3.
  8738. If a table does not have a caption, an informal table is generated using the
  8739. @code{informaltable} element; otherwise, a formal table will be generated
  8740. using the @code{table} element.
  8741. @node Images in DocBook export, Special characters, Tables in DocBook export, DocBook export
  8742. @subsection Images in DocBook export
  8743. @cindex images, inline in DocBook
  8744. @cindex inlining images in DocBook
  8745. Images that are linked to without a description part in the link, like
  8746. @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]}, will be exported to DocBook
  8747. using @code{mediaobject} elements. Each @code{mediaobject} element contains
  8748. an @code{imageobject} that wraps an @code{imagedata} element. If you have
  8749. specified a caption for an image as described in @ref{Images and tables}, a
  8750. @code{caption} element will be added in @code{mediaobject}. If a label is
  8751. also specified, it will be exported as an @code{xml:id} attribute of the
  8752. @code{mediaobject} element.
  8753. @vindex org-export-docbook-default-image-attributes
  8754. Image attributes supported by the @code{imagedata} element, like @code{align}
  8755. or @code{width}, can be specified in two ways: you can either customize
  8756. variable @code{org-export-docbook-default-image-attributes} or use the
  8757. @code{#+ATTR_DOCBOOK:} line. Attributes specified in variable
  8758. @code{org-export-docbook-default-image-attributes} are applied to all inline
  8759. images in the Org file to be exported (unless they are overwritten by image
  8760. attributes specified in @code{#+ATTR_DOCBOOK:} lines).
  8761. The @code{#+ATTR_DOCBOOK:} line can be used to specify additional image
  8762. attributes or overwrite default image attributes for individual images. If
  8763. the same attribute appears in both the @code{#+ATTR_DOCBOOK:} line and
  8764. variable @code{org-export-docbook-default-image-attributes}, the former
  8765. overwrites the latter. Here is an example about how image attributes can be
  8766. set:
  8767. @cindex #+CAPTION
  8768. @cindex #+LABEL
  8769. @cindex #+ATTR_DOCBOOK
  8770. @example
  8771. #+CAPTION: The logo of Org mode
  8772. #+LABEL: unicorn-svg
  8773. #+ATTR_DOCBOOK: scalefit="1" width="100%" depth="100%"
  8774. [[./img/org-mode-unicorn.svg]]
  8775. @end example
  8776. @vindex org-export-docbook-inline-image-extensions
  8777. By default, DocBook exporter recognizes the following image file types:
  8778. @file{jpeg}, @file{jpg}, @file{png}, @file{gif}, and @file{svg}. You can
  8779. customize variable @code{org-export-docbook-inline-image-extensions} to add
  8780. more types to this list as long as DocBook supports them.
  8781. @node Special characters, , Images in DocBook export, DocBook export
  8782. @subsection Special characters in DocBook export
  8783. @cindex Special characters in DocBook export
  8784. @vindex org-export-docbook-doctype
  8785. @vindex org-html-entities
  8786. Special characters that are written in @TeX{}-like syntax, such as @code{\alpha},
  8787. @code{\Gamma}, and @code{\Zeta}, are supported by DocBook exporter. These
  8788. characters are rewritten to XML entities, like @code{&alpha;},
  8789. @code{&Gamma;}, and @code{&Zeta;}, based on the list saved in variable
  8790. @code{org-html-entities}. As long as the generated DocBook file includes the
  8791. corresponding entities, these special characters are recognized.
  8792. You can customize variable @code{org-export-docbook-doctype} to include the
  8793. entities you need. For example, you can set variable
  8794. @code{org-export-docbook-doctype} to the following value to recognize all
  8795. special characters included in XHTML entities:
  8796. @example
  8797. "<!DOCTYPE article [
  8798. <!ENTITY % xhtml1-symbol PUBLIC
  8799. \"-//W3C//ENTITIES Symbol for HTML//EN//XML\"
  8800. \"http://www.w3.org/2003/entities/2007/xhtml1-symbol.ent\"
  8801. >
  8802. %xhtml1-symbol;
  8803. ]>
  8804. "
  8805. @end example
  8806. @node Freemind export, XOXO export, DocBook export, Exporting
  8807. @section Freemind export
  8808. @cindex Freemind export
  8809. @cindex mind map
  8810. The freemind exporter was written by Lennart Borgman.
  8811. @table @kbd
  8812. @kindex C-c C-e m
  8813. @item C-c C-e m
  8814. Export as Freemind mind map @file{myfile.mm}.
  8815. @end table
  8816. @node XOXO export, iCalendar export, Freemind export, Exporting
  8817. @section XOXO export
  8818. @cindex XOXO export
  8819. Org mode contains an exporter that produces XOXO-style output.
  8820. Currently, this exporter only handles the general outline structure and
  8821. does not interpret any additional Org-mode features.
  8822. @table @kbd
  8823. @kindex C-c C-e x
  8824. @item C-c C-e x
  8825. Export as XOXO file @file{myfile.html}.
  8826. @kindex C-c C-e v
  8827. @item C-c C-e v x
  8828. Export only the visible part of the document.
  8829. @end table
  8830. @node iCalendar export, , XOXO export, Exporting
  8831. @section iCalendar export
  8832. @cindex iCalendar export
  8833. @vindex org-icalendar-include-todo
  8834. @vindex org-icalendar-use-deadline
  8835. @vindex org-icalendar-use-scheduled
  8836. @vindex org-icalendar-categories
  8837. Some people use Org mode for keeping track of projects, but still prefer a
  8838. standard calendar application for anniversaries and appointments. In this
  8839. case it can be useful to show deadlines and other time-stamped items in Org
  8840. files in the calendar application. Org mode can export calendar information
  8841. in the standard iCalendar format. If you also want to have TODO entries
  8842. included in the export, configure the variable
  8843. @code{org-icalendar-include-todo}. Plain timestamps are exported as VEVENT,
  8844. and TODO items as VTODO. It will also create events from deadlines that are
  8845. in non-TODO items. Deadlines and scheduling dates in TODO items will be used
  8846. to set the start and due dates for the TODO entry@footnote{See the variables
  8847. @code{org-icalendar-use-deadline} and @code{org-icalendar-use-scheduled}.}.
  8848. As categories, it will use the tags locally defined in the heading, and the
  8849. file/tree category@footnote{To add inherited tags or the TODO state,
  8850. configure the variable @code{org-icalendar-categories}.}.
  8851. @vindex org-icalendar-store-UID
  8852. @cindex property, ID
  8853. The iCalendar standard requires each entry to have a globally unique
  8854. identifier (UID). Org creates these identifiers during export. If you set
  8855. the variable @code{org-icalendar-store-UID}, the UID will be stored in the
  8856. @code{:ID:} property of the entry and re-used next time you report this
  8857. entry. Since a single entry can give rise to multiple iCalendar entries (as
  8858. a timestamp, a deadline, a scheduled item, and as a TODO item), Org adds
  8859. prefixes to the UID, depending on what triggered the inclusion of the entry.
  8860. In this way the UID remains unique, but a synchronization program can still
  8861. figure out from which entry all the different instances originate.
  8862. @table @kbd
  8863. @kindex C-c C-e i
  8864. @item C-c C-e i
  8865. Create iCalendar entries for the current file and store them in the same
  8866. directory, using a file extension @file{.ics}.
  8867. @kindex C-c C-e I
  8868. @item C-c C-e I
  8869. @vindex org-agenda-files
  8870. Like @kbd{C-c C-e i}, but do this for all files in
  8871. @code{org-agenda-files}. For each of these files, a separate iCalendar
  8872. file will be written.
  8873. @kindex C-c C-e c
  8874. @item C-c C-e c
  8875. @vindex org-combined-agenda-icalendar-file
  8876. Create a single large iCalendar file from all files in
  8877. @code{org-agenda-files} and write it to the file given by
  8878. @code{org-combined-agenda-icalendar-file}.
  8879. @end table
  8880. @vindex org-use-property-inheritance
  8881. @vindex org-icalendar-include-body
  8882. @cindex property, SUMMARY
  8883. @cindex property, DESCRIPTION
  8884. @cindex property, LOCATION
  8885. The export will honor SUMMARY, DESCRIPTION and LOCATION@footnote{The LOCATION
  8886. property can be inherited from higher in the hierarchy if you configure
  8887. @code{org-use-property-inheritance} accordingly.} properties if the selected
  8888. entries have them. If not, the summary will be derived from the headline,
  8889. and the description from the body (limited to
  8890. @code{org-icalendar-include-body} characters).
  8891. How this calendar is best read and updated, depends on the application
  8892. you are using. The FAQ covers this issue.
  8893. @node Publishing, Working With Source Code, Exporting, Top
  8894. @chapter Publishing
  8895. @cindex publishing
  8896. @cindex O'Toole, David
  8897. Org includes a publishing management system that allows you to configure
  8898. automatic HTML conversion of @emph{projects} composed of interlinked org
  8899. files. You can also configure Org to automatically upload your exported HTML
  8900. pages and related attachments, such as images and source code files, to a web
  8901. server.
  8902. You can also use Org to convert files into PDF, or even combine HTML and PDF
  8903. conversion so that files are available in both formats on the server.
  8904. Publishing has been contributed to Org by David O'Toole.
  8905. @menu
  8906. * Configuration:: Defining projects
  8907. * Uploading files:: How to get files up on the server
  8908. * Sample configuration:: Example projects
  8909. * Triggering publication:: Publication commands
  8910. @end menu
  8911. @node Configuration, Uploading files, Publishing, Publishing
  8912. @section Configuration
  8913. Publishing needs significant configuration to specify files, destination
  8914. and many other properties of a project.
  8915. @menu
  8916. * Project alist:: The central configuration variable
  8917. * Sources and destinations:: From here to there
  8918. * Selecting files:: What files are part of the project?
  8919. * Publishing action:: Setting the function doing the publishing
  8920. * Publishing options:: Tweaking HTML export
  8921. * Publishing links:: Which links keep working after publishing?
  8922. * Sitemap:: Generating a list of all pages
  8923. * Generating an index:: An index that reaches across pages
  8924. @end menu
  8925. @node Project alist, Sources and destinations, Configuration, Configuration
  8926. @subsection The variable @code{org-publish-project-alist}
  8927. @cindex org-publish-project-alist
  8928. @cindex projects, for publishing
  8929. @vindex org-publish-project-alist
  8930. Publishing is configured almost entirely through setting the value of one
  8931. variable, called @code{org-publish-project-alist}. Each element of the list
  8932. configures one project, and may be in one of the two following forms:
  8933. @lisp
  8934. ("project-name" :property value :property value ...)
  8935. @r{or}
  8936. ("project-name" :components ("project-name" "project-name" ...))
  8937. @end lisp
  8938. In both cases, projects are configured by specifying property values. A
  8939. project defines the set of files that will be published, as well as the
  8940. publishing configuration to use when publishing those files. When a project
  8941. takes the second form listed above, the individual members of the
  8942. @code{:components} property are taken to be sub-projects, which group
  8943. together files requiring different publishing options. When you publish such
  8944. a ``meta-project'', all the components will also be published, in the
  8945. sequence given.
  8946. @node Sources and destinations, Selecting files, Project alist, Configuration
  8947. @subsection Sources and destinations for files
  8948. @cindex directories, for publishing
  8949. Most properties are optional, but some should always be set. In
  8950. particular, Org needs to know where to look for source files,
  8951. and where to put published files.
  8952. @multitable @columnfractions 0.3 0.7
  8953. @item @code{:base-directory}
  8954. @tab Directory containing publishing source files
  8955. @item @code{:publishing-directory}
  8956. @tab Directory where output files will be published. You can directly
  8957. publish to a webserver using a file name syntax appropriate for
  8958. the Emacs @file{tramp} package. Or you can publish to a local directory and
  8959. use external tools to upload your website (@pxref{Uploading files}).
  8960. @item @code{:preparation-function}
  8961. @tab Function or list of functions to be called before starting the
  8962. publishing process, for example, to run @code{make} for updating files to be
  8963. published. The project property list is scoped into this call as the
  8964. variable @code{project-plist}.
  8965. @item @code{:completion-function}
  8966. @tab Function or list of functions called after finishing the publishing
  8967. process, for example, to change permissions of the resulting files. The
  8968. project property list is scoped into this call as the variable
  8969. @code{project-plist}.
  8970. @end multitable
  8971. @noindent
  8972. @node Selecting files, Publishing action, Sources and destinations, Configuration
  8973. @subsection Selecting files
  8974. @cindex files, selecting for publishing
  8975. By default, all files with extension @file{.org} in the base directory
  8976. are considered part of the project. This can be modified by setting the
  8977. properties
  8978. @multitable @columnfractions 0.25 0.75
  8979. @item @code{:base-extension}
  8980. @tab Extension (without the dot!) of source files. This actually is a
  8981. regular expression. Set this to the symbol @code{any} if you want to get all
  8982. files in @code{:base-directory}, even without extension.
  8983. @item @code{:exclude}
  8984. @tab Regular expression to match file names that should not be
  8985. published, even though they have been selected on the basis of their
  8986. extension.
  8987. @item @code{:include}
  8988. @tab List of files to be included regardless of @code{:base-extension}
  8989. and @code{:exclude}.
  8990. @end multitable
  8991. @node Publishing action, Publishing options, Selecting files, Configuration
  8992. @subsection Publishing action
  8993. @cindex action, for publishing
  8994. Publishing means that a file is copied to the destination directory and
  8995. possibly transformed in the process. The default transformation is to export
  8996. Org files as HTML files, and this is done by the function
  8997. @code{org-publish-org-to-html} which calls the HTML exporter (@pxref{HTML
  8998. export}). But you also can publish your content as PDF files using
  8999. @code{org-publish-org-to-pdf}. If you want to publish the Org file itself,
  9000. but with @i{archived}, @i{commented}, and @i{tag-excluded} trees removed, use
  9001. @code{org-publish-org-to-org} and set the parameters @code{:plain-source}
  9002. and/or @code{:htmlized-source}. This will produce @file{file.org} and
  9003. @file{file.org.html} in the publishing
  9004. directory@footnote{@file{file-source.org} and @file{file-source.org.html} if
  9005. source and publishing directories are equal. Note that with this kind of
  9006. setup, you need to add @code{:exclude "-source\\.org"} to the project
  9007. definition in @code{org-publish-project-alist} to avoid that the published
  9008. source files will be considered as new org files the next time the project is
  9009. published.}. Other files like images only
  9010. need to be copied to the publishing destination, for this you may use
  9011. @code{org-publish-attachment}. For non-Org files, you always need to
  9012. specify the publishing function:
  9013. @multitable @columnfractions 0.3 0.7
  9014. @item @code{:publishing-function}
  9015. @tab Function executing the publication of a file. This may also be a
  9016. list of functions, which will all be called in turn.
  9017. @item @code{:plain-source}
  9018. @tab Non-nil means, publish plain source.
  9019. @item @code{:htmlized-source}
  9020. @tab Non-nil means, publish htmlized source.
  9021. @end multitable
  9022. The function must accept three arguments: a property list containing at least
  9023. a @code{:publishing-directory} property, the name of the file to be
  9024. published, and the path to the publishing directory of the output file. It
  9025. should take the specified file, make the necessary transformation (if any)
  9026. and place the result into the destination folder.
  9027. @node Publishing options, Publishing links, Publishing action, Configuration
  9028. @subsection Options for the HTML/La@TeX{} exporters
  9029. @cindex options, for publishing
  9030. The property list can be used to set many export options for the HTML
  9031. and La@TeX{} exporters. In most cases, these properties correspond to user
  9032. variables in Org. The table below lists these properties along
  9033. with the variable they belong to. See the documentation string for the
  9034. respective variable for details.
  9035. @vindex org-export-html-link-up
  9036. @vindex org-export-html-link-home
  9037. @vindex org-export-default-language
  9038. @vindex org-display-custom-times
  9039. @vindex org-export-headline-levels
  9040. @vindex org-export-with-section-numbers
  9041. @vindex org-export-section-number-format
  9042. @vindex org-export-with-toc
  9043. @vindex org-export-preserve-breaks
  9044. @vindex org-export-with-archived-trees
  9045. @vindex org-export-with-emphasize
  9046. @vindex org-export-with-sub-superscripts
  9047. @vindex org-export-with-special-strings
  9048. @vindex org-export-with-footnotes
  9049. @vindex org-export-with-drawers
  9050. @vindex org-export-with-tags
  9051. @vindex org-export-with-todo-keywords
  9052. @vindex org-export-with-priority
  9053. @vindex org-export-with-TeX-macros
  9054. @vindex org-export-with-LaTeX-fragments
  9055. @vindex org-export-skip-text-before-1st-heading
  9056. @vindex org-export-with-fixed-width
  9057. @vindex org-export-with-timestamps
  9058. @vindex org-export-author-info
  9059. @vindex org-export-email
  9060. @vindex org-export-creator-info
  9061. @vindex org-export-with-tables
  9062. @vindex org-export-highlight-first-table-line
  9063. @vindex org-export-html-style-include-default
  9064. @vindex org-export-html-style
  9065. @vindex org-export-html-style-extra
  9066. @vindex org-export-html-link-org-files-as-html
  9067. @vindex org-export-html-inline-images
  9068. @vindex org-export-html-extension
  9069. @vindex org-export-html-table-tag
  9070. @vindex org-export-html-expand
  9071. @vindex org-export-html-with-timestamp
  9072. @vindex org-export-publishing-directory
  9073. @vindex org-export-html-preamble
  9074. @vindex org-export-html-postamble
  9075. @vindex org-export-html-auto-preamble
  9076. @vindex org-export-html-auto-postamble
  9077. @vindex user-full-name
  9078. @vindex user-mail-address
  9079. @vindex org-export-select-tags
  9080. @vindex org-export-exclude-tags
  9081. @multitable @columnfractions 0.32 0.68
  9082. @item @code{:link-up} @tab @code{org-export-html-link-up}
  9083. @item @code{:link-home} @tab @code{org-export-html-link-home}
  9084. @item @code{:language} @tab @code{org-export-default-language}
  9085. @item @code{:customtime} @tab @code{org-display-custom-times}
  9086. @item @code{:headline-levels} @tab @code{org-export-headline-levels}
  9087. @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
  9088. @item @code{:section-number-format} @tab @code{org-export-section-number-format}
  9089. @item @code{:table-of-contents} @tab @code{org-export-with-toc}
  9090. @item @code{:preserve-breaks} @tab @code{org-export-preserve-breaks}
  9091. @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
  9092. @item @code{:emphasize} @tab @code{org-export-with-emphasize}
  9093. @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
  9094. @item @code{:special-strings} @tab @code{org-export-with-special-strings}
  9095. @item @code{:footnotes} @tab @code{org-export-with-footnotes}
  9096. @item @code{:drawers} @tab @code{org-export-with-drawers}
  9097. @item @code{:tags} @tab @code{org-export-with-tags}
  9098. @item @code{:todo-keywords} @tab @code{org-export-with-todo-keywords}
  9099. @item @code{:priority} @tab @code{org-export-with-priority}
  9100. @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
  9101. @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
  9102. @item @code{:latex-listings} @tab @code{org-export-latex-listings}
  9103. @item @code{:skip-before-1st-heading} @tab @code{org-export-skip-text-before-1st-heading}
  9104. @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
  9105. @item @code{:timestamps} @tab @code{org-export-with-timestamps}
  9106. @item @code{:author-info} @tab @code{org-export-author-info}
  9107. @item @code{:email-info} @tab @code{org-export-email-info}
  9108. @item @code{:creator-info} @tab @code{org-export-creator-info}
  9109. @item @code{:tables} @tab @code{org-export-with-tables}
  9110. @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
  9111. @item @code{:style-include-default} @tab @code{org-export-html-style-include-default}
  9112. @item @code{:style} @tab @code{org-export-html-style}
  9113. @item @code{:style-extra} @tab @code{org-export-html-style-extra}
  9114. @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
  9115. @item @code{:inline-images} @tab @code{org-export-html-inline-images}
  9116. @item @code{:html-extension} @tab @code{org-export-html-extension}
  9117. @item @code{:xml-declaration} @tab @code{org-export-html-xml-declaration}
  9118. @item @code{:html-table-tag} @tab @code{org-export-html-table-tag}
  9119. @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
  9120. @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
  9121. @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
  9122. @item @code{:preamble} @tab @code{org-export-html-preamble}
  9123. @item @code{:postamble} @tab @code{org-export-html-postamble}
  9124. @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
  9125. @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
  9126. @item @code{:author} @tab @code{user-full-name}
  9127. @item @code{:email} @tab @code{user-mail-address} : @code{addr;addr;..}
  9128. @item @code{:select-tags} @tab @code{org-export-select-tags}
  9129. @item @code{:exclude-tags} @tab @code{org-export-exclude-tags}
  9130. @item @code{:latex-image-options} @tab @code{org-export-latex-image-default-option}
  9131. @end multitable
  9132. Most of the @code{org-export-with-*} variables have the same effect in
  9133. both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
  9134. @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
  9135. La@TeX{} export.
  9136. @vindex org-publish-project-alist
  9137. When a property is given a value in @code{org-publish-project-alist},
  9138. its setting overrides the value of the corresponding user variable (if
  9139. any) during publishing. Options set within a file (@pxref{Export
  9140. options}), however, override everything.
  9141. @node Publishing links, Sitemap, Publishing options, Configuration
  9142. @subsection Links between published files
  9143. @cindex links, publishing
  9144. To create a link from one Org file to another, you would use
  9145. something like @samp{[[file:foo.org][The foo]]} or simply
  9146. @samp{file:foo.org.} (@pxref{Hyperlinks}). When published, this link
  9147. becomes a link to @file{foo.html}. In this way, you can interlink the
  9148. pages of your "org web" project and the links will work as expected when
  9149. you publish them to HTML. If you also publish the Org source file and want
  9150. to link to that, use an @code{http:} link instead of a @code{file:} link,
  9151. because @code{file:} links are converted to link to the corresponding
  9152. @file{html} file.
  9153. You may also link to related files, such as images. Provided you are careful
  9154. with relative file names, and provided you have also configured Org to upload
  9155. the related files, these links will work too. See @ref{Complex example}, for
  9156. an example of this usage.
  9157. Sometimes an Org file to be published may contain links that are
  9158. only valid in your production environment, but not in the publishing
  9159. location. In this case, use the property
  9160. @multitable @columnfractions 0.4 0.6
  9161. @item @code{:link-validation-function}
  9162. @tab Function to validate links
  9163. @end multitable
  9164. @noindent
  9165. to define a function for checking link validity. This function must
  9166. accept two arguments, the file name and a directory relative to which
  9167. the file name is interpreted in the production environment. If this
  9168. function returns @code{nil}, then the HTML generator will only insert a
  9169. description into the HTML file, but no link. One option for this
  9170. function is @code{org-publish-validate-link} which checks if the given
  9171. file is part of any project in @code{org-publish-project-alist}.
  9172. @node Sitemap, Generating an index, Publishing links, Configuration
  9173. @subsection Generating a sitemap
  9174. @cindex sitemap, of published pages
  9175. The following properties may be used to control publishing of
  9176. a map of files for a given project.
  9177. @multitable @columnfractions 0.25 0.75
  9178. @item @code{:auto-sitemap}
  9179. @tab When non-nil, publish a sitemap during @code{org-publish-current-project}
  9180. or @code{org-publish-all}.
  9181. @item @code{:sitemap-filename}
  9182. @tab Filename for output of sitemap. Defaults to @file{sitemap.org} (which
  9183. becomes @file{sitemap.html}).
  9184. @item @code{:sitemap-title}
  9185. @tab Title of sitemap page. Defaults to name of file.
  9186. @item @code{:sitemap-function}
  9187. @tab Plug-in function to use for generation of the sitemap.
  9188. Defaults to @code{org-publish-org-sitemap}, which generates a plain list
  9189. of links to all files in the project.
  9190. @end multitable
  9191. @node Generating an index, , Sitemap, Configuration
  9192. @subsection Generating an index
  9193. @cindex index, in a publishing project
  9194. Org-mode can generate an index across the files of a publishing project.
  9195. @multitable @columnfractions 0.25 0.75
  9196. @item @code{:makeindex}
  9197. @tab When non-nil, generate in index in the file @file{theindex.org} and
  9198. publish it as @file{theindex.html}.
  9199. @end multitable
  9200. The file will be create when first publishing a project with the
  9201. @code{:makeindex} set. The file only contains a statement @code{#+include:
  9202. "theindex.inc"}. You can then built around this include statement by adding
  9203. a title, style information etc.
  9204. @node Uploading files, Sample configuration, Configuration, Publishing
  9205. @section Uploading files
  9206. @cindex rsync
  9207. @cindex unison
  9208. For those people already utilizing third party sync tools such as
  9209. @command{rsync} or @command{unison}, it might be preferable not to use the built in
  9210. @i{remote} publishing facilities of Org mode which rely heavily on
  9211. Tramp. Tramp, while very useful and powerful, tends not to be
  9212. so efficient for multiple file transfer and has been known to cause problems
  9213. under heavy usage.
  9214. Specialized synchronization utilities offer several advantages. In addition
  9215. to timestamp comparison, they also do content and permissions/attribute
  9216. checks. For this reason you might prefer to publish your web to a local
  9217. directory (possibly even @i{in place} with your Org files) and then use
  9218. @file{unison} or @file{rsync} to do the synchronization with the remote host.
  9219. Since Unison (for example) can be configured as to which files to transfer to
  9220. a certain remote destination, it can greatly simplify the project publishing
  9221. definition. Simply keep all files in the correct location, process your Org
  9222. files with @code{org-publish} and let the synchronization tool do the rest.
  9223. You do not need, in this scenario, to include attachments such as @file{jpg},
  9224. @file{css} or @file{gif} files in the project definition since the 3rd party
  9225. tool syncs them.
  9226. Publishing to a local directory is also much faster than to a remote one, so
  9227. that you can afford more easily to republish entire projects. If you set
  9228. @code{org-publish-use-timestamps-flag} to @code{nil}, you gain the main
  9229. benefit of re-including any changed external files such as source example
  9230. files you might include with @code{#+INCLUDE}. The timestamp mechanism in
  9231. Org is not smart enough to detect if included files have been modified.
  9232. @node Sample configuration, Triggering publication, Uploading files, Publishing
  9233. @section Sample configuration
  9234. Below we provide two example configurations. The first one is a simple
  9235. project publishing only a set of Org files. The second example is
  9236. more complex, with a multi-component project.
  9237. @menu
  9238. * Simple example:: One-component publishing
  9239. * Complex example:: A multi-component publishing example
  9240. @end menu
  9241. @node Simple example, Complex example, Sample configuration, Sample configuration
  9242. @subsection Example: simple publishing configuration
  9243. This example publishes a set of Org files to the @file{public_html}
  9244. directory on the local machine.
  9245. @lisp
  9246. (setq org-publish-project-alist
  9247. '(("org"
  9248. :base-directory "~/org/"
  9249. :publishing-directory "~/public_html"
  9250. :section-numbers nil
  9251. :table-of-contents nil
  9252. :style "<link rel=\"stylesheet\"
  9253. href=\"../other/mystyle.css\"
  9254. type=\"text/css\"/>")))
  9255. @end lisp
  9256. @node Complex example, , Simple example, Sample configuration
  9257. @subsection Example: complex publishing configuration
  9258. This more complicated example publishes an entire website, including
  9259. Org files converted to HTML, image files, Emacs Lisp source code, and
  9260. style sheets. The publishing directory is remote and private files are
  9261. excluded.
  9262. To ensure that links are preserved, care should be taken to replicate
  9263. your directory structure on the web server, and to use relative file
  9264. paths. For example, if your Org files are kept in @file{~/org} and your
  9265. publishable images in @file{~/images}, you'd link to an image with
  9266. @c
  9267. @example
  9268. file:../images/myimage.png
  9269. @end example
  9270. @c
  9271. On the web server, the relative path to the image should be the
  9272. same. You can accomplish this by setting up an "images" folder in the
  9273. right place on the web server, and publishing images to it.
  9274. @lisp
  9275. (setq org-publish-project-alist
  9276. '(("orgfiles"
  9277. :base-directory "~/org/"
  9278. :base-extension "org"
  9279. :publishing-directory "/ssh:user@@host:~/html/notebook/"
  9280. :publishing-function org-publish-org-to-html
  9281. :exclude "PrivatePage.org" ;; regexp
  9282. :headline-levels 3
  9283. :section-numbers nil
  9284. :table-of-contents nil
  9285. :style "<link rel=\"stylesheet\"
  9286. href=\"../other/mystyle.css\" type=\"text/css\"/>"
  9287. :auto-preamble t
  9288. :auto-postamble nil)
  9289. ("images"
  9290. :base-directory "~/images/"
  9291. :base-extension "jpg\\|gif\\|png"
  9292. :publishing-directory "/ssh:user@@host:~/html/images/"
  9293. :publishing-function org-publish-attachment)
  9294. ("other"
  9295. :base-directory "~/other/"
  9296. :base-extension "css\\|el"
  9297. :publishing-directory "/ssh:user@@host:~/html/other/"
  9298. :publishing-function org-publish-attachment)
  9299. ("website" :components ("orgfiles" "images" "other"))))
  9300. @end lisp
  9301. @node Triggering publication, , Sample configuration, Publishing
  9302. @section Triggering publication
  9303. Once properly configured, Org can publish with the following commands:
  9304. @table @kbd
  9305. @kindex C-c C-e C
  9306. @item C-c C-e C
  9307. Prompt for a specific project and publish all files that belong to it.
  9308. @kindex C-c C-e P
  9309. @item C-c C-e P
  9310. Publish the project containing the current file.
  9311. @kindex C-c C-e F
  9312. @item C-c C-e F
  9313. Publish only the current file.
  9314. @kindex C-c C-e E
  9315. @item C-c C-e E
  9316. Publish every project.
  9317. @end table
  9318. @vindex org-publish-use-timestamps-flag
  9319. Org uses timestamps to track when a file has changed. The above functions
  9320. normally only publish changed files. You can override this and force
  9321. publishing of all files by giving a prefix argument to any of the commands
  9322. above, or by customizing the variable @code{org-publish-use-timestamps-flag}.
  9323. This may be necessary in particular if files include other files via
  9324. @code{#+SETUPFILE:} or @code{#+INCLUDE:}.
  9325. @node Working With Source Code, Miscellaneous, Publishing, Top
  9326. @comment node-name, next, previous, up
  9327. @comment Working With Source Code, Miscellaneous, Publishing, Top
  9328. @chapter ``Working With Source Code'' or ``Embedded Source Code''
  9329. Source code can be included in Org-mode documents using a @samp{src} block:
  9330. @example
  9331. #+BEGIN_SRC emacs-lisp
  9332. (defun org-xor (a b)
  9333. "Exclusive or."
  9334. (if a (not b) b))
  9335. #+END_SRC
  9336. @end example
  9337. Org provides the following features for working with blocks of code:
  9338. @itemize @bullet
  9339. @item
  9340. Editing in the appropriate Emacs major-mode (@ref{Editing Source Code})
  9341. @item
  9342. Export with appropriate markup (@ref{Exporting Code Blocks})
  9343. @item
  9344. Extraction (``tangling'') into pure code files. (@ref{Extracting Source Code})
  9345. @item
  9346. Code execution, with results captured in the Org buffer (@ref{Evaluating Code Blocks})
  9347. @item
  9348. Using code blocks in table formulas
  9349. @end itemize
  9350. @menu
  9351. * Structure of Code Blocks::
  9352. * Editing Source Code::
  9353. * Exporting Code Blocks::
  9354. * Extracting Source Code::
  9355. * Evaluating Code Blocks::
  9356. @end menu
  9357. @node Structure of Code Blocks, Editing Source Code, Working With Source Code, Working With Source Code
  9358. @comment node-name, next, previous, up
  9359. @comment Structure of Code Blocks, Editing Source Code, Working With Source Code, Working With Source Code
  9360. @section Structure of Code Blocks
  9361. The structure of code blocks is as follows:
  9362. @example
  9363. #+srcname: <name>
  9364. #+begin_src <language> <switches> <header arguments>
  9365. <body>
  9366. #+end_src
  9367. @end example
  9368. @table @code
  9369. @item <name>
  9370. An optional name for the block (see @ref{Evaluating Code Blocks})
  9371. @item <language>
  9372. The language of the code in the block.
  9373. @item <switches>
  9374. Optional links FIXME link/relocate switches discussion in @ref{Literal examples}
  9375. @item <header arguments>
  9376. Optional header arguments control many aspects of evaluation, export and
  9377. tangling of source code blocks. See the [[header-arguments][Header
  9378. Arguments]] section. Header arguments can also be set on a per-buffer or
  9379. per-subtree basis using properties.
  9380. @item <body>
  9381. The code
  9382. @end table
  9383. @node Editing Source Code, Exporting Code Blocks, Structure of Code Blocks, Working With Source Code
  9384. @comment node-name, next, previous, up
  9385. @comment Editing Source Code, Exporting Code Blocks, Structure of Code Blocks, Working With Source Code
  9386. @section Editing Source Code
  9387. Use @kbd{C-c '} to edit the code block at point. This brings up a language
  9388. major-mode edit buffer containing the body of the code block. Saving this
  9389. buffer will write the new contents back to the Org buffer. Use @kbd{C-c '}
  9390. again to exit.
  9391. The edit buffer has a minor mode active called @code{org-src-mode}. The
  9392. following variables can be used to configure the behavior of the edit
  9393. buffer. See also the customization group @code{org-edit-structure} for futher
  9394. configuration options.
  9395. @table @code
  9396. @item org-src-lang-modes
  9397. If an emacs major-mode named @code{<lang>-mode} exists, where
  9398. @code{<lang>} is the language named in the header line of the code block,
  9399. then the edit buffer will be placed in that major-mode. This variable
  9400. can be used to map arbitrary language names to existing major modes.
  9401. @item org-src-window-setup
  9402. Controls the way Emacs windows are rearranged when the edit buffer is created.
  9403. @item org-src-preserve-indentation
  9404. This variable is expecially useful for tangling languages such as
  9405. python, in which whitespace indentation in the output is critical.
  9406. @item org-src-ask-before-returning-to-edit-buffer
  9407. By default, Org will ask before returning to an open edit buffer. Set
  9408. to a non-nil value to switch without asking.
  9409. @end table
  9410. @node Exporting Code Blocks, Extracting Source Code, Editing Source Code, Working With Source Code
  9411. @comment node-name, next, previous, up
  9412. @comment Exporting Code Blocks, Extracting Source Code, Editing Source Code, Working With Source Code
  9413. @section Exporting Code Blocks
  9414. By default, code blocks export to HTML with the appearance of the fontified
  9415. language major-mode Emacs buffer
  9416. FIXME: say something more knowledgable about the HTML/CSS output.
  9417. A similar effect is possible with LaTeX if you turn on
  9418. the option @code{org-export-latex-listings} and make sure that the listings
  9419. package is included by the LaTeX header FIXME: be more specific about latex
  9420. config.
  9421. FIXME: This duplicated discussion in @ref{Literal examples}. Add
  9422. documentation of relevant switches.
  9423. The @code{:exports} header argument can be used to specify non-default export behavior:
  9424. @table @code
  9425. @item :exports results
  9426. On export, the code block will be executed and the block will be replaced by
  9427. the results of the code block (as determined by the values of other header
  9428. arguments such as @code{results} and @code{file}.
  9429. @item :exports both
  9430. On export, the code block will be executed and the exported material will
  9431. contain the code, followed by the results.
  9432. @item :exports code
  9433. The default. The body of the code block is exported as described above.
  9434. @end table
  9435. @node Extracting Source Code, Evaluating Code Blocks, Exporting Code Blocks, Working With Source Code
  9436. @comment node-name, next, previous, up
  9437. @comment Extracting Source Code, Evaluating Code Blocks, Exporting Code Blocks, Working With Source Code
  9438. @section Extracting Source Code
  9439. Creating monolingual code files by extracting code from source blocks is
  9440. referred to as ``tangling''.
  9441. Header arguments:
  9442. @table @code
  9443. @item :tangle no
  9444. The default.
  9445. @item :tangle yes
  9446. Include block in tangled output. The output file name is the name of the org
  9447. file with the extension @samp{.org} replaced by the extension for the block language.
  9448. @item :tangle filename
  9449. Include block in tangled output to file @samp{filename}
  9450. @end table
  9451. Functions:
  9452. @table @code
  9453. @item org-babel-tangle @key{C-c M-b t}
  9454. Tangle the current file
  9455. @item org-babel-tangle-file
  9456. Choose a file to tangle
  9457. @end table
  9458. Variables:
  9459. @table @code
  9460. @item org-babel-tangle-langs
  9461. FIXME: This variable may have been changed recently
  9462. @end table
  9463. @node Evaluating Code Blocks, , Extracting Source Code, Working With Source Code
  9464. @comment node-name, next, previous, up
  9465. @comment Evaluating Code Blocks, , Extracting Source Code, Working With Source Code
  9466. @section Evaluating Code Blocks
  9467. For many languages, blocks of code can be evaluated, with the results being
  9468. returned to the org buffer (or linked to from the org buffer).
  9469. FIXME: Are we going to use ``evaluate'' or ``execute''
  9470. This syntax can be expanded by naming the source code block.
  9471. @example
  9472. #+sourcename
  9473. #+begin_src language header-arguments switches
  9474. body
  9475. #+end_src
  9476. @end example
  9477. - name :: This name is associated with the source code block. This is
  9478. similar to the =#+tblname= lines that can be used to name tables
  9479. in Org-mode files. Referencing the name of a source code
  9480. block makes it possible to evaluate the block from other places in
  9481. the file, other files, or inside Org-mode tables. It
  9482. is also possible to pass arguments to a source code block through
  9483. this =#+source:= line (see [[alternate-argument-syntax][Alternate argument syntax]]).
  9484. @subsection Library of Babel
  9485. [[file:library-of-babel.org][Library of Babel]] functions can be called using the following syntax.
  9486. @example
  9487. #+lob: R-plot(data=R-plot-example-data)
  9488. @end example
  9489. @subsection Aliases
  9490. Keyword aliases are intended to make Org-babel feel natural to
  9491. programmers fluent in a variety of languages. For example,
  9492. @example
  9493. #+srcname: alias-example
  9494. #+begin_src emacs-lisp
  9495. '((call lob)
  9496. (source function srcname)
  9497. (results resname))
  9498. #+end_src
  9499. #+results: alias-example
  9500. | call | lob | |
  9501. | source | function | srcname |
  9502. | results | resname | |
  9503. @end example
  9504. - =#+srcname:= can be replaced with either of two aliases, =#+source:= or =#+function:=.
  9505. - =#+results:= can be replaced with its alias, =#+resname:=.
  9506. When calling Library of Babel functions, as in the following
  9507. example, there are two acceptable keywords. The =#+lob= call in
  9508. the example could be replaced with its alias, =#+call=.
  9509. @example
  9510. #+lob: R-plot(data=R-plot-example-data)
  9511. @end example
  9512. @subsection Languages
  9513. :PROPERTIES:
  9514. :CUSTOM_ID: languages
  9515. :END:
  9516. Org-babel can evaluate/execute/compile the following languages. See the
  9517. language specific documentation on Worg for details.
  9518. FIXME: How are we going to refer to the external documentation?
  9519. @c BEGIN RECEIVE ORGTBL org-babel-lang-table
  9520. @multitable @columnfractions 0.583 0.417
  9521. @item Language @tab Identifier
  9522. @item Asymptote @tab asymptote
  9523. @item C @tab C
  9524. @item Clojure @tab clojure
  9525. @item css @tab css
  9526. @item ditaa @tab ditaa
  9527. @item Graphviz @tab dot
  9528. @item Emacs Lisp @tab emacs-lisp
  9529. @item gnuplot @tab gnuplot
  9530. @item Haskell @tab haskell
  9531. @item Matlab @tab matlab
  9532. @item LaTeX @tab latex
  9533. @item Objective Caml @tab ocaml
  9534. @item Octave @tab octave
  9535. @item OZ @tab oz
  9536. @item Perl @tab perl
  9537. @item Python @tab python
  9538. @item R @tab R
  9539. @item Ruby @tab ruby
  9540. @item Sass @tab sass
  9541. @item GNU Screen @tab screen
  9542. @item shell @tab sh[fn:1]
  9543. @item SQL @tab sql
  9544. @end multitable
  9545. @c END RECEIVE ORGTBL org-babel-lang-table
  9546. @ignore
  9547. The original table from reference.org is below; I'm just using the first column for now.
  9548. #+ORGTBL: SEND org-babel-lang-table orgtbl-to-texinfo
  9549. | Language | Identifier |
  9550. |----------------+------------|
  9551. | Asymptote | asymptote |
  9552. | C | C |
  9553. | Clojure | clojure |
  9554. | css | css |
  9555. | ditaa | ditaa |
  9556. | Graphviz | dot |
  9557. | Emacs Lisp | emacs-lisp |
  9558. | gnuplot | gnuplot |
  9559. | Haskell | haskell |
  9560. | Matlab | matlab |
  9561. | LaTeX | latex |
  9562. | Objective Caml | ocaml |
  9563. | Octave | octave |
  9564. | OZ | oz |
  9565. | Perl | perl |
  9566. | Python | python |
  9567. | R | R |
  9568. | Ruby | ruby |
  9569. | Sass | sass |
  9570. | GNU Screen | screen |
  9571. | shell | sh[fn:1] |
  9572. | SQL | sql |
  9573. | Language | Documentation | Identifier | Requirements |
  9574. |----------------+---------------------------------------------------------------------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  9575. | Asymptote | org-babel-doc-asymptote | asymptote | [[http://asymptote.sourceforge.net/][asymptote]], [[http://asymptote.sourceforge.net/doc/Editing-modes.html][asy-mode]] |
  9576. | C | [[file:languages/org-babel-doc-C.org][org-babel-doc-C]] | C | none |
  9577. | Clojure | [[file:languages/org-babel-doc-clojure.org][org-babel-doc-clojure]] | clojure | [[http://clojure.org/][clojure]], [[http://www.emacswiki.org/emacs/clojure-mode.el][clojure-mode]], [[http://common-lisp.net/project/slime/][slime]], [[http://clojure.codestuffs.com/][swank-clojure]] |
  9578. | css | org-babel-doc-css | css | none |
  9579. | ditaa | org-babel-doc-ditaa | ditaa | [[http://ditaa.org/ditaa/][ditaa]] (bundled with Org-mode) |
  9580. | Graphviz | org-babel-doc-dot | dot | [[http://www.graphviz.org/][dot]] |
  9581. | Emacs Lisp | org-babel-doc-emacs-lisp | emacs-lisp | none |
  9582. | gnuplot | org-babel-doc-gnuplot | gnuplot | [[http://www.gnuplot.info/][gnuplot]], [[http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html][gnuplot-mode]] |
  9583. | Haskell | org-babel-doc-haskell | haskell | [[http://www.haskell.org/][haskell]], [[http://projects.haskell.org/haskellmode-emacs/][haskell-mode]], [[http://www.haskell.org/haskellwiki/Haskell_mode_for_Emacs#inf-haskell.el:_the_best_thing_since_the_breadknife][inf-haskell]], [[http://people.cs.uu.nl/andres/lhs2tex/][lhs2tex]] |
  9584. | Matlab | [[file:languages/org-babel-doc-octave-matlab.org][org-babel-doc-octave-matlab]] | matlab | matlab, [[http://sourceforge.net/projects/matlab-emacs/][matlab.el]] |
  9585. | LaTeX | [[file:languages/org-babel-doc-LaTeX.org][org-babel-doc-latex]] | latex | [[http://www.latex-project.org/][latex]], [[http://www.gnu.org/software/auctex/][auctex]], [[http://www.gnu.org/software/auctex/reftex.html][reftex]] |
  9586. | Objective Caml | org-babel-doc-ocaml | ocaml | [[http://caml.inria.fr/][ocaml]], [[http://www-rocq.inria.fr/~acohen/tuareg/][tuareg-mode]] |
  9587. | Octave | [[file:languages/org-babel-doc-octave-matlab.org][org-babel-doc-octave-matlab]] | octave | octave |
  9588. | OZ | [[file:languages/org-babel-doc-oz.org][org-babel-doc-oz]] | oz | [[http://www.mozart-oz.org/][Mozart]] which includes a major mode |
  9589. | Perl | org-babel-doc-perl | perl | [[http://www.perl.org/][perl]], [[http://www.emacswiki.org/emacs/CPerlMode][cperl-mode]] (optional) |
  9590. | Python | org-babel-doc-python | python | [[http://www.python.org/][python]], [[https://launchpad.net/python-mode][python-mode]] (optional) |
  9591. | R | [[file:languages/org-babel-doc-R.org][org-babel-doc-R]] | R | [[http://www.r-project.org/][R]], [[http://ess.r-project.org/][ess-mode]] |
  9592. | Ruby | org-babel-doc-ruby | ruby | [[http://www.ruby-lang.org/][ruby]], [[http://www.ruby-lang.org/][irb]], [[http://github.com/eschulte/rinari/raw/master/util/ruby-mode.el][ruby-mode]], [[http://github.com/eschulte/rinari/raw/master/util/inf-ruby.el][inf-ruby mode]] |
  9593. | Sass | org-babel-doc-sass | sass | [[http://sass-lang.com/][sass]], [[http://github.com/nex3/haml/blob/master/extra/sass-mode.el][sass-mode]] |
  9594. | GNU Screen | [[file:languages/org-babel-doc-screen.org][org-babel-doc-screen]] | screen | [[http://www.gnu.org/software/screen/][screen]], a terminal |
  9595. | shell | org-babel-doc-sh | sh[fn:1] | a shell |
  9596. | SQL | org-babel-doc-sql | sql | none |
  9597. @end ignore
  9598. To add support for a particular language to your Org-babel installation
  9599. first make sure that the requirements of the language are met, then add a
  9600. line like the following to your Emacs configuration, (replace "identifier"
  9601. with one of the entries in the Identifier column of the table).
  9602. @example
  9603. (require 'org-babel-identifier)
  9604. @end example
  9605. @section Header Arguments
  9606. :PROPERTIES:
  9607. :CUSTOM_ID: header-arguments
  9608. :END:
  9609. Definitions of all Org-babel header arguments are given
  9610. [[header-argument-specific-documentation][below]]. In addition, some
  9611. languages may add their own header arguments. Please see the
  9612. language-specific documentation for information on language-specific header
  9613. arguments.
  9614. @subsection Using Header Arguments
  9615. The values of header arguments can be set in four different ways, each
  9616. more specific (and having higher priority) than the last.
  9617. @subsubsection System-wide
  9618. :PROPERTIES:
  9619. :CUSTOM_ID: system-wide-header-argument
  9620. :END:
  9621. System-wide values of header arguments can be specified by
  9622. customizing the =org-babel-default-header-args= variable:
  9623. @example
  9624. org-babel-default-header-args is a variable defined in `org-babel.el'.
  9625. Its value is
  9626. ((:session . "none")
  9627. (:results . "replace")
  9628. (:exports . "code")
  9629. (:cache . "no")
  9630. (:noweb . "no"))
  9631. Documentation:
  9632. Default arguments to use when evaluating a source block.
  9633. @end example
  9634. [[#default-noweb]]
  9635. For example, the following example could be used to set the default value
  9636. of =:noweb= header arguments to =yes=. This would have the effect of
  9637. expanding =:noweb= references by default when evaluating source code blocks.
  9638. @example
  9639. (setq org-babel-default-header-args
  9640. (cons '(:noweb . "yes")
  9641. (assq-delete-all :noweb org-babel-default-header-args)))
  9642. @end example
  9643. @subsubsection Org-mode Properties
  9644. Header arguments are also read from
  9645. [[http://orgmode.org/manual/Properties-and-Columns.html#Properties-and-Columns][Org-mode
  9646. properties]], which can be set on a buffer-wide or per-heading basis. An
  9647. example of setting a header argument for all code blocks in a buffer is
  9648. #+begin_example
  9649. #+property: tangle yes
  9650. #+end_example
  9651. When properties are used to set default header arguments, they are looked up
  9652. with inheritance, so the value of the =:cache= header argument will default
  9653. to true in all source code blocks in the subtree rooted at the following
  9654. heading:
  9655. @example
  9656. * outline header
  9657. :PROPERTIES:
  9658. :cache: yes
  9659. :CUSTOM_ID: property-set-header-arguments
  9660. :END:
  9661. @end example
  9662. Properties defined in this way override the properties set in
  9663. =org-babel-default-header-args=. It is convenient to use the
  9664. =org-set-property= function bound to =C-c C-x p= to set properties
  9665. in Org-mode documents.
  9666. @subsubsection Source Code Block
  9667. :PROPERTIES:
  9668. :CUSTOM_ID: single-block-header-arguments
  9669. :END:
  9670. The most common way to assign values to header arguments is at the
  9671. source code block level. This can be done by listing a sequence of
  9672. header arguments and their values as part of the =#+begin_src=
  9673. line. Properties set in this way override both the values of
  9674. =org-babel-default-header-args= and header argument specified as
  9675. properties. In the following example, the
  9676. =:results= header argument is set to =silent=, meaning the results
  9677. of execution will not be inserted in the buffer, and the =:exports=
  9678. header argument is set to =code=, meaning only the body of the
  9679. source code block
  9680. will be preserved on export to HTML or LaTeX.
  9681. @example
  9682. #+source: factorial
  9683. #+begin_src haskell :results silent :exports code
  9684. fac 0 = 1
  9685. fac n = n * fac (n-1)
  9686. #+end_src
  9687. @end example
  9688. @subsection Specific Header Arguments
  9689. :PROPERTIES:
  9690. :CUSTOM_ID: header-argument-specific-documentation
  9691. :END:
  9692. @subsubsection =:var=
  9693. :PROPERTIES:
  9694. :CUSTOM_ID: header-argument-var
  9695. :END:
  9696. The =:var= header argument is used to pass arguments to
  9697. source code blocks. The specifics of how arguments are included
  9698. in a source code block are language specific and are
  9699. addressed in the language-specific documentation. However, the
  9700. syntax used to specify arguments is the same across all
  9701. languages. The values passed to arguments can be or
  9702. - literal values
  9703. - values from org-mode tables
  9704. - the results of other source code blocks
  9705. These values can be indexed in a manner similar to arrays -- see
  9706. [[var-argument-indexing][argument indexing]].
  9707. The following syntax is used to pass arguments to source code
  9708. blocks using the =:var= header argument.
  9709. @example
  9710. :var name=assign
  9711. @end example
  9712. where =assign= can take one of the following forms
  9713. - literal value :: either a string ="string"= or a number =9=.
  9714. - reference :: a table name:
  9715. @example
  9716. #+tblname: example-table
  9717. | 1 |
  9718. | 2 |
  9719. | 3 |
  9720. | 4 |
  9721. #+source: table-length
  9722. #+begin_src emacs-lisp :var table=example-table
  9723. (length table)
  9724. #+end_src
  9725. #+results: table-length
  9726. : 4
  9727. @end example
  9728. a source code block name, as assigned by =#+srcname:=,
  9729. followed by parentheses:
  9730. @example
  9731. #+begin_src emacs-lisp :var length=table-length()
  9732. (* 2 length)
  9733. #+end_src
  9734. #+results:
  9735. : 8
  9736. @end example
  9737. In addition, an argument can be passed to the source code
  9738. block referenced by =:var=. The argument is passed within
  9739. the parentheses following the source code block name:
  9740. @example
  9741. #+source: double
  9742. #+begin_src emacs-lisp :var input=8
  9743. (* 2 input)
  9744. #+end_src
  9745. #+results: double
  9746. : 16
  9747. #+source: squared
  9748. #+begin_src emacs-lisp :var input=double(input=1)
  9749. (* input input)
  9750. #+end_src
  9751. #+results: squared
  9752. : 4
  9753. @end example
  9754. @subsubheading alternate argument syntax
  9755. :PROPERTIES:
  9756. :CUSTOM_ID: alternate-argument-syntax
  9757. :END:
  9758. It is also possible to specify arguments in a potentially more
  9759. natural way using the =#+source:= line of a source code block.
  9760. As in the following example arguments can be packed inside of
  9761. parenthesis following the source name.
  9762. @example
  9763. #+source: double(input=0)
  9764. #+begin_src emacs-lisp
  9765. (* 2 input)
  9766. #+end_src
  9767. @end example
  9768. **** indexable variable values
  9769. :PROPERTIES:
  9770. :CUSTOM_ID: var-argument-indexing
  9771. :END:
  9772. It is possible to assign a portion of a value to a
  9773. variable in a source block. The following example
  9774. assigns the second and third rows of the table
  9775. =example-table= to the variable =data=:
  9776. @example
  9777. :var data=example-table[1:2]
  9778. @end example
  9779. *Note:* ranges are indexed using the =:= operator.
  9780. *Note:* indices are 0 based.
  9781. The following example assigns the second column of the
  9782. first row of =example-table= to =data=:
  9783. @example
  9784. :var data=example-table[0,1]
  9785. @end example
  9786. It is possible to index into the results of source code blocks
  9787. as well as tables. Any number of dimensions can be indexed.
  9788. Dimensions are separated from one another by commas.
  9789. For more information on indexing behavior see the documentation
  9790. for the =org-babel-ref-index-list= function -- provided below.
  9791. @example
  9792. org-babel-ref-index-list is a Lisp function in `org-babel-ref.el'.
  9793. (org-babel-ref-index-list INDEX LIS)
  9794. Return the subset of LIS indexed by INDEX. If INDEX is
  9795. separated by ,s then each PORTION is assumed to index into the
  9796. next deepest nesting or dimension. A valid PORTION can consist
  9797. of either an integer index, or two integers separated by a : in
  9798. which case the entire range is returned.
  9799. @end example
  9800. *Note:* In Emacs, the documentation for any function or variable
  9801. can be read using the =describe-function= (M-x describe
  9802. function) and =describe-variable= (M-x describe variable)
  9803. functions, respectively.
  9804. @subsubsection =:results=
  9805. :PROPERTIES:
  9806. :CUSTOM_ID: header-argument-results
  9807. :END:
  9808. There are three types of results header argument:
  9809. - *collection* header arguments specify how the results should be collected from
  9810. the source code block;
  9811. - *type* header arguments specify what type of result the source code block
  9812. will return -- which has implications for how they will be
  9813. inserted into the Org-mode buffer; and
  9814. - *handling* header arguments specify how the results of
  9815. evaluating the source code block should be handled.
  9816. *Note:* only one option from each type may be supplied per source code
  9817. block.
  9818. @subsubheading collection
  9819. :PROPERTIES:
  9820. :CUSTOM_ID: header-argument-results-collection
  9821. :END:
  9822. The following options are mutually exclusive, and specify how the
  9823. results should be collected from the source code block.
  9824. - value :: This is the default. The result is the value
  9825. of the last statement in the source code block.
  9826. This header argument places Org-babel in functional
  9827. mode. Note that in some languages, e.g., python,
  9828. use of this result type requires that a =return=
  9829. statement be included in the body of the source code
  9830. block. E.g., =:results value=.
  9831. - output :: The result is the collection of everything printed
  9832. to stdout during the execution of the source code
  9833. block. This header argument places Org-babel in scripting
  9834. mode. E.g., =:results output=.
  9835. @subsubheading type
  9836. The following options are mutually exclusive and specify what
  9837. type of results the code block will return. By default, results
  9838. are inserted as either a *table* or *scalar* depending on their
  9839. value.
  9840. - table, vector :: The results should be interpreted as an Org-mode table.
  9841. If a single value is returned, Org-babel will convert it
  9842. into a table with one row and one column. E.g., =:results
  9843. value table=.
  9844. - scalar, verbatim :: The results should be interpreted
  9845. literally -- meaning they will not be converted into a table.
  9846. The results will be inserted into the Org-mode buffer as
  9847. quoted text. E.g., =:results value verbatim=.
  9848. - file :: The results will be interpreted as the path to a file,
  9849. and will be inserted into the Org-mode buffer as a file
  9850. link. E.g., =:results value file=.
  9851. - raw, org :: The results are interpreted as raw Org-mode code and
  9852. are inserted directly into the buffer. If the results look
  9853. like a table they will be aligned as such by Org-mode.
  9854. E.g., =:results value raw=.
  9855. - html :: Results are assumed to be HTML and will be enclosed in
  9856. a =begin_html= block. E.g., =:results value html=.
  9857. - latex :: Results assumed to be LaTeX and are enclosed in a
  9858. =begin_latex= block. E.g., =:results value latex=.
  9859. - code :: Result are assumed to be parseable code and are
  9860. enclosed in a code block. E.g., =:results value code=.
  9861. - pp :: The result is converted to pretty-printed code and is
  9862. enclosed in a code block. This option currently supports
  9863. Emacs Lisp, python, and ruby. E.g., =:results value pp=.
  9864. @subsubheading handling
  9865. The following results options indicate what Org-babel should do
  9866. with the results once they are collected.
  9867. - silent :: The results will be echoed in the minibuffer but
  9868. will not be inserted into the Org-mode buffer. E.g.,
  9869. =:results output silent=.
  9870. - replace :: The default value. The results will be inserted
  9871. into the Org-mode buffer. E.g., =:results output
  9872. replace=.
  9873. @subsubsection =:file=
  9874. :PROPERTIES:
  9875. :CUSTOM_ID: header-argument-file
  9876. :END:
  9877. =:file= is used to specify a path for file output in which case an
  9878. [[http://orgmode.org/manual/Link-format.html#Link-format][org style]] =file:= link is inserted into the buffer as the
  9879. result. Common examples are graphical output from [[file:languages/org-babel-doc-R.org][R]], gnuplot,
  9880. ditaa and [[file:languages/org-babel-doc-LaTeX.org][latex]] blocks.
  9881. See the [[#header-argument-dir][=:dir= and remote execution]] section for examples.
  9882. Note that for some languages, including [[file:languages/org-babel-doc-R.org][R]], gnuplot, [[file:languages/org-babel-doc-LaTeX.org][latex]] and
  9883. ditaa, graphical output is sent to the specified file without the
  9884. file being referenced explicitly in the code block. See the
  9885. documentation for the individual languages for details. In
  9886. contrast, general purpose languages such as python and ruby
  9887. require that the code explicitly create output corresponding to
  9888. the path indicated by =:file=.
  9889. While the =:file= header argument can be used to specify the path
  9890. to the output file,
  9891. @subsubsection =:dir= and remote execution
  9892. :PROPERTIES:
  9893. :CUSTOM_ID: header-argument-dir
  9894. :END:
  9895. =:dir= specifies the /default directory/ during code block
  9896. execution. If it is absent, then the directory associated with the
  9897. current buffer is used. In other words, supplying =:dir path=
  9898. temporarily has the same effect as changing the current directory
  9899. with =M-x cd path=, and then not supplying =:dir=. Under the
  9900. surface, =:dir= simply sets the value of the emacs variable
  9901. =default-directory=.
  9902. When using =:dir=, you should supply a relative path for [[#header-argument-file][file
  9903. output]] (e.g. =:file myfile.jpg= or =:file results/myfile.jpg=) in
  9904. which case that path will be interpreted relative to the default
  9905. directory.
  9906. In other words, if you want your plot to go into a folder called
  9907. Work in your home directory, you could use
  9908. @example
  9909. #+begin_src R :file myplot.png :dir ~/Work
  9910. matplot(matrix(rnorm(100), 10), type="l")
  9911. #+end_src
  9912. @end example
  9913. @subsubheading Remote execution
  9914. A directory on a remote machine can be specified using [[http://www.gnu.org/software/tramp/#Filename-Syntax][tramp
  9915. filename syntax]], in which case the code will be executed on the
  9916. remote machine[fn:2]. An example is
  9917. @example
  9918. #+begin_src R :file plot.png :dir /dand@@yakuba.princeton.edu:
  9919. plot(1:10, main=system("hostname", intern=TRUE))
  9920. #+end_src
  9921. @end example
  9922. Text results will be returned to the local org buffer as normal, and
  9923. file output will be created on the remote machine with relative paths
  9924. interpreted relative to the remote directory. An org link to the
  9925. remote file will be created.
  9926. So in the above example a plot will be created on the remote machine,
  9927. and a link of the following form will be inserted in the org buffer:
  9928. @example
  9929. [[file:/scp:dand@@yakuba.princeton.edu:/home/dand/plot.png][plot.png]]
  9930. @end example
  9931. Most of this functionality follows immediately from the fact that
  9932. =:dir= sets the value of the emacs variable =default-directory=,
  9933. thanks to [[http://www.gnu.org/software/tramp/][tramp]]. Those using XEmacs, or GNU Emacs prior to
  9934. version 23 may need to install tramp separately in order for the
  9935. above features to work correctly.
  9936. @subsubheading Further points
  9937. - If =:dir= is used in conjunction with =:session=, although it
  9938. will determine the starting directory for a new session as
  9939. expected, no attempt is currently made to alter the directory
  9940. associated with an existing session.
  9941. - =:dir= should typically not be used to create files during
  9942. export with =:exports results= or =:exports both=. The reason
  9943. is that, in order to retain portability of exported material
  9944. between machines, during export, links inserted into the buffer
  9945. will *not* be expanded against default directory. Therefore, if
  9946. default-directory is altered using =:dir=, it it probable that
  9947. the file will be created in a location to which the link does
  9948. not point.
  9949. @subsubsection =:exports=
  9950. :PROPERTIES:
  9951. :CUSTOM_ID: header-argument-exports
  9952. :END:
  9953. Specify what should be included in HTML or LaTeX exports of the
  9954. Org-mode file.
  9955. - code :: the default. The body of code is included
  9956. into the exported file. E.g., =:exports code=.
  9957. - results :: the result of evaluating the code is included in the
  9958. exported file. E.g., =:exports results=.
  9959. - both :: both the code and results are included in the exported
  9960. file. E.g., =:exports both=.
  9961. - none :: nothing is included in the exported file. E.g.,
  9962. =:exports none=.
  9963. @subsubsection =:tangle=
  9964. :PROPERTIES:
  9965. :CUSTOM_ID: tangle-header-arguments
  9966. :END:
  9967. Specify whether or not the source code block should be included
  9968. in tangled extraction of source code files.
  9969. - yes :: the source code block is exported to a source code file
  9970. named after the basename (name w/o extension) of the
  9971. Org-mode file. E.g., =:tangle yes=.
  9972. - no :: the default. The source code block is not
  9973. exported to a source code file. E.g., =:tangle no=.
  9974. - other :: Any other string passed to the =:tangle= header argument
  9975. is interpreted as a file basename to which the block will
  9976. be exported. E.g., =:tangle basename=.
  9977. @subsubsection =:session=
  9978. :PROPERTIES:
  9979. :CUSTOM_ID: header-argument-session
  9980. :END:
  9981. Start a session for an interpreted language where state is
  9982. preserved. This applies particularly to the supported languages
  9983. python, R and ruby.
  9984. By default, a session is not started.
  9985. A string passed to the =:session= header argument will give the
  9986. session a name. This makes it possible to run concurrent
  9987. sessions for each interpreted language.
  9988. @subsubsection =:noweb=
  9989. :PROPERTIES:
  9990. :CUSTOM_ID: header-argument-noweb
  9991. :END:
  9992. Controls the expansion of [[noweb-reference-syntax][noweb syntax]] references in a
  9993. source code block. This header argument can have one of two
  9994. values: =yes= or =no=.
  9995. - =no= :: the default. No [[noweb-reference-syntax][noweb syntax]] specific action is taken
  9996. on evaluating source code blocks/ However, noweb references
  9997. will still be expanded during tangling.
  9998. - =yes= :: all [[noweb-reference-syntax][noweb syntax]] references in the body of the source
  9999. code block will be expanded before the block is evaluated.
  10000. @subsubheading Noweb Prefix Lines
  10001. Noweb insertions are now placed behind the line prefix of the
  10002. =<<reference>>=.
  10003. This behavior is illustrated in the following example. Because
  10004. the =<<example>>= noweb reference appears behind the SQL
  10005. comment syntax, each line of the expanded noweb reference will
  10006. be commented.
  10007. This source code block:
  10008. @example
  10009. -- <<example>>
  10010. @end example
  10011. expands to:
  10012. @example
  10013. -- this is the
  10014. -- multi-line body of example
  10015. @end example
  10016. Note that noweb replacement text that does *not* contain any
  10017. newlines will not be affected by this change, so it is still
  10018. possible to use inline noweb references.
  10019. Thanks to Sébastien Vauban for this idea.
  10020. @subsubsection =:cache=
  10021. :PROPERTIES:
  10022. :CUSTOM_ID: header-argument-cache
  10023. :END:
  10024. Controls the use of in-buffer caching of source code block
  10025. results to avoid re-running unchanged source code blocks. This
  10026. header argument can have one of two values: =yes= or =no=.
  10027. - =no= :: The default. No caching takes place and the source
  10028. code block will be run every time it is executed.
  10029. - =yes= :: every time the source code block is run a sha1 hash of
  10030. the code and arguments passed to the block will be
  10031. generated. This hash is packed into the =#+results:= line
  10032. of the results and will be checked on subsequent executions
  10033. of the source code block. If the source code block has not
  10034. changed since the last time it was evaluated, it will not be
  10035. re-evaluated.
  10036. @section Results
  10037. :PROPERTIES:
  10038. :CUSTOM_ID: results-specification
  10039. :END:
  10040. The way in which results are handled depends on whether a [[header-argument-session][session]]
  10041. is invoked, as well as on whether
  10042. [[header-argument-results-collection][=:results value=] or
  10043. [[header-argument-results-collection][=:results output=]] is used. The following table shows the
  10044. possibilities:
  10045. | | non-session (default) | =:session= |
  10046. |-------------------+--------------------------+-------------------------------------|
  10047. | =:results value= | value of last expression | value of last expression |
  10048. | =:results output= | contents of stdout | concatenation of interpreter output |
  10049. *Note:* With =:results value=, the result in both =:session= and
  10050. non-session is returned to Org-mode as a table (a one- or
  10051. two-dimensional vector of strings or numbers) when appropriate.
  10052. @subsection Non-session
  10053. @subsubsection =:results value=
  10054. This is the default. Internally, the value is obtained by
  10055. wrapping the code in a function definition in the external
  10056. language, and evaluating that function. Therefore, code should be
  10057. written as if it were the body of such a function. In particular,
  10058. note that python does not automatically return a value from a
  10059. function unless a =return= statement is present, and so a
  10060. 'return' statement will usually be required in python.
  10061. This is the only one of the four evaluation contexts in which the
  10062. code is automatically wrapped in a function definition.
  10063. @subsubsection =:results output=
  10064. The code is passed to the interpreter as an external process, and
  10065. the contents of the standard output stream are returned as
  10066. text. (In certain languages this also contains the error output
  10067. stream; this is an area for future work.)
  10068. @subsection =:session=
  10069. @subsubsection =:results value=
  10070. The code is passed to the interpreter running as an interactive
  10071. Emacs inferior process. The result returned is the result of the
  10072. last evaluation performed by the interpreter. (This is obtained in
  10073. a language-specific manner: the value of the variable =_= in
  10074. python and ruby, and the value of =.Last.value= in R).
  10075. @subsubsection =:results output=
  10076. The code is passed to the interpreter running as an interactive
  10077. Emacs inferior process. The result returned is the concatenation
  10078. of the sequence of (text) output from the interactive
  10079. interpreter. Notice that this is not necessarily the same as what
  10080. would be sent to stdout if the same code were passed to a
  10081. non-interactive interpreter running as an external process. For
  10082. example, compare the following two blocks:
  10083. @example
  10084. #+begin_src python :results output
  10085. print "hello"
  10086. 2
  10087. print "bye"
  10088. #+end_src
  10089. #+resname:
  10090. : hello
  10091. : bye
  10092. @end example
  10093. In non-session mode, the '2' is not printed and does not appear.
  10094. @example
  10095. #+begin_src python :results output :session
  10096. print "hello"
  10097. 2
  10098. print "bye"
  10099. #+end_src
  10100. #+resname:
  10101. : hello
  10102. : 2
  10103. : bye
  10104. @end example
  10105. But in =:session= mode, the interactive interpreter receives input '2'
  10106. and prints out its value, '2'. (Indeed, the other print statements are
  10107. unnecessary here).
  10108. @section Noweb Reference Syntax
  10109. :PROPERTIES:
  10110. :CUSTOM_ID: noweb-reference-syntax
  10111. :END:
  10112. The [[http://www.cs.tufts.edu/~nr/noweb/][Noweb]] Literate Programming system allows named blocks of code to
  10113. be referenced by using the familiar Noweb syntax:
  10114. : <<code-block-name>>
  10115. Noweb references are handled differently during evaluation and
  10116. tangling.
  10117. When a document is tangled, Noweb references are replaced with the
  10118. named source code block.
  10119. When a source code block is evaluated, the action depends upon the
  10120. value of the =:noweb= header argument. If =:noweb yes=, then a
  10121. Noweb reference is expanded before evaluation. If =:noweb no=,
  10122. the default, then the reference is not expanded before
  10123. evaluation.
  10124. *Note:* the default value, =:noweb no=, was chosen to ensure that
  10125. Org-babel does not break correct code in a language, such as Ruby,
  10126. where =<<arg>>= is a syntactically valid construct. If =<<arg>>= is
  10127. not syntactically valid in languages that you use, then please
  10128. consider [[*System%20wide][setting the default value]].
  10129. An example that uses the Noweb reference syntax is provided in the
  10130. [[literate programming example]].
  10131. @section Key Bindings & Useful Functions
  10132. Org-babel re-binds many common Org-mode key sequences depending on
  10133. the context. Within a source-code block the following sequences
  10134. are rebound:
  10135. | =C-c C-c= | [[function-org-babel-execute][org-babel-execute-src-block]] |
  10136. | =C-c C-o= | [[function-org-babel-open-src-block-result][org-babel-open-src-block-result]] |
  10137. | =C-up= | [[function-org-babel-load-in-session][org-babel-load-in-session]] |
  10138. | =M-down= | [[function-org-babel-pop-to-session][org-babel-pop-to-session]] |
  10139. Org-babel also exposes a number of functions behind the common
  10140. =org-babel-key-prefix= of =C-c M-b=:
  10141. @example
  10142. #+begin_src emacs-lisp :exports none
  10143. (lambda (binding
  10144. (list (format "\\C-c \\M-b %s"
  10145. (car binding))
  10146. (format "[[function-%s][%s]]"
  10147. (cdr binding) (cdr binding))))
  10148. org-babel-key-bindings)
  10149. #+end_src
  10150. @end example
  10151. | =C-c M-b t= | [[function-org-babel-tangle][org-babel-tangle]] |
  10152. | =C-c M-b T= | [[function-org-babel-tangle-file][org-babel-tangle-file]] |
  10153. | =C-c M-b e= | [[function-org-babel-execute-src-block][org-babel-execute-src-block]] |
  10154. | =C-c M-b s= | [[function-org-babel-execute-subtree][org-babel-execute-subtree]] |
  10155. | =C-c M-b b= | [[function-org-babel-execute-buffer][org-babel-execute-buffer]] |
  10156. | =C-c M-b h= | [[function-org-babel-sha1-hash][org-babel-sha1-hash]] |
  10157. | =C-c M-b g= | [[function-org-babel-goto-named-source-block][org-babel-goto-named-source-block]] |
  10158. | =C-c M-b l= | [[function-org-babel-lob-ingest][org-babel-lob-ingest]] |
  10159. @subsection Functions
  10160. @subsubsection org-babel-execute-src-block
  10161. :PROPERTIES:
  10162. :CUSTOM_ID: function-org-babel-execute-src-block
  10163. :END:
  10164. @example
  10165. org-babel-execute-src-block is an interactive Lisp function in
  10166. `org-babel.el'.
  10167. (org-babel-execute-src-block &optional ARG INFO PARAMS)
  10168. Execute the current source code block, and insert the results
  10169. into the buffer. Source code execution and the collection and
  10170. formatting of results can be controlled through a variety of
  10171. header arguments.
  10172. Optionally supply a value for INFO in the form returned by
  10173. `org-babel-get-src-block-info'.
  10174. Optionally supply a value for PARAMS which will be merged with
  10175. the header arguments specified at the front of the source code
  10176. block.
  10177. @end example
  10178. @subsubsection org-babel-open-src-block-result
  10179. :PROPERTIES:
  10180. :CUSTOM_ID: function-org-babel-open-src-block-result
  10181. :END:
  10182. @example
  10183. org-babel-open-src-block-result is an interactive Lisp function in
  10184. `org-babel.el'.
  10185. (org-babel-open-src-block-result &optional RE-RUN)
  10186. If `point' is on a src block then open the results of the
  10187. source code block, otherwise return nil. With optional prefix
  10188. argument RE-RUN the source-code block is evaluated even if
  10189. results already exist.
  10190. @end example
  10191. @subsubsection org-babel-load-in-session
  10192. :PROPERTIES:
  10193. :CUSTOM_ID: function-org-babel-load-in-session
  10194. :END:
  10195. @example
  10196. org-babel-load-in-session is an interactive Lisp function in
  10197. `org-babel.el'.
  10198. (org-babel-load-in-session &optional ARG INFO)
  10199. Load the body of the current source-code block. Evaluate the
  10200. header arguments for the source block before entering the
  10201. session. After loading the body this pops open the session.
  10202. [back]
  10203. @end example
  10204. @subsubsection org-babel-pop-to-session
  10205. :PROPERTIES:
  10206. :CUSTOM_ID: function-org-babel-pop-to-session
  10207. :END:
  10208. @example
  10209. org-babel-pop-to-session is an interactive Lisp function in
  10210. `org-babel.el'.
  10211. (org-babel-pop-to-session &optional ARG INFO)
  10212. Pop to the session of the current source-code block. If
  10213. called with a prefix argument then evaluate the header arguments
  10214. for the source block before entering the session. Copy the body
  10215. of the source block to the kill ring.
  10216. [back]
  10217. @end example
  10218. @subsubsection org-babel-tangle
  10219. :PROPERTIES:
  10220. :CUSTOM_ID: function-org-babel-tangle
  10221. :END:
  10222. @example
  10223. org-babel-tangle is an interactive Lisp function in
  10224. `org-babel-tangle.el'.
  10225. It is bound to C-c M-b t.
  10226. (org-babel-tangle &optional TARGET-FILE LANG)
  10227. Extract the bodies of all source code blocks from the current
  10228. file into their own source-specific files. Optional argument
  10229. TARGET-FILE can be used to specify a default export file for all
  10230. source blocks. Optional argument LANG can be used to limit the
  10231. exported source code blocks by language.
  10232. @end example
  10233. @subsubsection org-babel-execute-subtree
  10234. :PROPERTIES:
  10235. :CUSTOM_ID: function-org-babel-execute-subtree
  10236. :END:
  10237. @example
  10238. org-babel-execute-subtree is an interactive Lisp function in
  10239. `org-babel.el'.
  10240. It is bound to C-c M-b s.
  10241. (org-babel-execute-subtree &optional ARG)
  10242. Replace EVAL snippets in the entire subtree.
  10243. @end example
  10244. @subsubsection org-babel-execute-buffer
  10245. :PROPERTIES:
  10246. :CUSTOM_ID: function-org-babel-execute-buffer
  10247. :END:
  10248. @example
  10249. org-babel-execute-buffer is an interactive Lisp function in
  10250. `org-babel.el'.
  10251. It is bound to C-c M-b b.
  10252. (org-babel-execute-buffer &optional ARG)
  10253. Replace EVAL snippets in the entire buffer.
  10254. @end example
  10255. @subsubsection org-babel-sha1-hash
  10256. :PROPERTIES:
  10257. :CUSTOM_ID: function-org-babel-sha1-hash
  10258. :END:
  10259. @example
  10260. org-babel-sha1-hash is an interactive Lisp function in `org-babel.el'.
  10261. It is bound to C-c M-b h.
  10262. (org-babel-sha1-hash &optional INFO)
  10263. Not documented.
  10264. @end example
  10265. @subsubsection org-babel-goto-named-source-block
  10266. :PROPERTIES:
  10267. :CUSTOM_ID: function-org-babel-goto-named-source-block
  10268. :END:
  10269. @example
  10270. org-babel-goto-named-source-block is an interactive Lisp function in
  10271. `org-babel.el'.
  10272. It is bound to C-c M-b g.
  10273. (org-babel-goto-named-source-block &optional NAME)
  10274. Go to a named source-code block.
  10275. @end example
  10276. @subsubsection org-babel-lob-ingest
  10277. :PROPERTIES:
  10278. :CUSTOM_ID: function-org-babel-lob-ingest
  10279. :END:
  10280. @example
  10281. org-babel-lob-ingest is an interactive Lisp function in
  10282. `org-babel-lob.el'.
  10283. It is bound to C-c M-b l.
  10284. (org-babel-lob-ingest &optional FILE)
  10285. Add all source-blocks defined in FILE to `org-babel-library-of-babel'.
  10286. @end example
  10287. @section Batch Execution
  10288. It is possible to call Org-babel functions from the command line.
  10289. This shell script calls [[function-org-babel-tangle][org-babel-tangle]] on every one of its
  10290. arguments.
  10291. Be sure to adjust the paths to fit your system.
  10292. @example
  10293. #!/bin/sh
  10294. # -*- mode: shell-script -*-
  10295. #
  10296. # tangle a file with org-babel
  10297. #
  10298. DIR=`pwd`
  10299. FILES=""
  10300. # wrap each argument in the code required to call tangle on it
  10301. for i in $@@; do
  10302. FILES="$FILES \"$i\""
  10303. done
  10304. emacsclient \
  10305. --eval "(progn
  10306. (add-to-list 'load-path (expand-file-name \"~/src/org/lisp/\"))
  10307. (add-to-list 'load-path (expand-file-name \"~/src/org/contrib/lisp/\"))
  10308. (require 'org)(require 'org-exp)(require 'org-babel)
  10309. (mapc (lambda (file)
  10310. (find-file (expand-file-name file \"$DIR\"))
  10311. (org-babel-tangle)
  10312. (kill-buffer)) '($FILES)))"
  10313. @end example
  10314. @section Footnotes
  10315. [fn:1] The former use of the =shell= identifier is now deprecated.
  10316. [fn:2] As long as the interpreter executable is found on the remote
  10317. machine: see the variable =tramp-remote-path=
  10318. @node Miscellaneous, Hacking, Working With Source Code, Top
  10319. @chapter Miscellaneous
  10320. @menu
  10321. * Completion:: M-TAB knows what you need
  10322. * Speed keys:: Electic commands at the beginning of a headline
  10323. * Customization:: Adapting Org to your taste
  10324. * In-buffer settings:: Overview of the #+KEYWORDS
  10325. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  10326. * Clean view:: Getting rid of leading stars in the outline
  10327. * TTY keys:: Using Org on a tty
  10328. * Interaction:: Other Emacs packages
  10329. @end menu
  10330. @node Completion, Speed keys, Miscellaneous, Miscellaneous
  10331. @section Completion
  10332. @cindex completion, of @TeX{} symbols
  10333. @cindex completion, of TODO keywords
  10334. @cindex completion, of dictionary words
  10335. @cindex completion, of option keywords
  10336. @cindex completion, of tags
  10337. @cindex completion, of property keys
  10338. @cindex completion, of link abbreviations
  10339. @cindex @TeX{} symbol completion
  10340. @cindex TODO keywords completion
  10341. @cindex dictionary word completion
  10342. @cindex option keyword completion
  10343. @cindex tag completion
  10344. @cindex link abbreviations, completion of
  10345. Emacs would not be Emacs without completion, and Org-mode uses it whenever it
  10346. makes sense. If you prefer an @i{iswitchb}- or @i{ido}-like interface for
  10347. some of the completion prompts, you can specify your preference by setting at
  10348. most one of the variables @code{org-completion-use-iswitchb}
  10349. @code{org-completion-use-ido}.
  10350. Org supports in-buffer completion. This type of completion does
  10351. not make use of the minibuffer. You simply type a few letters into
  10352. the buffer and use the key to complete text right there.
  10353. @table @kbd
  10354. @kindex M-@key{TAB}
  10355. @item M-@key{TAB}
  10356. Complete word at point
  10357. @itemize @bullet
  10358. @item
  10359. At the beginning of a headline, complete TODO keywords.
  10360. @item
  10361. After @samp{\}, complete @TeX{} symbols supported by the exporter.
  10362. @item
  10363. After @samp{*}, complete headlines in the current buffer so that they
  10364. can be used in search links like @samp{[[*find this headline]]}.
  10365. @item
  10366. After @samp{:} in a headline, complete tags. The list of tags is taken
  10367. from the variable @code{org-tag-alist} (possibly set through the
  10368. @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
  10369. dynamically from all tags used in the current buffer.
  10370. @item
  10371. After @samp{:} and not in a headline, complete property keys. The list
  10372. of keys is constructed dynamically from all keys used in the current
  10373. buffer.
  10374. @item
  10375. After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
  10376. @item
  10377. After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
  10378. @samp{OPTIONS} which set file-specific options for Org mode. When the
  10379. option keyword is already complete, pressing @kbd{M-@key{TAB}} again
  10380. will insert example settings for this keyword.
  10381. @item
  10382. In the line after @samp{#+STARTUP: }, complete startup keywords,
  10383. i.e. valid keys for this line.
  10384. @item
  10385. Elsewhere, complete dictionary words using Ispell.
  10386. @end itemize
  10387. @end table
  10388. @node Speed keys, Customization, Completion, Miscellaneous
  10389. @section Speed keys
  10390. @cindex speed keys
  10391. @vindex org-use-speed-commands
  10392. @vindex org-speed-commands-user
  10393. Single keys can be made to execute commands when the cursor is at the
  10394. beginning of a headline, i.e. before the first star. Configure the variable
  10395. @code{org-use-speed-commands} to activate this feature. There is a
  10396. pre-defined list of commands, and you can add more such commands using the
  10397. variable @code{org-speed-commands-user}. Speed keys do not only speed up
  10398. navigation and other commands, but they also provide an alternative way to
  10399. execute commands bound to keys that are not or not easily available on a tty,
  10400. or on a small mobile device with a limited keyboard.
  10401. To see which commands are available, activate the feature and press @kbd{?}
  10402. with the cursor at the beginning of a headline.
  10403. @node Customization, In-buffer settings, Speed keys, Miscellaneous
  10404. @section Customization
  10405. @cindex customization
  10406. @cindex options, for customization
  10407. @cindex variables, for customization
  10408. There are more than 180 variables that can be used to customize
  10409. Org. For the sake of compactness of the manual, I am not
  10410. describing the variables here. A structured overview of customization
  10411. variables is available with @kbd{M-x org-customize}. Or select
  10412. @code{Browse Org Group} from the @code{Org->Customization} menu. Many
  10413. settings can also be activated on a per-file basis, by putting special
  10414. lines into the buffer (@pxref{In-buffer settings}).
  10415. @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
  10416. @section Summary of in-buffer settings
  10417. @cindex in-buffer settings
  10418. @cindex special keywords
  10419. Org mode uses special lines in the buffer to define settings on a
  10420. per-file basis. These lines start with a @samp{#+} followed by a
  10421. keyword, a colon, and then individual words defining a setting. Several
  10422. setting words can be in the same line, but you can also have multiple
  10423. lines for the keyword. While these settings are described throughout
  10424. the manual, here is a summary. After changing any of those lines in the
  10425. buffer, press @kbd{C-c C-c} with the cursor still in the line to
  10426. activate the changes immediately. Otherwise they become effective only
  10427. when the file is visited again in a new Emacs session.
  10428. @vindex org-archive-location
  10429. @table @kbd
  10430. @item #+ARCHIVE: %s_done::
  10431. This line sets the archive location for the agenda file. It applies for
  10432. all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
  10433. of the file. The first such line also applies to any entries before it.
  10434. The corresponding variable is @code{org-archive-location}.
  10435. @item #+CATEGORY:
  10436. This line sets the category for the agenda file. The category applies
  10437. for all subsequent lines until the next @samp{#+CATEGORY} line, or the
  10438. end of the file. The first such line also applies to any entries before it.
  10439. @item #+COLUMNS: %25ITEM .....
  10440. @cindex property, COLUMNS
  10441. Set the default format for columns view. This format applies when
  10442. columns view is invoked in locations where no @code{COLUMNS} property
  10443. applies.
  10444. @item #+CONSTANTS: name1=value1 ...
  10445. @vindex org-table-formula-constants
  10446. @vindex org-table-formula
  10447. Set file-local values for constants to be used in table formulas. This
  10448. line set the local variable @code{org-table-formula-constants-local}.
  10449. The global version of this variable is
  10450. @code{org-table-formula-constants}.
  10451. @item #+FILETAGS: :tag1:tag2:tag3:
  10452. Set tags that can be inherited by any entry in the file, including the
  10453. top-level entries.
  10454. @item #+DRAWERS: NAME1 .....
  10455. @vindex org-drawers
  10456. Set the file-local set of drawers. The corresponding global variable is
  10457. @code{org-drawers}.
  10458. @item #+LINK: linkword replace
  10459. @vindex org-link-abbrev-alist
  10460. These lines (several are allowed) specify link abbreviations.
  10461. @xref{Link abbreviations}. The corresponding variable is
  10462. @code{org-link-abbrev-alist}.
  10463. @item #+PRIORITIES: highest lowest default
  10464. @vindex org-highest-priority
  10465. @vindex org-lowest-priority
  10466. @vindex org-default-priority
  10467. This line sets the limits and the default for the priorities. All three
  10468. must be either letters A-Z or numbers 0-9. The highest priority must
  10469. have a lower ASCII number that the lowest priority.
  10470. @item #+PROPERTY: Property_Name Value
  10471. This line sets a default inheritance value for entries in the current
  10472. buffer, most useful for specifying the allowed values of a property.
  10473. @cindex #+SETUPFILE
  10474. @item #+SETUPFILE: file
  10475. This line defines a file that holds more in-buffer setup. Normally this is
  10476. entirely ignored. Only when the buffer is parsed for option-setting lines
  10477. (i.e. when starting Org mode for a file, when pressing @kbd{C-c C-c} in a
  10478. settings line, or when exporting), then the contents of this file are parsed
  10479. as if they had been included in the buffer. In particular, the file can be
  10480. any other Org mode file with internal setup. You can visit the file the
  10481. cursor is in the line with @kbd{C-c '}.
  10482. @item #+STARTUP:
  10483. @cindex #+STARTUP:
  10484. This line sets options to be used at startup of Org mode, when an
  10485. Org file is being visited.
  10486. The first set of options deals with the initial visibility of the outline
  10487. tree. The corresponding variable for global default settings is
  10488. @code{org-startup-folded}, with a default value @code{t}, which means
  10489. @code{overview}.
  10490. @vindex org-startup-folded
  10491. @cindex @code{overview}, STARTUP keyword
  10492. @cindex @code{content}, STARTUP keyword
  10493. @cindex @code{showall}, STARTUP keyword
  10494. @cindex @code{showeverything}, STARTUP keyword
  10495. @example
  10496. overview @r{top-level headlines only}
  10497. content @r{all headlines}
  10498. showall @r{no folding of any entries}
  10499. showeverything @r{show even drawer contents}
  10500. @end example
  10501. @vindex org-startup-indented
  10502. @cindex @code{indent}, STARTUP keyword
  10503. @cindex @code{noindent}, STARTUP keyword
  10504. Dynamic virtual indentation is controlled by the variable
  10505. @code{org-startup-indented}@footnote{Emacs 23 and Org-mode 6.29 are required}
  10506. @example
  10507. indent @r{start with @code{org-indent-mode} turned on}
  10508. noindent @r{start with @code{org-indent-mode} turned off}
  10509. @end example
  10510. @vindex org-startup-align-all-tables
  10511. Then there are options for aligning tables upon visiting a file. This
  10512. is useful in files containing narrowed table columns. The corresponding
  10513. variable is @code{org-startup-align-all-tables}, with a default value
  10514. @code{nil}.
  10515. @cindex @code{align}, STARTUP keyword
  10516. @cindex @code{noalign}, STARTUP keyword
  10517. @example
  10518. align @r{align all tables}
  10519. noalign @r{don't align tables on startup}
  10520. @end example
  10521. @vindex org-log-done
  10522. @vindex org-log-note-clock-out
  10523. @vindex org-log-repeat
  10524. Logging the closing and reopening of TODO items and clock intervals can be
  10525. configured using these options (see variables @code{org-log-done},
  10526. @code{org-log-note-clock-out} and @code{org-log-repeat})
  10527. @cindex @code{logdone}, STARTUP keyword
  10528. @cindex @code{lognotedone}, STARTUP keyword
  10529. @cindex @code{nologdone}, STARTUP keyword
  10530. @cindex @code{lognoteclock-out}, STARTUP keyword
  10531. @cindex @code{nolognoteclock-out}, STARTUP keyword
  10532. @cindex @code{logrepeat}, STARTUP keyword
  10533. @cindex @code{lognoterepeat}, STARTUP keyword
  10534. @cindex @code{nologrepeat}, STARTUP keyword
  10535. @cindex @code{logreschedule}, STARTUP keyword
  10536. @cindex @code{lognotereschedule}, STARTUP keyword
  10537. @cindex @code{nologreschedule}, STARTUP keyword
  10538. @cindex @code{logredeadline}, STARTUP keyword
  10539. @cindex @code{lognoteredeadline}, STARTUP keyword
  10540. @cindex @code{nologredeadline}, STARTUP keyword
  10541. @cindex @code{logrefile}, STARTUP keyword
  10542. @cindex @code{lognoterefile}, STARTUP keyword
  10543. @cindex @code{nologrefile}, STARTUP keyword
  10544. @example
  10545. logdone @r{record a timestamp when an item is marked DONE}
  10546. lognotedone @r{record timestamp and a note when DONE}
  10547. nologdone @r{don't record when items are marked DONE}
  10548. logrepeat @r{record a time when reinstating a repeating item}
  10549. lognoterepeat @r{record a note when reinstating a repeating item}
  10550. nologrepeat @r{do not record when reinstating repeating item}
  10551. lognoteclock-out @r{record a note when clocking out}
  10552. nolognoteclock-out @r{don't record a note when clocking out}
  10553. logreschedule @r{record a timestamp when scheduling time changes}
  10554. lognotereschedule @r{record a note when scheduling time changes}
  10555. nologreschedule @r{do not record when a scheduling date changes}
  10556. logredeadline @r{record a timestamp when deadline changes}
  10557. lognoteredeadline @r{record a note when deadline changes}
  10558. nologredeadline @r{do not record when a deadline date changes}
  10559. logrefile @r{record a timestamp when refiling}
  10560. lognoterefile @r{record a note when refiling}
  10561. nologrefile @r{do not record when refiling}
  10562. @end example
  10563. @vindex org-hide-leading-stars
  10564. @vindex org-odd-levels-only
  10565. Here are the options for hiding leading stars in outline headings, and for
  10566. indenting outlines. The corresponding variables are
  10567. @code{org-hide-leading-stars} and @code{org-odd-levels-only}, both with a
  10568. default setting @code{nil} (meaning @code{showstars} and @code{oddeven}).
  10569. @cindex @code{hidestars}, STARTUP keyword
  10570. @cindex @code{showstars}, STARTUP keyword
  10571. @cindex @code{odd}, STARTUP keyword
  10572. @cindex @code{even}, STARTUP keyword
  10573. @example
  10574. hidestars @r{make all but one of the stars starting a headline invisible.}
  10575. showstars @r{show all stars starting a headline}
  10576. indent @r{virtual indentation according to outline level}
  10577. noindent @r{no virtual indentation according to outline level}
  10578. odd @r{allow only odd outline levels (1,3,...)}
  10579. oddeven @r{allow all outline levels}
  10580. @end example
  10581. @vindex org-put-time-stamp-overlays
  10582. @vindex org-time-stamp-overlay-formats
  10583. To turn on custom format overlays over timestamps (variables
  10584. @code{org-put-time-stamp-overlays} and
  10585. @code{org-time-stamp-overlay-formats}), use
  10586. @cindex @code{customtime}, STARTUP keyword
  10587. @example
  10588. customtime @r{overlay custom time format}
  10589. @end example
  10590. @vindex constants-unit-system
  10591. The following options influence the table spreadsheet (variable
  10592. @code{constants-unit-system}).
  10593. @cindex @code{constcgs}, STARTUP keyword
  10594. @cindex @code{constSI}, STARTUP keyword
  10595. @example
  10596. constcgs @r{@file{constants.el} should use the c-g-s unit system}
  10597. constSI @r{@file{constants.el} should use the SI unit system}
  10598. @end example
  10599. @vindex org-footnote-define-inline
  10600. @vindex org-footnote-auto-label
  10601. @vindex org-footnote-auto-adjust
  10602. To influence footnote settings, use the following keywords. The
  10603. corresponding variables are @code{org-footnote-define-inline},
  10604. @code{org-footnote-auto-label}, and @code{org-footnote-auto-adjust}.
  10605. @cindex @code{fninline}, STARTUP keyword
  10606. @cindex @code{nofninline}, STARTUP keyword
  10607. @cindex @code{fnlocal}, STARTUP keyword
  10608. @cindex @code{fnprompt}, STARTUP keyword
  10609. @cindex @code{fnauto}, STARTUP keyword
  10610. @cindex @code{fnconfirm}, STARTUP keyword
  10611. @cindex @code{fnplain}, STARTUP keyword
  10612. @cindex @code{fnadjust}, STARTUP keyword
  10613. @cindex @code{nofnadjust}, STARTUP keyword
  10614. @example
  10615. fninline @r{define footnotes inline}
  10616. fnnoinline @r{define footnotes in separate section}
  10617. fnlocal @r{define footnotes near first reference, but not inline}
  10618. fnprompt @r{prompt for footnote labels}
  10619. fnauto @r{create [fn:1]-like labels automatically (default)}
  10620. fnconfirm @r{offer automatic label for editing or confirmation}
  10621. fnplain @r{create [1]-like labels automatically}
  10622. fnadjust @r{automatically renumber and sort footnotes}
  10623. nofnadjust @r{do not renumber and sort automatically}
  10624. @end example
  10625. @cindex org-hide-block-startup
  10626. To hide blocks on startup, use these keywords. The corresponding variable is
  10627. @code{org-hide-block-startup}.
  10628. @cindex @code{hideblocks}, STARTUP keyword
  10629. @cindex @code{nohideblocks}, STARTUP keyword
  10630. @example
  10631. hideblocks @r{Hide all begin/end blocks on startup}
  10632. nohideblocks @r{Do not hide blocks on startup}
  10633. @end example
  10634. @item #+TAGS: TAG1(c1) TAG2(c2)
  10635. @vindex org-tag-alist
  10636. These lines (several such lines are allowed) specify the valid tags in
  10637. this file, and (potentially) the corresponding @emph{fast tag selection}
  10638. keys. The corresponding variable is @code{org-tag-alist}.
  10639. @item #+TBLFM:
  10640. This line contains the formulas for the table directly above the line.
  10641. @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+DATE:,
  10642. @itemx #+OPTIONS:, #+BIND:
  10643. @itemx #+DESCRIPTION:, #+KEYWORDS:
  10644. @itemx #+LATEX_HEADER:, #+STYLE:, #+LINK_UP:, #+LINK_HOME:,
  10645. @itemx #+EXPORT_SELECT_TAGS:, #+EXPORT_EXCLUDE_TAGS:
  10646. These lines provide settings for exporting files. For more details see
  10647. @ref{Export options}.
  10648. @item #+TODO: #+SEQ_TODO: #+TYP_TODO:
  10649. @vindex org-todo-keywords
  10650. These lines set the TODO keywords and their interpretation in the
  10651. current file. The corresponding variable is @code{org-todo-keywords}.
  10652. @end table
  10653. @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
  10654. @section The very busy C-c C-c key
  10655. @kindex C-c C-c
  10656. @cindex C-c C-c, overview
  10657. The key @kbd{C-c C-c} has many purposes in Org, which are all
  10658. mentioned scattered throughout this manual. One specific function of
  10659. this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
  10660. other circumstances it means something like @emph{``Hey Org, look
  10661. here and update according to what you see here''}. Here is a summary of
  10662. what this means in different contexts.
  10663. @itemize @minus
  10664. @item
  10665. If there are highlights in the buffer from the creation of a sparse
  10666. tree, or from clock display, remove these highlights.
  10667. @item
  10668. If the cursor is in one of the special @code{#+KEYWORD} lines, this
  10669. triggers scanning the buffer for these lines and updating the
  10670. information.
  10671. @item
  10672. If the cursor is inside a table, realign the table. This command
  10673. works even if the automatic table editor has been turned off.
  10674. @item
  10675. If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
  10676. the entire table.
  10677. @item
  10678. If the current buffer is a Remember buffer, close the note and file it.
  10679. With a prefix argument, file it, without further interaction, to the
  10680. default location.
  10681. @item
  10682. If the cursor is on a @code{<<<target>>>}, update radio targets and
  10683. corresponding links in this buffer.
  10684. @item
  10685. If the cursor is in a property line or at the start or end of a property
  10686. drawer, offer property commands.
  10687. @item
  10688. If the cursor is at a footnote reference, go to the corresponding
  10689. definition, and vice versa.
  10690. @item
  10691. If the cursor is on a statistics cookie, update it.
  10692. @item
  10693. If the cursor is in a plain list item with a checkbox, toggle the status
  10694. of the checkbox.
  10695. @item
  10696. If the cursor is on a numbered item in a plain list, renumber the
  10697. ordered list.
  10698. @item
  10699. If the cursor is on the @code{#+BEGIN} line of a dynamic block, the
  10700. block is updated.
  10701. @end itemize
  10702. @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
  10703. @section A cleaner outline view
  10704. @cindex hiding leading stars
  10705. @cindex dynamic indentation
  10706. @cindex odd-levels-only outlines
  10707. @cindex clean outline view
  10708. Some people find it noisy and distracting that the Org headlines start with a
  10709. potentially large number of stars, and that text below the headlines is not
  10710. indented. While this is no problem when writing a @emph{book-like} document
  10711. where the outline headings are really section headings, in a more
  10712. @emph{list-oriented} outline, indented structure is a lot cleaner:
  10713. @example
  10714. @group
  10715. * Top level headline | * Top level headline
  10716. ** Second level | * Second level
  10717. *** 3rd level | * 3rd level
  10718. some text | some text
  10719. *** 3rd level | * 3rd level
  10720. more text | more text
  10721. * Another top level headline | * Another top level headline
  10722. @end group
  10723. @end example
  10724. @noindent
  10725. If you are using at least Emacs 23.1.50.3 and version 6.29 of Org, this kind
  10726. of view can be achieved dynamically at display time using
  10727. @code{org-indent-mode}. In this minor mode, all lines are prefixed for
  10728. display with the necessary amount of space@footnote{@code{org-indent-mode}
  10729. also sets the @code{wrap-prefix} property, such that @code{visual-line-mode}
  10730. (or purely setting @code{word-wrap}) wraps long lines (including headlines)
  10731. correctly indented. }. Also headlines are prefixed with additional stars,
  10732. so that the amount of indentation shifts by two@footnote{See the variable
  10733. @code{org-indent-indentation-per-level}.} spaces per level. All headline
  10734. stars but the last one are made invisible using the @code{org-hide}
  10735. face@footnote{Turning on @code{org-indent-mode} sets
  10736. @code{org-hide-leading-stars} to @code{t} and @code{org-adapt-indentation} to
  10737. @code{nil}.} - see below under @samp{2.} for more information on how this
  10738. works. You can turn on @code{org-indent-mode} for all files by customizing
  10739. the variable @code{org-startup-indented}, or you can turn it on for
  10740. individual files using
  10741. @example
  10742. #+STARTUP: indent
  10743. @end example
  10744. If you want a similar effect in earlier version of Emacs and/or Org, or if
  10745. you want the indentation to be hard space characters so that the plain text
  10746. file looks as similar as possible to the Emacs display, Org supports you in
  10747. the following way:
  10748. @enumerate
  10749. @item
  10750. @emph{Indentation of text below headlines}@*
  10751. You may indent text below each headline to make the left boundary line up
  10752. with the headline, like
  10753. @example
  10754. *** 3rd level
  10755. more text, now indented
  10756. @end example
  10757. @vindex org-adapt-indentation
  10758. Org supports this with paragraph filling, line wrapping, and structure
  10759. editing@footnote{See also the variable @code{org-adapt-indentation}.},
  10760. preserving or adapting the indentation as appropriate.
  10761. @item
  10762. @vindex org-hide-leading-stars
  10763. @emph{Hiding leading stars}@* You can modify the display in such a way that
  10764. all leading stars become invisible. To do this in a global way, configure
  10765. the variable @code{org-hide-leading-stars} or change this on a per-file basis
  10766. with
  10767. @example
  10768. #+STARTUP: hidestars
  10769. #+STARTUP: showstars
  10770. @end example
  10771. With hidden stars, the tree becomes:
  10772. @example
  10773. @group
  10774. * Top level headline
  10775. * Second level
  10776. * 3rd level
  10777. ...
  10778. @end group
  10779. @end example
  10780. @noindent
  10781. @vindex org-hide @r{(face)}
  10782. The leading stars are not truly replaced by whitespace, they are only
  10783. fontified with the face @code{org-hide} that uses the background color as
  10784. font color. If you are not using either white or black background, you may
  10785. have to customize this face to get the wanted effect. Another possibility is
  10786. to set this font such that the extra stars are @i{almost} invisible, for
  10787. example using the color @code{grey90} on a white background.
  10788. @item
  10789. @vindex org-odd-levels-only
  10790. Things become cleaner still if you skip all the even levels and use only odd
  10791. levels 1, 3, 5..., effectively adding two stars to go from one outline level
  10792. to the next@footnote{When you need to specify a level for a property search
  10793. or refile targets, @samp{LEVEL=2} will correspond to 3 stars, etc@.}. In this
  10794. way we get the outline view shown at the beginning of this section. In order
  10795. to make the structure editing and export commands handle this convention
  10796. correctly, configure the variable @code{org-odd-levels-only}, or set this on
  10797. a per-file basis with one of the following lines:
  10798. @example
  10799. #+STARTUP: odd
  10800. #+STARTUP: oddeven
  10801. @end example
  10802. You can convert an Org file from single-star-per-level to the
  10803. double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
  10804. RET} in that file. The reverse operation is @kbd{M-x
  10805. org-convert-to-oddeven-levels}.
  10806. @end enumerate
  10807. @node TTY keys, Interaction, Clean view, Miscellaneous
  10808. @section Using Org on a tty
  10809. @cindex tty key bindings
  10810. Because Org contains a large number of commands, by default many of
  10811. Org's core commands are bound to keys that are generally not
  10812. accessible on a tty, such as the cursor keys (@key{left}, @key{right},
  10813. @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
  10814. together with modifiers like @key{Meta} and/or @key{Shift}. To access
  10815. these commands on a tty when special keys are unavailable, the following
  10816. alternative bindings can be used. The tty bindings below will likely be
  10817. more cumbersome; you may find for some of the bindings below that a
  10818. customized workaround suits you better. For example, changing a timestamp
  10819. is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
  10820. tty you would rather use @kbd{C-c .} to re-insert the timestamp.
  10821. @multitable @columnfractions 0.15 0.2 0.1 0.2
  10822. @item @b{Default} @tab @b{Alternative 1} @tab @b{Speed key} @tab @b{Alternative 2}
  10823. @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab @kbd{C} @tab
  10824. @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{l} @tab @kbd{@key{Esc} @key{left}}
  10825. @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab @kbd{L} @tab
  10826. @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{r} @tab @kbd{@key{Esc} @key{right}}
  10827. @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab @kbd{R} @tab
  10828. @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{ } @tab @kbd{@key{Esc} @key{up}}
  10829. @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab @kbd{U} @tab
  10830. @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{ } @tab @kbd{@key{Esc} @key{down}}
  10831. @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab @kbd{D} @tab
  10832. @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab @kbd{ } @tab
  10833. @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{ } @tab @kbd{@key{Esc} @key{RET}}
  10834. @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab @kbd{ } @tab
  10835. @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab @kbd{ } @tab
  10836. @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab @kbd{ } @tab
  10837. @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab @kbd{ } @tab
  10838. @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab @kbd{ } @tab
  10839. @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab @kbd{ } @tab
  10840. @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab @kbd{ } @tab
  10841. @end multitable
  10842. @node Interaction, , TTY keys, Miscellaneous
  10843. @section Interaction with other packages
  10844. @cindex packages, interaction with other
  10845. Org lives in the world of GNU Emacs and interacts in various ways
  10846. with other code out there.
  10847. @menu
  10848. * Cooperation:: Packages Org cooperates with
  10849. * Conflicts:: Packages that lead to conflicts
  10850. @end menu
  10851. @node Cooperation, Conflicts, Interaction, Interaction
  10852. @subsection Packages that Org cooperates with
  10853. @table @asis
  10854. @cindex @file{calc.el}
  10855. @cindex Gillespie, Dave
  10856. @item @file{calc.el} by Dave Gillespie
  10857. Org uses the Calc package for implementing spreadsheet
  10858. functionality in its tables (@pxref{The spreadsheet}). Org
  10859. checks for the availability of Calc by looking for the function
  10860. @code{calc-eval} which will have been autoloaded during setup if Calc has
  10861. been installed properly. As of Emacs 22, Calc is part of the Emacs
  10862. distribution. Another possibility for interaction between the two
  10863. packages is using Calc for embedded calculations. @xref{Embedded Mode,
  10864. , Embedded Mode, Calc, GNU Emacs Calc Manual}.
  10865. @item @file{constants.el} by Carsten Dominik
  10866. @cindex @file{constants.el}
  10867. @cindex Dominik, Carsten
  10868. @vindex org-table-formula-constants
  10869. In a table formula (@pxref{The spreadsheet}), it is possible to use
  10870. names for natural constants or units. Instead of defining your own
  10871. constants in the variable @code{org-table-formula-constants}, install
  10872. the @file{constants} package which defines a large number of constants
  10873. and units, and lets you use unit prefixes like @samp{M} for
  10874. @samp{Mega}, etc@. You will need version 2.0 of this package, available
  10875. at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
  10876. the function @code{constants-get}, which has to be autoloaded in your
  10877. setup. See the installation instructions in the file
  10878. @file{constants.el}.
  10879. @item @file{cdlatex.el} by Carsten Dominik
  10880. @cindex @file{cdlatex.el}
  10881. @cindex Dominik, Carsten
  10882. Org mode can make use of the CDLa@TeX{} package to efficiently enter
  10883. La@TeX{} fragments into Org files. See @ref{CDLaTeX mode}.
  10884. @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
  10885. @cindex @file{imenu.el}
  10886. Imenu allows menu access to an index of items in a file. Org mode
  10887. supports Imenu---all you need to do to get the index is the following:
  10888. @lisp
  10889. (add-hook 'org-mode-hook
  10890. (lambda () (imenu-add-to-menubar "Imenu")))
  10891. @end lisp
  10892. @vindex org-imenu-depth
  10893. By default the index is two levels deep---you can modify the depth using
  10894. the option @code{org-imenu-depth}.
  10895. @item @file{remember.el} by John Wiegley
  10896. @cindex @file{remember.el}
  10897. @cindex Wiegley, John
  10898. Org cooperates with remember, see @ref{Remember}.
  10899. As of Emacs 23, @file{Remember.el} is part of the Emacs distribution.
  10900. @item @file{speedbar.el} by Eric M. Ludlam
  10901. @cindex @file{speedbar.el}
  10902. @cindex Ludlam, Eric M.
  10903. Speedbar is a package that creates a special frame displaying files and
  10904. index items in files. Org mode supports Speedbar and allows you to
  10905. drill into Org files directly from the Speedbar. It also allows you to
  10906. restrict the scope of agenda commands to a file or a subtree by using
  10907. the command @kbd{<} in the Speedbar frame.
  10908. @cindex @file{table.el}
  10909. @item @file{table.el} by Takaaki Ota
  10910. @kindex C-c C-c
  10911. @cindex table editor, @file{table.el}
  10912. @cindex @file{table.el}
  10913. @cindex Ota, Takaaki
  10914. Complex ASCII tables with automatic line wrapping, column- and row-spanning,
  10915. and alignment can be created using the Emacs table package by Takaaki Ota
  10916. (@uref{http://sourceforge.net/projects/table}, and also part of Emacs 22).
  10917. Org-mode will recognize these tables and export them properly. Because of
  10918. interference with other Org-mode functionality, you unfortunately cannot edit
  10919. these tables directly in the buffer. Instead, you need to use the command
  10920. @kbd{C-c '} to edit them, similar to source code snippets.
  10921. @table @kbd
  10922. @kindex C-c '
  10923. @item C-c '
  10924. Edit a @file{table.el} table. Works when the cursor is in a table.el table.
  10925. @c
  10926. @kindex C-c ~
  10927. @item C-c ~
  10928. Insert a @file{table.el} table. If there is already a table at point, this
  10929. command converts it between the @file{table.el} format and the Org-mode
  10930. format. See the documentation string of the command
  10931. @code{org-convert-table} for the restrictions under which this is
  10932. possible.
  10933. @end table
  10934. @file{table.el} is part of Emacs since Emacs 22.
  10935. @item @file{footnote.el} by Steven L. Baur
  10936. @cindex @file{footnote.el}
  10937. @cindex Baur, Steven L.
  10938. Org mode recognizes numerical footnotes as provided by this package.
  10939. However, Org mode also has its own footnote support (@pxref{Footnotes}),
  10940. which makes using @file{footnote.el} unnecessary.
  10941. @end table
  10942. @node Conflicts, , Cooperation, Interaction
  10943. @subsection Packages that lead to conflicts with Org mode
  10944. @table @asis
  10945. @cindex @code{shift-selection-mode}
  10946. @vindex org-support-shift-select
  10947. In Emacs 23, @code{shift-selection-mode} is on by default, meaning that
  10948. cursor motions combined with the shift key should start or enlarge regions.
  10949. This conflicts with the use of @kbd{S-@key{cursor}} commands in Org to change
  10950. timestamps, TODO keywords, priorities, and item bullet types if the cursor is
  10951. at such a location. By default, @kbd{S-@key{cursor}} commands outside
  10952. special contexts don't do anything, but you can customize the variable
  10953. @code{org-support-shift-select}. Org mode then tries to accommodate shift
  10954. selection by (i) using it outside of the special contexts where special
  10955. commands apply, and by (ii) extending an existing active region even if the
  10956. cursor moves across a special context.
  10957. @item @file{CUA.el} by Kim. F. Storm
  10958. @cindex @file{CUA.el}
  10959. @cindex Storm, Kim. F.
  10960. @vindex org-replace-disputed-keys
  10961. Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by CUA mode
  10962. (as well as @code{pc-select-mode} and @code{s-region-mode}) to select and extend the
  10963. region. In fact, Emacs 23 has this built-in in the form of
  10964. @code{shift-selection-mode}, see previous paragraph. If you are using Emacs
  10965. 23, you probably don't want to use another package for this purpose. However,
  10966. if you prefer to leave these keys to a different package while working in
  10967. Org mode, configure the variable @code{org-replace-disputed-keys}. When set,
  10968. Org will move the following key bindings in Org files, and in the agenda
  10969. buffer (but not during date selection).
  10970. @example
  10971. S-UP -> M-p S-DOWN -> M-n
  10972. S-LEFT -> M-- S-RIGHT -> M-+
  10973. C-S-LEFT -> M-S-- C-S-RIGHT -> M-S-+
  10974. @end example
  10975. @vindex org-disputed-keys
  10976. Yes, these are unfortunately more difficult to remember. If you want
  10977. to have other replacement keys, look at the variable
  10978. @code{org-disputed-keys}.
  10979. @item @file{yasnippet.el}
  10980. @cindex @file{yasnippet.el}
  10981. The way Org-mode binds the TAB key (binding to @code{[tab]} instead of
  10982. @code{"\t"}) overrules yasnippets' access to this key. The following code
  10983. fixed this problem:
  10984. @lisp
  10985. (add-hook 'org-mode-hook
  10986. (lambda ()
  10987. (org-set-local 'yas/trigger-key [tab])
  10988. (define-key yas/keymap [tab] 'yas/next-field-group)))
  10989. @end lisp
  10990. @item @file{windmove.el} by Hovav Shacham
  10991. @cindex @file{windmove.el}
  10992. This package also uses the @kbd{S-<cursor>} keys, so everything written
  10993. in the paragraph above about CUA mode also applies here.
  10994. @item @file{viper.el} by Michael Kifer
  10995. @cindex @file{viper.el}
  10996. @kindex C-c /
  10997. Viper uses @kbd{C-c /} and therefore makes this key not access the
  10998. corresponding Org-mode command @code{org-sparse-tree}. You need to find
  10999. another key for this command, or override the key in
  11000. @code{viper-vi-global-user-map} with
  11001. @lisp
  11002. (define-key viper-vi-global-user-map "C-c /" 'org-sparse-tree)
  11003. @end lisp
  11004. @end table
  11005. @node Hacking, MobileOrg, Miscellaneous, Top
  11006. @appendix Hacking
  11007. @cindex hacking
  11008. This appendix covers some aspects where users can extend the functionality of
  11009. Org.
  11010. @menu
  11011. * Hooks:: Who to reach into Org's internals
  11012. * Add-on packages:: Available extensions
  11013. * Adding hyperlink types:: New custom link types
  11014. * Context-sensitive commands:: How to add functionality to such commands
  11015. * Tables in arbitrary syntax:: Orgtbl for La@TeX{} and other programs
  11016. * Dynamic blocks:: Automatically filled blocks
  11017. * Special agenda views:: Customized views
  11018. * Extracting agenda information:: Postprocessing of agenda information
  11019. * Using the property API:: Writing programs that use entry properties
  11020. * Using the mapping API:: Mapping over all or selected entries
  11021. @end menu
  11022. @node Hooks, Add-on packages, Hacking, Hacking
  11023. @section Hooks
  11024. @cindex hooks
  11025. Org has a large number of hook variables that can be used to add
  11026. functionality. This appendix about hacking is going to illustrate the
  11027. use of some of them. A complete list of all hooks with documentation is
  11028. maintained by the Worg project and can be found at
  11029. @uref{http://orgmode.org/worg/org-configs/org-hooks.php}.
  11030. @node Add-on packages, Adding hyperlink types, Hooks, Hacking
  11031. @section Add-on packages
  11032. @cindex add-on packages
  11033. A large number of add-on packages have been written by various authors.
  11034. These packages are not part of Emacs, but they are distributed as contributed
  11035. packages with the separate release available at the Org mode home page at
  11036. @uref{http://orgmode.org}. The list of contributed packages, along with
  11037. documentation about each package, is maintained by the Worg project at
  11038. @uref{http://orgmode.org/worg/org-contrib/}.
  11039. @node Adding hyperlink types, Context-sensitive commands, Add-on packages, Hacking
  11040. @section Adding hyperlink types
  11041. @cindex hyperlinks, adding new types
  11042. Org has a large number of hyperlink types built-in
  11043. (@pxref{Hyperlinks}). If you would like to add new link types, Org
  11044. provides an interface for doing so. Let's look at an example file,
  11045. @file{org-man.el}, that will add support for creating links like
  11046. @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
  11047. Emacs:
  11048. @lisp
  11049. ;;; org-man.el - Support for links to manpages in Org
  11050. (require 'org)
  11051. (org-add-link-type "man" 'org-man-open)
  11052. (add-hook 'org-store-link-functions 'org-man-store-link)
  11053. (defcustom org-man-command 'man
  11054. "The Emacs command to be used to display a man page."
  11055. :group 'org-link
  11056. :type '(choice (const man) (const woman)))
  11057. (defun org-man-open (path)
  11058. "Visit the manpage on PATH.
  11059. PATH should be a topic that can be thrown at the man command."
  11060. (funcall org-man-command path))
  11061. (defun org-man-store-link ()
  11062. "Store a link to a manpage."
  11063. (when (memq major-mode '(Man-mode woman-mode))
  11064. ;; This is a man page, we do make this link
  11065. (let* ((page (org-man-get-page-name))
  11066. (link (concat "man:" page))
  11067. (description (format "Manpage for %s" page)))
  11068. (org-store-link-props
  11069. :type "man"
  11070. :link link
  11071. :description description))))
  11072. (defun org-man-get-page-name ()
  11073. "Extract the page name from the buffer name."
  11074. ;; This works for both `Man-mode' and `woman-mode'.
  11075. (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
  11076. (match-string 1 (buffer-name))
  11077. (error "Cannot create link to this man page")))
  11078. (provide 'org-man)
  11079. ;;; org-man.el ends here
  11080. @end lisp
  11081. @noindent
  11082. You would activate this new link type in @file{.emacs} with
  11083. @lisp
  11084. (require 'org-man)
  11085. @end lisp
  11086. @noindent
  11087. Let's go through the file and see what it does.
  11088. @enumerate
  11089. @item
  11090. It does @code{(require 'org)} to make sure that @file{org.el} has been
  11091. loaded.
  11092. @item
  11093. The next line calls @code{org-add-link-type} to define a new link type
  11094. with prefix @samp{man}. The call also contains the name of a function
  11095. that will be called to follow such a link.
  11096. @item
  11097. @vindex org-store-link-functions
  11098. The next line adds a function to @code{org-store-link-functions}, in
  11099. order to allow the command @kbd{C-c l} to record a useful link in a
  11100. buffer displaying a man page.
  11101. @end enumerate
  11102. The rest of the file defines the necessary variables and functions.
  11103. First there is a customization variable that determines which Emacs
  11104. command should be used to display man pages. There are two options,
  11105. @code{man} and @code{woman}. Then the function to follow a link is
  11106. defined. It gets the link path as an argument---in this case the link
  11107. path is just a topic for the manual command. The function calls the
  11108. value of @code{org-man-command} to display the man page.
  11109. Finally the function @code{org-man-store-link} is defined. When you try
  11110. to store a link with @kbd{C-c l}, this function will be called to
  11111. try to make a link. The function must first decide if it is supposed to
  11112. create the link for this buffer type; we do this by checking the value
  11113. of the variable @code{major-mode}. If not, the function must exit and
  11114. return the value @code{nil}. If yes, the link is created by getting the
  11115. manual topic from the buffer name and prefixing it with the string
  11116. @samp{man:}. Then it must call the command @code{org-store-link-props}
  11117. and set the @code{:type} and @code{:link} properties. Optionally you
  11118. can also set the @code{:description} property to provide a default for
  11119. the link description when the link is later inserted into an Org
  11120. buffer with @kbd{C-c C-l}.
  11121. When is makes sense for your new link type, you may also define a function
  11122. @code{org-PREFIX-complete-link} that implements special (e.g. completion)
  11123. support for inserting such a link with @kbd{C-c C-l}. Such a function should
  11124. not accept any arguments, and return the full link with prefix.
  11125. @node Context-sensitive commands, Tables in arbitrary syntax, Adding hyperlink types, Hacking
  11126. @section Context-sensitive commands
  11127. @cindex context-sensitive commands, hooks
  11128. @cindex add-ons, context-sensitive commands
  11129. @vindex org-ctrl-c-ctrl-c-hook
  11130. Org has several commands that act differently depending on context. The most
  11131. important example it the @kbd{C-c C-c} (@pxref{The very busy C-c C-c key}).
  11132. Also the @kbd{M-cursor} and @kbd{M-S-cursor} keys have this property.
  11133. Add-ons can tap into this functionality by providing a function that detects
  11134. special context for that add-on and executes functionality appropriate for
  11135. the context. Here is an example from Dan Davison's @file{org-R.el} which
  11136. allows you to evaluate commands based on the @file{R} programming language. For
  11137. this package, special contexts are lines that start with @code{#+R:} or
  11138. @code{#+RR:}.
  11139. @lisp
  11140. (defun org-R-apply-maybe ()
  11141. "Detect if this is context for org-R and execute R commands."
  11142. (if (save-excursion
  11143. (beginning-of-line 1)
  11144. (looking-at "#\\+RR?:"))
  11145. (progn (call-interactively 'org-R-apply)
  11146. t) ;; to signal that we took action
  11147. nil)) ;; to signal that we did not
  11148. (add-hook 'org-ctrl-c-ctrl-c-hook 'org-R-apply-maybe)
  11149. @end lisp
  11150. The function first checks if the cursor is in such a line. If that is the
  11151. case, @code{org-R-apply} is called and the function returns @code{t} to
  11152. signal that action was taken, and @kbd{C-c C-c} will stop looking for other
  11153. contexts. If the function finds it should do nothing locally, it returns @code{nil} so that other, similar functions can have a try.
  11154. @node Tables in arbitrary syntax, Dynamic blocks, Context-sensitive commands, Hacking
  11155. @section Tables and lists in arbitrary syntax
  11156. @cindex tables, in other modes
  11157. @cindex lists, in other modes
  11158. @cindex Orgtbl mode
  11159. Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
  11160. frequent feature request has been to make it work with native tables in
  11161. specific languages, for example La@TeX{}. However, this is extremely
  11162. hard to do in a general way, would lead to a customization nightmare,
  11163. and would take away much of the simplicity of the Orgtbl-mode table
  11164. editor.
  11165. This appendix describes a different approach. We keep the Orgtbl mode
  11166. table in its native format (the @i{source table}), and use a custom
  11167. function to @i{translate} the table to the correct syntax, and to
  11168. @i{install} it in the right location (the @i{target table}). This puts
  11169. the burden of writing conversion functions on the user, but it allows
  11170. for a very flexible system.
  11171. Bastien added the ability to do the same with lists. You can use Org's
  11172. facilities to edit and structure lists by turning @code{orgstruct-mode}
  11173. on, then locally exporting such lists in another format (HTML, La@TeX{}
  11174. or Texinfo.)
  11175. @menu
  11176. * Radio tables:: Sending and receiving radio tables
  11177. * A LaTeX example:: Step by step, almost a tutorial
  11178. * Translator functions:: Copy and modify
  11179. * Radio lists:: Doing the same for lists
  11180. @end menu
  11181. @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
  11182. @subsection Radio tables
  11183. @cindex radio tables
  11184. To define the location of the target table, you first need to create two
  11185. lines that are comments in the current mode, but contain magic words for
  11186. Orgtbl mode to find. Orgtbl mode will insert the translated table
  11187. between these lines, replacing whatever was there before. For example:
  11188. @example
  11189. /* BEGIN RECEIVE ORGTBL table_name */
  11190. /* END RECEIVE ORGTBL table_name */
  11191. @end example
  11192. @noindent
  11193. Just above the source table, we put a special line that tells
  11194. Orgtbl mode how to translate this table and where to install it. For
  11195. example:
  11196. @cindex #+ORGTBL
  11197. @example
  11198. #+ORGTBL: SEND table_name translation_function arguments....
  11199. @end example
  11200. @noindent
  11201. @code{table_name} is the reference name for the table that is also used
  11202. in the receiver lines. @code{translation_function} is the Lisp function
  11203. that does the translation. Furthermore, the line can contain a list of
  11204. arguments (alternating key and value) at the end. The arguments will be
  11205. passed as a property list to the translation function for
  11206. interpretation. A few standard parameters are already recognized and
  11207. acted upon before the translation function is called:
  11208. @table @code
  11209. @item :skip N
  11210. Skip the first N lines of the table. Hlines do count as separate lines for
  11211. this parameter!
  11212. @item :skipcols (n1 n2 ...)
  11213. List of columns that should be skipped. If the table has a column with
  11214. calculation marks, that column is automatically discarded as well.
  11215. Please note that the translator function sees the table @emph{after} the
  11216. removal of these columns, the function never knows that there have been
  11217. additional columns.
  11218. @end table
  11219. @noindent
  11220. The one problem remaining is how to keep the source table in the buffer
  11221. without disturbing the normal workings of the file, for example during
  11222. compilation of a C file or processing of a La@TeX{} file. There are a
  11223. number of different solutions:
  11224. @itemize @bullet
  11225. @item
  11226. The table could be placed in a block comment if that is supported by the
  11227. language. For example, in C mode you could wrap the table between
  11228. @samp{/*} and @samp{*/} lines.
  11229. @item
  11230. Sometimes it is possible to put the table after some kind of @i{END}
  11231. statement, for example @samp{\bye} in @TeX{} and @samp{\end@{document@}}
  11232. in La@TeX{}.
  11233. @item
  11234. You can just comment the table line-by-line whenever you want to process
  11235. the file, and uncomment it whenever you need to edit the table. This
  11236. only sounds tedious---the command @kbd{M-x orgtbl-toggle-comment}
  11237. makes this comment-toggling very easy, in particular if you bind it to a
  11238. key.
  11239. @end itemize
  11240. @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
  11241. @subsection A La@TeX{} example of radio tables
  11242. @cindex La@TeX{}, and Orgtbl mode
  11243. The best way to wrap the source table in La@TeX{} is to use the
  11244. @code{comment} environment provided by @file{comment.sty}. It has to be
  11245. activated by placing @code{\usepackage@{comment@}} into the document
  11246. header. Orgtbl mode can insert a radio table skeleton@footnote{By
  11247. default this works only for La@TeX{}, HTML, and Texinfo. Configure the
  11248. variable @code{orgtbl-radio-tables} to install templates for other
  11249. modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
  11250. be prompted for a table name, let's say we use @samp{salesfigures}. You
  11251. will then get the following template:
  11252. @cindex #+ORGTBL, SEND
  11253. @example
  11254. % BEGIN RECEIVE ORGTBL salesfigures
  11255. % END RECEIVE ORGTBL salesfigures
  11256. \begin@{comment@}
  11257. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  11258. | | |
  11259. \end@{comment@}
  11260. @end example
  11261. @noindent
  11262. @vindex La@TeX{}-verbatim-environments
  11263. The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
  11264. @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
  11265. into the receiver location with name @code{salesfigures}. You may now
  11266. fill in the table, feel free to use the spreadsheet features@footnote{If
  11267. the @samp{#+TBLFM} line contains an odd number of dollar characters,
  11268. this may cause problems with font-lock in La@TeX{} mode. As shown in the
  11269. example you can fix this by adding an extra line inside the
  11270. @code{comment} environment that is used to balance the dollar
  11271. expressions. If you are using AUC@TeX{} with the font-latex library, a
  11272. much better solution is to add the @code{comment} environment to the
  11273. variable @code{LaTeX-verbatim-environments}.}:
  11274. @example
  11275. % BEGIN RECEIVE ORGTBL salesfigures
  11276. % END RECEIVE ORGTBL salesfigures
  11277. \begin@{comment@}
  11278. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  11279. | Month | Days | Nr sold | per day |
  11280. |-------+------+---------+---------|
  11281. | Jan | 23 | 55 | 2.4 |
  11282. | Feb | 21 | 16 | 0.8 |
  11283. | March | 22 | 278 | 12.6 |
  11284. #+TBLFM: $4=$3/$2;%.1f
  11285. % $ (optional extra dollar to keep font-lock happy, see footnote)
  11286. \end@{comment@}
  11287. @end example
  11288. @noindent
  11289. When you are done, press @kbd{C-c C-c} in the table to get the converted
  11290. table inserted between the two marker lines.
  11291. Now let's assume you want to make the table header by hand, because you
  11292. want to control how columns are aligned, etc@. In this case we make sure
  11293. that the table translator skips the first 2 lines of the source
  11294. table, and tell the command to work as a @i{splice}, i.e. to not produce
  11295. header and footer commands of the target table:
  11296. @example
  11297. \begin@{tabular@}@{lrrr@}
  11298. Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
  11299. % BEGIN RECEIVE ORGTBL salesfigures
  11300. % END RECEIVE ORGTBL salesfigures
  11301. \end@{tabular@}
  11302. %
  11303. \begin@{comment@}
  11304. #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
  11305. | Month | Days | Nr sold | per day |
  11306. |-------+------+---------+---------|
  11307. | Jan | 23 | 55 | 2.4 |
  11308. | Feb | 21 | 16 | 0.8 |
  11309. | March | 22 | 278 | 12.6 |
  11310. #+TBLFM: $4=$3/$2;%.1f
  11311. \end@{comment@}
  11312. @end example
  11313. The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
  11314. Orgtbl mode. It uses a @code{tabular} environment to typeset the table
  11315. and marks horizontal lines with @code{\hline}. Furthermore, it
  11316. interprets the following parameters (see also @pxref{Translator functions}):
  11317. @table @code
  11318. @item :splice nil/t
  11319. When set to t, return only table body lines, don't wrap them into a
  11320. tabular environment. Default is nil.
  11321. @item :fmt fmt
  11322. A format to be used to wrap each field, it should contain @code{%s} for the
  11323. original field value. For example, to wrap each field value in dollars,
  11324. you could use @code{:fmt "$%s$"}. This may also be a property list with
  11325. column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
  11326. A function of one argument can be used in place of the strings; the
  11327. function must return a formatted string.
  11328. @item :efmt efmt
  11329. Use this format to print numbers with exponentials. The format should
  11330. have @code{%s} twice for inserting mantissa and exponent, for example
  11331. @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
  11332. may also be a property list with column numbers and formats, for example
  11333. @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
  11334. @code{efmt} has been applied to a value, @code{fmt} will also be
  11335. applied. Similar to @code{fmt}, functions of two arguments can be
  11336. supplied instead of strings.
  11337. @end table
  11338. @node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
  11339. @subsection Translator functions
  11340. @cindex HTML, and Orgtbl mode
  11341. @cindex translator function
  11342. Orgtbl mode has several translator functions built-in: @code{orgtbl-to-csv}
  11343. (comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values)
  11344. @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and @code{orgtbl-to-texinfo}.
  11345. Except for @code{orgtbl-to-html}@footnote{The HTML translator uses the same
  11346. code that produces tables during HTML export.}, these all use a generic
  11347. translator, @code{orgtbl-to-generic}. For example, @code{orgtbl-to-latex}
  11348. itself is a very short function that computes the column definitions for the
  11349. @code{tabular} environment, defines a few field and line separators and then
  11350. hands processing over to the generic translator. Here is the entire code:
  11351. @lisp
  11352. @group
  11353. (defun orgtbl-to-latex (table params)
  11354. "Convert the Orgtbl mode TABLE to LaTeX."
  11355. (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
  11356. org-table-last-alignment ""))
  11357. (params2
  11358. (list
  11359. :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
  11360. :tend "\\end@{tabular@}"
  11361. :lstart "" :lend " \\\\" :sep " & "
  11362. :efmt "%s\\,(%s)" :hline "\\hline")))
  11363. (orgtbl-to-generic table (org-combine-plists params2 params))))
  11364. @end group
  11365. @end lisp
  11366. As you can see, the properties passed into the function (variable
  11367. @var{PARAMS}) are combined with the ones newly defined in the function
  11368. (variable @var{PARAMS2}). The ones passed into the function (i.e. the
  11369. ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
  11370. would like to use the La@TeX{} translator, but wanted the line endings to
  11371. be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
  11372. overrule the default with
  11373. @example
  11374. #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
  11375. @end example
  11376. For a new language, you can either write your own converter function in
  11377. analogy with the La@TeX{} translator, or you can use the generic function
  11378. directly. For example, if you have a language where a table is started
  11379. with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
  11380. started with @samp{!BL!}, ended with @samp{!EL!}, and where the field
  11381. separator is a TAB, you could call the generic translator like this (on
  11382. a single line!):
  11383. @example
  11384. #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
  11385. :lstart "!BL! " :lend " !EL!" :sep "\t"
  11386. @end example
  11387. @noindent
  11388. Please check the documentation string of the function
  11389. @code{orgtbl-to-generic} for a full list of parameters understood by
  11390. that function, and remember that you can pass each of them into
  11391. @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
  11392. using the generic function.
  11393. Of course you can also write a completely new function doing complicated
  11394. things the generic translator cannot do. A translator function takes
  11395. two arguments. The first argument is the table, a list of lines, each
  11396. line either the symbol @code{hline} or a list of fields. The second
  11397. argument is the property list containing all parameters specified in the
  11398. @samp{#+ORGTBL: SEND} line. The function must return a single string
  11399. containing the formatted table. If you write a generally useful
  11400. translator, please post it on @email{emacs-orgmode@@gnu.org} so that
  11401. others can benefit from your work.
  11402. @node Radio lists, , Translator functions, Tables in arbitrary syntax
  11403. @subsection Radio lists
  11404. @cindex radio lists
  11405. @cindex org-list-insert-radio-list
  11406. Sending and receiving radio lists works exactly the same way than sending and
  11407. receiving radio tables (@pxref{Radio tables}). As for radio tables, you can
  11408. insert radio lists templates in HTML, La@TeX{} and Texinfo modes by calling
  11409. @code{org-list-insert-radio-list}.
  11410. Here are the differences with radio tables:
  11411. @itemize @minus
  11412. @item
  11413. Use @code{ORGLST} instead of @code{ORGTBL}.
  11414. @item
  11415. The available translation functions for radio lists don't take
  11416. parameters.
  11417. @item
  11418. @kbd{C-c C-c} will work when pressed on the first item of the list.
  11419. @end itemize
  11420. Here is a La@TeX{} example. Let's say that you have this in your
  11421. La@TeX{} file:
  11422. @cindex #+ORGLIST
  11423. @example
  11424. % BEGIN RECEIVE ORGLST to-buy
  11425. % END RECEIVE ORGLST to-buy
  11426. \begin@{comment@}
  11427. #+ORGLIST: SEND to-buy orgtbl-to-latex
  11428. - a new house
  11429. - a new computer
  11430. + a new keyboard
  11431. + a new mouse
  11432. - a new life
  11433. \end@{comment@}
  11434. @end example
  11435. Pressing `C-c C-c' on @code{a new house} and will insert the converted
  11436. La@TeX{} list between the two marker lines.
  11437. @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
  11438. @section Dynamic blocks
  11439. @cindex dynamic blocks
  11440. Org documents can contain @emph{dynamic blocks}. These are
  11441. specially marked regions that are updated by some user-written function.
  11442. A good example for such a block is the clock table inserted by the
  11443. command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
  11444. Dynamic block are enclosed by a BEGIN-END structure that assigns a name
  11445. to the block and can also specify parameters for the function producing
  11446. the content of the block.
  11447. #+BEGIN:dynamic block
  11448. @example
  11449. #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
  11450. #+END:
  11451. @end example
  11452. Dynamic blocks are updated with the following commands
  11453. @table @kbd
  11454. @kindex C-c C-x C-u
  11455. @item C-c C-x C-u
  11456. Update dynamic block at point.
  11457. @kindex C-u C-c C-x C-u
  11458. @item C-u C-c C-x C-u
  11459. Update all dynamic blocks in the current file.
  11460. @end table
  11461. Updating a dynamic block means to remove all the text between BEGIN and
  11462. END, parse the BEGIN line for parameters and then call the specific
  11463. writer function for this block to insert the new content. If you want
  11464. to use the original content in the writer function, you can use the
  11465. extra parameter @code{:content}.
  11466. For a block with name @code{myblock}, the writer function is
  11467. @code{org-dblock-write:myblock} with as only parameter a property list
  11468. with the parameters given in the begin line. Here is a trivial example
  11469. of a block that keeps track of when the block update function was last
  11470. run:
  11471. @example
  11472. #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
  11473. #+END:
  11474. @end example
  11475. @noindent
  11476. The corresponding block writer function could look like this:
  11477. @lisp
  11478. (defun org-dblock-write:block-update-time (params)
  11479. (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
  11480. (insert "Last block update at: "
  11481. (format-time-string fmt (current-time)))))
  11482. @end lisp
  11483. If you want to make sure that all dynamic blocks are always up-to-date,
  11484. you could add the function @code{org-update-all-dblocks} to a hook, for
  11485. example @code{before-save-hook}. @code{org-update-all-dblocks} is
  11486. written in a way such that it does nothing in buffers that are not in
  11487. @code{org-mode}.
  11488. @node Special agenda views, Extracting agenda information, Dynamic blocks, Hacking
  11489. @section Special agenda views
  11490. @cindex agenda views, user-defined
  11491. Org provides a special hook that can be used to narrow down the
  11492. selection made by any of the agenda views. You may specify a function
  11493. that is used at each match to verify if the match should indeed be part
  11494. of the agenda view, and if not, how much should be skipped.
  11495. Let's say you want to produce a list of projects that contain a WAITING
  11496. tag anywhere in the project tree. Let's further assume that you have
  11497. marked all tree headings that define a project with the TODO keyword
  11498. PROJECT. In this case you would run a TODO search for the keyword
  11499. PROJECT, but skip the match unless there is a WAITING tag anywhere in
  11500. the subtree belonging to the project line.
  11501. To achieve this, you must write a function that searches the subtree for
  11502. the tag. If the tag is found, the function must return @code{nil} to
  11503. indicate that this match should not be skipped. If there is no such
  11504. tag, return the location of the end of the subtree, to indicate that
  11505. search should continue from there.
  11506. @lisp
  11507. (defun my-skip-unless-waiting ()
  11508. "Skip trees that are not waiting"
  11509. (let ((subtree-end (save-excursion (org-end-of-subtree t))))
  11510. (if (re-search-forward ":waiting:" subtree-end t)
  11511. nil ; tag found, do not skip
  11512. subtree-end))) ; tag not found, continue after end of subtree
  11513. @end lisp
  11514. Now you may use this function in an agenda custom command, for example
  11515. like this:
  11516. @lisp
  11517. (org-add-agenda-custom-command
  11518. '("b" todo "PROJECT"
  11519. ((org-agenda-skip-function 'my-skip-unless-waiting)
  11520. (org-agenda-overriding-header "Projects waiting for something: "))))
  11521. @end lisp
  11522. @vindex org-agenda-overriding-header
  11523. Note that this also binds @code{org-agenda-overriding-header} to get a
  11524. meaningful header in the agenda view.
  11525. @vindex org-odd-levels-only
  11526. @vindex org-agenda-skip-function
  11527. A general way to create custom searches is to base them on a search for
  11528. entries with a certain level limit. If you want to study all entries with
  11529. your custom search function, simply do a search for
  11530. @samp{LEVEL>0}@footnote{Note that, when using @code{org-odd-levels-only}, a
  11531. level number corresponds to order in the hierarchy, not to the number of
  11532. stars.}, and then use @code{org-agenda-skip-function} to select the entries
  11533. you really want to have.
  11534. You may also put a Lisp form into @code{org-agenda-skip-function}. In
  11535. particular, you may use the functions @code{org-agenda-skip-entry-if}
  11536. and @code{org-agenda-skip-subtree-if} in this form, for example:
  11537. @table @code
  11538. @item '(org-agenda-skip-entry-if 'scheduled)
  11539. Skip current entry if it has been scheduled.
  11540. @item '(org-agenda-skip-entry-if 'notscheduled)
  11541. Skip current entry if it has not been scheduled.
  11542. @item '(org-agenda-skip-entry-if 'deadline)
  11543. Skip current entry if it has a deadline.
  11544. @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
  11545. Skip current entry if it has a deadline, or if it is scheduled.
  11546. @item '(org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))
  11547. Skip current entry if the TODO keyword is TODO or WAITING.
  11548. @item '(org-agenda-skip-entry-if 'todo 'done)
  11549. Skip current entry if the TODO keyword marks a DONE state.
  11550. @item '(org-agenda-skip-entry-if 'timestamp)
  11551. Skip current entry if it has any timestamp, may also be deadline or scheduled.
  11552. @item '(org-agenda-skip-entry 'regexp "regular expression")
  11553. Skip current entry if the regular expression matches in the entry.
  11554. @item '(org-agenda-skip-entry 'notregexp "regular expression")
  11555. Skip current entry unless the regular expression matches.
  11556. @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
  11557. Same as above, but check and skip the entire subtree.
  11558. @end table
  11559. Therefore we could also have written the search for WAITING projects
  11560. like this, even without defining a special function:
  11561. @lisp
  11562. (org-add-agenda-custom-command
  11563. '("b" todo "PROJECT"
  11564. ((org-agenda-skip-function '(org-agenda-skip-subtree-if
  11565. 'regexp ":waiting:"))
  11566. (org-agenda-overriding-header "Projects waiting for something: "))))
  11567. @end lisp
  11568. @node Extracting agenda information, Using the property API, Special agenda views, Hacking
  11569. @section Extracting agenda information
  11570. @cindex agenda, pipe
  11571. @cindex Scripts, for agenda processing
  11572. @vindex org-agenda-custom-commands
  11573. Org provides commands to access agenda information for the command
  11574. line in Emacs batch mode. This extracted information can be sent
  11575. directly to a printer, or it can be read by a program that does further
  11576. processing of the data. The first of these commands is the function
  11577. @code{org-batch-agenda}, that produces an agenda view and sends it as
  11578. ASCII text to STDOUT. The command takes a single string as parameter.
  11579. If the string has length 1, it is used as a key to one of the commands
  11580. you have configured in @code{org-agenda-custom-commands}, basically any
  11581. key you can use after @kbd{C-c a}. For example, to directly print the
  11582. current TODO list, you could use
  11583. @example
  11584. emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
  11585. @end example
  11586. If the parameter is a string with 2 or more characters, it is used as a
  11587. tags/TODO match string. For example, to print your local shopping list
  11588. (all items with the tag @samp{shop}, but excluding the tag
  11589. @samp{NewYork}), you could use
  11590. @example
  11591. emacs -batch -l ~/.emacs \
  11592. -eval '(org-batch-agenda "+shop-NewYork")' | lpr
  11593. @end example
  11594. @noindent
  11595. You may also modify parameters on the fly like this:
  11596. @example
  11597. emacs -batch -l ~/.emacs \
  11598. -eval '(org-batch-agenda "a" \
  11599. org-agenda-ndays 30 \
  11600. org-agenda-include-diary nil \
  11601. org-agenda-files (quote ("~/org/project.org")))' \
  11602. | lpr
  11603. @end example
  11604. @noindent
  11605. which will produce a 30-day agenda, fully restricted to the Org file
  11606. @file{~/org/projects.org}, not even including the diary.
  11607. If you want to process the agenda data in more sophisticated ways, you
  11608. can use the command @code{org-batch-agenda-csv} to get a comma-separated
  11609. list of values for each agenda item. Each line in the output will
  11610. contain a number of fields separated by commas. The fields in a line
  11611. are:
  11612. @example
  11613. category @r{The category of the item}
  11614. head @r{The headline, without TODO keyword, TAGS and PRIORITY}
  11615. type @r{The type of the agenda entry, can be}
  11616. todo @r{selected in TODO match}
  11617. tagsmatch @r{selected in tags match}
  11618. diary @r{imported from diary}
  11619. deadline @r{a deadline}
  11620. scheduled @r{scheduled}
  11621. timestamp @r{appointment, selected by timestamp}
  11622. closed @r{entry was closed on date}
  11623. upcoming-deadline @r{warning about nearing deadline}
  11624. past-scheduled @r{forwarded scheduled item}
  11625. block @r{entry has date block including date}
  11626. todo @r{The TODO keyword, if any}
  11627. tags @r{All tags including inherited ones, separated by colons}
  11628. date @r{The relevant date, like 2007-2-14}
  11629. time @r{The time, like 15:00-16:50}
  11630. extra @r{String with extra planning info}
  11631. priority-l @r{The priority letter if any was given}
  11632. priority-n @r{The computed numerical priority}
  11633. @end example
  11634. @noindent
  11635. Time and date will only be given if a timestamp (or deadline/scheduled)
  11636. led to the selection of the item.
  11637. A CSV list like this is very easy to use in a post-processing script.
  11638. For example, here is a Perl program that gets the TODO list from
  11639. Emacs/Org and prints all the items, preceded by a checkbox:
  11640. @example
  11641. #!/usr/bin/perl
  11642. # define the Emacs command to run
  11643. $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
  11644. # run it and capture the output
  11645. $agenda = qx@{$cmd 2>/dev/null@};
  11646. # loop over all lines
  11647. foreach $line (split(/\n/,$agenda)) @{
  11648. # get the individual values
  11649. ($category,$head,$type,$todo,$tags,$date,$time,$extra,
  11650. $priority_l,$priority_n) = split(/,/,$line);
  11651. # process and print
  11652. print "[ ] $head\n";
  11653. @}
  11654. @end example
  11655. @node Using the property API, Using the mapping API, Extracting agenda information, Hacking
  11656. @section Using the property API
  11657. @cindex API, for properties
  11658. @cindex properties, API
  11659. Here is a description of the functions that can be used to work with
  11660. properties.
  11661. @defun org-entry-properties &optional pom which
  11662. Get all properties of the entry at point-or-marker POM.@*
  11663. This includes the TODO keyword, the tags, time strings for deadline,
  11664. scheduled, and clocking, and any additional properties defined in the
  11665. entry. The return value is an alist, keys may occur multiple times
  11666. if the property key was used several times.@*
  11667. POM may also be nil, in which case the current entry is used.
  11668. If WHICH is nil or `all', get all properties. If WHICH is
  11669. `special' or `standard', only get that subclass.
  11670. @end defun
  11671. @vindex org-use-property-inheritance
  11672. @defun org-entry-get pom property &optional inherit
  11673. Get value of PROPERTY for entry at point-or-marker POM. By default,
  11674. this only looks at properties defined locally in the entry. If INHERIT
  11675. is non-nil and the entry does not have the property, then also check
  11676. higher levels of the hierarchy. If INHERIT is the symbol
  11677. @code{selective}, use inheritance if and only if the setting of
  11678. @code{org-use-property-inheritance} selects PROPERTY for inheritance.
  11679. @end defun
  11680. @defun org-entry-delete pom property
  11681. Delete the property PROPERTY from entry at point-or-marker POM.
  11682. @end defun
  11683. @defun org-entry-put pom property value
  11684. Set PROPERTY to VALUE for entry at point-or-marker POM.
  11685. @end defun
  11686. @defun org-buffer-property-keys &optional include-specials
  11687. Get all property keys in the current buffer.
  11688. @end defun
  11689. @defun org-insert-property-drawer
  11690. Insert a property drawer at point.
  11691. @end defun
  11692. @defun org-entry-put-multivalued-property pom property &rest values
  11693. Set PROPERTY at point-or-marker POM to VALUES. VALUES should be a list of
  11694. strings. They will be concatenated, with spaces as separators.
  11695. @end defun
  11696. @defun org-entry-get-multivalued-property pom property
  11697. Treat the value of the property PROPERTY as a whitespace-separated list of
  11698. values and return the values as a list of strings.
  11699. @end defun
  11700. @defun org-entry-add-to-multivalued-property pom property value
  11701. Treat the value of the property PROPERTY as a whitespace-separated list of
  11702. values and make sure that VALUE is in this list.
  11703. @end defun
  11704. @defun org-entry-remove-from-multivalued-property pom property value
  11705. Treat the value of the property PROPERTY as a whitespace-separated list of
  11706. values and make sure that VALUE is @emph{not} in this list.
  11707. @end defun
  11708. @defun org-entry-member-in-multivalued-property pom property value
  11709. Treat the value of the property PROPERTY as a whitespace-separated list of
  11710. values and check if VALUE is in this list.
  11711. @end defun
  11712. @defopt org-property-allowed-value-functions
  11713. Hook for functions supplying allowed values for specific.
  11714. The functions must take a single argument, the name of the property, and
  11715. return a flat list of allowed values. If @samp{:ETC} is one of
  11716. the values, use the values as completion help, but allow also other values
  11717. to be entered. The functions must return @code{nil} if they are not
  11718. responsible for this property.
  11719. @end defopt
  11720. @node Using the mapping API, , Using the property API, Hacking
  11721. @section Using the mapping API
  11722. @cindex API, for mapping
  11723. @cindex mapping entries, API
  11724. Org has sophisticated mapping capabilities to find all entries satisfying
  11725. certain criteria. Internally, this functionality is used to produce agenda
  11726. views, but there is also an API that can be used to execute arbitrary
  11727. functions for each or selected entries. The main entry point for this API
  11728. is:
  11729. @defun org-map-entries func &optional match scope &rest skip
  11730. Call FUNC at each headline selected by MATCH in SCOPE.
  11731. FUNC is a function or a Lisp form. The function will be called without
  11732. arguments, with the cursor positioned at the beginning of the headline.
  11733. The return values of all calls to the function will be collected and
  11734. returned as a list.
  11735. The call to FUNC will be wrapped into a save-excursion form, so FUNC
  11736. does not need to preserve point. After evaluation, the cursor will be
  11737. moved to the end of the line (presumably of the headline of the
  11738. processed entry) and search continues from there. Under some
  11739. circumstances, this may not produce the wanted results. For example,
  11740. if you have removed (e.g. archived) the current (sub)tree it could
  11741. mean that the next entry will be skipped entirely. In such cases, you
  11742. can specify the position from where search should continue by making
  11743. FUNC set the variable `org-map-continue-from' to the desired buffer
  11744. position.
  11745. MATCH is a tags/property/todo match as it is used in the agenda match view.
  11746. Only headlines that are matched by this query will be considered during
  11747. the iteration. When MATCH is nil or t, all headlines will be
  11748. visited by the iteration.
  11749. SCOPE determines the scope of this command. It can be any of:
  11750. @example
  11751. nil @r{the current buffer, respecting the restriction if any}
  11752. tree @r{the subtree started with the entry at point}
  11753. file @r{the current buffer, without restriction}
  11754. file-with-archives
  11755. @r{the current buffer, and any archives associated with it}
  11756. agenda @r{all agenda files}
  11757. agenda-with-archives
  11758. @r{all agenda files with any archive files associated with them}
  11759. (file1 file2 ...)
  11760. @r{if this is a list, all files in the list will be scanned}
  11761. @end example
  11762. @noindent
  11763. The remaining args are treated as settings for the skipping facilities of
  11764. the scanner. The following items can be given here:
  11765. @vindex org-agenda-skip-function
  11766. @example
  11767. archive @r{skip trees with the archive tag}
  11768. comment @r{skip trees with the COMMENT keyword}
  11769. function or Lisp form
  11770. @r{will be used as value for @code{org-agenda-skip-function},}
  11771. @r{so whenever the function returns t, FUNC}
  11772. @r{will not be called for that entry and search will}
  11773. @r{continue from the point where the function leaves it}
  11774. @end example
  11775. @end defun
  11776. The function given to that mapping routine can really do anything you like.
  11777. It can use the property API (@pxref{Using the property API}) to gather more
  11778. information about the entry, or in order to change metadata in the entry.
  11779. Here are a couple of functions that might be handy:
  11780. @defun org-todo &optional arg
  11781. Change the TODO state of the entry, see the docstring of the functions for
  11782. the many possible values for the argument ARG.
  11783. @end defun
  11784. @defun org-priority &optional action
  11785. Change the priority of the entry, see the docstring of this function for the
  11786. possible values for ACTION.
  11787. @end defun
  11788. @defun org-toggle-tag tag &optional onoff
  11789. Toggle the tag TAG in the current entry. Setting ONOFF to either @code{on}
  11790. or @code{off} will not toggle tag, but ensure that it is either on or off.
  11791. @end defun
  11792. @defun org-promote
  11793. Promote the current entry.
  11794. @end defun
  11795. @defun org-demote
  11796. Demote the current entry.
  11797. @end defun
  11798. Here is a simple example that will turn all entries in the current file with
  11799. a tag @code{TOMORROW} into TODO entries with the keyword @code{UPCOMING}.
  11800. Entries in comment trees and in archive trees will be ignored.
  11801. @lisp
  11802. (org-map-entries
  11803. '(org-todo "UPCOMING")
  11804. "+TOMORROW" 'file 'archive 'comment)
  11805. @end lisp
  11806. The following example counts the number of entries with TODO keyword
  11807. @code{WAITING}, in all agenda files.
  11808. @lisp
  11809. (length (org-map-entries t "/+WAITING" 'agenda))
  11810. @end lisp
  11811. @node MobileOrg, History and Acknowledgments, Hacking, Top
  11812. @appendix MobileOrg
  11813. @cindex iPhone
  11814. @cindex MobileOrg
  11815. @i{MobileOrg} is an application for the @i{iPhone/iPod Touch} series of
  11816. devices, developed by Richard Moreland. @i{MobileOrg} offers offline viewing
  11817. and capture support for an Org-mode system rooted on a ``real'' computer. It
  11818. does also allow you to record changes to existing entries. For information
  11819. about @i{MobileOrg}, see @uref{http://mobileorg.ncogni.to/}).
  11820. This appendix describes the support Org has for creating agenda views in a
  11821. format that can be displayed by @i{MobileOrg}, and for integrating notes
  11822. captured and changes made by @i{MobileOrg} into the main system.
  11823. For changing tags and TODO states in MobileOrg, you should have set up the
  11824. customization variables @code{org-todo-keywords} and @code{org-tags-alist} to
  11825. cover all important tags and todo keywords, even if individual files use only
  11826. part of these. MobileOrg will also offer you states and tags set up with
  11827. in-buffer settings, but it will understand the logistics of todo state
  11828. @i{sets} (@pxref{Per-file keywords}) and @i{mutually exclusive} tags
  11829. (@pxref{Setting tags}) only for those set in these variables.
  11830. @menu
  11831. * Setting up the staging area:: Where to interact with the mobile device
  11832. * Pushing to MobileOrg:: Uploading Org files and agendas
  11833. * Pulling from MobileOrg:: Integrating captured and flagged items
  11834. @end menu
  11835. @node Setting up the staging area, Pushing to MobileOrg, MobileOrg, MobileOrg
  11836. @section Setting up the staging area
  11837. Org-mode has commands to prepare a directory with files for @i{MobileOrg},
  11838. and to read captured notes from there. If Emacs can directly write to the
  11839. WebDAV directory@footnote{If you are using a public server, you might prefer
  11840. to encrypt the files on the server. This can be done with Org-mode 6.35 and
  11841. MobileOrg 1.2. On the Emacs side, configure the variables
  11842. @code{org-mobile-use-encryption} and @code{org-mobile-encryption-password}.}
  11843. accessed by @i{MobileOrg}, just point to this directory using the variable
  11844. @code{org-mobile-directory}. Using the @file{tramp} method,
  11845. @code{org-mobile-directory} may point to a remote directory accessible
  11846. through, for example, @file{ssh/scp}:
  11847. @smallexample
  11848. (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
  11849. @end smallexample
  11850. If Emacs cannot access the WebDAV directory directly using a @file{tramp}
  11851. method, or you prefer to maintain a local copy, you can use a local directory
  11852. for staging. Other means must then be used to keep this directory in sync
  11853. with the WebDAV directory. In the following example, files are staged in
  11854. @file{~/stage}, and Org-mode hooks take care of moving files to and from the
  11855. WebDAV directory using @file{scp}.
  11856. @smallexample
  11857. (setq org-mobile-directory "~/stage/")
  11858. (add-hook 'org-mobile-post-push-hook
  11859. (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
  11860. (add-hook 'org-mobile-pre-pull-hook
  11861. (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
  11862. (add-hook 'org-mobile-post-pull-hook
  11863. (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
  11864. @end smallexample
  11865. @node Pushing to MobileOrg, Pulling from MobileOrg, Setting up the staging area, MobileOrg
  11866. @section Pushing to MobileOrg
  11867. This operation copies all files currently listed in @code{org-mobile-files}
  11868. to the directory @code{org-mobile-directory}. By default this list contains
  11869. all agenda files (as listed in @code{org-agenda-files}), but additional files
  11870. can be included by customizing @code{org-mobiles-files}. File names will be
  11871. staged with path relative to @code{org-directory}, so all files should be
  11872. inside this directory. The push operation also creates (in the same
  11873. directory) a special Org file @file{agendas.org}. This file is an Org-mode
  11874. style outline, containing every custom agenda view defined by the user.
  11875. While creating the agendas, Org-mode will force@footnote{See the variable
  11876. @code{org-mobile-force-id-on-agenda-items}.} an ID property on all entries
  11877. referenced by the agendas, so that these entries can be uniquely identified
  11878. if @i{MobileOrg} flags them for further action. Finally, Org writes the file
  11879. @file{index.org}, containing links to all other files. If @i{MobileOrg} is
  11880. configured to request this file from the WebDAV server, all agendas and Org
  11881. files will be downloaded to the device. To speed up the download, MobileOrg
  11882. will only read files whose checksums@footnote{stored automatically in the
  11883. file @file{checksums.dat}} have changed.
  11884. @node Pulling from MobileOrg, , Pushing to MobileOrg, MobileOrg
  11885. @section Pulling from MobileOrg
  11886. When @i{MobileOrg} synchronizes with the WebDAV server, it not only pulls the
  11887. Org files for viewing. It also appends captured entries and pointers to
  11888. flagged and changed entries to the file @file{mobileorg.org} on the server.
  11889. Org has a @emph{pull} operation that integrates this information into an
  11890. inbox file and operates on the pointers to flagged entries. Here is how it
  11891. works:
  11892. @enumerate
  11893. @item
  11894. Org moves all entries found in
  11895. @file{mobileorg.org}@footnote{@file{mobileorg.org} will be empty after this
  11896. operation.} and appends them to the file pointed to by the variable
  11897. @code{org-mobile-inbox-for-pull}. Each captured entry and each editing event
  11898. will be a top-level entry in the inbox file.
  11899. @item
  11900. After moving the entries, Org will attempt to implement the changes made in
  11901. @i{MobileOrg}. Some changes are applied directly and without user
  11902. interaction. Examples are all changes to tags, TODO state, headline and body
  11903. text that can be cleanly applied. Entries that have been flagged for further
  11904. action will receive a tag @code{:FLAGGED:}, so that they can be easily found
  11905. again. When there is a problem finding an entry or applying the change, the
  11906. pointer entry will remain in the inbox and will be marked with an error
  11907. message. You need to later resolve these issues by hand.
  11908. @item
  11909. Org will then generate an agenda view with all flagged entries. The user
  11910. should then go through these entries and do whatever actions are necessary.
  11911. If a note has been stored while flagging an entry in @i{MobileOrg}, that note
  11912. will be displayed in the echo area when the cursor is on the corresponding
  11913. agenda line.
  11914. @table @kbd
  11915. @kindex ?
  11916. @item ?
  11917. Pressing @kbd{?} in that special agenda will display the full flagging note in
  11918. another window and also push it onto the kill ring. So you could use @kbd{?
  11919. z C-y C-c C-c} to store that flagging note as a normal note in the entry.
  11920. Pressing @kbd{?} twice in succession will offer to remove the
  11921. @code{:FLAGGED:} tag along with the recorded flagging note (which is stored
  11922. in a property). In this way you indicate, that the intended processing for
  11923. this flagged entry is finished.
  11924. @end table
  11925. @end enumerate
  11926. @kindex C-c a ?
  11927. If you are not able to process all flagged entries directly, you can always
  11928. return to this agenda view using @kbd{C-c a ?}. Note, however, that there is
  11929. a subtle difference. The view created automatically by @kbd{M-x
  11930. org-mobile-pull RET} is guaranteed to search all files that have been
  11931. addressed by the last pull. This might include a file that is not currently
  11932. in your list of agenda files. If you later use @kbd{C-c a ?} to regenerate
  11933. the view, only the current agenda files will be searched.
  11934. @node History and Acknowledgments, Main Index, MobileOrg, Top
  11935. @appendix History and Acknowledgments
  11936. @cindex acknowledgements
  11937. @cindex history
  11938. @cindex thanks
  11939. Org was born in 2003, out of frustration over the user interface
  11940. of the Emacs Outline mode. I was trying to organize my notes and
  11941. projects, and using Emacs seemed to be the natural way to go. However,
  11942. having to remember eleven different commands with two or three keys per
  11943. command, only to hide and show parts of the outline tree, that seemed
  11944. entirely unacceptable to me. Also, when using outlines to take notes, I
  11945. constantly wanted to restructure the tree, organizing it parallel to my
  11946. thoughts and plans. @emph{Visibility cycling} and @emph{structure
  11947. editing} were originally implemented in the package
  11948. @file{outline-magic.el}, but quickly moved to the more general
  11949. @file{org.el}. As this environment became comfortable for project
  11950. planning, the next step was adding @emph{TODO entries}, basic
  11951. @emph{timestamps}, and @emph{table support}. These areas highlighted the two main
  11952. goals that Org still has today: to be a new, outline-based,
  11953. plain text mode with innovative and intuitive editing features, and to
  11954. incorporate project planning functionality directly into a notes file.
  11955. A special thanks goes to @i{Bastien Guerry} who has not only written a large
  11956. number of extensions to Org (most of them integrated into the core by now),
  11957. but who has also helped in the development and maintenance of Org so much that he
  11958. should be considered the main co-contributor to this package.
  11959. Since the first release, literally thousands of emails to me or to
  11960. @email{emacs-orgmode@@gnu.org} have provided a constant stream of bug
  11961. reports, feedback, new ideas, and sometimes patches and add-on code.
  11962. Many thanks to everyone who has helped to improve this package. I am
  11963. trying to keep here a list of the people who had significant influence
  11964. in shaping one or more aspects of Org. The list may not be
  11965. complete, if I have forgotten someone, please accept my apologies and
  11966. let me know.
  11967. @itemize @bullet
  11968. @item
  11969. @i{Russel Adams} came up with the idea for drawers.
  11970. @item
  11971. @i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
  11972. @item
  11973. @i{Christophe Bataillon} created the great unicorn logo that we use on the
  11974. Org-mode website.
  11975. @item
  11976. @i{Alex Bochannek} provided a patch for rounding timestamps.
  11977. @item
  11978. @i{Jan Böcker} wrote @file{org-docview.el}.
  11979. @item
  11980. @i{Brad Bozarth} showed how to pull RSS feed data into Org-mode files.
  11981. @item
  11982. @i{Tom Breton} wrote @file{org-choose.el}.
  11983. @item
  11984. @i{Charles Cave}'s suggestion sparked the implementation of templates
  11985. for Remember.
  11986. @item
  11987. @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
  11988. specified time.
  11989. @item
  11990. @i{Gregory Chernov} patched support for Lisp forms into table
  11991. calculations and improved XEmacs compatibility, in particular by porting
  11992. @file{nouline.el} to XEmacs.
  11993. @item
  11994. @i{Sacha Chua} suggested copying some linking code from Planner.
  11995. @item
  11996. @i{Baoqiu Cui} contributed the DocBook exporter.
  11997. @item
  11998. @i{Dan Davison} wrote (together with @i{Eric Schulte}) Org Babel.
  11999. @item
  12000. @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
  12001. came up with the idea of properties, and that there should be an API for
  12002. them.
  12003. @item
  12004. @i{Nick Dokos} tracked down several nasty bugs.
  12005. @item
  12006. @i{Kees Dullemond} used to edit projects lists directly in HTML and so
  12007. inspired some of the early development, including HTML export. He also
  12008. asked for a way to narrow wide table columns.
  12009. @item
  12010. @i{Christian Egli} converted the documentation into Texinfo format,
  12011. patched CSS formatting into the HTML exporter, and inspired the agenda.
  12012. @item
  12013. @i{David Emery} provided a patch for custom CSS support in exported
  12014. HTML agendas.
  12015. @item
  12016. @i{Nic Ferrier} contributed mailcap and XOXO support.
  12017. @item
  12018. @i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
  12019. @item
  12020. @i{John Foerch} figured out how to make incremental search show context
  12021. around a match in a hidden outline tree.
  12022. @item
  12023. @i{Raimar Finken} wrote @file{org-git-line.el}.
  12024. @item
  12025. @i{Mikael Fornius} works as a mailing list moderator.
  12026. @item
  12027. @i{Austin Frank} works as a mailing list moderator.
  12028. @item
  12029. @i{Niels Giesen} had the idea to automatically archive DONE trees.
  12030. @item
  12031. @i{Bastien Guerry} wrote the La@TeX{} exporter and @file{org-bibtex.el}, and
  12032. has been prolific with patches, ideas, and bug reports.
  12033. @item
  12034. @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
  12035. @item
  12036. @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
  12037. task state change logging, and the clocktable. His clear explanations have
  12038. been critical when we started to adopt the Git version control system.
  12039. @item
  12040. @i{Manuel Hermenegildo} has contributed various ideas, small fixes and
  12041. patches.
  12042. @item
  12043. @i{Phil Jackson} wrote @file{org-irc.el}.
  12044. @item
  12045. @i{Scott Jaderholm} proposed footnotes, control over whitespace between
  12046. folded entries, and column view for properties.
  12047. @item
  12048. @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
  12049. @item
  12050. @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
  12051. provided frequent feedback and some patches.
  12052. @item
  12053. @i{Matt Lundin} has proposed last-row references for table formulas and named
  12054. invisible anchors. He has also worked a lot on the FAQ.
  12055. @item
  12056. @i{Jason F. McBrayer} suggested agenda export to CSV format.
  12057. @item
  12058. @i{Max Mikhanosha} came up with the idea of refiling.
  12059. @item
  12060. @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
  12061. basis.
  12062. @item
  12063. @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
  12064. happy.
  12065. @item
  12066. @i{Richard Moreland} wrote @i{MobileOrg} for the iPhone.
  12067. @item
  12068. @i{Rick Moynihan} proposed allowing multiple TODO sequences in a file
  12069. and being able to quickly restrict the agenda to a subtree.
  12070. @item
  12071. @i{Todd Neal} provided patches for links to Info files and Elisp forms.
  12072. @item
  12073. @i{Greg Newman} refreshed the unicorn logo into its current form.
  12074. @item
  12075. @i{Tim O'Callaghan} suggested in-file links, search options for general
  12076. file links, and TAGS.
  12077. @item
  12078. @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
  12079. into Japanese.
  12080. @item
  12081. @i{Oliver Oppitz} suggested multi-state TODO items.
  12082. @item
  12083. @i{Scott Otterson} sparked the introduction of descriptive text for
  12084. links, among other things.
  12085. @item
  12086. @i{Pete Phillips} helped during the development of the TAGS feature, and
  12087. provided frequent feedback.
  12088. @item
  12089. @i{Martin Pohlack} provided the code snippet to bundle character insertion
  12090. into bundles of 20 for undo.
  12091. @item
  12092. @i{T.V. Raman} reported bugs and suggested improvements.
  12093. @item
  12094. @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
  12095. control.
  12096. @item
  12097. @i{Paul Rivier} provided the basic implementation of named footnotes. He
  12098. also acted as mailing list moderator for some time.
  12099. @item
  12100. @i{Kevin Rogers} contributed code to access VM files on remote hosts.
  12101. @item
  12102. @i{Sebastian Rose} wrote @file{org-info.js}, a Java script for displaying
  12103. webpages derived from Org using an Info-like or a folding interface with
  12104. single-key navigation.
  12105. @item
  12106. @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
  12107. conflict with @file{allout.el}.
  12108. @item
  12109. @i{Jason Riedy} generalized the send-receive mechanism for Orgtbl tables with
  12110. extensive patches.
  12111. @item
  12112. @i{Philip Rooke} created the Org reference card, provided lots
  12113. of feedback, developed and applied standards to the Org documentation.
  12114. @item
  12115. @i{Christian Schlauer} proposed angular brackets around links, among
  12116. other things.
  12117. @item
  12118. @i{Eric Schulte} wrote @file{org-plot.el} and (together with @i{Dan Davison})
  12119. Org Babel, and contributed various patches, small features and modules.
  12120. @item
  12121. @i{Paul Sexton} wrote @file{org-ctags.el}.
  12122. @item
  12123. Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
  12124. @file{organizer-mode.el}.
  12125. @item
  12126. @i{Ilya Shlyakhter} proposed the Archive Sibling, line numbering in literal
  12127. examples, and remote highlighting for referenced code lines.
  12128. @item
  12129. @i{Stathis Sideris} wrote the @file{ditaa.jar} ASCII to PNG converter that is
  12130. now packaged into Org's @file{contrib} directory.
  12131. @item
  12132. @i{Daniel Sinder} came up with the idea of internal archiving by locking
  12133. subtrees.
  12134. @item
  12135. @i{Dale Smith} proposed link abbreviations.
  12136. @item
  12137. @i{James TD Smith} has contributed a large number of patches for useful
  12138. tweaks and features.
  12139. @item
  12140. @i{Adam Spiers} asked for global linking commands, inspired the link
  12141. extension system, added support for mairix, and proposed the mapping API.
  12142. @item
  12143. @i{Andy Stewart} contributed code to @file{org-w3m.el}, to copy HTML content
  12144. with links transformation to Org syntax.
  12145. @item
  12146. @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
  12147. chapter about publishing.
  12148. @item
  12149. @i{J@"urgen Vollmer} contributed code generating the table of contents
  12150. in HTML output.
  12151. @item
  12152. @i{Samuel Wales} has provided important feedback and bug reports.
  12153. @item
  12154. @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
  12155. keyword.
  12156. @item
  12157. @i{David Wainberg} suggested archiving, and improvements to the linking
  12158. system.
  12159. @item
  12160. @i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
  12161. @file{muse.el}, which have some overlap with Org. Initially the development
  12162. of Org was fully independent because I was not aware of the existence of
  12163. these packages. But with time I have occasionally looked at John's code and
  12164. learned a lot from it. John has also contributed a number of great ideas and
  12165. patches directly to Org, including the attachment system
  12166. (@file{org-attach.el}), integration with Apple Mail
  12167. (@file{org-mac-message.el}), hierarchical dependencies of TODO items, habit
  12168. tracking (@file{org-habits.el}).
  12169. @item
  12170. @i{Carsten Wimmer} suggested some changes and helped fix a bug in
  12171. linking to Gnus.
  12172. @item
  12173. @i{Roland Winkler} requested additional key bindings to make Org
  12174. work on a tty.
  12175. @item
  12176. @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
  12177. and contributed various ideas and code snippets.
  12178. @end itemize
  12179. @node Main Index, Key Index, History and Acknowledgments, Top
  12180. @unnumbered Concept Index
  12181. @printindex cp
  12182. @node Key Index, Variable Index, Main Index, Top
  12183. @unnumbered Key Index
  12184. @printindex ky
  12185. @node Variable Index, , Key Index, Top
  12186. @unnumbered Variable Index
  12187. This is not a complete index of variables and faces, only the ones that are
  12188. mentioned in the manual. For a more complete list, use @kbd{M-x
  12189. org-customize @key{RET}} and then click yourself through the tree.
  12190. @printindex vr
  12191. @bye
  12192. @ignore
  12193. arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
  12194. @end ignore
  12195. @c Local variables:
  12196. @c ispell-local-dictionary: "en_US-w_accents"
  12197. @c ispell-local-pdict: "./.aspell.org.pws"
  12198. @c fill-column: 77
  12199. @c End:
  12200. @c LocalWords: webdavhost pre