org.texi 405 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168
  1. \input texinfo
  2. @c %**start of header
  3. @setfilename ../../info/org
  4. @settitle The Org Manual
  5. @set VERSION 6.15f
  6. @set DATE December 2008
  7. @dircategory Emacs
  8. @direntry
  9. * Org Mode: (org). Outline-based notes management and organizer
  10. @end direntry
  11. @c Version and Contact Info
  12. @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
  13. @set AUTHOR Carsten Dominik
  14. @set MAINTAINER Carsten Dominik
  15. @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
  16. @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
  17. @c %**end of header
  18. @finalout
  19. @c Macro definitions
  20. @c Subheadings inside a table.
  21. @macro tsubheading{text}
  22. @ifinfo
  23. @subsubheading \text\
  24. @end ifinfo
  25. @ifnotinfo
  26. @item @b{\text\}
  27. @end ifnotinfo
  28. @end macro
  29. @copying
  30. This manual is for Org (version @value{VERSION}).
  31. Copyright @copyright{} 2004, 2005, 2006, 2007, 2008 Free Software Foundation
  32. @quotation
  33. Permission is granted to copy, distribute and/or modify this document
  34. under the terms of the GNU Free Documentation License, Version 1.3 or
  35. any later version published by the Free Software Foundation; with no
  36. Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
  37. and with the Back-Cover Texts as in (a) below. A copy of the license
  38. is included in the section entitled ``GNU Free Documentation License.''
  39. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  40. modify this GNU manual. Buying copies from the FSF supports it in
  41. developing GNU and promoting software freedom.''
  42. This document is part of a collection distributed under the GNU Free
  43. Documentation License. If you want to distribute this document
  44. separately from the collection, you can do so by adding a copy of the
  45. license to the document, as described in section 6 of the license.
  46. @end quotation
  47. @end copying
  48. @titlepage
  49. @title The Org Manual
  50. @subtitle Release @value{VERSION}
  51. @author by Carsten Dominik
  52. @c The following two commands start the copyright page.
  53. @page
  54. @vskip 0pt plus 1filll
  55. @insertcopying
  56. @end titlepage
  57. @c Output the table of contents at the beginning.
  58. @contents
  59. @ifnottex
  60. @node Top, Introduction, (dir), (dir)
  61. @top Org Mode Manual
  62. @insertcopying
  63. @end ifnottex
  64. @menu
  65. * Introduction:: Getting started
  66. * Document Structure:: A tree works like your brain
  67. * Tables:: Pure magic for quick formatting
  68. * Hyperlinks:: Notes in context
  69. * TODO Items:: Every tree branch can be a TODO item
  70. * Tags:: Tagging headlines and matching sets of tags
  71. * Properties and Columns:: Storing information about an entry
  72. * Dates and Times:: Making items useful for planning
  73. * Capture:: Creating tasks and attaching files
  74. * Agenda Views:: Collecting information into views
  75. * Embedded LaTeX:: LaTeX fragments and formulas
  76. * Exporting:: Sharing and publishing of notes
  77. * Publishing:: Create a web site of linked Org files
  78. * Miscellaneous:: All the rest which did not fit elsewhere
  79. * Extensions:: Add-ons for Org mode
  80. * Hacking:: How hack your way around
  81. * History and Acknowledgments:: How Org came into being
  82. * Main Index:: An index of Org's concepts and features
  83. * Key Index:: Key bindings and where they are described
  84. @detailmenu
  85. --- The Detailed Node Listing ---
  86. Introduction
  87. * Summary:: Brief summary of what Org does
  88. * Installation:: How to install a downloaded version of Org
  89. * Activation:: How to activate Org for certain buffers
  90. * Feedback:: Bug reports, ideas, patches etc.
  91. * Conventions:: Type-setting conventions in the manual
  92. Document Structure
  93. * Outlines:: Org is based on Outline mode
  94. * Headlines:: How to typeset Org tree headlines
  95. * Visibility cycling:: Show and hide, much simplified
  96. * Motion:: Jumping to other headlines
  97. * Structure editing:: Changing sequence and level of headlines
  98. * Archiving:: Move done task trees to a different place
  99. * Sparse trees:: Matches embedded in context
  100. * Plain lists:: Additional structure within an entry
  101. * Drawers:: Tucking stuff away
  102. * Orgstruct mode:: Structure editing outside Org
  103. Archiving
  104. * ARCHIVE tag:: Marking a tree as inactive
  105. * Moving subtrees:: Moving a tree to an archive file
  106. Tables
  107. * Built-in table editor:: Simple tables
  108. * Narrow columns:: Stop wasting space in tables
  109. * Column groups:: Grouping to trigger vertical lines
  110. * Orgtbl mode:: The table editor as minor mode
  111. * The spreadsheet:: The table editor has spreadsheet capabilities
  112. * Org Plot:: Plotting from org tables
  113. The spreadsheet
  114. * References:: How to refer to another field or range
  115. * Formula syntax for Calc:: Using Calc to compute stuff
  116. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  117. * Field formulas:: Formulas valid for a single field
  118. * Column formulas:: Formulas valid for an entire column
  119. * Editing and debugging formulas:: Fixing formulas
  120. * Updating the table:: Recomputing all dependent fields
  121. * Advanced features:: Field names, parameters and automatic recalc
  122. Hyperlinks
  123. * Link format:: How links in Org are formatted
  124. * Internal links:: Links to other places in the current file
  125. * External links:: URL-like links to the world
  126. * Handling links:: Creating, inserting and following
  127. * Using links outside Org:: Linking from my C source code?
  128. * Link abbreviations:: Shortcuts for writing complex links
  129. * Search options:: Linking to a specific location
  130. * Custom searches:: When the default search is not enough
  131. Internal links
  132. * Radio targets:: Make targets trigger links in plain text
  133. TODO Items
  134. * TODO basics:: Marking and displaying TODO entries
  135. * TODO extensions:: Workflow and assignments
  136. * Progress logging:: Dates and notes for progress
  137. * Priorities:: Some things are more important than others
  138. * Breaking down tasks:: Splitting a task into manageable pieces
  139. * Checkboxes:: Tick-off lists
  140. Extended use of TODO keywords
  141. * Workflow states:: From TODO to DONE in steps
  142. * TODO types:: I do this, Fred does the rest
  143. * Multiple sets in one file:: Mixing it all, and still finding your way
  144. * Fast access to TODO states:: Single letter selection of a state
  145. * Per-file keywords:: Different files, different requirements
  146. * Faces for TODO keywords:: Highlighting states
  147. Progress logging
  148. * Closing items:: When was this entry marked DONE?
  149. * Tracking TODO state changes:: When did the status change?
  150. Tags
  151. * Tag inheritance:: Tags use the tree structure of the outline
  152. * Setting tags:: How to assign tags to a headline
  153. * Tag searches:: Searching for combinations of tags
  154. Properties and Columns
  155. * Property syntax:: How properties are spelled out
  156. * Special properties:: Access to other Org mode features
  157. * Property searches:: Matching property values
  158. * Property inheritance:: Passing values down the tree
  159. * Column view:: Tabular viewing and editing
  160. * Property API:: Properties for Lisp programmers
  161. Column view
  162. * Defining columns:: The COLUMNS format property
  163. * Using column view:: How to create and use column view
  164. * Capturing column view:: A dynamic block for column view
  165. Defining columns
  166. * Scope of column definitions:: Where defined, where valid?
  167. * Column attributes:: Appearance and content of a column
  168. Dates and Times
  169. * Timestamps:: Assigning a time to a tree entry
  170. * Creating timestamps:: Commands which insert timestamps
  171. * Deadlines and scheduling:: Planning your work
  172. * Clocking work time:: Tracking how long you spend on a task
  173. * Effort estimates:: Planning work effort in advance
  174. * Relative timer:: Notes with a running timer
  175. Creating timestamps
  176. * The date/time prompt:: How Org mode helps you entering date and time
  177. * Custom time format:: Making dates look different
  178. Deadlines and scheduling
  179. * Inserting deadline/schedule:: Planning items
  180. * Repeated tasks:: Items that show up again and again
  181. Capture
  182. * Remember:: Capture new tasks/ideas with little interruption
  183. * Attachments:: Add files to tasks.
  184. Remember
  185. * Setting up Remember:: Some code for .emacs to get things going
  186. * Remember templates:: Define the outline of different note types
  187. * Storing notes:: Directly get the note to where it belongs
  188. * Refiling notes:: Moving a note or task to a project
  189. Agenda Views
  190. * Agenda files:: Files being searched for agenda information
  191. * Agenda dispatcher:: Keyboard access to agenda views
  192. * Built-in agenda views:: What is available out of the box?
  193. * Presentation and sorting:: How agenda items are prepared for display
  194. * Agenda commands:: Remote editing of Org trees
  195. * Custom agenda views:: Defining special searches and views
  196. * Agenda column view:: Using column view for collected entries
  197. The built-in agenda views
  198. * Weekly/daily agenda:: The calendar page with current tasks
  199. * Global TODO list:: All unfinished action items
  200. * Matching tags and properties:: Structured information with fine-tuned search
  201. * Timeline:: Time-sorted view for single file
  202. * Keyword search:: Finding entries by keyword
  203. * Stuck projects:: Find projects you need to review
  204. Presentation and sorting
  205. * Categories:: Not all tasks are equal
  206. * Time-of-day specifications:: How the agenda knows the time
  207. * Sorting of agenda items:: The order of things
  208. Custom agenda views
  209. * Storing searches:: Type once, use often
  210. * Block agenda:: All the stuff you need in a single buffer
  211. * Setting Options:: Changing the rules
  212. * Exporting Agenda Views:: Writing agendas to files
  213. * Using the agenda elsewhere:: Using agenda information in other programs
  214. Embedded LaTeX
  215. * Math symbols:: TeX macros for symbols and Greek letters
  216. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  217. * LaTeX fragments:: Complex formulas made easy
  218. * Processing LaTeX fragments:: Previewing LaTeX processing
  219. * CDLaTeX mode:: Speed up entering of formulas
  220. Exporting
  221. * Markup rules:: Which structures are recognized?
  222. * Selective export:: Using tags to select and exclude trees
  223. * Export options:: Per-file export settings
  224. * The export dispatcher:: How to access exporter commands
  225. * ASCII export:: Exporting to plain ASCII
  226. * HTML export:: Exporting to HTML
  227. * LaTeX and PDF export:: Exporting to LaTeX, and processing to PDF
  228. * XOXO export:: Exporting to XOXO
  229. * iCalendar export:: Exporting in iCalendar format
  230. Markup rules
  231. * Document title:: How the document title is determined
  232. * Headings and sections:: The main structure of the exported document
  233. * Table of contents:: If, where, how to create a table of contents
  234. * Initial text:: Text before the first headline
  235. * Lists:: Plain lists are exported
  236. * Paragraphs:: What determines beginning and ending
  237. * Literal examples:: Source code and other examples
  238. * Include files:: Include the contents of a file during export
  239. * Tables exported:: Tables are exported richly
  240. * Inlined images:: How to inline images during export
  241. * Footnotes:: Numbers like [1]
  242. * Emphasis and monospace:: To bold or not to bold
  243. * TeX macros and LaTeX fragments:: Create special, rich export.
  244. * Horizontal rules:: A line across the page
  245. * Comment lines:: Some lines will not be exported
  246. HTML export
  247. * HTML Export commands:: How to invoke HTML export
  248. * Quoting HTML tags:: Using direct HTML in Org mode
  249. * Links:: Transformation of links for HTML
  250. * Images in HTML export::
  251. * CSS support:: Changing the appearance of the output
  252. * Javascript support:: Info and Folding in a web browser
  253. LaTeX and PDF export
  254. * LaTeX/PDF export commands:: Which key invode which commands
  255. * Quoting LaTeX code:: Incorporating literal LaTeX code
  256. * Sectioning structure:: Changing sectioning in LaTeX output
  257. * Tables in LaTeX export:: Options for exporting tables to LaTeX
  258. * Images in LaTeX export:: How to insert figures into LaTeX output
  259. Publishing
  260. * Configuration:: Defining projects
  261. * Sample configuration:: Example projects
  262. * Triggering publication:: Publication commands
  263. Configuration
  264. * Project alist:: The central configuration variable
  265. * Sources and destinations:: From here to there
  266. * Selecting files:: What files are part of the project?
  267. * Publishing action:: Setting the function doing the publishing
  268. * Publishing options:: Tweaking HTML export
  269. * Publishing links:: Which links keep working after publishing?
  270. * Project page index:: Publishing a list of project files
  271. Sample configuration
  272. * Simple example:: One-component publishing
  273. * Complex example:: A multi-component publishing example
  274. Miscellaneous
  275. * Completion:: M-TAB knows what you need
  276. * Customization:: Adapting Org to your taste
  277. * In-buffer settings:: Overview of the #+KEYWORDS
  278. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  279. * Clean view:: Getting rid of leading stars in the outline
  280. * TTY keys:: Using Org on a tty
  281. * Interaction:: Other Emacs packages
  282. * Bugs:: Things which do not work perfectly
  283. Interaction with other packages
  284. * Cooperation:: Packages Org cooperates with
  285. * Conflicts:: Packages that lead to conflicts
  286. Extensions
  287. * Extensions in the contrib directory:: These come with the Org distro
  288. * Other extensions:: These you have to find on the web.
  289. Hacking
  290. * Adding hyperlink types:: New custom link types
  291. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  292. * Dynamic blocks:: Automatically filled blocks
  293. * Special agenda views:: Customized views
  294. * Using the property API:: Writing programs that use entry properties
  295. * Using the mapping API:: Mapping over all or selected entries
  296. Tables and lists in arbitrary syntax
  297. * Radio tables:: Sending and receiving
  298. * A LaTeX example:: Step by step, almost a tutorial
  299. * Translator functions:: Copy and modify
  300. * Radio lists:: Doing the same for lists
  301. @end detailmenu
  302. @end menu
  303. @node Introduction, Document Structure, Top, Top
  304. @chapter Introduction
  305. @cindex introduction
  306. @menu
  307. * Summary:: Brief summary of what Org does
  308. * Installation:: How to install a downloaded version of Org
  309. * Activation:: How to activate Org for certain buffers
  310. * Feedback:: Bug reports, ideas, patches etc.
  311. * Conventions:: Type-setting conventions in the manual
  312. @end menu
  313. @node Summary, Installation, Introduction, Introduction
  314. @section Summary
  315. @cindex summary
  316. Org is a mode for keeping notes, maintaining TODO lists, and doing
  317. project planning with a fast and effective plain-text system.
  318. Org develops organizational tasks around NOTES files that contain
  319. lists or information about projects as plain text. Org is
  320. implemented on top of Outline mode, which makes it possible to keep the
  321. content of large files well structured. Visibility cycling and
  322. structure editing help to work with the tree. Tables are easily created
  323. with a built-in table editor. Org supports TODO items, deadlines,
  324. time stamps, and scheduling. It dynamically compiles entries into an
  325. agenda that utilizes and smoothly integrates much of the Emacs calendar
  326. and diary. Plain text URL-like links connect to websites, emails,
  327. Usenet messages, BBDB entries, and any files related to the projects.
  328. For printing and sharing of notes, an Org file can be exported as a
  329. structured ASCII file, as HTML, or (TODO and agenda items only) as an
  330. iCalendar file. It can also serve as a publishing tool for a set of
  331. linked web pages.
  332. An important design aspect that distinguishes Org from for example
  333. Planner/Muse is that it encourages to store every piece of information
  334. only once. In Planner, you have project pages, day pages and possibly
  335. other files, duplicating some information such as tasks. In Org,
  336. you only have notes files. In your notes you mark entries as tasks,
  337. label them with tags and timestamps. All necessary lists like a
  338. schedule for the day, the agenda for a meeting, tasks lists selected by
  339. tags etc are created dynamically when you need them.
  340. Org keeps simple things simple. When first fired up, it should
  341. feel like a straightforward, easy to use outliner. Complexity is not
  342. imposed, but a large amount of functionality is available when you need
  343. it. Org is a toolbox and can be used in different ways, for
  344. example as:
  345. @example
  346. @r{@bullet{} outline extension with visibility cycling and structure editing}
  347. @r{@bullet{} ASCII system and table editor for taking structured notes}
  348. @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
  349. @r{@bullet{} TODO list editor}
  350. @r{@bullet{} full agenda and planner with deadlines and work scheduling}
  351. @r{@bullet{} environment to implement David Allen's GTD system}
  352. @r{@bullet{} a basic database application}
  353. @r{@bullet{} simple hypertext system, with HTML and LaTeX export}
  354. @r{@bullet{} publishing tool to create a set of interlinked webpages}
  355. @end example
  356. Org's automatic, context sensitive table editor with spreadsheet
  357. capabilities can be integrated into any major mode by activating the
  358. minor Orgtbl mode. Using a translation step, it can be used to maintain
  359. tables in arbitrary file types, for example in La@TeX{}. The structure
  360. editing and list creation capabilities can be used outside Org with
  361. the minor Orgstruct mode.
  362. @cindex FAQ
  363. There is a website for Org which provides links to the newest
  364. version of Org, as well as additional information, frequently asked
  365. questions (FAQ), links to tutorials etc. This page is located at
  366. @uref{http://orgmode.org}.
  367. @page
  368. @node Installation, Activation, Summary, Introduction
  369. @section Installation
  370. @cindex installation
  371. @cindex XEmacs
  372. @b{Important:} @i{If Org is part of the Emacs distribution or an
  373. XEmacs package, please skip this section and go directly to
  374. @ref{Activation}.}
  375. If you have downloaded Org from the Web, either as a distribution @file{.zip}
  376. or @file{.tar} file, or as a GIT archive, you must take the following steps
  377. to install it: Go into the unpacked Org distribution directory and edit the
  378. top section of the file @file{Makefile}. You must set the name of the Emacs
  379. binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
  380. directories where local Lisp and Info files are kept. If you don't have
  381. access to the system-wide directories, you can simply run Org directly from
  382. the distribution directory by adding the @file{lisp} subdirectory to the
  383. Emacs load path. To do this, add the following line to @file{.emacs}:
  384. @example
  385. (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
  386. @end example
  387. @noindent
  388. If you plan to use code from the @file{contrib} subdirectory, do a similar
  389. step for this directory:
  390. @example
  391. (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
  392. @end example
  393. @b{XEmacs users now need to install the file @file{noutline.el} from
  394. the @file{xemacs} sub-directory of the Org distribution. Use the
  395. command:}
  396. @example
  397. @b{make install-noutline}
  398. @end example
  399. @noindent Now byte-compile the Lisp files with the shell command:
  400. @example
  401. make
  402. @end example
  403. @noindent If you are running Org from the distribution directory, this is
  404. all. If you want to install into the system directories, use
  405. @example
  406. make install
  407. make install-info
  408. @end example
  409. @noindent Then add to @file{.emacs}:
  410. @lisp
  411. ;; This line only if Org is not part of the X/Emacs distribution.
  412. (require 'org-install)
  413. @end lisp
  414. @node Activation, Feedback, Installation, Introduction
  415. @section Activation
  416. @cindex activation
  417. @cindex autoload
  418. @cindex global key bindings
  419. @cindex key bindings, global
  420. @iftex
  421. @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
  422. PDF documentation as viewed by some PDF viewers to your .emacs file, the
  423. single quote character comes out incorrectly and the code will not work.
  424. You need to fix the single quotes by hand, or copy from Info
  425. documentation.}
  426. @end iftex
  427. Add the following lines to your @file{.emacs} file. The last three lines
  428. define @emph{global} keys for the commands @command{org-store-link},
  429. @command{org-agenda}, and @command{org-iswitchb} - please choose suitable
  430. keys yourself.
  431. @lisp
  432. ;; The following lines are always needed. Choose your own keys.
  433. (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  434. (global-set-key "\C-cl" 'org-store-link)
  435. (global-set-key "\C-ca" 'org-agenda)
  436. (global-set-key "\C-cb" 'org-iswitchb)
  437. @end lisp
  438. Furthermore, you must activate @code{font-lock-mode} in Org
  439. buffers, because significant functionality depends on font-locking being
  440. active. You can do this with either one of the following two lines
  441. (XEmacs user must use the second option):
  442. @lisp
  443. (global-font-lock-mode 1) ; for all buffers
  444. (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
  445. @end lisp
  446. @cindex Org mode, turning on
  447. With this setup, all files with extension @samp{.org} will be put
  448. into Org mode. As an alternative, make the first line of a file look
  449. like this:
  450. @example
  451. MY PROJECTS -*- mode: org; -*-
  452. @end example
  453. @noindent which will select Org mode for this buffer no matter what
  454. the file's name is. See also the variable
  455. @code{org-insert-mode-line-in-empty-file}.
  456. @node Feedback, Conventions, Activation, Introduction
  457. @section Feedback
  458. @cindex feedback
  459. @cindex bug reports
  460. @cindex maintainer
  461. @cindex author
  462. If you find problems with Org, or if you have questions, remarks, or ideas
  463. about it, please mail to the Org mailing list @code{emacs-orgmode@@gnu.org}.
  464. If you are not a member of the mailing list, your mail will be reviewed by a
  465. moderator and then passed through to the list.
  466. For bug reports, please provide as much information as possible,
  467. including the version information of Emacs (@kbd{C-h v emacs-version
  468. @key{RET}}) and Org (@kbd{C-h v org-version @key{RET}}), as well as
  469. the Org related setup in @file{.emacs}. If an error occurs, a
  470. backtrace can be very useful (see below on how to create one). Often a
  471. small example file helps, along with clear information about:
  472. @enumerate
  473. @item What exactly did you do?
  474. @item What did you expect to happen?
  475. @item What happened instead?
  476. @end enumerate
  477. @noindent Thank you for helping to improve this mode.
  478. @subsubheading How to create a useful backtrace
  479. @cindex backtrace of an error
  480. If working with Org produces an error with a message you don't
  481. understand, you may have hit a bug. The best way to report this is by
  482. providing, in addition to what was mentioned above, a @emph{Backtrace}.
  483. This is information from the built-in debugger about where and how the
  484. error occurred. Here is how to produce a useful backtrace:
  485. @enumerate
  486. @item
  487. Start a fresh Emacs or XEmacs, and make sure that it will load the
  488. original Lisp code in @file{org.el} instead of the compiled version in
  489. @file{org.elc}. The backtrace contains much more information if it is
  490. produced with uncompiled code. To do this, either rename @file{org.elc}
  491. to something else before starting Emacs, or ask Emacs explicitly to load
  492. @file{org.el} by using the command line
  493. @example
  494. emacs -l /path/to/org.el
  495. @end example
  496. @item
  497. Go to the @code{Options} menu and select @code{Enter Debugger on Error}
  498. (XEmacs has this option in the @code{Troubleshooting} sub-menu).
  499. @item
  500. Do whatever you have to do to hit the error. Don't forget to
  501. document the steps you take.
  502. @item
  503. When you hit the error, a @file{*Backtrace*} buffer will appear on the
  504. screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
  505. attach it to your bug report.
  506. @end enumerate
  507. @node Conventions, , Feedback, Introduction
  508. @section Typesetting conventions used in this manual
  509. Org uses three types of keywords: TODO keywords, tags, and property
  510. names. In this manual we use the following conventions:
  511. @table @code
  512. @item TODO
  513. @itemx WAITING
  514. TODO keywords are written with all capitals, even if they are
  515. user-defined.
  516. @item boss
  517. @itemx ARCHIVE
  518. User-defined tags are written in lowercase; built-in tags with special
  519. meaning are written with all capitals.
  520. @item Release
  521. @itemx PRIORITY
  522. User-defined properties are capitalized; built-in properties with
  523. special meaning are written with all capitals.
  524. @end table
  525. @node Document Structure, Tables, Introduction, Top
  526. @chapter Document Structure
  527. @cindex document structure
  528. @cindex structure of document
  529. Org is based on outline mode and provides flexible commands to
  530. edit the structure of the document.
  531. @menu
  532. * Outlines:: Org is based on Outline mode
  533. * Headlines:: How to typeset Org tree headlines
  534. * Visibility cycling:: Show and hide, much simplified
  535. * Motion:: Jumping to other headlines
  536. * Structure editing:: Changing sequence and level of headlines
  537. * Archiving:: Move done task trees to a different place
  538. * Sparse trees:: Matches embedded in context
  539. * Plain lists:: Additional structure within an entry
  540. * Drawers:: Tucking stuff away
  541. * Orgstruct mode:: Structure editing outside Org
  542. @end menu
  543. @node Outlines, Headlines, Document Structure, Document Structure
  544. @section Outlines
  545. @cindex outlines
  546. @cindex Outline mode
  547. Org is implemented on top of Outline mode. Outlines allow a
  548. document to be organized in a hierarchical structure, which (at least
  549. for me) is the best representation of notes and thoughts. An overview
  550. of this structure is achieved by folding (hiding) large parts of the
  551. document to show only the general document structure and the parts
  552. currently being worked on. Org greatly simplifies the use of
  553. outlines by compressing the entire show/hide functionality into a single
  554. command @command{org-cycle}, which is bound to the @key{TAB} key.
  555. @node Headlines, Visibility cycling, Outlines, Document Structure
  556. @section Headlines
  557. @cindex headlines
  558. @cindex outline tree
  559. Headlines define the structure of an outline tree. The headlines in
  560. Org start with one or more stars, on the left margin@footnote{See
  561. the variable @code{org-special-ctrl-a/e} to configure special behavior
  562. of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
  563. @example
  564. * Top level headline
  565. ** Second level
  566. *** 3rd level
  567. some text
  568. *** 3rd level
  569. more text
  570. * Another top level headline
  571. @end example
  572. @noindent Some people find the many stars too noisy and would prefer an
  573. outline that has whitespace followed by a single star as headline
  574. starters. @ref{Clean view} describes a setup to realize this.
  575. An empty line after the end of a subtree is considered part of it and
  576. will be hidden when the subtree is folded. However, if you leave at
  577. least two empty lines, one empty line will remain visible after folding
  578. the subtree, in order to structure the collapsed view. See the
  579. variable @code{org-cycle-separator-lines} to modify this behavior.
  580. @node Visibility cycling, Motion, Headlines, Document Structure
  581. @section Visibility cycling
  582. @cindex cycling, visibility
  583. @cindex visibility cycling
  584. @cindex trees, visibility
  585. @cindex show hidden text
  586. @cindex hide text
  587. Outlines make it possible to hide parts of the text in the buffer.
  588. Org uses just two commands, bound to @key{TAB} and
  589. @kbd{S-@key{TAB}} to change the visibility in the buffer.
  590. @cindex subtree visibility states
  591. @cindex subtree cycling
  592. @cindex folded, subtree visibility state
  593. @cindex children, subtree visibility state
  594. @cindex subtree, subtree visibility state
  595. @table @kbd
  596. @kindex @key{TAB}
  597. @item @key{TAB}
  598. @emph{Subtree cycling}: Rotate current subtree among the states
  599. @example
  600. ,-> FOLDED -> CHILDREN -> SUBTREE --.
  601. '-----------------------------------'
  602. @end example
  603. The cursor must be on a headline for this to work@footnote{see, however,
  604. the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
  605. beginning of the buffer and the first line is not a headline, then
  606. @key{TAB} actually runs global cycling (see below)@footnote{see the
  607. option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
  608. argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
  609. @cindex global visibility states
  610. @cindex global cycling
  611. @cindex overview, global visibility state
  612. @cindex contents, global visibility state
  613. @cindex show all, global visibility state
  614. @kindex S-@key{TAB}
  615. @item S-@key{TAB}
  616. @itemx C-u @key{TAB}
  617. @emph{Global cycling}: Rotate the entire buffer among the states
  618. @example
  619. ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
  620. '--------------------------------------'
  621. @end example
  622. When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
  623. CONTENTS view up to headlines of level N will be shown. Note that inside
  624. tables, @kbd{S-@key{TAB}} jumps to the previous field.
  625. @cindex show all, command
  626. @kindex C-u C-u C-u @key{TAB}
  627. @item C-u C-u C-u @key{TAB}
  628. Show all, including drawers.
  629. @kindex C-c C-r
  630. @item C-c C-r
  631. Reveal context around point, showing the current entry, the following heading
  632. and the hierarchy above. Useful for working near a location that has been
  633. exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
  634. (@pxref{Agenda commands}). With a prefix argument show, on each
  635. level, all sibling headings.
  636. @kindex C-c C-x b
  637. @item C-c C-x b
  638. Show the current subtree in an indirect buffer@footnote{The indirect
  639. buffer
  640. @ifinfo
  641. (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
  642. @end ifinfo
  643. @ifnotinfo
  644. (see the Emacs manual for more information about indirect buffers)
  645. @end ifnotinfo
  646. will contain the entire buffer, but will be narrowed to the current
  647. tree. Editing the indirect buffer will also change the original buffer,
  648. but without affecting visibility in that buffer.}. With a numeric
  649. prefix argument N, go up to level N and then take that tree. If N is
  650. negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
  651. the previously used indirect buffer.
  652. @end table
  653. When Emacs first visits an Org file, the global state is set to
  654. OVERVIEW, i.e. only the top level headlines are visible. This can be
  655. configured through the variable @code{org-startup-folded}, or on a
  656. per-file basis by adding one of the following lines anywhere in the
  657. buffer:
  658. @example
  659. #+STARTUP: overview
  660. #+STARTUP: content
  661. #+STARTUP: showall
  662. @end example
  663. @noindent
  664. Forthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties
  665. and Columns}) will get their visibility adapted accordingly. Allowed values
  666. for this property are @code{folded}, @code{children}, @code{content}, and
  667. @code{all}.
  668. @table @kbd
  669. @kindex C-u C-u @key{TAB}
  670. @item C-u C-u @key{TAB}
  671. Switch back to the startup visibility of the buffer, i.e. whatever is
  672. requested by startup options and @samp{VISIBILITY} properties in individual
  673. entries.
  674. @end table
  675. @node Motion, Structure editing, Visibility cycling, Document Structure
  676. @section Motion
  677. @cindex motion, between headlines
  678. @cindex jumping, to headlines
  679. @cindex headline navigation
  680. The following commands jump to other headlines in the buffer.
  681. @table @kbd
  682. @kindex C-c C-n
  683. @item C-c C-n
  684. Next heading.
  685. @kindex C-c C-p
  686. @item C-c C-p
  687. Previous heading.
  688. @kindex C-c C-f
  689. @item C-c C-f
  690. Next heading same level.
  691. @kindex C-c C-b
  692. @item C-c C-b
  693. Previous heading same level.
  694. @kindex C-c C-u
  695. @item C-c C-u
  696. Backward to higher level heading.
  697. @kindex C-c C-j
  698. @item C-c C-j
  699. Jump to a different place without changing the current outline
  700. visibility. Shows the document structure in a temporary buffer, where
  701. you can use the following keys to find your destination:
  702. @example
  703. @key{TAB} @r{Cycle visibility.}
  704. @key{down} / @key{up} @r{Next/previous visible headline.}
  705. @key{RET} @r{Select this location.}
  706. @kbd{/} @r{Do a Sparse-tree search}
  707. @r{The following keys work if you turn off @code{org-goto-auto-isearch}}
  708. n / p @r{Next/previous visible headline.}
  709. f / b @r{Next/previous headline same level.}
  710. u @r{One level up.}
  711. 0-9 @r{Digit argument.}
  712. q @r{Quit}
  713. @end example
  714. See also the variable@code{org-goto-interface}.
  715. @end table
  716. @node Structure editing, Archiving, Motion, Document Structure
  717. @section Structure editing
  718. @cindex structure editing
  719. @cindex headline, promotion and demotion
  720. @cindex promotion, of subtrees
  721. @cindex demotion, of subtrees
  722. @cindex subtree, cut and paste
  723. @cindex pasting, of subtrees
  724. @cindex cutting, of subtrees
  725. @cindex copying, of subtrees
  726. @cindex subtrees, cut and paste
  727. @table @kbd
  728. @kindex M-@key{RET}
  729. @item M-@key{RET}
  730. Insert new heading with same level as current. If the cursor is in a
  731. plain list item, a new item is created (@pxref{Plain lists}). To force
  732. creation of a new headline, use a prefix argument, or first press @key{RET}
  733. to get to the beginning of the next line. When this command is used in
  734. the middle of a line, the line is split and the rest of the line becomes
  735. the new headline@footnote{If you do not want the line to be split,
  736. customize the variable @code{org-M-RET-may-split-line}.}. If the
  737. command is used at the beginning of a headline, the new headline is
  738. created before the current line. If at the beginning of any other line,
  739. the content of that line is made the new heading. If the command is
  740. used at the end of a folded subtree (i.e. behind the ellipses at the end
  741. of a headline), then a headline like the current one will be inserted
  742. after the end of the subtree.
  743. @kindex C-@key{RET}
  744. @item C-@key{RET}
  745. Just like @kbd{M-@key{RET}}, except when adding a new heading below the
  746. current heading, the new heading is placed after the body instead of before
  747. it. This command works from anywhere in the entry.
  748. @kindex M-S-@key{RET}
  749. @item M-S-@key{RET}
  750. Insert new TODO entry with same level as current heading.
  751. @kindex C-S-@key{RET}
  752. @item C-S-@key{RET}
  753. Insert new TODO entry with same level as current heading. Like
  754. @kbd{C-@key{RET}}, the new headline will be inserted after the current
  755. subtree.
  756. @kindex M-@key{left}
  757. @item M-@key{left}
  758. Promote current heading by one level.
  759. @kindex M-@key{right}
  760. @item M-@key{right}
  761. Demote current heading by one level.
  762. @kindex M-S-@key{left}
  763. @item M-S-@key{left}
  764. Promote the current subtree by one level.
  765. @kindex M-S-@key{right}
  766. @item M-S-@key{right}
  767. Demote the current subtree by one level.
  768. @kindex M-S-@key{up}
  769. @item M-S-@key{up}
  770. Move subtree up (swap with previous subtree of same
  771. level).
  772. @kindex M-S-@key{down}
  773. @item M-S-@key{down}
  774. Move subtree down (swap with next subtree of same level).
  775. @kindex C-c C-x C-w
  776. @item C-c C-x C-w
  777. Kill subtree, i.e. remove it from buffer but save in kill ring.
  778. With a numeric prefix argument N, kill N sequential subtrees.
  779. @kindex C-c C-x M-w
  780. @item C-c C-x M-w
  781. Copy subtree to kill ring. With a numeric prefix argument N, copy the N
  782. sequential subtrees.
  783. @kindex C-c C-x C-y
  784. @item C-c C-x C-y
  785. Yank subtree from kill ring. This does modify the level of the subtree to
  786. make sure the tree fits in nicely at the yank position. The yank level can
  787. also be specified with a numeric prefix argument, or by yanking after a
  788. headline marker like @samp{****}.
  789. @kindex C-y
  790. @item C-y
  791. Depending on the variables @code{org-yank-adjusted-subtrees} and
  792. @code{org-yank-folded-subtrees}, Org's internal @code{yank} command will
  793. paste subtrees folded and in a clever way, using the same command as @kbd{C-c
  794. C-x C-y}. With the default settings, level adjustment will take place and
  795. yanked trees will be folded unless doing so would swallow text previously
  796. visible. Any prefix argument to this command will force a normal @code{yank}
  797. to be executed, with the prefix passed along. A good way to force a normal
  798. yank is @kbd{C-u C-y}. If you use @code{yank-pop} after a yank, it will yank
  799. previous kill items plainly, without adjustment and folding.
  800. @kindex C-c C-w
  801. @item C-c C-w
  802. Refile entry or region to a different location. @xref{Refiling notes}.
  803. @kindex C-c ^
  804. @item C-c ^
  805. Sort same-level entries. When there is an active region, all entries in the
  806. region will be sorted. Otherwise the children of the current headline are
  807. sorted. The command prompts for the sorting method, which can be
  808. alphabetically, numerically, by time (using the first time stamp in each
  809. entry), by priority, or by TODO keyword (in the sequence the keywords have
  810. been defined in the setup). Reverse sorting is possible as well. You can
  811. also supply your own function to extract the sorting key. With a @kbd{C-u}
  812. prefix, sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes,
  813. duplicate entries will also be removed.
  814. @kindex C-x n s
  815. @item C-x n s
  816. Narrow buffer to current subtree.
  817. @kindex C-x n w
  818. @item C-x n w
  819. Widen buffer to remove a narrowing.
  820. @kindex C-c *
  821. @item C-c *
  822. Turn a normal line or plain list item into a headline (so that it
  823. becomes a subheading at its location). Also turn a headline into a
  824. normal line by removing the stars. If there is an active region, turn
  825. all lines in the region into headlines. Or, if the first line is a
  826. headline, remove the stars from all headlines in the region.
  827. @end table
  828. @cindex region, active
  829. @cindex active region
  830. @cindex Transient mark mode
  831. When there is an active region (Transient mark mode), promotion and
  832. demotion work on all headlines in the region. To select a region of
  833. headlines, it is best to place both point and mark at the beginning of a
  834. line, mark at the beginning of the first headline, and point at the line
  835. just after the last headline to change. Note that when the cursor is
  836. inside a table (@pxref{Tables}), the Meta-Cursor keys have different
  837. functionality.
  838. @node Archiving, Sparse trees, Structure editing, Document Structure
  839. @section Archiving
  840. @cindex archiving
  841. When a project represented by a (sub)tree is finished, you may want
  842. to move the tree out of the way and to stop it from contributing to the
  843. agenda. Org mode knows two ways of archiving. You can mark a tree with
  844. the ARCHIVE tag, or you can move an entire (sub)tree to a different
  845. location.
  846. @menu
  847. * ARCHIVE tag:: Marking a tree as inactive
  848. * Moving subtrees:: Moving a tree to an archive file
  849. @end menu
  850. @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
  851. @subsection The ARCHIVE tag
  852. @cindex internal archiving
  853. A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
  854. its location in the outline tree, but behaves in the following way:
  855. @itemize @minus
  856. @item
  857. It does not open when you attempt to do so with a visibility cycling
  858. command (@pxref{Visibility cycling}). You can force cycling archived
  859. subtrees with @kbd{C-@key{TAB}}, or by setting the option
  860. @code{org-cycle-open-archived-trees}. Also normal outline commands like
  861. @code{show-all} will open archived subtrees.
  862. @item
  863. During sparse tree construction (@pxref{Sparse trees}), matches in
  864. archived subtrees are not exposed, unless you configure the option
  865. @code{org-sparse-tree-open-archived-trees}.
  866. @item
  867. During agenda view construction (@pxref{Agenda Views}), the content of
  868. archived trees is ignored unless you configure the option
  869. @code{org-agenda-skip-archived-trees}, in which case these trees will always
  870. be included. In the agenda you can press the @kbd{v} key to get archives
  871. temporarily included.
  872. @item
  873. Archived trees are not exported (@pxref{Exporting}), only the headline
  874. is. Configure the details using the variable
  875. @code{org-export-with-archived-trees}.
  876. @end itemize
  877. The following commands help managing the ARCHIVE tag:
  878. @table @kbd
  879. @kindex C-c C-x a
  880. @item C-c C-x a
  881. Toggle the ARCHIVE tag for the current headline. When the tag is set,
  882. the headline changes to a shadowed face, and the subtree below it is
  883. hidden.
  884. @kindex C-u C-c C-x a
  885. @item C-u C-c C-x a
  886. Check if any direct children of the current headline should be archived.
  887. To do this, each subtree is checked for open TODO entries. If none are
  888. found, the command offers to set the ARCHIVE tag for the child. If the
  889. cursor is @emph{not} on a headline when this command is invoked, the
  890. level 1 trees will be checked.
  891. @kindex C-@kbd{TAB}
  892. @item C-@kbd{TAB}
  893. Cycle a tree even if it is tagged with ARCHIVE.
  894. @end table
  895. @node Moving subtrees, , ARCHIVE tag, Archiving
  896. @subsection Moving subtrees
  897. @cindex external archiving
  898. Once an entire project is finished, you may want to move it to a different
  899. location. Org can move it to an @emph{Archive Sibling} in the same tree, to a
  900. different tree in the current file, or to a different file, the archive file.
  901. @table @kbd
  902. @kindex C-c C-x A
  903. @item C-c C-x A
  904. Move the current entry to the @emph{Archive Sibling}. This is a sibling of
  905. the entry with the heading @samp{Archive} and the tag @samp{ARCHIVE}
  906. (@pxref{ARCHIVE tag}). The entry becomes a child of that sibling and in this
  907. way retains a lot of its original context, including inherited tags and
  908. approximate position in the outline.
  909. @kindex C-c C-x C-s
  910. @item C-c C-x C-s
  911. Archive the subtree starting at the cursor position to the location
  912. given by @code{org-archive-location}. Context information that could be
  913. lost like the file name, the category, inherited tags, and the TODO
  914. state will be store as properties in the entry.
  915. @kindex C-u C-c C-x C-s
  916. @item C-u C-c C-x C-s
  917. Check if any direct children of the current headline could be moved to
  918. the archive. To do this, each subtree is checked for open TODO entries.
  919. If none are found, the command offers to move it to the archive
  920. location. If the cursor is @emph{not} on a headline when this command
  921. is invoked, the level 1 trees will be checked.
  922. @end table
  923. @cindex archive locations
  924. The default archive location is a file in the same directory as the
  925. current file, with the name derived by appending @file{_archive} to the
  926. current file name. For information and examples on how to change this,
  927. see the documentation string of the variable
  928. @code{org-archive-location}. There is also an in-buffer option for
  929. setting this variable, for example@footnote{For backward compatibility,
  930. the following also works: If there are several such lines in a file,
  931. each specifies the archive location for the text below it. The first
  932. such line also applies to any text before its definition. However,
  933. using this method is @emph{strongly} deprecated as it is incompatible
  934. with the outline structure of the document. The correct method for
  935. setting multiple archive locations in a buffer is using a property.}:
  936. @example
  937. #+ARCHIVE: %s_done::
  938. @end example
  939. @noindent
  940. If you would like to have a special ARCHIVE location for a single entry
  941. or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
  942. location as the value (@pxref{Properties and Columns}).
  943. When a subtree is moved, it receives a number of special properties that
  944. record context information like the file from where the entry came, it's
  945. outline path the archiving time etc. Configure the variable
  946. @code{org-archive-save-context-info} to adjust the amount of information
  947. added.
  948. @node Sparse trees, Plain lists, Archiving, Document Structure
  949. @section Sparse trees
  950. @cindex sparse trees
  951. @cindex trees, sparse
  952. @cindex folding, sparse trees
  953. @cindex occur, command
  954. An important feature of Org mode is the ability to construct @emph{sparse
  955. trees} for selected information in an outline tree, so that the entire
  956. document is folded as much as possible, but the selected information is made
  957. visible along with the headline structure above it@footnote{See also the
  958. variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
  959. @code{org-show-siblings}, and @code{org-show-entry-below} for detailed
  960. control on how much context is shown around each match.}. Just try it out
  961. and you will see immediately how it works.
  962. Org mode contains several commands creating such trees, all these
  963. commands can be accessed through a dispatcher:
  964. @table @kbd
  965. @kindex C-c /
  966. @item C-c /
  967. This prompts for an extra key to select a sparse-tree creating command.
  968. @kindex C-c / r
  969. @item C-c / r
  970. Occur. Prompts for a regexp and shows a sparse tree with all matches. If
  971. the match is in a headline, the headline is made visible. If the match is in
  972. the body of an entry, headline and body are made visible. In order to
  973. provide minimal context, also the full hierarchy of headlines above the match
  974. is shown, as well as the headline following the match. Each match is also
  975. highlighted; the highlights disappear when the buffer is changed by an
  976. editing command@footnote{depending on the option
  977. @code{org-remove-highlights-with-change}}, or by pressing @kbd{C-c C-c}.
  978. When called with a @kbd{C-u} prefix argument, previous highlights are kept,
  979. so several calls to this command can be stacked.
  980. @end table
  981. @noindent
  982. For frequently used sparse trees of specific search strings, you can
  983. use the variable @code{org-agenda-custom-commands} to define fast
  984. keyboard access to specific sparse trees. These commands will then be
  985. accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
  986. For example:
  987. @lisp
  988. (setq org-agenda-custom-commands
  989. '(("f" occur-tree "FIXME")))
  990. @end lisp
  991. @noindent will define the key @kbd{C-c a f} as a shortcut for creating
  992. a sparse tree matching the string @samp{FIXME}.
  993. The other sparse tree commands select headings based on TODO keywords,
  994. tags, or properties and will be discussed later in this manual.
  995. @kindex C-c C-e v
  996. @cindex printing sparse trees
  997. @cindex visible text, printing
  998. To print a sparse tree, you can use the Emacs command
  999. @code{ps-print-buffer-with-faces} which does not print invisible parts
  1000. of the document @footnote{This does not work under XEmacs, because
  1001. XEmacs uses selective display for outlining, not text properties.}.
  1002. Or you can use the command @kbd{C-c C-e v} to export only the visible
  1003. part of the document and print the resulting file.
  1004. @node Plain lists, Drawers, Sparse trees, Document Structure
  1005. @section Plain lists
  1006. @cindex plain lists
  1007. @cindex lists, plain
  1008. @cindex lists, ordered
  1009. @cindex ordered lists
  1010. Within an entry of the outline tree, hand-formatted lists can provide
  1011. additional structure. They also provide a way to create lists of
  1012. checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
  1013. and the HTML exporter (@pxref{Exporting}) parses and formats them.
  1014. Org knows ordered lists, unordered lists, and description lists.
  1015. @itemize @bullet
  1016. @item
  1017. @emph{Unordered} list items start with @samp{-}, @samp{+}, or
  1018. @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
  1019. they will be seen as top-level headlines. Also, when you are hiding leading
  1020. stars to get a clean outline view, plain list items starting with a star are
  1021. visually indistinguishable from true headlines. In short: even though
  1022. @samp{*} is supported, it may be better to not use it for plain list items.}
  1023. as bullets.
  1024. @item
  1025. @emph{Ordered} list items start with a numeral followed by either a period or
  1026. a right parenthesis, such as @samp{1.} or @samp{1)}.
  1027. @item
  1028. @emph{Description} list items are like unordered list items, but contain the
  1029. separator @samp{ :: } to separate the description @emph{term} from the
  1030. desciption.
  1031. @end itemize
  1032. Items belonging to the same list must have the same indentation on the first
  1033. line. In particular, if an ordered list reaches number @samp{10.}, then the
  1034. 2--digit numbers must be written left-aligned with the other numbers in the
  1035. list. Indentation also determines the end of a list item. It ends before
  1036. the next line that is indented like the bullet/number, or less. Empty lines
  1037. are part of the previous item, so you can have several paragraphs in one
  1038. item. If you would like an empty line to terminate all currently open plain
  1039. lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
  1040. Here is an example:
  1041. @example
  1042. @group
  1043. ** Lord of the Rings
  1044. My favorite scenes are (in this order)
  1045. 1. The attack of the Rohirrim
  1046. 2. Eowyns fight with the witch king
  1047. + this was already my favorite scene in the book
  1048. + I really like Miranda Otto.
  1049. 3. Peter Jackson being shot by Legolas
  1050. - on DVD only
  1051. He makes a really funny face when it happens.
  1052. But in the end, not individual scenes matter but the film as a whole.
  1053. Important actors in this film are:
  1054. - @b{Elijah Wood} :: He plays the Frodo
  1055. - @b{Sean Austin} :: He plays the Sam, Frodos friend. I still remember
  1056. him very well from his role as Mikey Walsh a in the Goonies.
  1057. @end group
  1058. @end example
  1059. Org supports these lists by tuning filling and wrapping commands to
  1060. deal with them correctly@footnote{Org only changes the filling
  1061. settings for Emacs. For XEmacs, you should use Kyle E. Jones'
  1062. @file{filladapt.el}. To turn this on, put into @file{.emacs}:
  1063. @code{(require 'filladapt)}}, and by exporting them properly
  1064. (@pxref{Exporting}).
  1065. The following commands act on items when the cursor is in the first line
  1066. of an item (the line with the bullet or number).
  1067. @table @kbd
  1068. @kindex @key{TAB}
  1069. @item @key{TAB}
  1070. Items can be folded just like headline levels if you set the variable
  1071. @code{org-cycle-include-plain-lists}. The level of an item is then
  1072. given by the indentation of the bullet/number. Items are always
  1073. subordinate to real headlines, however; the hierarchies remain
  1074. completely separated.
  1075. If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
  1076. fixes the indentation of the current line in a heuristic way.
  1077. @kindex M-@key{RET}
  1078. @item M-@key{RET}
  1079. Insert new item at current level. With a prefix argument, force a new
  1080. heading (@pxref{Structure editing}). If this command is used in the middle
  1081. of a line, the line is @emph{split} and the rest of the line becomes the new
  1082. item@footnote{If you do not want the line to be split, customize the variable
  1083. @code{org-M-RET-may-split-line}.}. If this command is executed in the
  1084. @emph{whitespace before a bullet or number}, the new item is created
  1085. @emph{before} the current item. If the command is executed in the white
  1086. space before the text that is part of an item but does not contain the
  1087. bullet, a bullet is added to the current line.
  1088. @kindex M-S-@key{RET}
  1089. @item M-S-@key{RET}
  1090. Insert a new item with a checkbox (@pxref{Checkboxes}).
  1091. @kindex S-@key{up}
  1092. @kindex S-@key{down}
  1093. @item S-@key{up}
  1094. @itemx S-@key{down}
  1095. Jump to the previous/next item in the current list.
  1096. @kindex M-S-@key{up}
  1097. @kindex M-S-@key{down}
  1098. @item M-S-@key{up}
  1099. @itemx M-S-@key{down}
  1100. Move the item including subitems up/down (swap with previous/next item
  1101. of same indentation). If the list is ordered, renumbering is
  1102. automatic.
  1103. @kindex M-S-@key{left}
  1104. @kindex M-S-@key{right}
  1105. @item M-S-@key{left}
  1106. @itemx M-S-@key{right}
  1107. Decrease/increase the indentation of the item, including subitems.
  1108. Initially, the item tree is selected based on current indentation.
  1109. When these commands are executed several times in direct succession,
  1110. the initially selected region is used, even if the new indentation
  1111. would imply a different hierarchy. To use the new hierarchy, break
  1112. the command chain with a cursor motion or so.
  1113. @kindex C-c C-c
  1114. @item C-c C-c
  1115. If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
  1116. state of the checkbox. If not, this command makes sure that all the
  1117. items on this list level use the same bullet. Furthermore, if this is
  1118. an ordered list, make sure the numbering is OK.
  1119. @kindex C-c -
  1120. @item C-c -
  1121. Cycle the entire list level through the different itemize/enumerate bullets
  1122. (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}). With a numeric prefix
  1123. argument N, select the Nth bullet from this list. If there is an active
  1124. region when calling this, all lines will be converted to list items. If the
  1125. first line already was a list item, any item markers will be removed from the
  1126. list. Finally, even without an active region, a normal line will be
  1127. converted into a list item.
  1128. @kindex S-@key{left}
  1129. @kindex S-@key{right}
  1130. @item S-@key{left}/@key{right}
  1131. Also cycle bullet styles when in the first line of an item.
  1132. @end table
  1133. @node Drawers, Orgstruct mode, Plain lists, Document Structure
  1134. @section Drawers
  1135. @cindex drawers
  1136. @cindex visibility cycling, drawers
  1137. Sometimes you want to keep information associated with an entry, but you
  1138. normally don't want to see it. For this, Org mode has @emph{drawers}.
  1139. Drawers need to be configured with the variable
  1140. @code{org-drawers}@footnote{You can define drawers on a per-file basis
  1141. with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
  1142. look like this:
  1143. @example
  1144. ** This is a headline
  1145. Still outside the drawer
  1146. :DRAWERNAME:
  1147. This is inside the drawer.
  1148. :END:
  1149. After the drawer.
  1150. @end example
  1151. Visibility cycling (@pxref{Visibility cycling}) on the headline will
  1152. hide and show the entry, but keep the drawer collapsed to a single line.
  1153. In order to look inside the drawer, you need to move the cursor to the
  1154. drawer line and press @key{TAB} there. Org mode uses a drawer for
  1155. storing properties (@pxref{Properties and Columns}), and another one for
  1156. storing clock times (@pxref{Clocking work time}).
  1157. @node Orgstruct mode, , Drawers, Document Structure
  1158. @section The Orgstruct minor mode
  1159. @cindex Orgstruct mode
  1160. @cindex minor mode for structure editing
  1161. If you like the intuitive way the Org mode structure editing and list
  1162. formatting works, you might want to use these commands in other modes
  1163. like Text mode or Mail mode as well. The minor mode Orgstruct mode
  1164. makes this possible. You can always toggle the mode with @kbd{M-x
  1165. orgstruct-mode}. To turn it on by default, for example in Mail mode,
  1166. use
  1167. @lisp
  1168. (add-hook 'mail-mode-hook 'turn-on-orgstruct)
  1169. @end lisp
  1170. When this mode is active and the cursor is on a line that looks to
  1171. Org like a headline of the first line of a list item, most
  1172. structure editing commands will work, even if the same keys normally
  1173. have different functionality in the major mode you are using. If the
  1174. cursor is not in one of those special lines, Orgstruct mode lurks
  1175. silently in the shadow.
  1176. @node Tables, Hyperlinks, Document Structure, Top
  1177. @chapter Tables
  1178. @cindex tables
  1179. @cindex editing tables
  1180. Org comes with a fast and intuitive table editor. Spreadsheet-like
  1181. calculations are supported in connection with the Emacs @file{calc}
  1182. package
  1183. @ifinfo
  1184. (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
  1185. @end ifinfo
  1186. @ifnotinfo
  1187. (see the Emacs Calculator manual for more information about the Emacs
  1188. calculator).
  1189. @end ifnotinfo
  1190. @menu
  1191. * Built-in table editor:: Simple tables
  1192. * Narrow columns:: Stop wasting space in tables
  1193. * Column groups:: Grouping to trigger vertical lines
  1194. * Orgtbl mode:: The table editor as minor mode
  1195. * The spreadsheet:: The table editor has spreadsheet capabilities
  1196. * Org Plot:: Plotting from org tables
  1197. @end menu
  1198. @node Built-in table editor, Narrow columns, Tables, Tables
  1199. @section The built-in table editor
  1200. @cindex table editor, built-in
  1201. Org makes it easy to format tables in plain ASCII. Any line with
  1202. @samp{|} as the first non-whitespace character is considered part of a
  1203. table. @samp{|} is also the column separator. A table might look like
  1204. this:
  1205. @example
  1206. | Name | Phone | Age |
  1207. |-------+-------+-----|
  1208. | Peter | 1234 | 17 |
  1209. | Anna | 4321 | 25 |
  1210. @end example
  1211. A table is re-aligned automatically each time you press @key{TAB} or
  1212. @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
  1213. the next field (@key{RET} to the next row) and creates new table rows
  1214. at the end of the table or before horizontal lines. The indentation
  1215. of the table is set by the first line. Any line starting with
  1216. @samp{|-} is considered as a horizontal separator line and will be
  1217. expanded on the next re-align to span the whole table width. So, to
  1218. create the above table, you would only type
  1219. @example
  1220. |Name|Phone|Age|
  1221. |-
  1222. @end example
  1223. @noindent and then press @key{TAB} to align the table and start filling in
  1224. fields.
  1225. When typing text into a field, Org treats @key{DEL},
  1226. @key{Backspace}, and all character keys in a special way, so that
  1227. inserting and deleting avoids shifting other fields. Also, when
  1228. typing @emph{immediately after the cursor was moved into a new field
  1229. with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
  1230. field is automatically made blank. If this behavior is too
  1231. unpredictable for you, configure the variables
  1232. @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
  1233. @table @kbd
  1234. @tsubheading{Creation and conversion}
  1235. @kindex C-c |
  1236. @item C-c |
  1237. Convert the active region to table. If every line contains at least one
  1238. TAB character, the function assumes that the material is tab separated.
  1239. If every line contains a comma, comma-separated values (CSV) are assumed.
  1240. If not, lines are split at whitespace into fields. You can use a prefix
  1241. argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
  1242. C-u} forces TAB, and a numeric argument N indicates that at least N
  1243. consecutive spaces, or alternatively a TAB will be the separator.
  1244. @*
  1245. If there is no active region, this command creates an empty Org
  1246. table. But it's easier just to start typing, like
  1247. @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
  1248. @tsubheading{Re-aligning and field motion}
  1249. @kindex C-c C-c
  1250. @item C-c C-c
  1251. Re-align the table without moving the cursor.
  1252. @c
  1253. @kindex @key{TAB}
  1254. @item @key{TAB}
  1255. Re-align the table, move to the next field. Creates a new row if
  1256. necessary.
  1257. @c
  1258. @kindex S-@key{TAB}
  1259. @item S-@key{TAB}
  1260. Re-align, move to previous field.
  1261. @c
  1262. @kindex @key{RET}
  1263. @item @key{RET}
  1264. Re-align the table and move down to next row. Creates a new row if
  1265. necessary. At the beginning or end of a line, @key{RET} still does
  1266. NEWLINE, so it can be used to split a table.
  1267. @tsubheading{Column and row editing}
  1268. @kindex M-@key{left}
  1269. @kindex M-@key{right}
  1270. @item M-@key{left}
  1271. @itemx M-@key{right}
  1272. Move the current column left/right.
  1273. @c
  1274. @kindex M-S-@key{left}
  1275. @item M-S-@key{left}
  1276. Kill the current column.
  1277. @c
  1278. @kindex M-S-@key{right}
  1279. @item M-S-@key{right}
  1280. Insert a new column to the left of the cursor position.
  1281. @c
  1282. @kindex M-@key{up}
  1283. @kindex M-@key{down}
  1284. @item M-@key{up}
  1285. @itemx M-@key{down}
  1286. Move the current row up/down.
  1287. @c
  1288. @kindex M-S-@key{up}
  1289. @item M-S-@key{up}
  1290. Kill the current row or horizontal line.
  1291. @c
  1292. @kindex M-S-@key{down}
  1293. @item M-S-@key{down}
  1294. Insert a new row above the current row. With a prefix argument, the line is
  1295. created below the current one.
  1296. @c
  1297. @kindex C-c -
  1298. @item C-c -
  1299. Insert a horizontal line below current row. With a prefix argument, the line
  1300. is created above the current line.
  1301. @c
  1302. @kindex C-c ^
  1303. @item C-c ^
  1304. Sort the table lines in the region. The position of point indicates the
  1305. column to be used for sorting, and the range of lines is the range
  1306. between the nearest horizontal separator lines, or the entire table. If
  1307. point is before the first column, you will be prompted for the sorting
  1308. column. If there is an active region, the mark specifies the first line
  1309. and the sorting column, while point should be in the last line to be
  1310. included into the sorting. The command prompts for the sorting type
  1311. (alphabetically, numerically, or by time). When called with a prefix
  1312. argument, alphabetic sorting will be case-sensitive.
  1313. @tsubheading{Regions}
  1314. @kindex C-c C-x M-w
  1315. @item C-c C-x M-w
  1316. Copy a rectangular region from a table to a special clipboard. Point
  1317. and mark determine edge fields of the rectangle. The process ignores
  1318. horizontal separator lines.
  1319. @c
  1320. @kindex C-c C-x C-w
  1321. @item C-c C-x C-w
  1322. Copy a rectangular region from a table to a special clipboard, and
  1323. blank all fields in the rectangle. So this is the ``cut'' operation.
  1324. @c
  1325. @kindex C-c C-x C-y
  1326. @item C-c C-x C-y
  1327. Paste a rectangular region into a table.
  1328. The upper left corner ends up in the current field. All involved fields
  1329. will be overwritten. If the rectangle does not fit into the present table,
  1330. the table is enlarged as needed. The process ignores horizontal separator
  1331. lines.
  1332. @c
  1333. @kindex C-c C-q
  1334. @kindex M-@key{RET}
  1335. @item C-c C-q
  1336. @itemx M-@kbd{RET}
  1337. Wrap several fields in a column like a paragraph. If there is an active
  1338. region, and both point and mark are in the same column, the text in the
  1339. column is wrapped to minimum width for the given number of lines. A numeric
  1340. prefix argument may be used to change the number of desired lines. If there
  1341. is no region, the current field is split at the cursor position and the text
  1342. fragment to the right of the cursor is prepended to the field one line
  1343. down. If there is no region, but you specify a prefix argument, the current
  1344. field is made blank, and the content is appended to the field above.
  1345. @tsubheading{Calculations}
  1346. @cindex formula, in tables
  1347. @cindex calculations, in tables
  1348. @cindex region, active
  1349. @cindex active region
  1350. @cindex Transient mark mode
  1351. @kindex C-c +
  1352. @item C-c +
  1353. Sum the numbers in the current column, or in the rectangle defined by
  1354. the active region. The result is shown in the echo area and can
  1355. be inserted with @kbd{C-y}.
  1356. @c
  1357. @kindex S-@key{RET}
  1358. @item S-@key{RET}
  1359. When current field is empty, copy from first non-empty field above. When not
  1360. empty, copy current field down to next row and move cursor along with it.
  1361. Depending on the variable @code{org-table-copy-increment}, integer field
  1362. values will be incremented during copy. Integers that are too large will not
  1363. be incremented. Also, a @code{0} prefix argument temporarily dispables the
  1364. increment. This key is also used by CUA mode (@pxref{Cooperation}).
  1365. @tsubheading{Miscellaneous}
  1366. @kindex C-c `
  1367. @item C-c `
  1368. Edit the current field in a separate window. This is useful for fields
  1369. that are not fully visible (@pxref{Narrow columns}). When called with a
  1370. @kbd{C-u} prefix, just make the full field visible, so that it can be
  1371. edited in place.
  1372. @c
  1373. @item M-x org-table-import
  1374. Import a file as a table. The table should be TAB- or whitespace
  1375. separated. Useful, for example, to import a spreadsheet table or data
  1376. from a database, because these programs generally can write
  1377. TAB-separated text files. This command works by inserting the file into
  1378. the buffer and then converting the region to a table. Any prefix
  1379. argument is passed on to the converter, which uses it to determine the
  1380. separator.
  1381. @item C-c |
  1382. Tables can also be imported by pasting tabular text into the Org
  1383. buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
  1384. @kbd{C-c |} command (see above under @i{Creation and conversion}).
  1385. @c
  1386. @item M-x org-table-export
  1387. Export the table, by default as a TAB-separated file. Useful for data
  1388. exchange with, for example, spreadsheet or database programs. The format
  1389. used to export the file can be configured in the variable
  1390. @code{org-table-export-default-format}. You may also use properties
  1391. @code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
  1392. name and the format for table export in a subtree. Org supports quite
  1393. general formats for exported tables. The exporter format is the same as the
  1394. format used by Orgtbl radio tables, see @ref{Translator functions} for a
  1395. detailed description.
  1396. @end table
  1397. If you don't like the automatic table editor because it gets in your
  1398. way on lines which you would like to start with @samp{|}, you can turn
  1399. it off with
  1400. @lisp
  1401. (setq org-enable-table-editor nil)
  1402. @end lisp
  1403. @noindent Then the only table command that still works is
  1404. @kbd{C-c C-c} to do a manual re-align.
  1405. @node Narrow columns, Column groups, Built-in table editor, Tables
  1406. @section Narrow columns
  1407. @cindex narrow columns in tables
  1408. The width of columns is automatically determined by the table editor.
  1409. Sometimes a single field or a few fields need to carry more text,
  1410. leading to inconveniently wide columns. To limit@footnote{This feature
  1411. does not work on XEmacs.} the width of a column, one field anywhere in
  1412. the column may contain just the string @samp{<N>} where @samp{N} is an
  1413. integer specifying the width of the column in characters. The next
  1414. re-align will then set the width of this column to no more than this
  1415. value.
  1416. @example
  1417. @group
  1418. |---+------------------------------| |---+--------|
  1419. | | | | | <6> |
  1420. | 1 | one | | 1 | one |
  1421. | 2 | two | ----\ | 2 | two |
  1422. | 3 | This is a long chunk of text | ----/ | 3 | This=> |
  1423. | 4 | four | | 4 | four |
  1424. |---+------------------------------| |---+--------|
  1425. @end group
  1426. @end example
  1427. @noindent
  1428. Fields that are wider become clipped and end in the string @samp{=>}.
  1429. Note that the full text is still in the buffer, it is only invisible.
  1430. To see the full text, hold the mouse over the field - a tool-tip window
  1431. will show the full content. To edit such a field, use the command
  1432. @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
  1433. open a new window with the full field. Edit it and finish with @kbd{C-c
  1434. C-c}.
  1435. When visiting a file containing a table with narrowed columns, the
  1436. necessary character hiding has not yet happened, and the table needs to
  1437. be aligned before it looks nice. Setting the option
  1438. @code{org-startup-align-all-tables} will realign all tables in a file
  1439. upon visiting, but also slow down startup. You can also set this option
  1440. on a per-file basis with:
  1441. @example
  1442. #+STARTUP: align
  1443. #+STARTUP: noalign
  1444. @end example
  1445. @node Column groups, Orgtbl mode, Narrow columns, Tables
  1446. @section Column groups
  1447. @cindex grouping columns in tables
  1448. When Org exports tables, it does so by default without vertical
  1449. lines because that is visually more satisfying in general. Occasionally
  1450. however, vertical lines can be useful to structure a table into groups
  1451. of columns, much like horizontal lines can do for groups of rows. In
  1452. order to specify column groups, you can use a special row where the
  1453. first field contains only @samp{/}. The further fields can either
  1454. contain @samp{<} to indicate that this column should start a group,
  1455. @samp{>} to indicate the end of a column, or @samp{<>} to make a column
  1456. a group of its own. Boundaries between column groups will upon export be
  1457. marked with vertical lines. Here is an example:
  1458. @example
  1459. | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1460. |---+----+-----+-----+-----+---------+------------|
  1461. | / | <> | < | | > | < | > |
  1462. | # | 1 | 1 | 1 | 1 | 1 | 1 |
  1463. | # | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
  1464. | # | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
  1465. |---+----+-----+-----+-----+---------+------------|
  1466. #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2)))
  1467. @end example
  1468. It is also sufficient to just insert the column group starters after
  1469. every vertical line you'd like to have:
  1470. @example
  1471. | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
  1472. |----+-----+-----+-----+---------+------------|
  1473. | / | < | | | < | |
  1474. @end example
  1475. @node Orgtbl mode, The spreadsheet, Column groups, Tables
  1476. @section The Orgtbl minor mode
  1477. @cindex Orgtbl mode
  1478. @cindex minor mode for tables
  1479. If you like the intuitive way the Org table editor works, you
  1480. might also want to use it in other modes like Text mode or Mail mode.
  1481. The minor mode Orgtbl mode makes this possible. You can always toggle
  1482. the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
  1483. example in mail mode, use
  1484. @lisp
  1485. (add-hook 'mail-mode-hook 'turn-on-orgtbl)
  1486. @end lisp
  1487. Furthermore, with some special setup, it is possible to maintain tables
  1488. in arbitrary syntax with Orgtbl mode. For example, it is possible to
  1489. construct La@TeX{} tables with the underlying ease and power of
  1490. Orgtbl mode, including spreadsheet capabilities. For details, see
  1491. @ref{Tables in arbitrary syntax}.
  1492. @node The spreadsheet, Org Plot, Orgtbl mode, Tables
  1493. @section The spreadsheet
  1494. @cindex calculations, in tables
  1495. @cindex spreadsheet capabilities
  1496. @cindex @file{calc} package
  1497. The table editor makes use of the Emacs @file{calc} package to implement
  1498. spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
  1499. derive fields from other fields. While fully featured, Org's
  1500. implementation is not identical to other spreadsheets. For example,
  1501. Org knows the concept of a @emph{column formula} that will be
  1502. applied to all non-header fields in a column without having to copy the
  1503. formula to each relevant field.
  1504. @menu
  1505. * References:: How to refer to another field or range
  1506. * Formula syntax for Calc:: Using Calc to compute stuff
  1507. * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
  1508. * Field formulas:: Formulas valid for a single field
  1509. * Column formulas:: Formulas valid for an entire column
  1510. * Editing and debugging formulas:: Fixing formulas
  1511. * Updating the table:: Recomputing all dependent fields
  1512. * Advanced features:: Field names, parameters and automatic recalc
  1513. @end menu
  1514. @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
  1515. @subsection References
  1516. @cindex references
  1517. To compute fields in the table from other fields, formulas must
  1518. reference other fields or ranges. In Org, fields can be referenced
  1519. by name, by absolute coordinates, and by relative coordinates. To find
  1520. out what the coordinates of a field are, press @kbd{C-c ?} in that
  1521. field, or press @kbd{C-c @}} to toggle the display of a grid.
  1522. @subsubheading Field references
  1523. @cindex field references
  1524. @cindex references, to fields
  1525. Formulas can reference the value of another field in two ways. Like in
  1526. any other spreadsheet, you may reference fields with a letter/number
  1527. combination like @code{B3}, meaning the 2nd field in the 3rd row.
  1528. @c Such references are always fixed to that field, they don't change
  1529. @c when you copy and paste a formula to a different field. So
  1530. @c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
  1531. @noindent
  1532. Org also uses another, more general operator that looks like this:
  1533. @example
  1534. @@row$column
  1535. @end example
  1536. @noindent
  1537. Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
  1538. or relative to the current column like @samp{+1} or @samp{-2}.
  1539. The row specification only counts data lines and ignores horizontal
  1540. separator lines (hlines). You can use absolute row numbers
  1541. @samp{1}...@samp{N}, and row numbers relative to the current row like
  1542. @samp{+3} or @samp{-1}. Or specify the row relative to one of the
  1543. hlines: @samp{I} refers to the first hline@footnote{Note that only
  1544. hlines are counted that @emph{separate} table lines. If the table
  1545. starts with a hline above the header, it does not count.}, @samp{II} to
  1546. the second etc. @samp{-I} refers to the first such line above the
  1547. current line, @samp{+I} to the first such line below the current line.
  1548. You can also write @samp{III+2} which is the second data line after the
  1549. third hline in the table. Relative row numbers like @samp{-3} will not
  1550. cross hlines if the current line is too close to the hline. Instead,
  1551. the value directly at the hline is used.
  1552. @samp{0} refers to the current row and column. Also, if you omit
  1553. either the column or the row part of the reference, the current
  1554. row/column is implied.
  1555. Org's references with @emph{unsigned} numbers are fixed references
  1556. in the sense that if you use the same reference in the formula for two
  1557. different fields, the same field will be referenced each time.
  1558. Org's references with @emph{signed} numbers are floating
  1559. references because the same reference operator can reference different
  1560. fields depending on the field being calculated by the formula.
  1561. Here are a few examples:
  1562. @example
  1563. @@2$3 @r{2nd row, 3rd column}
  1564. C2 @r{same as previous}
  1565. $5 @r{column 5 in the current row}
  1566. E& @r{same as previous}
  1567. @@2 @r{current column, row 2}
  1568. @@-1$-3 @r{the field one row up, three columns to the left}
  1569. @@-I$2 @r{field just under hline above current row, column 2}
  1570. @end example
  1571. @subsubheading Range references
  1572. @cindex range references
  1573. @cindex references, to ranges
  1574. You may reference a rectangular range of fields by specifying two field
  1575. references connected by two dots @samp{..}. If both fields are in the
  1576. current row, you may simply use @samp{$2..$7}, but if at least one field
  1577. is in a different row, you need to use the general @code{@@row$column}
  1578. format at least for the first field (i.e the reference must start with
  1579. @samp{@@} in order to be interpreted correctly). Examples:
  1580. @example
  1581. $1..$3 @r{First three fields in the current row.}
  1582. $P..$Q @r{Range, using column names (see under Advanced)}
  1583. @@2$1..@@4$3 @r{6 fields between these two fields.}
  1584. A2..C4 @r{Same as above.}
  1585. @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
  1586. @end example
  1587. @noindent Range references return a vector of values that can be fed
  1588. into Calc vector functions. Empty fields in ranges are normally
  1589. suppressed, so that the vector contains only the non-empty fields (but
  1590. see the @samp{E} mode switch below). If there are no non-empty fields,
  1591. @samp{[0]} is returned to avoid syntax errors in formulas.
  1592. @subsubheading Named references
  1593. @cindex named references
  1594. @cindex references, named
  1595. @cindex name, of column or field
  1596. @cindex constants, in calculations
  1597. @samp{$name} is interpreted as the name of a column, parameter or
  1598. constant. Constants are defined globally through the variable
  1599. @code{org-table-formula-constants}, and locally (for the file) through a
  1600. line like
  1601. @example
  1602. #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
  1603. @end example
  1604. @noindent
  1605. Also properties (@pxref{Properties and Columns}) can be used as
  1606. constants in table formulas: For a property @samp{:Xyz:} use the name
  1607. @samp{$PROP_Xyz}, and the property will be searched in the current
  1608. outline entry and in the hierarchy above it. If you have the
  1609. @file{constants.el} package, it will also be used to resolve constants,
  1610. including natural constants like @samp{$h} for Planck's constant, and
  1611. units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
  1612. supply the values of constants in two different unit systems, @code{SI}
  1613. and @code{cgs}. Which one is used depends on the value of the variable
  1614. @code{constants-unit-system}. You can use the @code{#+STARTUP} options
  1615. @code{constSI} and @code{constcgs} to set this value for the current
  1616. buffer.}. Column names and parameters can be specified in special table
  1617. lines. These are described below, see @ref{Advanced features}. All
  1618. names must start with a letter, and further consist of letters and
  1619. numbers.
  1620. @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
  1621. @subsection Formula syntax for Calc
  1622. @cindex formula syntax, Calc
  1623. @cindex syntax, of formulas
  1624. A formula can be any algebraic expression understood by the Emacs
  1625. @file{Calc} package. @b{Note that @file{calc} has the
  1626. non-standard convention that @samp{/} has lower precedence than
  1627. @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
  1628. evaluation by @code{calc-eval} (@pxref{Calling Calc from
  1629. Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
  1630. Emacs Calc Manual}),
  1631. @c FIXME: The link to the Calc manual in HTML does not work.
  1632. variable substitution takes place according to the rules described above.
  1633. @cindex vectors, in table calculations
  1634. The range vectors can be directly fed into the Calc vector functions
  1635. like @samp{vmean} and @samp{vsum}.
  1636. @cindex format specifier
  1637. @cindex mode, for @file{calc}
  1638. A formula can contain an optional mode string after a semicolon. This
  1639. string consists of flags to influence Calc and other modes during
  1640. execution. By default, Org uses the standard Calc modes (precision
  1641. 12, angular units degrees, fraction and symbolic modes off). The display
  1642. format, however, has been changed to @code{(float 5)} to keep tables
  1643. compact. The default settings can be configured using the variable
  1644. @code{org-calc-default-modes}.
  1645. @example
  1646. p20 @r{switch the internal precision to 20 digits}
  1647. n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
  1648. D R @r{angle modes: degrees, radians}
  1649. F S @r{fraction and symbolic modes}
  1650. N @r{interpret all fields as numbers, use 0 for non-numbers}
  1651. T @r{force text interpretation}
  1652. E @r{keep empty fields in ranges}
  1653. @end example
  1654. @noindent
  1655. In addition, you may provide a @code{printf} format specifier to
  1656. reformat the final result. A few examples:
  1657. @example
  1658. $1+$2 @r{Sum of first and second field}
  1659. $1+$2;%.2f @r{Same, format result to two decimals}
  1660. exp($2)+exp($1) @r{Math functions can be used}
  1661. $0;%.1f @r{Reformat current cell to 1 decimal}
  1662. ($3-32)*5/9 @r{Degrees F -> C conversion}
  1663. $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
  1664. tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
  1665. sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
  1666. vmean($2..$7) @r{Compute column range mean, using vector function}
  1667. vmean($2..$7);EN @r{Same, but treat empty fields as 0}
  1668. taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
  1669. @end example
  1670. Calc also contains a complete set of logical operations. For example
  1671. @example
  1672. if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
  1673. @end example
  1674. @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
  1675. @subsection Emacs Lisp forms as formulas
  1676. @cindex Lisp forms, as table formulas
  1677. It is also possible to write a formula in Emacs Lisp; this can be useful
  1678. for string manipulation and control structures, if the Calc's
  1679. functionality is not enough. If a formula starts with a single quote
  1680. followed by an opening parenthesis, then it is evaluated as a lisp form.
  1681. The evaluation should return either a string or a number. Just as with
  1682. @file{calc} formulas, you can specify modes and a printf format after a
  1683. semicolon. With Emacs Lisp forms, you need to be conscious about the way
  1684. field references are interpolated into the form. By default, a
  1685. reference will be interpolated as a Lisp string (in double quotes)
  1686. containing the field. If you provide the @samp{N} mode switch, all
  1687. referenced elements will be numbers (non-number fields will be zero) and
  1688. interpolated as Lisp numbers, without quotes. If you provide the
  1689. @samp{L} flag, all fields will be interpolated literally, without quotes.
  1690. I.e., if you want a reference to be interpreted as a string by the Lisp
  1691. form, enclose the reference operator itself in double quotes, like
  1692. @code{"$3"}. Ranges are inserted as space-separated fields, so you can
  1693. embed them in list or vector syntax. A few examples, note how the
  1694. @samp{N} mode is used when we do computations in lisp.
  1695. @example
  1696. @r{Swap the first two characters of the content of column 1}
  1697. '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
  1698. @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
  1699. '(+ $1 $2);N
  1700. @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
  1701. '(apply '+ '($1..$4));N
  1702. @end example
  1703. @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
  1704. @subsection Field formulas
  1705. @cindex field formula
  1706. @cindex formula, for individual table field
  1707. To assign a formula to a particular field, type it directly into the
  1708. field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
  1709. press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
  1710. the field, the formula will be stored as the formula for this field,
  1711. evaluated, and the current field replaced with the result.
  1712. Formulas are stored in a special line starting with @samp{#+TBLFM:}
  1713. directly below the table. If you typed the equation in the 4th field of
  1714. the 3rd data line in the table, the formula will look like
  1715. @samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
  1716. with the appropriate commands, @i{absolute references} (but not relative
  1717. ones) in stored formulas are modified in order to still reference the
  1718. same field. Of cause this is not true if you edit the table structure
  1719. with normal editing commands - then you must fix the equations yourself.
  1720. Instead of typing an equation into the field, you may also use the
  1721. following command
  1722. @table @kbd
  1723. @kindex C-u C-c =
  1724. @item C-u C-c =
  1725. Install a new formula for the current field. The command prompts for a
  1726. formula, with default taken from the @samp{#+TBLFM:} line, applies
  1727. it to the current field and stores it.
  1728. @end table
  1729. @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
  1730. @subsection Column formulas
  1731. @cindex column formula
  1732. @cindex formula, for table column
  1733. Often in a table, the same formula should be used for all fields in a
  1734. particular column. Instead of having to copy the formula to all fields
  1735. in that column, Org allows to assign a single formula to an entire
  1736. column. If the table contains horizontal separator hlines, everything
  1737. before the first such line is considered part of the table @emph{header}
  1738. and will not be modified by column formulas.
  1739. To assign a formula to a column, type it directly into any field in the
  1740. column, preceded by an equal sign, like @samp{=$1+$2}. When you press
  1741. @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
  1742. field, the formula will be stored as the formula for the current column,
  1743. evaluated and the current field replaced with the result. If the field
  1744. contains only @samp{=}, the previously stored formula for this column is
  1745. used. For each column, Org will only remember the most recently
  1746. used formula. In the @samp{TBLFM:} line, column formulas will look like
  1747. @samp{$4=$1+$2}.
  1748. Instead of typing an equation into the field, you may also use the
  1749. following command:
  1750. @table @kbd
  1751. @kindex C-c =
  1752. @item C-c =
  1753. Install a new formula for the current column and replace current field with
  1754. the result of the formula. The command prompts for a formula, with default
  1755. taken from the @samp{#+TBLFM} line, applies it to the current field and
  1756. stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
  1757. will apply it to that many consecutive fields in the current column.
  1758. @end table
  1759. @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
  1760. @subsection Editing and debugging formulas
  1761. @cindex formula editing
  1762. @cindex editing, of table formulas
  1763. You can edit individual formulas in the minibuffer or directly in the
  1764. field. Org can also prepare a special buffer with all active
  1765. formulas of a table. When offering a formula for editing, Org
  1766. converts references to the standard format (like @code{B3} or @code{D&})
  1767. if possible. If you prefer to only work with the internal format (like
  1768. @code{@@3$2} or @code{$4}), configure the variable
  1769. @code{org-table-use-standard-references}.
  1770. @table @kbd
  1771. @kindex C-c =
  1772. @kindex C-u C-c =
  1773. @item C-c =
  1774. @itemx C-u C-c =
  1775. Edit the formula associated with the current column/field in the
  1776. minibuffer. See @ref{Column formulas} and @ref{Field formulas}.
  1777. @kindex C-u C-u C-c =
  1778. @item C-u C-u C-c =
  1779. Re-insert the active formula (either a
  1780. field formula, or a column formula) into the current field, so that you
  1781. can edit it directly in the field. The advantage over editing in the
  1782. minibuffer is that you can use the command @kbd{C-c ?}.
  1783. @kindex C-c ?
  1784. @item C-c ?
  1785. While editing a formula in a table field, highlight the field(s)
  1786. referenced by the reference at the cursor position in the formula.
  1787. @kindex C-c @}
  1788. @item C-c @}
  1789. Toggle the display of row and column numbers for a table, using
  1790. overlays. These are updated each time the table is aligned, you can
  1791. force it with @kbd{C-c C-c}.
  1792. @kindex C-c @{
  1793. @item C-c @{
  1794. Toggle the formula debugger on and off. See below.
  1795. @kindex C-c '
  1796. @item C-c '
  1797. Edit all formulas for the current table in a special buffer, where the
  1798. formulas will be displayed one per line. If the current field has an
  1799. active formula, the cursor in the formula editor will mark it.
  1800. While inside the special buffer, Org will automatically highlight
  1801. any field or range reference at the cursor position. You may edit,
  1802. remove and add formulas, and use the following commands:
  1803. @table @kbd
  1804. @kindex C-c C-c
  1805. @kindex C-x C-s
  1806. @item C-c C-c
  1807. @itemx C-x C-s
  1808. Exit the formula editor and store the modified formulas. With @kbd{C-u}
  1809. prefix, also apply the new formulas to the entire table.
  1810. @kindex C-c C-q
  1811. @item C-c C-q
  1812. Exit the formula editor without installing changes.
  1813. @kindex C-c C-r
  1814. @item C-c C-r
  1815. Toggle all references in the formula editor between standard (like
  1816. @code{B3}) and internal (like @code{@@3$2}).
  1817. @kindex @key{TAB}
  1818. @item @key{TAB}
  1819. Pretty-print or indent lisp formula at point. When in a line containing
  1820. a lisp formula, format the formula according to Emacs Lisp rules.
  1821. Another @key{TAB} collapses the formula back again. In the open
  1822. formula, @key{TAB} re-indents just like in Emacs lisp mode.
  1823. @kindex M-@key{TAB}
  1824. @item M-@key{TAB}
  1825. Complete Lisp symbols, just like in Emacs lisp mode.
  1826. @kindex S-@key{up}
  1827. @kindex S-@key{down}
  1828. @kindex S-@key{left}
  1829. @kindex S-@key{right}
  1830. @item S-@key{up}/@key{down}/@key{left}/@key{right}
  1831. Shift the reference at point. For example, if the reference is
  1832. @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
  1833. This also works for relative references, and for hline references.
  1834. @kindex M-S-@key{up}
  1835. @kindex M-S-@key{down}
  1836. @item M-S-@key{up}/@key{down}
  1837. Move the test line for column formulas in the Org buffer up and
  1838. down.
  1839. @kindex M-@key{up}
  1840. @kindex M-@key{down}
  1841. @item M-@key{up}/@key{down}
  1842. Scroll the window displaying the table.
  1843. @kindex C-c @}
  1844. @item C-c @}
  1845. Turn the coordinate grid in the table on and off.
  1846. @end table
  1847. @end table
  1848. Making a table field blank does not remove the formula associated with
  1849. the field, because that is stored in a different line (the @samp{TBLFM}
  1850. line) - during the next recalculation the field will be filled again.
  1851. To remove a formula from a field, you have to give an empty reply when
  1852. prompted for the formula, or to edit the @samp{#+TBLFM} line.
  1853. @kindex C-c C-c
  1854. You may edit the @samp{#+TBLFM} directly and re-apply the changed
  1855. equations with @kbd{C-c C-c} in that line, or with the normal
  1856. recalculation commands in the table.
  1857. @subsubheading Debugging formulas
  1858. @cindex formula debugging
  1859. @cindex debugging, of table formulas
  1860. When the evaluation of a formula leads to an error, the field content
  1861. becomes the string @samp{#ERROR}. If you would like see what is going
  1862. on during variable substitution and calculation in order to find a bug,
  1863. turn on formula debugging in the @code{Tbl} menu and repeat the
  1864. calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
  1865. field. Detailed information will be displayed.
  1866. @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
  1867. @subsection Updating the table
  1868. @cindex recomputing table fields
  1869. @cindex updating, table
  1870. Recalculation of a table is normally not automatic, but needs to be
  1871. triggered by a command. See @ref{Advanced features} for a way to make
  1872. recalculation at least semi-automatically.
  1873. In order to recalculate a line of a table or the entire table, use the
  1874. following commands:
  1875. @table @kbd
  1876. @kindex C-c *
  1877. @item C-c *
  1878. Recalculate the current row by first applying the stored column formulas
  1879. from left to right, and all field formulas in the current row.
  1880. @c
  1881. @kindex C-u C-c *
  1882. @item C-u C-c *
  1883. @kindex C-u C-c C-c
  1884. @itemx C-u C-c C-c
  1885. Recompute the entire table, line by line. Any lines before the first
  1886. hline are left alone, assuming that these are part of the table header.
  1887. @c
  1888. @kindex C-u C-u C-c *
  1889. @kindex C-u C-u C-c C-c
  1890. @item C-u C-u C-c *
  1891. @itemx C-u C-u C-c C-c
  1892. Iterate the table by recomputing it until no further changes occur.
  1893. This may be necessary if some computed fields use the value of other
  1894. fields that are computed @i{later} in the calculation sequence.
  1895. @end table
  1896. @node Advanced features, , Updating the table, The spreadsheet
  1897. @subsection Advanced features
  1898. If you want the recalculation of fields to happen automatically, or if
  1899. you want to be able to assign @i{names} to fields and columns, you need
  1900. to reserve the first column of the table for special marking characters.
  1901. @table @kbd
  1902. @kindex C-#
  1903. @item C-#
  1904. Rotate the calculation mark in first column through the states @samp{},
  1905. @samp{#}, @samp{*}, @samp{!}, @samp{$}. When there is an active region,
  1906. change all marks in the region.
  1907. @end table
  1908. Here is an example of a table that collects exam results of students and
  1909. makes use of these features:
  1910. @example
  1911. @group
  1912. |---+---------+--------+--------+--------+-------+------|
  1913. | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
  1914. |---+---------+--------+--------+--------+-------+------|
  1915. | ! | | P1 | P2 | P3 | Tot | |
  1916. | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
  1917. | ^ | | m1 | m2 | m3 | mt | |
  1918. |---+---------+--------+--------+--------+-------+------|
  1919. | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
  1920. | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
  1921. |---+---------+--------+--------+--------+-------+------|
  1922. | | Average | | | | 29.7 | |
  1923. | ^ | | | | | at | |
  1924. | $ | max=50 | | | | | |
  1925. |---+---------+--------+--------+--------+-------+------|
  1926. #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
  1927. @end group
  1928. @end example
  1929. @noindent @b{Important}: Please note that for these special tables,
  1930. recalculating the table with @kbd{C-u C-c *} will only affect rows that
  1931. are marked @samp{#} or @samp{*}, and fields that have a formula assigned
  1932. to the field itself. The column formulas are not applied in rows with
  1933. empty first field.
  1934. @cindex marking characters, tables
  1935. The marking characters have the following meaning:
  1936. @table @samp
  1937. @item !
  1938. The fields in this line define names for the columns, so that you may
  1939. refer to a column as @samp{$Tot} instead of @samp{$6}.
  1940. @item ^
  1941. This row defines names for the fields @emph{above} the row. With such
  1942. a definition, any formula in the table may use @samp{$m1} to refer to
  1943. the value @samp{10}. Also, if you assign a formula to a names field, it
  1944. will be stored as @samp{$name=...}.
  1945. @item _
  1946. Similar to @samp{^}, but defines names for the fields in the row
  1947. @emph{below}.
  1948. @item $
  1949. Fields in this row can define @emph{parameters} for formulas. For
  1950. example, if a field in a @samp{$} row contains @samp{max=50}, then
  1951. formulas in this table can refer to the value 50 using @samp{$max}.
  1952. Parameters work exactly like constants, only that they can be defined on
  1953. a per-table basis.
  1954. @item #
  1955. Fields in this row are automatically recalculated when pressing
  1956. @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
  1957. is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
  1958. lines will be left alone by this command.
  1959. @item *
  1960. Selects this line for global recalculation with @kbd{C-u C-c *}, but
  1961. not for automatic recalculation. Use this when automatic
  1962. recalculation slows down editing too much.
  1963. @item
  1964. Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
  1965. All lines that should be recalculated should be marked with @samp{#}
  1966. or @samp{*}.
  1967. @item /
  1968. Do not export this line. Useful for lines that contain the narrowing
  1969. @samp{<N>} markers.
  1970. @end table
  1971. Finally, just to whet your appetite on what can be done with the
  1972. fantastic @file{calc} package, here is a table that computes the Taylor
  1973. series of degree @code{n} at location @code{x} for a couple of
  1974. functions.
  1975. @example
  1976. @group
  1977. |---+-------------+---+-----+--------------------------------------|
  1978. | | Func | n | x | Result |
  1979. |---+-------------+---+-----+--------------------------------------|
  1980. | # | exp(x) | 1 | x | 1 + x |
  1981. | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
  1982. | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
  1983. | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
  1984. | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
  1985. | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
  1986. |---+-------------+---+-----+--------------------------------------|
  1987. #+TBLFM: $5=taylor($2,$4,$3);n3
  1988. @end group
  1989. @end example
  1990. @page
  1991. @node Org Plot, , The spreadsheet, Tables
  1992. @section Org Plot
  1993. @cindex graph, in tables
  1994. @cindex plot tables using gnuplot
  1995. Org Plot can produce 2D and 3D graphs of information stored in org tables
  1996. using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
  1997. @uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html}. To see
  1998. this in action ensure that you have both Gnuplot and Gnuplot-mode installed
  1999. on your system, then call @code{org-plot/gnuplot} on the following table.
  2000. @example
  2001. @group
  2002. #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
  2003. | Sede | Max cites | H-index |
  2004. |-----------+-----------+---------|
  2005. | Chile | 257.72 | 21.39 |
  2006. | Leeds | 165.77 | 19.68 |
  2007. | Sao Paolo | 71.00 | 11.50 |
  2008. | Stockholm | 134.19 | 14.33 |
  2009. | Morelia | 257.56 | 17.67 |
  2010. @end group
  2011. @end example
  2012. Notice that Org Plot is smart enough to apply the tables headers as labels.
  2013. Further control over the labels, type, content, and appearance of plots can
  2014. be exercised through the @code{#+Plot:} lines preceding a table. See below
  2015. for a complete list of Org plot options. For more information and examples
  2016. see the org-plot tutorial at
  2017. @uref{http://legito.org/worg/org-tutorials/org-plot.php}.
  2018. @subsubheading Plot Options
  2019. @table @code
  2020. @item set
  2021. Specify any @file{gnuplot} option to be set when graphing.
  2022. @item title
  2023. Specify the title of the plot.
  2024. @item ind
  2025. Specify which column of the table to use as the @code{x} axis.
  2026. @item deps
  2027. Specify the columns to graph as a lisp style list, surrounded by parenthesis
  2028. and separated by spaces for example @code{dep:(3 4)} to graph the third and
  2029. fourth columns (defaults to graphing all other columns aside from the ind
  2030. column).
  2031. @item type
  2032. Specify whether the plot will be @code{2d}, @code{3d}, or @code{grid}.
  2033. @item with
  2034. Specify a @code{with} option to be inserted for every col being plotted
  2035. (e.g. @code{lines}, @code{points}, @code{boxes}, @code{impulses}, etc...).
  2036. Defaults to 'lines'.
  2037. @item file
  2038. If you want to plot to a file specify the @code{"path/to/desired/output-file"}.
  2039. @item labels
  2040. List of labels to be used for the deps (defaults to column headers if they
  2041. exist).
  2042. @item line
  2043. Specify an entire line to be inserted in the gnuplot script.
  2044. @item map
  2045. When plotting @code{3d} or @code{grid} types, set this to @code{t} to graph a
  2046. flat mapping rather than a @code{3d} slope.
  2047. @item timefmt
  2048. Specify format of org-mode timestamps as they will be parsed by gnuplot.
  2049. Defaults to '%Y-%m-%d-%H:%M:%S'.
  2050. @item script
  2051. If you want total control you can specify a script file (place the file name
  2052. between double quotes) which will be used to plot. Before plotting, every
  2053. instance of @code{$datafile} in the specified script will be replaced with
  2054. the path to the generated data file. Note even if you set this option you
  2055. may still want to specify the plot type, as that can impact the content of
  2056. the data file.
  2057. @end table
  2058. @node Hyperlinks, TODO Items, Tables, Top
  2059. @chapter Hyperlinks
  2060. @cindex hyperlinks
  2061. Like HTML, Org provides links inside a file, external links to
  2062. other files, Usenet articles, emails, and much more.
  2063. @menu
  2064. * Link format:: How links in Org are formatted
  2065. * Internal links:: Links to other places in the current file
  2066. * External links:: URL-like links to the world
  2067. * Handling links:: Creating, inserting and following
  2068. * Using links outside Org:: Linking from my C source code?
  2069. * Link abbreviations:: Shortcuts for writing complex links
  2070. * Search options:: Linking to a specific location
  2071. * Custom searches:: When the default search is not enough
  2072. @end menu
  2073. @node Link format, Internal links, Hyperlinks, Hyperlinks
  2074. @section Link format
  2075. @cindex link format
  2076. @cindex format, of links
  2077. Org will recognize plain URL-like links and activate them as
  2078. clickable links. The general link format, however, looks like this:
  2079. @example
  2080. [[link][description]] @r{or alternatively} [[link]]
  2081. @end example
  2082. Once a link in the buffer is complete (all brackets present), Org
  2083. will change the display so that @samp{description} is displayed instead
  2084. of @samp{[[link][description]]} and @samp{link} is displayed instead of
  2085. @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
  2086. which by default is an underlined face. You can directly edit the
  2087. visible part of a link. Note that this can be either the @samp{link}
  2088. part (if there is no description) or the @samp{description} part. To
  2089. edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
  2090. cursor on the link.
  2091. If you place the cursor at the beginning or just behind the end of the
  2092. displayed text and press @key{BACKSPACE}, you will remove the
  2093. (invisible) bracket at that location. This makes the link incomplete
  2094. and the internals are again displayed as plain text. Inserting the
  2095. missing bracket hides the link internals again. To show the
  2096. internal structure of all links, use the menu entry
  2097. @code{Org->Hyperlinks->Literal links}.
  2098. @node Internal links, External links, Link format, Hyperlinks
  2099. @section Internal links
  2100. @cindex internal links
  2101. @cindex links, internal
  2102. @cindex targets, for links
  2103. If the link does not look like a URL, it is considered to be internal in
  2104. the current file. Links such as @samp{[[My Target]]} or @samp{[[My
  2105. Target][Find my target]]} lead to a text search in the current file.
  2106. The link can be followed with @kbd{C-c C-o} when the cursor is on the
  2107. link, or with a mouse click (@pxref{Handling links}). The preferred
  2108. match for such a link is a dedicated target: the same string in double
  2109. angular brackets. Targets may be located anywhere; sometimes it is
  2110. convenient to put them into a comment line. For example
  2111. @example
  2112. # <<My Target>>
  2113. @end example
  2114. @noindent In HTML export (@pxref{HTML export}), such targets will become
  2115. named anchors for direct access through @samp{http} links@footnote{Note that
  2116. text before the first headline is usually not exported, so the first such
  2117. target should be after the first headline, or in the line directly before the
  2118. first headline.}.
  2119. If no dedicated target exists, Org will search for the words in the
  2120. link. In the above example the search would be for @samp{my target}.
  2121. Links starting with a star like @samp{*My Target} restrict the search to
  2122. headlines. When searching, Org mode will first try an exact match, but
  2123. then move on to more and more lenient searches. For example, the link
  2124. @samp{[[*My Targets]]} will find any of the following:
  2125. @example
  2126. ** My targets
  2127. ** TODO my targets are bright
  2128. ** my 20 targets are
  2129. @end example
  2130. To insert a link targeting a headline, in-buffer completion can be used.
  2131. Just type a star followed by a few optional letters into the buffer and
  2132. press @kbd{M-@key{TAB}}. All headlines in the current buffer will be
  2133. offered as completions. @xref{Handling links}, for more commands
  2134. creating links.
  2135. Following a link pushes a mark onto Org's own mark ring. You can
  2136. return to the previous position with @kbd{C-c &}. Using this command
  2137. several times in direct succession goes back to positions recorded
  2138. earlier.
  2139. @menu
  2140. * Radio targets:: Make targets trigger links in plain text
  2141. @end menu
  2142. @node Radio targets, , Internal links, Internal links
  2143. @subsection Radio targets
  2144. @cindex radio targets
  2145. @cindex targets, radio
  2146. @cindex links, radio targets
  2147. Org can automatically turn any occurrences of certain target names
  2148. in normal text into a link. So without explicitly creating a link, the
  2149. text connects to the target radioing its position. Radio targets are
  2150. enclosed by triple angular brackets. For example, a target @samp{<<<My
  2151. Target>>>} causes each occurrence of @samp{my target} in normal text to
  2152. become activated as a link. The Org file is scanned automatically
  2153. for radio targets only when the file is first loaded into Emacs. To
  2154. update the target list during editing, press @kbd{C-c C-c} with the
  2155. cursor on or at a target.
  2156. @node External links, Handling links, Internal links, Hyperlinks
  2157. @section External links
  2158. @cindex links, external
  2159. @cindex external links
  2160. @cindex links, external
  2161. @cindex Gnus links
  2162. @cindex BBDB links
  2163. @cindex IRC links
  2164. @cindex URL links
  2165. @cindex file links
  2166. @cindex VM links
  2167. @cindex RMAIL links
  2168. @cindex WANDERLUST links
  2169. @cindex MH-E links
  2170. @cindex USENET links
  2171. @cindex SHELL links
  2172. @cindex Info links
  2173. @cindex elisp links
  2174. Org supports links to files, websites, Usenet and email messages,
  2175. BBDB database entries and links to both IRC conversations and their
  2176. logs. External links are URL-like locators. They start with a short
  2177. identifying string followed by a colon. There can be no space after
  2178. the colon. The following list shows examples for each link type.
  2179. @example
  2180. http://www.astro.uva.nl/~dominik @r{on the web}
  2181. file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
  2182. /home/dominik/images/jupiter.jpg @r{same as above}
  2183. file:papers/last.pdf @r{file, relative path}
  2184. ./papers/last.pdf @r{same as above}
  2185. news:comp.emacs @r{Usenet link}
  2186. mailto:adent@@galaxy.net @r{Mail link}
  2187. vm:folder @r{VM folder link}
  2188. vm:folder#id @r{VM message link}
  2189. vm://myself@@some.where.org/folder#id @r{VM on remote machine}
  2190. wl:folder @r{WANDERLUST folder link}
  2191. wl:folder#id @r{WANDERLUST message link}
  2192. mhe:folder @r{MH-E folder link}
  2193. mhe:folder#id @r{MH-E message link}
  2194. rmail:folder @r{RMAIL folder link}
  2195. rmail:folder#id @r{RMAIL message link}
  2196. gnus:group @r{Gnus group link}
  2197. gnus:group#id @r{Gnus article link}
  2198. bbdb:R.*Stallman @r{BBDB link (with regexp)}
  2199. irc:/irc.com/#emacs/bob @r{IRC link}
  2200. shell:ls *.org @r{A shell command}
  2201. elisp:org-agenda @r{Interactive elisp command}
  2202. elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate}
  2203. @end example
  2204. A link should be enclosed in double brackets and may contain a
  2205. descriptive text to be displayed instead of the URL (@pxref{Link
  2206. format}), for example:
  2207. @example
  2208. [[http://www.gnu.org/software/emacs/][GNU Emacs]]
  2209. @end example
  2210. @noindent
  2211. If the description is a file name or URL that points to an image, HTML
  2212. export (@pxref{HTML export}) will inline the image as a clickable
  2213. button. If there is no description at all and the link points to an
  2214. image,
  2215. that image will be inlined into the exported HTML file.
  2216. @cindex angular brackets, around links
  2217. @cindex plain text external links
  2218. Org also finds external links in the normal text and activates them
  2219. as links. If spaces must be part of the link (for example in
  2220. @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
  2221. about the end of the link, enclose them in angular brackets.
  2222. @node Handling links, Using links outside Org, External links, Hyperlinks
  2223. @section Handling links
  2224. @cindex links, handling
  2225. Org provides methods to create a link in the correct syntax, to
  2226. insert it into an Org file, and to follow the link.
  2227. @table @kbd
  2228. @kindex C-c l
  2229. @cindex storing links
  2230. @item C-c l
  2231. Store a link to the current location. This is a @emph{global} command which
  2232. can be used in any buffer to create a link. The link will be stored for
  2233. later insertion into an Org buffer (see below). For Org files, if there is a
  2234. @samp{<<target>>} at the cursor, the link points to the target. Otherwise it
  2235. points to the current headline, either by text, or, if @file{org-id.el} is
  2236. loaded, by ID property. For VM, Rmail, Wanderlust, MH-E, Gnus and BBDB
  2237. buffers, the link will indicate the current article/entry. For W3 and W3M
  2238. buffers, the link goes to the current URL. For IRC links, if you set the
  2239. variable @code{org-irc-link-to-logs} to non-nil then @kbd{C-c l} will store a
  2240. @samp{file:/} style link to the relevant point in the logs for the current
  2241. conversation. Otherwise an @samp{irc:/} style link to the user/channel/server
  2242. under the point will be stored. For any other files, the link will point to
  2243. the file, with a search string (@pxref{Search options}) pointing to the
  2244. contents of the current line. If there is an active region, the selected
  2245. words will form the basis of the search string. If the automatically created
  2246. link is not working correctly or accurately enough, you can write custom
  2247. functions to select the search string and to do the search for particular
  2248. file types - see @ref{Custom searches}. The key binding @kbd{C-c l} is only
  2249. a suggestion - see @ref{Installation}.
  2250. @c
  2251. @kindex C-c C-l
  2252. @cindex link completion
  2253. @cindex completion, of links
  2254. @cindex inserting links
  2255. @item C-c C-l
  2256. Insert a link. This prompts for a link to be inserted into the buffer. You
  2257. can just type a link, using text for an internal link, or one of the link
  2258. type prefixes mentioned in the examples above. All links stored during the
  2259. current session are part of the history for this prompt, so you can access
  2260. them with @key{up} and @key{down} (or @kbd{M-p/n}). Completion, on the other
  2261. hand, will help you to insert valid link prefixes like @samp{http:} or
  2262. @samp{ftp:}, including the prefixes defined through link abbreviations
  2263. (@pxref{Link abbreviations}). The link will be inserted into the
  2264. buffer@footnote{After insertion of a stored link, the link will be removed
  2265. from the list of stored links. To keep it in the list later use, use a
  2266. triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
  2267. @code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
  2268. If some text was selected when this command is called, the selected text
  2269. becomes the default description.@* Note that you don't have to use this
  2270. command to insert a link. Links in Org are plain text, and you can type
  2271. or paste them straight into the buffer. By using this command, the links are
  2272. automatically enclosed in double brackets, and you will be asked for the
  2273. optional descriptive text.
  2274. @c
  2275. @c If the link is a @samp{file:} link and
  2276. @c the linked file is located in the same directory as the current file or
  2277. @c a subdirectory of it, the path of the file will be inserted relative to
  2278. @c the current directory.
  2279. @c
  2280. @kindex C-u C-c C-l
  2281. @cindex file name completion
  2282. @cindex completion, of file names
  2283. @item C-u C-c C-l
  2284. When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
  2285. a file will be inserted and you may use file name completion to select
  2286. the name of the file. The path to the file is inserted relative to the
  2287. directory of the current org file, if the linked file is in the current
  2288. directory or in a sub-directory of it, or if the path is written relative
  2289. to the current directory using @samp{../}. Otherwise an absolute path
  2290. is used, if possible with @samp{~/} for your home directory. You can
  2291. force an absolute path with two @kbd{C-u} prefixes.
  2292. @c
  2293. @item C-c C-l @r{(with cursor on existing link)}
  2294. When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
  2295. link and description parts of the link.
  2296. @c
  2297. @cindex following links
  2298. @kindex C-c C-o
  2299. @item C-c C-o
  2300. Open link at point. This will launch a web browser for URLs (using
  2301. @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
  2302. the corresponding links, and execute the command in a shell link. When the
  2303. cursor is on an internal link, this commands runs the corresponding search.
  2304. When the cursor is on a TAG list in a headline, it creates the corresponding
  2305. TAGS view. If the cursor is on a time stamp, it compiles the agenda for that
  2306. date. Furthermore, it will visit text and remote files in @samp{file:} links
  2307. with Emacs and select a suitable application for local non-text files.
  2308. Classification of files is based on file extension only. See option
  2309. @code{org-file-apps}. If you want to override the default application and
  2310. visit the file with Emacs, use a @kbd{C-u} prefix. If you want to avoid
  2311. opening in Emacs, use a @kbd{C-u C-u} prefix.
  2312. @c
  2313. @kindex mouse-2
  2314. @kindex mouse-1
  2315. @item mouse-2
  2316. @itemx mouse-1
  2317. On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
  2318. would. Under Emacs 22, also @kbd{mouse-1} will follow a link.
  2319. @c
  2320. @kindex mouse-3
  2321. @item mouse-3
  2322. Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
  2323. internal links to be displayed in another window@footnote{See the
  2324. variable @code{org-display-internal-link-with-indirect-buffer}}.
  2325. @c
  2326. @cindex mark ring
  2327. @kindex C-c %
  2328. @item C-c %
  2329. Push the current position onto the mark ring, to be able to return
  2330. easily. Commands following an internal link do this automatically.
  2331. @c
  2332. @cindex links, returning to
  2333. @kindex C-c &
  2334. @item C-c &
  2335. Jump back to a recorded position. A position is recorded by the
  2336. commands following internal links, and by @kbd{C-c %}. Using this
  2337. command several times in direct succession moves through a ring of
  2338. previously recorded positions.
  2339. @c
  2340. @kindex C-c C-x C-n
  2341. @kindex C-c C-x C-p
  2342. @cindex links, finding next/previous
  2343. @item C-c C-x C-n
  2344. @itemx C-c C-x C-p
  2345. Move forward/backward to the next link in the buffer. At the limit of
  2346. the buffer, the search fails once, and then wraps around. The key
  2347. bindings for this are really too long, you might want to bind this also
  2348. to @kbd{C-n} and @kbd{C-p}
  2349. @lisp
  2350. (add-hook 'org-load-hook
  2351. (lambda ()
  2352. (define-key 'org-mode-map "\C-n" 'org-next-link)
  2353. (define-key 'org-mode-map "\C-p" 'org-previous-link)))
  2354. @end lisp
  2355. @end table
  2356. @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
  2357. @section Using links outside Org
  2358. You can insert and follow links that have Org syntax not only in
  2359. Org, but in any Emacs buffer. For this, you should create two
  2360. global commands, like this (please select suitable global keys
  2361. yourself):
  2362. @lisp
  2363. (global-set-key "\C-c L" 'org-insert-link-global)
  2364. (global-set-key "\C-c o" 'org-open-at-point-global)
  2365. @end lisp
  2366. @node Link abbreviations, Search options, Using links outside Org, Hyperlinks
  2367. @section Link abbreviations
  2368. @cindex link abbreviations
  2369. @cindex abbreviation, links
  2370. Long URLs can be cumbersome to type, and often many similar links are
  2371. needed in a document. For this you can use link abbreviations. An
  2372. abbreviated link looks like this
  2373. @example
  2374. [[linkword:tag][description]]
  2375. @end example
  2376. @noindent
  2377. where the tag is optional. Such abbreviations are resolved according to
  2378. the information in the variable @code{org-link-abbrev-alist} that
  2379. relates the linkwords to replacement text. Here is an example:
  2380. @lisp
  2381. @group
  2382. (setq org-link-abbrev-alist
  2383. '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
  2384. ("google" . "http://www.google.com/search?q=")
  2385. ("ads" . "http://adsabs.harvard.edu/cgi-bin/
  2386. nph-abs_connect?author=%s&db_key=AST")))
  2387. @end group
  2388. @end lisp
  2389. If the replacement text contains the string @samp{%s}, it will be
  2390. replaced with the tag. Otherwise the tag will be appended to the string
  2391. in order to create the link. You may also specify a function that will
  2392. be called with the tag as the only argument to create the link.
  2393. With the above setting, you could link to a specific bug with
  2394. @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
  2395. @code{[[google:OrgMode]]} and find out what the Org author is
  2396. doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
  2397. If you need special abbreviations just for a single Org buffer, you
  2398. can define them in the file with
  2399. @example
  2400. #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
  2401. #+LINK: google http://www.google.com/search?q=%s
  2402. @end example
  2403. @noindent
  2404. In-buffer completion @pxref{Completion} can be used after @samp{[} to
  2405. complete link abbreviations.
  2406. @node Search options, Custom searches, Link abbreviations, Hyperlinks
  2407. @section Search options in file links
  2408. @cindex search option in file links
  2409. @cindex file links, searching
  2410. File links can contain additional information to make Emacs jump to a
  2411. particular location in the file when following a link. This can be a
  2412. line number or a search option after a double@footnote{For backward
  2413. compatibility, line numbers can also follow a single colon.} colon. For
  2414. example, when the command @kbd{C-c l} creates a link (@pxref{Handling
  2415. links}) to a file, it encodes the words in the current line as a search
  2416. string that can be used to find this line back later when following the
  2417. link with @kbd{C-c C-o}.
  2418. Here is the syntax of the different ways to attach a search to a file
  2419. link, together with an explanation:
  2420. @example
  2421. [[file:~/code/main.c::255]]
  2422. [[file:~/xx.org::My Target]]
  2423. [[file:~/xx.org::*My Target]]
  2424. [[file:~/xx.org::/regexp/]]
  2425. @end example
  2426. @table @code
  2427. @item 255
  2428. Jump to line 255.
  2429. @item My Target
  2430. Search for a link target @samp{<<My Target>>}, or do a text search for
  2431. @samp{my target}, similar to the search in internal links, see
  2432. @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
  2433. link will become an HTML reference to the corresponding named anchor in
  2434. the linked file.
  2435. @item *My Target
  2436. In an Org file, restrict search to headlines.
  2437. @item /regexp/
  2438. Do a regular expression search for @code{regexp}. This uses the Emacs
  2439. command @code{occur} to list all matches in a separate window. If the
  2440. target file is in Org mode, @code{org-occur} is used to create a
  2441. sparse tree with the matches.
  2442. @c If the target file is a directory,
  2443. @c @code{grep} will be used to search all files in the directory.
  2444. @end table
  2445. As a degenerate case, a file link with an empty file name can be used
  2446. to search the current file. For example, @code{[[file:::find me]]} does
  2447. a search for @samp{find me} in the current file, just as
  2448. @samp{[[find me]]} would.
  2449. @node Custom searches, , Search options, Hyperlinks
  2450. @section Custom Searches
  2451. @cindex custom search strings
  2452. @cindex search strings, custom
  2453. The default mechanism for creating search strings and for doing the
  2454. actual search related to a file link may not work correctly in all
  2455. cases. For example, BibTeX database files have many entries like
  2456. @samp{year="1993"} which would not result in good search strings,
  2457. because the only unique identification for a BibTeX entry is the
  2458. citation key.
  2459. If you come across such a problem, you can write custom functions to set
  2460. the right search string for a particular file type, and to do the search
  2461. for the string in the file. Using @code{add-hook}, these functions need
  2462. to be added to the hook variables
  2463. @code{org-create-file-search-functions} and
  2464. @code{org-execute-file-search-functions}. See the docstring for these
  2465. variables for more information. Org actually uses this mechanism
  2466. for Bib@TeX{} database files, and you can use the corresponding code as
  2467. an implementation example. See the file @file{org-bibtex.el}.
  2468. @node TODO Items, Tags, Hyperlinks, Top
  2469. @chapter TODO Items
  2470. @cindex TODO items
  2471. Org mode does not maintain TODO lists as separate documents@footnote{Of
  2472. course, you can make a document that contains inly long lists of TODO items,
  2473. but this is not required.}. Instead, TODO items are an integral part of the
  2474. notes file, because TODO items usually come up while taking notes! With Org
  2475. mode, simply mark any entry in a tree as being a TODO item. In this way,
  2476. information is not duplicated, and the entire context from which the TODO
  2477. item emerged is always present.
  2478. Of course, this technique for managing TODO items scatters them
  2479. throughout your notes file. Org mode compensates for this by providing
  2480. methods to give you an overview of all the things that you have to do.
  2481. @menu
  2482. * TODO basics:: Marking and displaying TODO entries
  2483. * TODO extensions:: Workflow and assignments
  2484. * Progress logging:: Dates and notes for progress
  2485. * Priorities:: Some things are more important than others
  2486. * Breaking down tasks:: Splitting a task into manageable pieces
  2487. * Checkboxes:: Tick-off lists
  2488. @end menu
  2489. @node TODO basics, TODO extensions, TODO Items, TODO Items
  2490. @section Basic TODO functionality
  2491. Any headline becomes a TODO item when it starts with the word
  2492. @samp{TODO}, for example:
  2493. @example
  2494. *** TODO Write letter to Sam Fortune
  2495. @end example
  2496. @noindent
  2497. The most important commands to work with TODO entries are:
  2498. @table @kbd
  2499. @kindex C-c C-t
  2500. @cindex cycling, of TODO states
  2501. @item C-c C-t
  2502. Rotate the TODO state of the current item among
  2503. @example
  2504. ,-> (unmarked) -> TODO -> DONE --.
  2505. '--------------------------------'
  2506. @end example
  2507. The same rotation can also be done ``remotely'' from the timeline and
  2508. agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
  2509. @kindex C-u C-c C-t
  2510. @item C-u C-c C-t
  2511. Select a specific keyword using completion or (if it has been set up)
  2512. the fast selection interface. For the latter, you need to assign keys
  2513. to TODO states, see @ref{Per-file keywords} and @ref{Setting tags} for
  2514. more information.
  2515. @kindex S-@key{right}
  2516. @kindex S-@key{left}
  2517. @item S-@key{right}
  2518. @itemx S-@key{left}
  2519. Select the following/preceding TODO state, similar to cycling. Useful
  2520. mostly if more than two TODO states are possible (@pxref{TODO
  2521. extensions}).
  2522. @kindex C-c C-v
  2523. @kindex C-c / t
  2524. @cindex sparse tree, for TODO
  2525. @item C-c C-v
  2526. @itemx C-c / t
  2527. View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
  2528. the entire buffer, but shows all TODO items and the headings hierarchy
  2529. above them. With a prefix argument, search for a specific TODO. You will be
  2530. prompted for the keyword, and you can also give a list of keywords like
  2531. @code{KWD1|KWD2|...}. With numeric prefix argument N, show the tree for the
  2532. Nth keyword in the variable @code{org-todo-keywords}. With two prefix
  2533. arguments, find all TODO and DONE entries.
  2534. @kindex C-c a t
  2535. @item C-c a t
  2536. Show the global TODO list. Collects the TODO items from all agenda
  2537. files (@pxref{Agenda Views}) into a single buffer. The new buffer will
  2538. be in @code{agenda-mode}, which provides commands to examine and
  2539. manipulate the TODO entries from the new buffer (@pxref{Agenda
  2540. commands}). @xref{Global TODO list}, for more information.
  2541. @kindex S-M-@key{RET}
  2542. @item S-M-@key{RET}
  2543. Insert a new TODO entry below the current one.
  2544. @end table
  2545. @noindent
  2546. Changing a TODO state can also trigger tag changes. See the docstring of the
  2547. option @code{org-todo-state-tags-triggers} for details.
  2548. @node TODO extensions, Progress logging, TODO basics, TODO Items
  2549. @section Extended use of TODO keywords
  2550. @cindex extended TODO keywords
  2551. By default, marked TODO entries have one of only two states: TODO and
  2552. DONE. Org mode allows you to classify TODO items in more complex ways
  2553. with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
  2554. special setup, the TODO keyword system can work differently in different
  2555. files.
  2556. Note that @i{tags} are another way to classify headlines in general and
  2557. TODO items in particular (@pxref{Tags}).
  2558. @menu
  2559. * Workflow states:: From TODO to DONE in steps
  2560. * TODO types:: I do this, Fred does the rest
  2561. * Multiple sets in one file:: Mixing it all, and still finding your way
  2562. * Fast access to TODO states:: Single letter selection of a state
  2563. * Per-file keywords:: Different files, different requirements
  2564. * Faces for TODO keywords:: Highlighting states
  2565. @end menu
  2566. @node Workflow states, TODO types, TODO extensions, TODO extensions
  2567. @subsection TODO keywords as workflow states
  2568. @cindex TODO workflow
  2569. @cindex workflow states as TODO keywords
  2570. You can use TODO keywords to indicate different @emph{sequential} states
  2571. in the process of working on an item, for example@footnote{Changing
  2572. this variable only becomes effective after restarting Org mode in a
  2573. buffer.}:
  2574. @lisp
  2575. (setq org-todo-keywords
  2576. '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
  2577. @end lisp
  2578. The vertical bar separates the TODO keywords (states that @emph{need
  2579. action}) from the DONE states (which need @emph{no further action}). If
  2580. you don't provide the separator bar, the last state is used as the DONE
  2581. state.
  2582. @cindex completion, of TODO keywords
  2583. With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
  2584. to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
  2585. also use a numeric prefix argument to quickly select a specific state. For
  2586. example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
  2587. Or you can use @kbd{S-left} to go backward through the sequence. If you
  2588. define many keywords, you can use in-buffer completion
  2589. (@pxref{Completion}) or even a special one-key selection scheme
  2590. (@pxref{Fast access to TODO states}) to insert these words into the
  2591. buffer. Changing a TODO state can be logged with a timestamp, see
  2592. @ref{Tracking TODO state changes} for more information.
  2593. @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
  2594. @subsection TODO keywords as types
  2595. @cindex TODO types
  2596. @cindex names as TODO keywords
  2597. @cindex types as TODO keywords
  2598. The second possibility is to use TODO keywords to indicate different
  2599. @emph{types} of action items. For example, you might want to indicate
  2600. that items are for ``work'' or ``home''. Or, when you work with several
  2601. people on a single project, you might want to assign action items
  2602. directly to persons, by using their names as TODO keywords. This would
  2603. be set up like this:
  2604. @lisp
  2605. (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
  2606. @end lisp
  2607. In this case, different keywords do not indicate a sequence, but rather
  2608. different types. So the normal work flow would be to assign a task to a
  2609. person, and later to mark it DONE. Org mode supports this style by adapting
  2610. the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
  2611. @kbd{t} command in the timeline and agenda buffers.}. When used several
  2612. times in succession, it will still cycle through all names, in order to first
  2613. select the right type for a task. But when you return to the item after some
  2614. time and execute @kbd{C-c C-t} again, it will switch from any name directly
  2615. to DONE. Use prefix arguments or completion to quickly select a specific
  2616. name. You can also review the items of a specific TODO type in a sparse tree
  2617. by using a numeric prefix to @kbd{C-c C-v}. For example, to see all things
  2618. Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect Lucy's items
  2619. from all agenda files into a single buffer, you would use the numeric prefix
  2620. argument as well when creating the global TODO list: @kbd{C-3 C-c t}.
  2621. @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
  2622. @subsection Multiple keyword sets in one file
  2623. @cindex TODO keyword sets
  2624. Sometimes you may want to use different sets of TODO keywords in
  2625. parallel. For example, you may want to have the basic
  2626. @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
  2627. separate state indicating that an item has been canceled (so it is not
  2628. DONE, but also does not require action). Your setup would then look
  2629. like this:
  2630. @lisp
  2631. (setq org-todo-keywords
  2632. '((sequence "TODO" "|" "DONE")
  2633. (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
  2634. (sequence "|" "CANCELED")))
  2635. @end lisp
  2636. The keywords should all be different, this helps Org mode to keep track
  2637. of which subsequence should be used for a given entry. In this setup,
  2638. @kbd{C-c C-t} only operates within a subsequence, so it switches from
  2639. @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
  2640. (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
  2641. select the correct sequence. Besides the obvious ways like typing a
  2642. keyword or using completion, you may also apply the following commands:
  2643. @table @kbd
  2644. @kindex C-S-@key{right}
  2645. @kindex C-S-@key{left}
  2646. @item C-S-@key{right}
  2647. @itemx C-S-@key{left}
  2648. These keys jump from one TODO subset to the next. In the above example,
  2649. @kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
  2650. @code{REPORT}, and any of the words in the second row to @code{CANCELED}.
  2651. @kindex S-@key{right}
  2652. @kindex S-@key{left}
  2653. @item S-@key{right}
  2654. @itemx S-@key{left}
  2655. @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
  2656. @emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
  2657. would switch from @code{DONE} to @code{REPORT} in the example above.
  2658. @end table
  2659. @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
  2660. @subsection Fast access to TODO states
  2661. If you would like to quickly change an entry to an arbitrary TODO state
  2662. instead of cycling through the states, you can set up keys for
  2663. single-letter access to the states. This is done by adding the section
  2664. key after each keyword, in parenthesis. For example:
  2665. @lisp
  2666. (setq org-todo-keywords
  2667. '((sequence "TODO(t)" "|" "DONE(d)")
  2668. (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
  2669. (sequence "|" "CANCELED(c)")))
  2670. @end lisp
  2671. If you then press @code{C-u C-c C-t} followed by the selection key, the
  2672. entry will be switched to this state. @key{SPC} can be used to remove
  2673. any TODO keyword from an entry. Should you like this way of selecting
  2674. TODO states a lot, you might want to set the variable
  2675. @code{org-use-fast-todo-selection} to @code{t} and make this behavior
  2676. the default. Check also the variable
  2677. @code{org-fast-tag-selection-include-todo}, it allows to change the TODO
  2678. state through the tags interface (@pxref{Setting tags}), in case you
  2679. like to mingle the two concepts.
  2680. @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
  2681. @subsection Setting up keywords for individual files
  2682. @cindex keyword options
  2683. @cindex per-file keywords
  2684. It can be very useful to use different aspects of the TODO mechanism in
  2685. different files. For file-local settings, you need to add special lines
  2686. to the file which set the keywords and interpretation for that file
  2687. only. For example, to set one of the two examples discussed above, you
  2688. need one of the following lines, starting in column zero anywhere in the
  2689. file:
  2690. @example
  2691. #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
  2692. @end example
  2693. or
  2694. @example
  2695. #+TYP_TODO: Fred Sara Lucy Mike | DONE
  2696. @end example
  2697. A setup for using several sets in parallel would be:
  2698. @example
  2699. #+SEQ_TODO: TODO | DONE
  2700. #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
  2701. #+SEQ_TODO: | CANCELED
  2702. @end example
  2703. @cindex completion, of option keywords
  2704. @kindex M-@key{TAB}
  2705. @noindent To make sure you are using the correct keyword, type
  2706. @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
  2707. @cindex DONE, final TODO keyword
  2708. Remember that the keywords after the vertical bar (or the last keyword
  2709. if no bar is there) must always mean that the item is DONE (although you
  2710. may use a different word). After changing one of these lines, use
  2711. @kbd{C-c C-c} with the cursor still in the line to make the changes
  2712. known to Org mode@footnote{Org mode parses these lines only when
  2713. Org mode is activated after visiting a file. @kbd{C-c C-c} with the
  2714. cursor in a line starting with @samp{#+} is simply restarting Org mode
  2715. for the current buffer.}.
  2716. @node Faces for TODO keywords, , Per-file keywords, TODO extensions
  2717. @subsection Faces for TODO keywords
  2718. @cindex faces, for TODO keywords
  2719. Org mode highlights TODO keywords with special faces: @code{org-todo}
  2720. for keywords indicating that an item still has to be acted upon, and
  2721. @code{org-done} for keywords indicating that an item is finished. If
  2722. you are using more than 2 different states, you might want to use
  2723. special faces for some of them. This can be done using the variable
  2724. @code{org-todo-keyword-faces}. For example:
  2725. @lisp
  2726. @group
  2727. (setq org-todo-keyword-faces
  2728. '(("TODO" . org-warning)
  2729. ("DEFERRED" . shadow)
  2730. ("CANCELED" . (:foreground "blue" :weight bold))))
  2731. @end group
  2732. @end lisp
  2733. While using a list with face properties as shown for CANCELED
  2734. @emph{should} work, this does not aways seem to be the case. If
  2735. necessary, define a special face and use that.
  2736. @page
  2737. @node Progress logging, Priorities, TODO extensions, TODO Items
  2738. @section Progress logging
  2739. @cindex progress logging
  2740. @cindex logging, of progress
  2741. Org mode can automatically record a time stamp and possibly a note when
  2742. you mark a TODO item as DONE, or even each time you change the state of
  2743. a TODO item. This system is highly configurable, settings can be on a
  2744. per-keyword basis and can be localized to a file or even a subtree. For
  2745. information on how to clock working time for a task, see @ref{Clocking
  2746. work time}.
  2747. @menu
  2748. * Closing items:: When was this entry marked DONE?
  2749. * Tracking TODO state changes:: When did the status change?
  2750. @end menu
  2751. @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
  2752. @subsection Closing items
  2753. The most basic logging is to keep track of @emph{when} a certain TODO
  2754. item was finished. This is achieved with@footnote{The corresponding
  2755. in-buffer setting is: @code{#+STARTUP: logdone}}.
  2756. @lisp
  2757. (setq org-log-done 'time)
  2758. @end lisp
  2759. @noindent
  2760. Then each time you turn an entry from a TODO (not-done) state into any
  2761. of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
  2762. just after the headline. If you turn the entry back into a TODO item
  2763. through further state cycling, that line will be removed again. If you
  2764. want to record a note along with the timestamp, use@footnote{The
  2765. corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
  2766. @lisp
  2767. (setq org-log-done 'note)
  2768. @end lisp
  2769. @noindent
  2770. You will then be prompted for a note, and that note will be stored below
  2771. the entry with a @samp{Closing Note} heading.
  2772. In the timeline (@pxref{Timeline}) and in the agenda
  2773. (@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
  2774. display the TODO items with a @samp{CLOSED} timestamp on each day,
  2775. giving you an overview of what has been done.
  2776. @node Tracking TODO state changes, , Closing items, Progress logging
  2777. @subsection Tracking TODO state changes
  2778. When TODO keywords are used as workflow states (@pxref{Workflow
  2779. states}), you might want to keep track of when a state change occurred
  2780. and maybe take a note about this change. Since it is normally too much
  2781. to record a note for every state, Org mode expects configuration on a
  2782. per-keyword basis for this. This is achieved by adding special markers
  2783. @samp{!} (for a time stamp) and @samp{@@} (for a note) in parenthesis
  2784. after each keyword. For example, with the setting
  2785. @lisp
  2786. (setq org-todo-keywords
  2787. '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
  2788. @end lisp
  2789. @noindent
  2790. you not only define global TODO keywords and fast access keys, but also
  2791. request that a time is recorded when the entry is turned into
  2792. DONE@footnote{It is possible that Org mode will record two time stamps
  2793. when you are using both @code{org-log-done} and state change logging.
  2794. However, it will never prompt for two notes - if you have configured
  2795. both, the state change recording note will take precedence and cancel
  2796. the @samp{Closing Note}.}, and that a note is recorded when switching to
  2797. WAIT or CANCELED. The setting for WAIT is even more special: The
  2798. @samp{!} after the slash means that in addition to the note taken when
  2799. entering the state, a time stamp should be recorded when @i{leaving} the
  2800. WAIT state, if and only if the @i{target} state does not configure
  2801. logging for entering it. So it has no effect when switching from WAIT
  2802. to DONE, because DONE is configured to record a timestamp only. But
  2803. when switching from WAIT back to TODO, the @samp{/!} in the WAIT
  2804. setting now triggers a timestamp even though TODO has no logging
  2805. configured.
  2806. You can use the exact same syntax for setting logging preferences local
  2807. to a buffer:
  2808. @example
  2809. #+SEQ_TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
  2810. @end example
  2811. In order to define logging settings that are local to a subtree or a
  2812. single item, define a LOGGING property in this entry. Any non-empty
  2813. LOGGING property resets all logging settings to nil. You may then turn
  2814. on logging for this specific tree using STARTUP keywords like
  2815. @code{lognotedone} or @code{logrepeat}, as well as adding state specific
  2816. settings like @code{TODO(!)}. For example
  2817. @example
  2818. * TODO Log each state with only a time
  2819. :PROPERTIES:
  2820. :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
  2821. :END:
  2822. * TODO Only log when switching to WAIT, and when repeating
  2823. :PROPERTIES:
  2824. :LOGGING: WAIT(@@) logrepeat
  2825. :END:
  2826. * TODO No logging at all
  2827. :PROPERTIES:
  2828. :LOGGING: nil
  2829. :END:
  2830. @end example
  2831. @node Priorities, Breaking down tasks, Progress logging, TODO Items
  2832. @section Priorities
  2833. @cindex priorities
  2834. If you use Org mode extensively, you may end up enough TODO items that
  2835. it starts to make sense to prioritize them. Prioritizing can be done by
  2836. placing a @emph{priority cookie} into the headline of a TODO item, like
  2837. this
  2838. @example
  2839. *** TODO [#A] Write letter to Sam Fortune
  2840. @end example
  2841. @noindent
  2842. By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
  2843. @samp{C}. @samp{A} is the highest priority. An entry without a cookie
  2844. is treated as priority @samp{B}. Priorities make a difference only in
  2845. the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have
  2846. no inherent meaning to Org mode.
  2847. Priorities can be attached to any outline tree entries; they do not need
  2848. to be TODO items.
  2849. @table @kbd
  2850. @kindex @kbd{C-c ,}
  2851. @item @kbd{C-c ,}
  2852. Set the priority of the current headline. The command prompts for a
  2853. priority character @samp{A}, @samp{B} or @samp{C}. When you press
  2854. @key{SPC} instead, the priority cookie is removed from the headline.
  2855. The priorities can also be changed ``remotely'' from the timeline and
  2856. agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
  2857. @c
  2858. @kindex S-@key{up}
  2859. @kindex S-@key{down}
  2860. @item S-@key{up}
  2861. @itemx S-@key{down}
  2862. Increase/decrease priority of current headline@footnote{See also the
  2863. option @code{org-priority-start-cycle-with-default'}.}. Note that these
  2864. keys are also used to modify time stamps (@pxref{Creating timestamps}).
  2865. Furthermore, these keys are also used by CUA mode (@pxref{Conflicts}).
  2866. @end table
  2867. You can change the range of allowed priorities by setting the variables
  2868. @code{org-highest-priority}, @code{org-lowest-priority}, and
  2869. @code{org-default-priority}. For an individual buffer, you may set
  2870. these values (highest, lowest, default) like this (please make sure that
  2871. the highest priority is earlier in the alphabet than the lowest
  2872. priority):
  2873. @example
  2874. #+PRIORITIES: A C B
  2875. @end example
  2876. @node Breaking down tasks, Checkboxes, Priorities, TODO Items
  2877. @section Breaking tasks down into subtasks
  2878. @cindex tasks, breaking down
  2879. It is often advisable to break down large tasks into smaller, manageable
  2880. subtasks. You can do this by creating an outline tree below a TODO item,
  2881. with detailed subtasks on the tree@footnote{To keep subtasks out of the
  2882. global TODO list, see the @code{org-agenda-todo-list-sublevels}.}. To keep
  2883. the overview over the fraction of subtasks that are already completed, insert
  2884. either @samp{[/]} or @samp{[%]} anywhere in the headline. These cookies will
  2885. be updates each time the todo status of a child changes. For example:
  2886. @example
  2887. * Organize Party [33%]
  2888. ** TODO Call people [1/2]
  2889. *** TODO Peter
  2890. *** DONE Sarah
  2891. ** TODO Buy food
  2892. ** DONE Talk to neighbor
  2893. @end example
  2894. If you would like a TODO entry to automatically change to DONE when all
  2895. chilrden are done, you can use the following setup:
  2896. @example
  2897. (defun org-summary-todo (n-done n-not-done)
  2898. "Switch entry to DONE when all subentries are done, to TODO otherwise."
  2899. (let (org-log-done org-log-states) ; turn off logging
  2900. (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
  2901. (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
  2902. @end example
  2903. Another possibility is the use of checkboxes to identify (a hierarchy of) a
  2904. large number of subtasks (@pxref{Checkboxes}).
  2905. @node Checkboxes, , Breaking down tasks, TODO Items
  2906. @section Checkboxes
  2907. @cindex checkboxes
  2908. Every item in a plain list (@pxref{Plain lists}) can be made into a
  2909. checkbox by starting it with the string @samp{[ ]}. This feature is
  2910. similar to TODO items (@pxref{TODO Items}), but is more lightweight.
  2911. Checkboxes are not included into the global TODO list, so they are often
  2912. great to split a task into a number of simple steps. Or you can use
  2913. them in a shopping list. To toggle a checkbox, use @kbd{C-c C-c}, or
  2914. use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}).
  2915. Here is an example of a checkbox list.
  2916. @example
  2917. * TODO Organize party [2/4]
  2918. - [-] call people [1/3]
  2919. - [ ] Peter
  2920. - [X] Sarah
  2921. - [ ] Sam
  2922. - [X] order food
  2923. - [ ] think about what music to play
  2924. - [X] talk to the neighbors
  2925. @end example
  2926. Checkboxes work hierarchically, so if a checkbox item has children that
  2927. are checkboxes, toggling one of the children checkboxes will make the
  2928. parent checkbox reflect if none, some, or all of the children are
  2929. checked.
  2930. @cindex statistics, for checkboxes
  2931. @cindex checkbox statistics
  2932. The @samp{[2/4]} and @samp{[1/3]} in the first and second line are
  2933. cookies indicating how many checkboxes present in this entry have been
  2934. checked off, and the total number of checkboxes are present. This can
  2935. give you an idea on how many checkboxes remain, even without opening a
  2936. folded entry. The cookies can be placed into a headline or into (the
  2937. first line of) a plain list item. Each cookie covers all checkboxes
  2938. structurally below the headline/item on which the cookie appear. You
  2939. have to insert the cookie yourself by typing either @samp{[/]} or
  2940. @samp{[%]}. With @samp{[/]} you get an @samp{n out of m} result, as in
  2941. the examples above. With @samp{[%]} you get information about the
  2942. percentage of checkboxes checked (in the above example, this would be
  2943. @samp{[50%]} and @samp{[33%]}, respectively).
  2944. @noindent The following commands work with checkboxes:
  2945. @table @kbd
  2946. @kindex C-c C-c
  2947. @item C-c C-c
  2948. Toggle checkbox at point. With a prefix argument, set it to @samp{[-]},
  2949. which is considered to be an intermediate state.
  2950. @kindex C-c C-x C-b
  2951. @item C-c C-x C-b
  2952. Toggle checkbox at point.
  2953. @itemize @minus
  2954. @item
  2955. If there is an active region, toggle the first checkbox in the region
  2956. and set all remaining boxes to the same status as the first. If you
  2957. want to toggle all boxes in the region independently, use a prefix
  2958. argument.
  2959. @item
  2960. If the cursor is in a headline, toggle checkboxes in the region between
  2961. this headline and the next (so @emph{not} the entire subtree).
  2962. @item
  2963. If there is no active region, just toggle the checkbox at point.
  2964. @end itemize
  2965. @kindex M-S-@key{RET}
  2966. @item M-S-@key{RET}
  2967. Insert a new item with a checkbox.
  2968. This works only if the cursor is already in a plain list item
  2969. (@pxref{Plain lists}).
  2970. @kindex C-c #
  2971. @item C-c #
  2972. Update the checkbox statistics in the current outline entry. When
  2973. called with a @kbd{C-u} prefix, update the entire file. Checkbox
  2974. statistic cookies are updated automatically if you toggle checkboxes
  2975. with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}. If you
  2976. delete boxes or add/change them by hand, use this command to get things
  2977. back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
  2978. @end table
  2979. @node Tags, Properties and Columns, TODO Items, Top
  2980. @chapter Tags
  2981. @cindex tags
  2982. @cindex headline tagging
  2983. @cindex matching, tags
  2984. @cindex sparse tree, tag based
  2985. An excellent way to implement labels and contexts for cross-correlating
  2986. information is to assign @i{tags} to headlines. Org mode has extensive
  2987. support for tags.
  2988. Every headline can contain a list of tags; they occur at the end of the
  2989. headline. Tags are normal words containing letters, numbers, @samp{_}, and
  2990. @samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
  2991. @samp{:work:}. Several tags can be specified, as in @samp{:work:urgent:}.
  2992. Tags will by default get a bold face with the same color as the headline.
  2993. You may specify special faces for specific tags using the variable
  2994. @code{org-tag-faces}, much in the same way as you can do for TODO keywords
  2995. (@pxref{Faces for TODO keywords}).
  2996. @menu
  2997. * Tag inheritance:: Tags use the tree structure of the outline
  2998. * Setting tags:: How to assign tags to a headline
  2999. * Tag searches:: Searching for combinations of tags
  3000. @end menu
  3001. @node Tag inheritance, Setting tags, Tags, Tags
  3002. @section Tag inheritance
  3003. @cindex tag inheritance
  3004. @cindex inheritance, of tags
  3005. @cindex sublevels, inclusion into tags match
  3006. @i{Tags} make use of the hierarchical structure of outline trees. If a
  3007. heading has a certain tag, all subheadings will inherit the tag as
  3008. well. For example, in the list
  3009. @example
  3010. * Meeting with the French group :work:
  3011. ** Summary by Frank :boss:notes:
  3012. *** TODO Prepare slides for him :action:
  3013. @end example
  3014. @noindent
  3015. the final heading will have the tags @samp{:work:}, @samp{:boss:},
  3016. @samp{:notes:}, and @samp{:action:} even though the final heading is not
  3017. explicitly marked with those tags. You can also set tags that all entries in
  3018. a file should inherit as if these tags would be defined in a hypothetical
  3019. level zero that surounds the entire file.
  3020. @example
  3021. #+FILETAGS: :Peter:Boss:Secret:
  3022. @end example
  3023. @noindent
  3024. To limit tag inheritance to specific tags, or to turn it off entirely, use
  3025. the variables @code{org-use-tag-inheritance} and
  3026. @code{org-tags-exclude-from-inheritance}.
  3027. When a headline matches during a tags search while tag inheritance is turned
  3028. on, all the sublevels in the same tree will (for a simple match form) match
  3029. as well@footnote{This is only true if the the search does not involve more
  3030. complex tests including properties (@pxref{Property searches}).}. The list
  3031. of matches may then become very long. If you only want to see the first tags
  3032. match in a subtree, configure the variable
  3033. @code{org-tags-match-list-sublevels} (not recommended).
  3034. @node Setting tags, Tag searches, Tag inheritance, Tags
  3035. @section Setting tags
  3036. @cindex setting tags
  3037. @cindex tags, setting
  3038. @kindex M-@key{TAB}
  3039. Tags can simply be typed into the buffer at the end of a headline.
  3040. After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
  3041. also a special command for inserting tags:
  3042. @table @kbd
  3043. @kindex C-c C-q
  3044. @item C-c C-q
  3045. @cindex completion, of tags
  3046. Enter new tags for the current headline. Org mode will either offer
  3047. completion or a special single-key interface for setting tags, see
  3048. below. After pressing @key{RET}, the tags will be inserted and aligned
  3049. to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
  3050. tags in the current buffer will be aligned to that column, just to make
  3051. things look nice. TAGS are automatically realigned after promotion,
  3052. demotion, and TODO state changes (@pxref{TODO basics}).
  3053. @kindex C-c C-c
  3054. @item C-c C-c
  3055. When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
  3056. @end table
  3057. Org will support tag insertion based on a @emph{list of tags}. By
  3058. default this list is constructed dynamically, containing all tags
  3059. currently used in the buffer. You may also globally specify a hard list
  3060. of tags with the variable @code{org-tag-alist}. Finally you can set
  3061. the default tags for a given file with lines like
  3062. @example
  3063. #+TAGS: @@work @@home @@tennisclub
  3064. #+TAGS: laptop car pc sailboat
  3065. @end example
  3066. If you have globally defined your preferred set of tags using the
  3067. variable @code{org-tag-alist}, but would like to use a dynamic tag list
  3068. in a specific file, add an empty TAGS option line to that file:
  3069. @example
  3070. #+TAGS:
  3071. @end example
  3072. By default Org mode uses the standard minibuffer completion facilities for
  3073. entering tags. However, it also implements another, quicker, tag selection
  3074. method called @emph{fast tag selection}. This allows you to select and
  3075. deselect tags with just a single key press. For this to work well you should
  3076. assign unique letters to most of your commonly used tags. You can do this
  3077. globally by configuring the variable @code{org-tag-alist} in your
  3078. @file{.emacs} file. For example, you may find the need to tag many items in
  3079. different files with @samp{:@@home:}. In this case you can set something
  3080. like:
  3081. @lisp
  3082. (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
  3083. @end lisp
  3084. @noindent If the tag is only relevant to the file you are working on then you
  3085. can, instead, set the TAGS option line as:
  3086. @example
  3087. #+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
  3088. @end example
  3089. @noindent
  3090. You can also group together tags that are mutually exclusive. By using
  3091. braces, as in:
  3092. @example
  3093. #+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
  3094. @end example
  3095. @noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
  3096. and @samp{@@tennisclub} should be selected. Multiple such groups are allowed.
  3097. @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
  3098. these lines to activate any changes.
  3099. @noindent
  3100. To set these mutually exclusive groups in the variable @code{org-mode-alist}
  3101. you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
  3102. of the braces. The previous example would be set globally by the following
  3103. configuration:
  3104. @lisp
  3105. (setq org-tag-alist '((:startgroup . nil)
  3106. ("@@work" . ?w) ("@@home" . ?h)
  3107. ("@@tennisclub" . ?t)
  3108. (:endgroup . nil)
  3109. ("laptop" . ?l) ("pc" . ?p)))
  3110. @end lisp
  3111. If at least one tag has a selection key then pressing @kbd{C-c C-c} will
  3112. automatically present you with a special interface, listing inherited tags,
  3113. the tags of the current headline, and a list of all valid tags with
  3114. corresponding keys@footnote{Keys will automatically be assigned to tags which
  3115. have no configured keys.}. In this interface, you can use the following
  3116. keys:
  3117. @table @kbd
  3118. @item a-z...
  3119. Pressing keys assigned to tags will add or remove them from the list of
  3120. tags in the current line. Selecting a tag in a group of mutually
  3121. exclusive tags will turn off any other tags from that group.
  3122. @kindex @key{TAB}
  3123. @item @key{TAB}
  3124. Enter a tag in the minibuffer, even if the tag is not in the predefined
  3125. list. You will be able to complete on all tags present in the buffer.
  3126. @kindex @key{SPC}
  3127. @item @key{SPC}
  3128. Clear all tags for this line.
  3129. @kindex @key{RET}
  3130. @item @key{RET}
  3131. Accept the modified set.
  3132. @item C-g
  3133. Abort without installing changes.
  3134. @item q
  3135. If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
  3136. @item !
  3137. Turn off groups of mutually exclusive tags. Use this to (as an
  3138. exception) assign several tags from such a group.
  3139. @item C-c
  3140. Toggle auto-exit after the next change (see below).
  3141. If you are using expert mode, the first @kbd{C-c} will display the
  3142. selection window.
  3143. @end table
  3144. @noindent
  3145. This method lets you assign tags to a headline with very few keys. With
  3146. the above setup, you could clear the current tags and set @samp{@@home},
  3147. @samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
  3148. C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to
  3149. @samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
  3150. alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
  3151. @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
  3152. @key{RET} @key{RET}}.
  3153. If you find that most of the time, you need only a single key press to
  3154. modify your list of tags, set the variable
  3155. @code{org-fast-tag-selection-single-key}. Then you no longer have to
  3156. press @key{RET} to exit fast tag selection - it will immediately exit
  3157. after the first change. If you then occasionally need more keys, press
  3158. @kbd{C-c} to turn off auto-exit for the current tag selection process
  3159. (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
  3160. C-c}). If you set the variable to the value @code{expert}, the special
  3161. window is not even shown for single-key tag selection, it comes up only
  3162. when you press an extra @kbd{C-c}.
  3163. @node Tag searches, , Setting tags, Tags
  3164. @section Tag searches
  3165. @cindex tag searches
  3166. @cindex searching for tags
  3167. Once a system of tags has been set up, it can be used to collect related
  3168. information into special lists.
  3169. @table @kbd
  3170. @kindex C-c \
  3171. @kindex C-c / T
  3172. @item C-c \
  3173. @itemx C-c / T
  3174. Create a sparse tree with all headlines matching a tags search. With a
  3175. @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
  3176. @kindex C-c a m
  3177. @item C-c a m
  3178. Create a global list of tag matches from all agenda files.
  3179. @xref{Matching tags and properties}.
  3180. @kindex C-c a M
  3181. @item C-c a M
  3182. Create a global list of tag matches from all agenda files, but check
  3183. only TODO items and force checking subitems (see variable
  3184. @code{org-tags-match-list-sublevels}).
  3185. @end table
  3186. @cindex Boolean logic, for tag searches
  3187. A @i{tags} search string can use Boolean operators @samp{&} for AND and
  3188. @samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
  3189. Parenthesis are currently not implemented. A tag may also be preceded
  3190. by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
  3191. positive selection. The AND operator @samp{&} is optional when @samp{+}
  3192. or @samp{-} is present. Examples:
  3193. @table @samp
  3194. @item +work-boss
  3195. Select headlines tagged @samp{:work:}, but discard those also tagged
  3196. @samp{:boss:}.
  3197. @item work|laptop
  3198. Selects lines tagged @samp{:work:} or @samp{:laptop:}.
  3199. @item work|laptop&night
  3200. Like before, but require the @samp{:laptop:} lines to be tagged also
  3201. @samp{:night:}.
  3202. @end table
  3203. @cindex TODO keyword matching, with tags search
  3204. You may also test for TODO keywords (@pxref{TODO extensions}) and properties
  3205. (@pxref{Properties and Columns}) at the same time as matching tags. For a
  3206. guide on how to match properties, see @ref{Property searches}. To match a
  3207. specific TODO keyword, include an expression like @samp{+TODO="NEXT"} as one
  3208. of the terms in a tags search.
  3209. There is also the possibility to end the tags part of the match (which may
  3210. include several terms connected with @samp{|}) with a @samp{/} and then
  3211. specify a Boolean expression just for TODO keywords. The syntax is then
  3212. similar to the tag matches, but should be applied with consideration: For
  3213. example, a positive selection on several TODO keywords can not meaningfully
  3214. be combined with boolean AND. However, @emph{negative selection} combined
  3215. with AND can be meaningful. To make sure that only lines are checked that
  3216. actually have any TODO keyword (resulting in a speed-up), use @kbd{C-c a M},
  3217. or equivalently start the TODO part after the slash with @samp{!}. Examples:
  3218. @table @samp
  3219. @item work+TODO="WAITING"
  3220. Select @samp{:work:}-tagged TODO lines with the specific TODO
  3221. keyword @samp{WAITING}.
  3222. @item work+TODO="WAITING"|home+TODO="WAITING"
  3223. Waiting tasks both at work and at home.
  3224. @item work/WAITING
  3225. Same as the first example.
  3226. @item work/!-WAITING-NEXT
  3227. Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
  3228. nor @samp{NEXT}
  3229. @item work/!+WAITING|+NEXT
  3230. Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
  3231. @samp{NEXT}.
  3232. @end table
  3233. @cindex regular expressions, with tags search
  3234. Any element of the tag/todo match can be a regular expression - in this
  3235. case it must be enclosed in curly braces. For example,
  3236. @samp{work+@{^boss.*@}} matches headlines that contain the tag
  3237. @samp{:work:} and any tag @i{starting} with @samp{boss}. You may also use a
  3238. regular expression in @samp{TODO=@{^W@}} which would match TODO keywords
  3239. starting with the letter @samp{W}.
  3240. @cindex level, require for tags/property match
  3241. @cindex category, require for tags/property match
  3242. You can also require a headline to be of a certain level or category, by
  3243. writing instead of any TAG an expression like @samp{LEVEL=3} or
  3244. @samp{CATEGORY="work"}, respectively. For example, a search
  3245. @samp{+LEVEL=3+boss/-DONE} lists all level three headlines that have the
  3246. tag @samp{boss} and are @emph{not} marked with the TODO keyword DONE.
  3247. Accessing TODO, LEVEL, and CATEGORY during a search is fast. Accessing any
  3248. other properties will slow down the search.
  3249. @node Properties and Columns, Dates and Times, Tags, Top
  3250. @chapter Properties and Columns
  3251. @cindex properties
  3252. Properties are a set of key-value pairs associated with an entry. There
  3253. are two main applications for properties in Org mode. First, properties
  3254. are like tags, but with a value. Second, you can use properties to
  3255. implement (very basic) database capabilities in an Org buffer. For
  3256. an example of the first application, imagine maintaining a file where
  3257. you document bugs and plan releases of a piece of software. Instead of
  3258. using tags like @code{:release_1:}, @code{:release_2:}, one can use a
  3259. property, say @code{:Release:}, that in different subtrees has different
  3260. values, such as @code{1.0} or @code{2.0}. For an example of the second
  3261. application of properties, imagine keeping track of your music CD's,
  3262. where properties could be things such as the album artist, date of
  3263. release, number of tracks, and so on.
  3264. Properties can be conveniently edited and viewed in column view
  3265. (@pxref{Column view}).
  3266. @menu
  3267. * Property syntax:: How properties are spelled out
  3268. * Special properties:: Access to other Org mode features
  3269. * Property searches:: Matching property values
  3270. * Property inheritance:: Passing values down the tree
  3271. * Column view:: Tabular viewing and editing
  3272. * Property API:: Properties for Lisp programmers
  3273. @end menu
  3274. @node Property syntax, Special properties, Properties and Columns, Properties and Columns
  3275. @section Property syntax
  3276. @cindex property syntax
  3277. @cindex drawer, for properties
  3278. Properties are key-value pairs. They need to be inserted into a special
  3279. drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
  3280. is specified on a single line, with the key (surrounded by colons)
  3281. first, and the value after it. Here is an example:
  3282. @example
  3283. * CD collection
  3284. ** Classic
  3285. *** Goldberg Variations
  3286. :PROPERTIES:
  3287. :Title: Goldberg Variations
  3288. :Composer: J.S. Bach
  3289. :Artist: Glen Gould
  3290. :Publisher: Deutsche Grammphon
  3291. :NDisks: 1
  3292. :END:
  3293. @end example
  3294. You may define the allowed values for a particular property @samp{:Xyz:}
  3295. by setting a property @samp{:Xyz_ALL:}. This special property is
  3296. @emph{inherited}, so if you set it in a level 1 entry, it will apply to
  3297. the entire tree. When allowed values are defined, setting the
  3298. corresponding property becomes easier and is less prone to typing
  3299. errors. For the example with the CD collection, we can predefine
  3300. publishers and the number of disks in a box like this:
  3301. @example
  3302. * CD collection
  3303. :PROPERTIES:
  3304. :NDisks_ALL: 1 2 3 4
  3305. :Publisher_ALL: "Deutsche Grammophon" Philips EMI
  3306. :END:
  3307. @end example
  3308. If you want to set properties that can be inherited by any entry in a
  3309. file, use a line like
  3310. @example
  3311. #+PROPERTY: NDisks_ALL 1 2 3 4
  3312. @end example
  3313. Property values set with the global variable
  3314. @code{org-global-properties} can be inherited by all entries in all
  3315. Org files.
  3316. @noindent
  3317. The following commands help to work with properties:
  3318. @table @kbd
  3319. @kindex M-@key{TAB}
  3320. @item M-@key{TAB}
  3321. After an initial colon in a line, complete property keys. All keys used
  3322. in the current file will be offered as possible completions.
  3323. @kindex C-c C-x p
  3324. @item C-c C-x p
  3325. Set a property. This prompts for a property name and a value. If
  3326. necessary, the property drawer is created as well.
  3327. @item M-x org-insert-property-drawer
  3328. Insert a property drawer into the current entry. The drawer will be
  3329. inserted early in the entry, but after the lines with planning
  3330. information like deadlines.
  3331. @kindex C-c C-c
  3332. @item C-c C-c
  3333. With the cursor in a property drawer, this executes property commands.
  3334. @item C-c C-c s
  3335. Set a property in the current entry. Both the property and the value
  3336. can be inserted using completion.
  3337. @kindex S-@key{right}
  3338. @kindex S-@key{left}
  3339. @item S-@key{left}/@key{right}
  3340. Switch property at point to the next/previous allowed value.
  3341. @item C-c C-c d
  3342. Remove a property from the current entry.
  3343. @item C-c C-c D
  3344. Globally remove a property, from all entries in the current file.
  3345. @item C-c C-c c
  3346. Compute the property at point, using the operator and scope from the
  3347. nearest column format definition.
  3348. @end table
  3349. @node Special properties, Property searches, Property syntax, Properties and Columns
  3350. @section Special properties
  3351. @cindex properties, special
  3352. Special properties provide alternative access method to Org mode
  3353. features discussed in the previous chapters, like the TODO state or the
  3354. priority of an entry. This interface exists so that you can include
  3355. these states into columns view (@pxref{Column view}), or to use them in
  3356. queries. The following property names are special and should not be
  3357. used as keys in the properties drawer:
  3358. @example
  3359. TODO @r{The TODO keyword of the entry.}
  3360. TAGS @r{The tags defined directly in the headline.}
  3361. ALLTAGS @r{All tags, including inherited ones.}
  3362. PRIORITY @r{The priority of the entry, a string with a single letter.}
  3363. DEADLINE @r{The deadline time string, without the angular brackets.}
  3364. SCHEDULED @r{The scheduling time stamp, without the angular brackets.}
  3365. TIMESTAMP @r{The first keyword-less time stamp in the entry.}
  3366. TIMESTAMP_IA @r{The first inactive time stamp in the entry.}
  3367. CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
  3368. @r{must be run first to compute the values.}
  3369. @end example
  3370. @node Property searches, Property inheritance, Special properties, Properties and Columns
  3371. @section Property searches
  3372. @cindex properties, searching
  3373. @cindex searching, of properties
  3374. To create sparse trees and special lists with selection based on properties,
  3375. the same commands are used as for tag searches (@pxref{Tag searches}), and
  3376. the same logic applies. For example, here is a search string:
  3377. @example
  3378. +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \
  3379. +With=@{Sarah\|Denny@}+SCHEDULED>="<2008-10-11>"
  3380. @end example
  3381. @noindent
  3382. The type of comparison will depend on how the comparison value is written:
  3383. @itemize @minus
  3384. @item
  3385. If the comparison value is a plain number, a numerical comparison is done,
  3386. and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
  3387. @samp{>=}, and @samp{<>}.
  3388. @item
  3389. If the comparison value is enclosed in double
  3390. quotes, a string comparison is done, and the same operators are allowed.
  3391. @item
  3392. If the comparison value is enclosed in double quotes @emph{and} angular
  3393. brackets (like @samp{DEADLINE<="<2008-12-24 18:30>"}), both values are
  3394. assumed to be date/time specifications in the standard Org way, and the
  3395. comparison will be done accordingly. Special values that will be recognized
  3396. are @code{"<now>"} for now (including time), and @code{"<today>"}, and
  3397. @code{"<tomorrow>"} for these days at 0:00 hours, i.e. without a time
  3398. specification. Also strings like @code{"<+5d>"} or @code{"<-2m>"} with units
  3399. @code{d}, @code{w}, @code{m}, and @code{y} for day, week, month, and year,
  3400. respectively, can be used.
  3401. @item
  3402. If the comparison value is enclosed
  3403. in curly braces, a regexp match is performed, with @samp{=} meaning that the
  3404. regexp matches the property value, and @samp{<>} meaning that it does not
  3405. match.
  3406. @end itemize
  3407. So the search string in the example finds entries tagged @samp{:work:} but
  3408. not @samp{:boss:}, which also have a priority value @samp{A}, a
  3409. @samp{:Coffee:} property with the value @samp{unlimited}, an @samp{Effort}
  3410. property that is numerically smaller than 2, a @samp{:With:} property that is
  3411. matched by the regular expression @samp{Sarah\|Denny}, and that are scheduled
  3412. on or after October 11, 2008.
  3413. You can configure Org mode to use property inheritance during a search, but
  3414. beware that this can slow down searches considerably. See @ref{Property
  3415. inheritance} for details.
  3416. There is also a special command for creating sparse trees based on a
  3417. single property:
  3418. @table @kbd
  3419. @kindex C-c / p
  3420. @item C-c / p
  3421. Create a sparse tree based on the value of a property. This first
  3422. prompts for the name of a property, and then for a value. A sparse tree
  3423. is created with all entries that define this property with the given
  3424. value. If you enclose the value into curly braces, it is interpreted as
  3425. a regular expression and matched against the property values.
  3426. @end table
  3427. @node Property inheritance, Column view, Property searches, Properties and Columns
  3428. @section Property Inheritance
  3429. @cindex properties, inheritance
  3430. @cindex inheritance, of properties
  3431. The outline structure of Org mode documents lends itself for an
  3432. inheritance model of properties: If the parent in a tree has a certain
  3433. property, the children can inherit this property. Org mode does not
  3434. turn this on by default, because it can slow down property searches
  3435. significantly and is often not needed. However, if you find inheritance
  3436. useful, you can turn it on by setting the variable
  3437. @code{org-use-property-inheritance}. It may be set to @code{t}, to make
  3438. all properties inherited from the parent, to a list of properties
  3439. that should be inherited, or to a regular expression that matches
  3440. inherited properties.
  3441. Org mode has a few properties for which inheritance is hard-coded, at
  3442. least for the special applications for which they are used:
  3443. @table @code
  3444. @item COLUMNS
  3445. The @code{:COLUMNS:} property defines the format of column view
  3446. (@pxref{Column view}). It is inherited in the sense that the level
  3447. where a @code{:COLUMNS:} property is defined is used as the starting
  3448. point for a column view table, independently of the location in the
  3449. subtree from where columns view is turned on.
  3450. @item CATEGORY
  3451. For agenda view, a category set through a @code{:CATEGORY:} property
  3452. applies to the entire subtree.
  3453. @item ARCHIVE
  3454. For archiving, the @code{:ARCHIVE:} property may define the archive
  3455. location for the entire subtree (@pxref{Moving subtrees}).
  3456. @item LOGGING
  3457. The LOGGING property may define logging settings for an entry or a
  3458. subtree (@pxref{Tracking TODO state changes}).
  3459. @end table
  3460. @node Column view, Property API, Property inheritance, Properties and Columns
  3461. @section Column view
  3462. A great way to view and edit properties in an outline tree is
  3463. @emph{column view}. In column view, each outline item is turned into a
  3464. table row. Columns in this table provide access to properties of the
  3465. entries. Org mode implements columns by overlaying a tabular structure
  3466. over the headline of each item. While the headlines have been turned
  3467. into a table row, you can still change the visibility of the outline
  3468. tree. For example, you get a compact table by switching to CONTENTS
  3469. view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
  3470. is active), but you can still open, read, and edit the entry below each
  3471. headline. Or, you can switch to column view after executing a sparse
  3472. tree command and in this way get a table only for the selected items.
  3473. Column view also works in agenda buffers (@pxref{Agenda Views}) where
  3474. queries have collected selected items, possibly from a number of files.
  3475. @menu
  3476. * Defining columns:: The COLUMNS format property
  3477. * Using column view:: How to create and use column view
  3478. * Capturing column view:: A dynamic block for column view
  3479. @end menu
  3480. @node Defining columns, Using column view, Column view, Column view
  3481. @subsection Defining columns
  3482. @cindex column view, for properties
  3483. @cindex properties, column view
  3484. Setting up a column view first requires defining the columns. This is
  3485. done by defining a column format line.
  3486. @menu
  3487. * Scope of column definitions:: Where defined, where valid?
  3488. * Column attributes:: Appearance and content of a column
  3489. @end menu
  3490. @node Scope of column definitions, Column attributes, Defining columns, Defining columns
  3491. @subsubsection Scope of column definitions
  3492. To define a column format for an entire file, use a line like
  3493. @example
  3494. #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3495. @end example
  3496. To specify a format that only applies to a specific tree, add a
  3497. @code{:COLUMNS:} property to the top node of that tree, for example:
  3498. @example
  3499. ** Top node for columns view
  3500. :PROPERTIES:
  3501. :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
  3502. :END:
  3503. @end example
  3504. If a @code{:COLUMNS:} property is present in an entry, it defines columns
  3505. for the entry itself, and for the entire subtree below it. Since the
  3506. column definition is part of the hierarchical structure of the document,
  3507. you can define columns on level 1 that are general enough for all
  3508. sublevels, and more specific columns further down, when you edit a
  3509. deeper part of the tree.
  3510. @node Column attributes, , Scope of column definitions, Defining columns
  3511. @subsubsection Column attributes
  3512. A column definition sets the attributes of a column. The general
  3513. definition looks like this:
  3514. @example
  3515. %[width]property[(title)][@{summary-type@}]
  3516. @end example
  3517. @noindent
  3518. Except for the percent sign and the property name, all items are
  3519. optional. The individual parts have the following meaning:
  3520. @example
  3521. width @r{An integer specifying the width of the column in characters.}
  3522. @r{If omitted, the width will be determined automatically.}
  3523. property @r{The property that should be edited in this column.}
  3524. (title) @r{The header text for the column. If omitted, the}
  3525. @r{property name is used.}
  3526. @{summary-type@} @r{The summary type. If specified, the column values for}
  3527. @r{parent nodes are computed from the children.}
  3528. @r{Supported summary types are:}
  3529. @{+@} @r{Sum numbers in this column.}
  3530. @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.}
  3531. @{$@} @r{Currency, short for @samp{+;%.2f}.}
  3532. @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
  3533. @{X@} @r{Checkbox status, [X] if all children are [X].}
  3534. @{X/@} @r{Checkbox status, [n/m].}
  3535. @{X%@} @r{Checkbox status, [n%].}
  3536. @end example
  3537. @noindent
  3538. Here is an example for a complete columns definition, along with allowed
  3539. values.
  3540. @example
  3541. :COLUMNS: %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status \@footnote{Please note that the COLUMNS definition must be on a single line - it is wrapped here only because of formatting constraints.}
  3542. %10Time_Estimate@{:@} %CLOCKSUM
  3543. :Owner_ALL: Tammy Mark Karl Lisa Don
  3544. :Status_ALL: "In progress" "Not started yet" "Finished" ""
  3545. :Approved_ALL: "[ ]" "[X]"
  3546. @end example
  3547. The first column, @samp{%25ITEM}, means the first 25 characters of the
  3548. item itself, i.e. of the headline. You probably always should start the
  3549. column definition with the @samp{ITEM} specifier. The other specifiers
  3550. create columns @samp{Owner} with a list of names as allowed values, for
  3551. @samp{Status} with four different possible values, and for a checkbox
  3552. field @samp{Approved}. When no width is given after the @samp{%}
  3553. character, the column will be exactly as wide as it needs to be in order
  3554. to fully display all values. The @samp{Approved} column does have a
  3555. modified title (@samp{Approved?}, with a question mark). Summaries will
  3556. be created for the @samp{Time_Estimate} column by adding time duration
  3557. expressions like HH:MM, and for the @samp{Approved} column, by providing
  3558. an @samp{[X]} status if all children have been checked. The
  3559. @samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
  3560. in the subtree.
  3561. @node Using column view, Capturing column view, Defining columns, Column view
  3562. @subsection Using column view
  3563. @table @kbd
  3564. @tsubheading{Turning column view on and off}
  3565. @kindex C-c C-x C-c
  3566. @item C-c C-x C-c
  3567. Create the column view for the local environment. This command searches
  3568. the hierarchy, up from point, for a @code{:COLUMNS:} property that defines
  3569. a format. When one is found, the column view table is established for
  3570. the entire tree, starting from the entry that contains the @code{:COLUMNS:}
  3571. property. If none is found, the format is taken from the @code{#+COLUMNS}
  3572. line or from the variable @code{org-columns-default-format}, and column
  3573. view is established for the current entry and its subtree.
  3574. @kindex r
  3575. @item r
  3576. Recreate the column view, to include recent changes made in the buffer.
  3577. @kindex g
  3578. @item g
  3579. Same as @kbd{r}.
  3580. @kindex q
  3581. @item q
  3582. Exit column view.
  3583. @tsubheading{Editing values}
  3584. @item @key{left} @key{right} @key{up} @key{down}
  3585. Move through the column view from field to field.
  3586. @kindex S-@key{left}
  3587. @kindex S-@key{right}
  3588. @item S-@key{left}/@key{right}
  3589. Switch to the next/previous allowed value of the field. For this, you
  3590. have to have specified allowed values for a property.
  3591. @item 1..9,0
  3592. Directly select the nth allowed value, @kbd{0} selects the 10th value.
  3593. @kindex n
  3594. @kindex p
  3595. @itemx n / p
  3596. Same as @kbd{S-@key{left}/@key{right}}
  3597. @kindex e
  3598. @item e
  3599. Edit the property at point. For the special properties, this will
  3600. invoke the same interface that you normally use to change that
  3601. property. For example, when editing a TAGS property, the tag completion
  3602. or fast selection interface will pop up.
  3603. @kindex C-c C-c
  3604. @item C-c C-c
  3605. When there is a checkbox at point, toggle it.
  3606. @kindex v
  3607. @item v
  3608. View the full value of this property. This is useful if the width of
  3609. the column is smaller than that of the value.
  3610. @kindex a
  3611. @item a
  3612. Edit the list of allowed values for this property. If the list is found
  3613. in the hierarchy, the modified values is stored there. If no list is
  3614. found, the new value is stored in the first entry that is part of the
  3615. current column view.
  3616. @tsubheading{Modifying the table structure}
  3617. @kindex <
  3618. @kindex >
  3619. @item < / >
  3620. Make the column narrower/wider by one character.
  3621. @kindex S-M-@key{right}
  3622. @item S-M-@key{right}
  3623. Insert a new column, to the left of the current column.
  3624. @kindex S-M-@key{left}
  3625. @item S-M-@key{left}
  3626. Delete the current column.
  3627. @end table
  3628. @node Capturing column view, , Using column view, Column view
  3629. @subsection Capturing column view
  3630. Since column view is just an overlay over a buffer, it cannot be
  3631. exported or printed directly. If you want to capture a column view, use
  3632. this @code{columnview} dynamic block (@pxref{Dynamic blocks}). The frame
  3633. of this block looks like this:
  3634. @cindex #+BEGIN: columnview
  3635. @example
  3636. * The column view
  3637. #+BEGIN: columnview :hlines 1 :id "label"
  3638. #+END:
  3639. @end example
  3640. @noindent This dynamic block has the following parameters:
  3641. @table @code
  3642. @item :id
  3643. This is most important parameter. Column view is a feature that is
  3644. often localized to a certain (sub)tree, and the capture block might be
  3645. in a different location in the file. To identify the tree whose view to
  3646. capture, you can use 3 values:
  3647. @example
  3648. local @r{use the tree in which the capture block is located}
  3649. global @r{make a global view, including all headings in the file}
  3650. "label" @r{call column view in the tree that has an @code{:ID:}}
  3651. @r{property with the value @i{label}. You can use}
  3652. @r{@kbd{M-x org-id-copy} to create a globally unique ID for}
  3653. @r{the current entry and copy it to the kill-ring.}
  3654. @end example
  3655. @item :hlines
  3656. When @code{t}, insert a hline after every line. When a number N, insert
  3657. a hline before each headline with level @code{<= N}.
  3658. @item :vlines
  3659. When set to @code{t}, enforce column groups to get vertical lines.
  3660. @item :maxlevel
  3661. When set to a number, don't capture entries below this level.
  3662. @item :skip-empty-rows
  3663. When set to @code{t}, skip row where the only non-empty specifier of the
  3664. column view is @code{ITEM}.
  3665. @end table
  3666. @noindent
  3667. The following commands insert or update the dynamic block:
  3668. @table @kbd
  3669. @kindex C-c C-x i
  3670. @item C-c C-x i
  3671. Insert a dynamic block capturing a column view. You will be prompted
  3672. for the scope or id of the view.
  3673. @kindex C-c C-c
  3674. @item C-c C-c
  3675. @kindex C-c C-x C-u
  3676. @itemx C-c C-x C-u
  3677. Update dynamical block at point. The cursor needs to be in the
  3678. @code{#+BEGIN} line of the dynamic block.
  3679. @kindex C-u C-c C-x C-u
  3680. @item C-u C-c C-x C-u
  3681. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  3682. you have several clock table blocks in a buffer.
  3683. @end table
  3684. You can add formulas to the column view table and you may add plotting
  3685. instructions in front of the table - these will survive an update of the
  3686. block. If there is a @code{#+TBLFM:} after the table, the table will
  3687. actually be recalculated automatically after an update.
  3688. @node Property API, , Column view, Properties and Columns
  3689. @section The Property API
  3690. @cindex properties, API
  3691. @cindex API, for properties
  3692. There is a full API for accessing and changing properties. This API can
  3693. be used by Emacs Lisp programs to work with properties and to implement
  3694. features based on them. For more information see @ref{Using the
  3695. property API}.
  3696. @node Dates and Times, Capture, Properties and Columns, Top
  3697. @chapter Dates and Times
  3698. @cindex dates
  3699. @cindex times
  3700. @cindex time stamps
  3701. @cindex date stamps
  3702. To assist project planning, TODO items can be labeled with a date and/or
  3703. a time. The specially formatted string carrying the date and time
  3704. information is called a @emph{timestamp} in Org mode. This may be a
  3705. little confusing because timestamp is often used as indicating when
  3706. something was created or last changed. However, in Org mode this term
  3707. is used in a much wider sense.
  3708. @menu
  3709. * Timestamps:: Assigning a time to a tree entry
  3710. * Creating timestamps:: Commands which insert timestamps
  3711. * Deadlines and scheduling:: Planning your work
  3712. * Clocking work time:: Tracking how long you spend on a task
  3713. * Effort estimates:: Planning work effort in advance
  3714. * Relative timer:: Notes with a running timer
  3715. @end menu
  3716. @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
  3717. @section Timestamps, deadlines and scheduling
  3718. @cindex time stamps
  3719. @cindex ranges, time
  3720. @cindex date stamps
  3721. @cindex deadlines
  3722. @cindex scheduling
  3723. A time stamp is a specification of a date (possibly with time or a range
  3724. of times) in a special format, either @samp{<2003-09-16 Tue>} or
  3725. @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
  3726. 12:00-12:30>}@footnote{This is the standard ISO date/time format. To
  3727. use an alternative format, see @ref{Custom time format}.}. A time stamp
  3728. can appear anywhere in the headline or body of an Org tree entry. Its
  3729. presence causes entries to be shown on specific dates in the agenda
  3730. (@pxref{Weekly/daily agenda}). We distinguish:
  3731. @table @var
  3732. @item Plain time stamp; Event; Appointment
  3733. @cindex timestamp
  3734. A simple time stamp just assigns a date/time to an item. This is just
  3735. like writing down an appointment or event in a paper agenda. In the
  3736. timeline and agenda displays, the headline of an entry associated with a
  3737. plain time stamp will be shown exactly on that date.
  3738. @example
  3739. * Meet Peter at the movies <2006-11-01 Wed 19:15>
  3740. * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
  3741. @end example
  3742. @item Time stamp with repeater interval
  3743. @cindex timestamp, with repeater interval
  3744. A time stamp may contain a @emph{repeater interval}, indicating that it
  3745. applies not only on the given date, but again and again after a certain
  3746. interval of N days (d), weeks (w), months(m), or years(y). The
  3747. following will show up in the agenda every Wednesday:
  3748. @example
  3749. * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
  3750. @end example
  3751. @item Diary-style sexp entries
  3752. For more complex date specifications, Org mode supports using the
  3753. special sexp diary entries implemented in the Emacs calendar/diary
  3754. package. For example
  3755. @example
  3756. * The nerd meeting on every 2nd Thursday of the month
  3757. <%%(diary-float t 4 2)>
  3758. @end example
  3759. @item Time/Date range
  3760. @cindex timerange
  3761. @cindex date range
  3762. Two time stamps connected by @samp{--} denote a range. The headline
  3763. will be shown on the first and last day of the range, and on any dates
  3764. that are displayed and fall in the range. Here is an example:
  3765. @example
  3766. ** Meeting in Amsterdam
  3767. <2004-08-23 Mon>--<2004-08-26 Thu>
  3768. @end example
  3769. @item Inactive time stamp
  3770. @cindex timestamp, inactive
  3771. @cindex inactive timestamp
  3772. Just like a plain time stamp, but with square brackets instead of
  3773. angular ones. These time stamps are inactive in the sense that they do
  3774. @emph{not} trigger an entry to show up in the agenda.
  3775. @example
  3776. * Gillian comes late for the fifth time [2006-11-01 Wed]
  3777. @end example
  3778. @end table
  3779. @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
  3780. @section Creating timestamps
  3781. @cindex creating timestamps
  3782. @cindex timestamps, creating
  3783. For Org mode to recognize time stamps, they need to be in the specific
  3784. format. All commands listed below produce time stamps in the correct
  3785. format.
  3786. @table @kbd
  3787. @kindex C-c .
  3788. @item C-c .
  3789. Prompt for a date and insert a corresponding time stamp. When the cursor is
  3790. at an existing time stamp in the buffer, the command is used to modify this
  3791. timestamp instead of inserting a new one. When this command is used twice in
  3792. succession, a time range is inserted.
  3793. @c
  3794. @kindex C-u C-c .
  3795. @item C-u C-c .
  3796. Like @kbd{C-c .}, but use the alternative format which contains date
  3797. and time. The default time can be rounded to multiples of 5 minutes,
  3798. see the option @code{org-time-stamp-rounding-minutes}.
  3799. @c
  3800. @kindex C-c !
  3801. @item C-c !
  3802. Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
  3803. an agenda entry.
  3804. @c
  3805. @kindex C-c <
  3806. @item C-c <
  3807. Insert a time stamp corresponding to the cursor date in the Calendar.
  3808. @c
  3809. @kindex C-c >
  3810. @item C-c >
  3811. Access the Emacs calendar for the current date. If there is a
  3812. timestamp in the current line, go to the corresponding date
  3813. instead.
  3814. @c
  3815. @kindex C-c C-o
  3816. @item C-c C-o
  3817. Access the agenda for the date given by the time stamp or -range at
  3818. point (@pxref{Weekly/daily agenda}).
  3819. @c
  3820. @kindex S-@key{left}
  3821. @kindex S-@key{right}
  3822. @item S-@key{left}
  3823. @itemx S-@key{right}
  3824. Change date at cursor by one day. These key bindings conflict with
  3825. CUA mode (@pxref{Conflicts}).
  3826. @c
  3827. @kindex S-@key{up}
  3828. @kindex S-@key{down}
  3829. @item S-@key{up}
  3830. @itemx S-@key{down}
  3831. Change the item under the cursor in a timestamp. The cursor can be on a
  3832. year, month, day, hour or minute. Note that if the cursor is in a
  3833. headline and not at a time stamp, these same keys modify the priority of
  3834. an item. (@pxref{Priorities}). The key bindings also conflict with
  3835. CUA mode (@pxref{Conflicts}).
  3836. @c
  3837. @kindex C-c C-y
  3838. @cindex evaluate time range
  3839. @item C-c C-y
  3840. Evaluate a time range by computing the difference between start and end.
  3841. With a prefix argument, insert result after the time range (in a table: into
  3842. the following column).
  3843. @end table
  3844. @menu
  3845. * The date/time prompt:: How Org mode helps you entering date and time
  3846. * Custom time format:: Making dates look different
  3847. @end menu
  3848. @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
  3849. @subsection The date/time prompt
  3850. @cindex date, reading in minibuffer
  3851. @cindex time, reading in minibuffer
  3852. When Org mode prompts for a date/time, the default is shown as an ISO
  3853. date, and the prompt therefore seems to ask for an ISO date. But it
  3854. will in fact accept any string containing some date and/or time
  3855. information, and it is really smart about interpreting your input. You
  3856. can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
  3857. copied from an email message. Org mode will find whatever information
  3858. is in there and derive anything you have not specified from the
  3859. @emph{default date and time}. The default is usually the current date
  3860. and time, but when modifying an existing time stamp, or when entering
  3861. the second stamp of a range, it is taken from the stamp in the buffer.
  3862. When filling in information, Org mode assumes that most of the time you
  3863. will want to enter a date in the future: If you omit the month/year and
  3864. the given day/month is @i{before} today, it will assume that you mean a
  3865. future date@footnote{See the variable
  3866. @code{org-read-date-prefer-future}.}.
  3867. For example, lets assume that today is @b{June 13, 2006}. Here is how
  3868. various inputs will be interpreted, the items filled in by Org mode are
  3869. in @b{bold}.
  3870. @example
  3871. 3-2-5 --> 2003-02-05
  3872. 14 --> @b{2006}-@b{06}-14
  3873. 12 --> @b{2006}-@b{07}-12
  3874. Fri --> nearest Friday (defaultdate or later)
  3875. sep 15 --> @b{2006}-11-15
  3876. feb 15 --> @b{2007}-02-15
  3877. sep 12 9 --> 2009-09-12
  3878. 12:45 --> @b{2006}-@b{06}-@b{13} 12:45
  3879. 22 sept 0:34 --> @b{2006}-09-22 0:34
  3880. w4 --> ISO week for of the current year @b{2006}
  3881. 2012 w4 fri --> Friday of ISO week 4 in 2012
  3882. 2012-w04-5 --> Same as above
  3883. @end example
  3884. Furthermore you can specify a relative date by giving, as the
  3885. @emph{first} thing in the input: a plus/minus sign, a number and a
  3886. letter [dwmy] to indicate change in days weeks, months, years. With a
  3887. single plus or minus, the date is always relative to today. With a
  3888. double plus or minus, it is relative to the default date. If instead of
  3889. a single letter, you use the abbreviation of day name, the date will be
  3890. the nth such day. E.g.
  3891. @example
  3892. +0 --> today
  3893. . --> today
  3894. +4d --> four days from today
  3895. +4 --> same as above
  3896. +2w --> two weeks from today
  3897. ++5 --> five days from default date
  3898. +2tue --> second tuesday from now.
  3899. @end example
  3900. The function understands English month and weekday abbreviations. If
  3901. you want to use unabbreviated names and/or other languages, configure
  3902. the variables @code{parse-time-months} and @code{parse-time-weekdays}.
  3903. @cindex calendar, for selecting date
  3904. Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
  3905. you don't need/want the calendar, configure the variable
  3906. @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
  3907. prompt, either by clicking on a date in the calendar, or by pressing
  3908. @key{RET}, the date selected in the calendar will be combined with the
  3909. information entered at the prompt. You can control the calendar fully
  3910. from the minibuffer:
  3911. @kindex <
  3912. @kindex >
  3913. @kindex mouse-1
  3914. @kindex S-@key{right}
  3915. @kindex S-@key{left}
  3916. @kindex S-@key{down}
  3917. @kindex S-@key{up}
  3918. @kindex M-S-@key{right}
  3919. @kindex M-S-@key{left}
  3920. @kindex @key{RET}
  3921. @example
  3922. > / < @r{Scroll calendar forward/backward by one month.}
  3923. mouse-1 @r{Select date by clicking on it.}
  3924. S-@key{right}/@key{left} @r{One day forward/backward.}
  3925. S-@key{down}/@key{up} @r{One week forward/backward.}
  3926. M-S-@key{right}/@key{left} @r{One month forward/backward.}
  3927. @key{RET} @r{Choose date in calendar.}
  3928. @end example
  3929. The actions of the date/time prompt may seem complex, but I assure you they
  3930. will grow on you, and you will start getting annoyed by pretty much any other
  3931. way of entering a date/time out there. To help you understand what is going
  3932. on, the current interpretation of your input will be displayed live in the
  3933. minibuffer@footnote{If you find this distracting, turn the display of with
  3934. @code{org-read-date-display-live}.}.
  3935. @node Custom time format, , The date/time prompt, Creating timestamps
  3936. @subsection Custom time format
  3937. @cindex custom date/time format
  3938. @cindex time format, custom
  3939. @cindex date format, custom
  3940. Org mode uses the standard ISO notation for dates and times as it is
  3941. defined in ISO 8601. If you cannot get used to this and require another
  3942. representation of date and time to keep you happy, you can get it by
  3943. customizing the variables @code{org-display-custom-times} and
  3944. @code{org-time-stamp-custom-formats}.
  3945. @table @kbd
  3946. @kindex C-c C-x C-t
  3947. @item C-c C-x C-t
  3948. Toggle the display of custom formats for dates and times.
  3949. @end table
  3950. @noindent
  3951. Org mode needs the default format for scanning, so the custom date/time
  3952. format does not @emph{replace} the default format - instead it is put
  3953. @emph{over} the default format using text properties. This has the
  3954. following consequences:
  3955. @itemize @bullet
  3956. @item
  3957. You cannot place the cursor onto a time stamp anymore, only before or
  3958. after.
  3959. @item
  3960. The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
  3961. each component of a time stamp. If the cursor is at the beginning of
  3962. the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
  3963. just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
  3964. time will be changed by one minute.
  3965. @item
  3966. If the time stamp contains a range of clock times or a repeater, these
  3967. will not be overlayed, but remain in the buffer as they were.
  3968. @item
  3969. When you delete a time stamp character-by-character, it will only
  3970. disappear from the buffer after @emph{all} (invisible) characters
  3971. belonging to the ISO timestamp have been removed.
  3972. @item
  3973. If the custom time stamp format is longer than the default and you are
  3974. using dates in tables, table alignment will be messed up. If the custom
  3975. format is shorter, things do work as expected.
  3976. @end itemize
  3977. @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
  3978. @section Deadlines and scheduling
  3979. A time stamp may be preceded by special keywords to facilitate planning:
  3980. @table @var
  3981. @item DEADLINE
  3982. @cindex DEADLINE keyword
  3983. Meaning: the task (most likely a TODO item, though not necessarily) is supposed
  3984. to be finished on that date.
  3985. On the deadline date, the task will be listed in the agenda. In
  3986. addition, the agenda for @emph{today} will carry a warning about the
  3987. approaching or missed deadline, starting
  3988. @code{org-deadline-warning-days} before the due date, and continuing
  3989. until the entry is marked DONE. An example:
  3990. @example
  3991. *** TODO write article about the Earth for the Guide
  3992. The editor in charge is [[bbdb:Ford Prefect]]
  3993. DEADLINE: <2004-02-29 Sun>
  3994. @end example
  3995. You can specify a different lead time for warnings for a specific
  3996. deadlines using the following syntax. Here is an example with a warning
  3997. period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
  3998. @item SCHEDULED
  3999. @cindex SCHEDULED keyword
  4000. Meaning: you are planning to start working on that task on the given
  4001. date.
  4002. The headline will be listed under the given date@footnote{It will still
  4003. be listed on that date after it has been marked DONE. If you don't like
  4004. this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
  4005. addition, a reminder that the scheduled date has passed will be present
  4006. in the compilation for @emph{today}, until the entry is marked DONE.
  4007. I.e., the task will automatically be forwarded until completed.
  4008. @example
  4009. *** TODO Call Trillian for a date on New Years Eve.
  4010. SCHEDULED: <2004-12-25 Sat>
  4011. @end example
  4012. @noindent
  4013. @b{Important:} Scheduling an item in Org mode should @i{not} be
  4014. understood in the same way that we understand @i{scheduling a meeting}.
  4015. Setting a date for a meeting is just a simple appointment, you should
  4016. mark this entry with a simple plain time stamp, to get this item shown
  4017. on the date where it applies. This is a frequent mis-understanding from
  4018. Org-users. In Org mode, @i{scheduling} means setting a date when you
  4019. want to start working on an action item.
  4020. @end table
  4021. You may use time stamps with repeaters in scheduling and deadline
  4022. entries. Org mode will issue early and late warnings based on the
  4023. assumption that the time stamp represents the @i{nearest instance} of
  4024. the repeater. However, the use of diary sexp entries like
  4025. @c
  4026. @code{<%%(diary-float t 42)>}
  4027. @c
  4028. in scheduling and deadline timestamps is limited. Org mode does not
  4029. know enough about the internals of each sexp function to issue early and
  4030. late warnings. However, it will show the item on each day where the
  4031. sexp entry matches.
  4032. @menu
  4033. * Inserting deadline/schedule:: Planning items
  4034. * Repeated tasks:: Items that show up again and again
  4035. @end menu
  4036. @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
  4037. @subsection Inserting deadlines or schedules
  4038. The following commands allow to quickly insert a deadline or to schedule
  4039. an item:
  4040. @table @kbd
  4041. @c
  4042. @kindex C-c C-d
  4043. @item C-c C-d
  4044. Insert @samp{DEADLINE} keyword along with a stamp. The insertion will
  4045. happen in the line directly following the headline. When called with a
  4046. prefix arg, an existing deadline will be removed from the entry.
  4047. @c FIXME Any CLOSED timestamp will be removed.????????
  4048. @c
  4049. @kindex C-c / d
  4050. @cindex sparse tree, for deadlines
  4051. @item C-c / d
  4052. Create a sparse tree with all deadlines that are either past-due, or
  4053. which will become due within @code{org-deadline-warning-days}.
  4054. With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
  4055. prefix, check that many days. For example, @kbd{C-1 C-c / d} shows
  4056. all deadlines due tomorrow.
  4057. @c
  4058. @kindex C-c C-s
  4059. @item C-c C-s
  4060. Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
  4061. happen in the line directly following the headline. Any CLOSED
  4062. timestamp will be removed. When called with a prefix argument, remove
  4063. the scheduling date from the entry.
  4064. @c
  4065. @kindex C-c C-x C-k
  4066. @kindex k a
  4067. @kindex k s
  4068. @item C-c C-x C-k
  4069. Mark the current entry for agenda action. After you have marked the entry
  4070. like this, you can open the agenda or the calendar to find an appropriate
  4071. date. With the cursor on the selected date, press @kbd{k s} or @kbd{k d} to
  4072. schedule the marked item.
  4073. @end table
  4074. @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
  4075. @subsection Repeated tasks
  4076. Some tasks need to be repeated again and again. Org mode helps to
  4077. organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
  4078. or plain time stamp. In the following example
  4079. @example
  4080. ** TODO Pay the rent
  4081. DEADLINE: <2005-10-01 Sat +1m>
  4082. @end example
  4083. the @code{+1m} is a repeater; the intended interpretation is that the
  4084. task has a deadline on <2005-10-01> and repeats itself every (one) month
  4085. starting from that time. If you need both a repeater and a special
  4086. warning period in a deadline entry, the repeater comes first and the
  4087. warning period last: @code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
  4088. Deadlines and scheduled items produce entries in the agenda when they
  4089. are over-due, so it is important to be able to mark such an entry as
  4090. completed once you have done so. When you mark a DEADLINE or a SCHEDULE
  4091. with the TODO keyword DONE, it will no longer produce entries in the
  4092. agenda. The problem with this is, however, that then also the
  4093. @emph{next} instance of the repeated entry will not be active. Org mode
  4094. deals with this in the following way: When you try to mark such an entry
  4095. DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
  4096. time stamp by the repeater interval, and immediately set the entry state
  4097. back to TODO. In the example above, setting the state to DONE would
  4098. actually switch the date like this:
  4099. @example
  4100. ** TODO Pay the rent
  4101. DEADLINE: <2005-11-01 Tue +1m>
  4102. @end example
  4103. A timestamp@footnote{You can change this using the option
  4104. @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
  4105. @code{lognoterepeat}, and @code{nologrepeat}. With @code{lognoterepeat}, you
  4106. will aslo be prompted for a note.} will be added under the deadline, to keep
  4107. a record that you actually acted on the previous instance of this deadline.
  4108. As a consequence of shifting the base date, this entry will no longer be
  4109. visible in the agenda when checking past dates, but all future instances
  4110. will be visible.
  4111. With the @samp{+1m} cookie, the date shift will always be exactly one
  4112. month. So if you have not payed the rent for three months, marking this
  4113. entry DONE will still keep it as an overdue deadline. Depending on the
  4114. task, this may not be the best way to handle it. For example, if you
  4115. forgot to call you father for 3 weeks, it does not make sense to call
  4116. him 3 times in a single day to make up for it. Finally, there are tasks
  4117. like changing batteries which should always repeat a certain time
  4118. @i{after} the last time you did it. For these tasks, Org mode has
  4119. special repeaters markers with @samp{++} and @samp{.+}. For example:
  4120. @example
  4121. ** TODO Call Father
  4122. DEADLINE: <2008-02-10 Sun ++1w>
  4123. Marking this DONE will shift the date by at least one week,
  4124. but also by as many weeks as it takes to get this date into
  4125. the future. However, it stays on a Sunday, even if you called
  4126. and marked it done on Saturday.
  4127. ** TODO Check the batteries in the smoke detectors
  4128. DEADLINE: <2005-11-01 Tue .+1m>
  4129. Marking this DONE will shift the date to one month after
  4130. today.
  4131. @end example
  4132. You may have both scheduling and deadline information for a specific
  4133. task - just make sure that the repeater intervals on both are the same.
  4134. @node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times
  4135. @section Clocking work time
  4136. Org mode allows you to clock the time you spent on specific tasks in a
  4137. project. When you start working on an item, you can start the clock.
  4138. When you stop working on that task, or when you mark the task done, the
  4139. clock is stopped and the corresponding time interval is recorded. It
  4140. also computes the total time spent on each subtree of a project.
  4141. @table @kbd
  4142. @kindex C-c C-x C-i
  4143. @item C-c C-x C-i
  4144. Start the clock on the current item (clock-in). This inserts the CLOCK
  4145. keyword together with a timestamp. If this is not the first clocking of
  4146. this item, the multiple CLOCK lines will be wrapped into a
  4147. @code{:CLOCK:} drawer (see also the variable
  4148. @code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument,
  4149. select the task from a list of recently clocked tasks. With two @kbd{C-u
  4150. C-u} prefixes, clock into the task at point and mark it as the default task.
  4151. The default task will always be available when selecting a clocking task,
  4152. with letter @kbd{d}.
  4153. @kindex C-c C-x C-o
  4154. @item C-c C-x C-o
  4155. Stop the clock (clock-out). The inserts another timestamp at the same
  4156. location where the clock was last started. It also directly computes
  4157. the resulting time in inserts it after the time range as @samp{=>
  4158. HH:MM}. See the variable @code{org-log-note-clock-out} for the
  4159. possibility to record an additional note together with the clock-out
  4160. time stamp@footnote{The corresponding in-buffer setting is:
  4161. @code{#+STARTUP: lognoteclock-out}}.
  4162. @kindex C-c C-y
  4163. @item C-c C-y
  4164. Recompute the time interval after changing one of the time stamps. This
  4165. is only necessary if you edit the time stamps directly. If you change
  4166. them with @kbd{S-@key{cursor}} keys, the update is automatic.
  4167. @kindex C-c C-t
  4168. @item C-c C-t
  4169. Changing the TODO state of an item to DONE automatically stops the clock
  4170. if it is running in this same item.
  4171. @kindex C-c C-x C-x
  4172. @item C-c C-x C-x
  4173. Cancel the current clock. This is useful if a clock was started by
  4174. mistake, or if you ended up working on something else.
  4175. @kindex C-c C-x C-j
  4176. @item C-c C-x C-j
  4177. Jump to the entry that contains the currently running clock. With a
  4178. @kbd{C-u} prefix arg, select the target task from a list of recently clocked
  4179. tasks.
  4180. @kindex C-c C-x C-d
  4181. @item C-c C-x C-d
  4182. Display time summaries for each subtree in the current buffer. This
  4183. puts overlays at the end of each headline, showing the total time
  4184. recorded under that heading, including the time of any subheadings. You
  4185. can use visibility cycling to study the tree, but the overlays disappear
  4186. when you change the buffer (see variable
  4187. @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
  4188. @kindex C-c C-x C-r
  4189. @item C-c C-x C-r
  4190. Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
  4191. report as an Org mode table into the current file. When the cursor is
  4192. at an existing clock table, just update it. When called with a prefix
  4193. argument, jump to the first clock report in the current document and
  4194. update it.
  4195. @cindex #+BEGIN: clocktable
  4196. @example
  4197. #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
  4198. #+END: clocktable
  4199. @end example
  4200. @noindent
  4201. If such a block already exists at point, its content is replaced by the
  4202. new table. The @samp{BEGIN} line can specify options:
  4203. @example
  4204. :maxlevel @r{Maximum level depth to which times are listed in the table.}
  4205. :emphasize @r{When @code{t}, emphasize level one and level two items}
  4206. :scope @r{The scope to consider. This can be any of the following:}
  4207. nil @r{the current buffer or narrowed region}
  4208. file @r{the full current buffer}
  4209. subtree @r{the subtree where the clocktable is located}
  4210. treeN @r{the surrounding level N tree, for example @code{tree3}}
  4211. tree @r{the surrounding level 1 tree}
  4212. agenda @r{all agenda files}
  4213. ("file"..) @r{scan these files}
  4214. file-with-archives @r{current file and its archives}
  4215. agenda-with-archives @r{all agenda files, including archives}
  4216. :block @r{The time block to consider. This block is specified either}
  4217. @r{absolute, or relative to the current time and may be any of}
  4218. @r{these formats:}
  4219. 2007-12-31 @r{New year eve 2007}
  4220. 2007-12 @r{December 2007}
  4221. 2007-W50 @r{ISO-week 50 in 2007}
  4222. 2007 @r{the year 2007}
  4223. today, yesterday, today-N @r{a relative day}
  4224. thisweek, lastweek, thisweek-N @r{a relative week}
  4225. thismonth, lastmonth, thismonth-N @r{a relative month}
  4226. thisyear, lastyear, thisyear-N @r{a relative year}
  4227. @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
  4228. :tstart @r{A time string specifying when to start considering times}
  4229. :tend @r{A time string specifying when to stop considering times}
  4230. :step @r{@code{week} or @code{day}, to split the table into chunks.}
  4231. @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
  4232. :link @r{Link the item headlines in the table to their origins}
  4233. :formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
  4234. @r{As a special case, @samp{:formula %} adds column with % time.}
  4235. @r{If you do not specify a formula here, any existing formula}
  4236. @r{below the clock table will survive updates and be evaluated.}
  4237. @end example
  4238. So to get a clock summary of the current level 1 tree, for the current
  4239. day, you could write
  4240. @example
  4241. #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
  4242. #+END: clocktable
  4243. @end example
  4244. and to use a specific time range you could write@footnote{Note that all
  4245. parameters must be specified in a single line - the line is broken here
  4246. only to fit it onto the manual.}
  4247. @example
  4248. #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
  4249. :tend "<2006-08-10 Thu 12:00>"
  4250. #+END: clocktable
  4251. @end example
  4252. A summary of the current subtree with % times would be
  4253. @example
  4254. #+BEGIN: clocktable :scope subtree :link t :formula %
  4255. #+END: clocktable
  4256. @end example
  4257. @kindex C-c C-c
  4258. @item C-c C-c
  4259. @kindex C-c C-x C-u
  4260. @itemx C-c C-x C-u
  4261. Update dynamical block at point. The cursor needs to be in the
  4262. @code{#+BEGIN} line of the dynamic block.
  4263. @kindex C-u C-c C-x C-u
  4264. @item C-u C-c C-x C-u
  4265. Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
  4266. you have several clock table blocks in a buffer.
  4267. @kindex S-@key{left}
  4268. @kindex S-@key{right}
  4269. @item S-@key{left}
  4270. @itemx S-@key{right}
  4271. Shift the current @code{:block} interval and update the table. The cursor
  4272. needs to be in the @code{#+BEGIN: clocktable} line for this command. If
  4273. @code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
  4274. @end table
  4275. The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
  4276. the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
  4277. worked on or closed during a day.
  4278. @node Effort estimates, Relative timer, Clocking work time, Dates and Times
  4279. @section Effort estimates
  4280. @cindex effort estimates
  4281. If you want to plan your work in a very detailed way, or if you need to
  4282. produce offers with quotations of the estimated work effort, you may want to
  4283. assign effort estimates to entries. If you are also clocking your work, you
  4284. may later want to compare the planned effort with the actual working time, a
  4285. great way to improve planning estimates. Effort estimates are stored in a
  4286. special property @samp{Effort}@footnote{You may change the property being
  4287. used with the variable @code{org-effort-property}.}. Clearly the best way to
  4288. work with effort estimates is through column view (@pxref{Column view}). You
  4289. should start by setting up discrete values for effort estimates, and a
  4290. @code{COLUMNS} format that displays these values together with clock sums (if
  4291. you want to clock your time). For a specific buffer you can use
  4292. @example
  4293. #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
  4294. #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
  4295. @end example
  4296. @noindent
  4297. or, even better, you can set up these values globally by customizing the
  4298. variables @code{org-global-properties} and @code{org-columns-default-format}.
  4299. In particular if you want to use this setup also in the agenda, a global
  4300. setup may be advised.
  4301. The way to assign estimates to individual items is then to switch to column
  4302. mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
  4303. value. The values you enter will immediately be summed up in the hierarchy.
  4304. In the column next to it, any clocked time will be displayed.
  4305. If you switch to column view in the daily/weekly agenda, the effort column
  4306. will summarize the estimated work effort for each day@footnote{Please note
  4307. the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
  4308. column view}).}, and you can use this to find space in your schedule. To get
  4309. an overview of the entire part of the day that is committed, you can set the
  4310. option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
  4311. appointments on a day that take place over a specified time interval will
  4312. then also be added to the load estimate of the day.
  4313. Effort estimates can be used in secondary agenda filtering that is triggered
  4314. with the @kbd{/} key in the agenda (@pxref{Agenda commands}). If you have
  4315. these estimates defined consistently, two or three key presses will narrow
  4316. down the list to stuff that fits into an available time slot.
  4317. @node Relative timer, , Effort estimates, Dates and Times
  4318. @section Taking notes with a relative timer
  4319. @cindex relative timer
  4320. When taking notes during, for example, a meeting or a video viewing, it can
  4321. be useful to have access to times relative to a starting time. Org provides
  4322. such a relative timer and make it easy to create timed notes.
  4323. @table @kbd
  4324. @kindex C-c C-x .
  4325. @item C-c C-x .
  4326. Insert a relative time into the buffer. The first time you use this, the
  4327. timer will be started. When called with a prefix argument, the timer is
  4328. restarted.
  4329. @kindex C-c C-x -
  4330. @item C-c C-x -
  4331. Insert a description list item with the current relative time. With a prefix
  4332. argument, first reset the timer to 0.
  4333. @kindex M-@key{RET}
  4334. @item M-@key{RET}
  4335. One the timer list is started, you can also use @kbd{M-@key{RET}} to insert
  4336. new timer items.
  4337. @kindex C-c C-x 0
  4338. @item C-c C-x 0
  4339. Reset the timer without inserting anything into the buffer. By default, the
  4340. timer is reset to 0. When called with a @kbd{C-u} prefix, reset the timer to
  4341. specific starting offset. The user is prompted for the offset, with a
  4342. default taken from a timer string at point, if any, So this can be used to
  4343. restart taking notes after a break in the process. When called with a double
  4344. prefix argument @kbd{C-c C-u}, change all timer strings in the active region
  4345. by a certain amount. This can be used to fix timer strings if the timer was
  4346. not started at exactly the right moment.
  4347. @end table
  4348. @node Capture, Agenda Views, Dates and Times, Top
  4349. @chapter Capture
  4350. @cindex capture
  4351. An important part of any organization system is the ability to quickly
  4352. capture new ideas and tasks, and to associate reference material with them.
  4353. Org uses the @file{remember} package to create tasks, and stores files
  4354. related to a task (@i{attachments}) in a special directory.
  4355. @menu
  4356. * Remember:: Capture new tasks/ideas with little interruption
  4357. * Attachments:: Add files to tasks.
  4358. @end menu
  4359. @node Remember, Attachments, Capture, Capture
  4360. @section Remember
  4361. @cindex @file{remember.el}
  4362. The @i{Remember} package by John Wiegley lets you store quick notes with
  4363. little interruption of your work flow. See
  4364. @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
  4365. information. It is an excellent way to add new notes and tasks to
  4366. Org files. Org significantly expands the possibilities of
  4367. @i{remember}: You may define templates for different note types, and
  4368. associate target files and headlines with specific templates. It also
  4369. allows you to select the location where a note should be stored
  4370. interactively, on the fly.
  4371. @menu
  4372. * Setting up Remember:: Some code for .emacs to get things going
  4373. * Remember templates:: Define the outline of different note types
  4374. * Storing notes:: Directly get the note to where it belongs
  4375. * Refiling notes:: Moving a note or task to a project
  4376. @end menu
  4377. @node Setting up Remember, Remember templates, Remember, Remember
  4378. @subsection Setting up Remember
  4379. The following customization will tell @i{remember} to use org files as
  4380. target, and to create annotations compatible with Org links.
  4381. @example
  4382. (org-remember-insinuate)
  4383. (setq org-directory "~/path/to/my/orgfiles/")
  4384. (setq org-default-notes-file (concat org-directory "/notes.org"))
  4385. (define-key global-map "\C-cr" 'org-remember)
  4386. @end example
  4387. The last line binds the command @code{org-remember} to a global
  4388. key@footnote{Please select your own key, @kbd{C-c r} is only a
  4389. suggestion.}. @code{org-remember} basically just calls @code{remember},
  4390. but it makes a few things easier: If there is an active region, it will
  4391. automatically copy the region into the remember buffer. It also allows
  4392. to jump to the buffer and location where remember notes are being
  4393. stored: Just call @code{org-remember} with a prefix argument. If you
  4394. use two prefix arguments, Org jumps to the location where the last
  4395. remember note was stored.
  4396. The remember buffer will actually use @code{org-mode} as its major mode, so
  4397. that all editing features of Org-mode are available. In addition to this, a
  4398. minor mode @code{org-remember-mode} is turned on, for the single purpose that
  4399. you can use its keymap @code{org-remember-mode-map} to overwrite some of
  4400. Org-mode's key bindings.
  4401. You can also call @code{org-remember} in a special way from the agenda,
  4402. using the @kbd{k r} key combination. With this access, any time stamps
  4403. inserted by the selected remember template (see below) will default to
  4404. the cursor date in the agenda, rather than to the current date.
  4405. @node Remember templates, Storing notes, Setting up Remember, Remember
  4406. @subsection Remember templates
  4407. @cindex templates, for remember
  4408. In combination with Org, you can use templates to generate
  4409. different types of @i{remember} notes. For example, if you would like
  4410. to use one template to create general TODO entries, another one for
  4411. journal entries, and a third one for collecting random ideas, you could
  4412. use:
  4413. @example
  4414. (setq org-remember-templates
  4415. '(("Todo" ?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
  4416. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
  4417. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  4418. @end example
  4419. @noindent In these entries, the first string is just a name, and the
  4420. character specifies how to select the template. It is useful if the
  4421. character is also the first letter of the name. The next string specifies
  4422. the template. Two more (optional) strings give the file in which, and the
  4423. headline under which the new note should be stored. The file (if not present
  4424. or @code{nil}) defaults to @code{org-default-notes-file}, the heading to
  4425. @code{org-remember-default-headline}. If the file name is not an absolute
  4426. path, it will be interpreted relative to @code{org-directory}. The heading
  4427. can also be the symbols @code{top} or @code{bottom} to send note as level 1
  4428. entries to the beginning or end of the file, respectively.
  4429. An optional sixth element specifies the contexts in which the user can select
  4430. the template. This element can be a list of major modes or a function.
  4431. @code{org-remember} will first check whether the function returns @code{t} or
  4432. if we are in any of the listed major mode, and exclude templates fo which
  4433. this condition is not fulfilled. Templates that do not specify this element
  4434. at all, or that use @code{nil} or @code{t} as a value will always be
  4435. selectable.
  4436. So for example:
  4437. @example
  4438. (setq org-remember-templates
  4439. '(("Bug" ?b "* BUG %?\n %i\n %a" "~/org/BUGS.org" "Bugs" (emacs-lisp-mode))
  4440. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org" "X" my-check)
  4441. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  4442. @end example
  4443. The first template will only be available when invoking @code{org-remember}
  4444. from an buffer in @code{emacs-lisp-mode}. The second template will only be
  4445. available when the function @code{my-check} returns @code{t}. The third
  4446. template will be proposed in any context.
  4447. When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
  4448. something, Org will prompt for a key to select the template (if you have
  4449. more than one template) and then prepare the buffer like
  4450. @example
  4451. * TODO
  4452. [[file:link to where you called remember]]
  4453. @end example
  4454. @noindent
  4455. During expansion of the template, special @kbd{%}-escapes allow dynamic
  4456. insertion of content:
  4457. @example
  4458. %^@{prompt@} @r{prompt the user for a string and replace this sequence with it.}
  4459. @r{You may specify a default value and a completion table with}
  4460. @r{%^@{prompt|default|completion2|completion3...@}}
  4461. @r{The arrow keys access a prompt-specific history.}
  4462. %a @r{annotation, normally the link created with @code{org-store-link}}
  4463. %A @r{like @code{%a}, but prompt for the description part}
  4464. %i @r{initial content, the region when remember is called with C-u.}
  4465. @r{The entire text will be indented like @code{%i} itself.}
  4466. %t @r{time stamp, date only}
  4467. %T @r{time stamp with date and time}
  4468. %u, %U @r{like the above, but inactive time stamps}
  4469. %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
  4470. @r{You may define a prompt like @code{%^@{Birthday@}t}}
  4471. %n @r{user name (taken from @code{user-full-name})}
  4472. %c @r{Current kill ring head.}
  4473. %x @r{Content of the X clipboard.}
  4474. %^C @r{Interactive selection of which kill or clip to use.}
  4475. %^L @r{Like @code{%^C}, but insert as link.}
  4476. %^g @r{prompt for tags, with completion on tags in target file.}
  4477. %k @r{title of currently clocked task}
  4478. %K @r{link to currently clocked task}
  4479. %^G @r{prompt for tags, with completion all tags in all agenda files.}
  4480. %^@{prop@}p @r{Prompt the user for a value for property @code{prop}}
  4481. %:keyword @r{specific information for certain link types, see below}
  4482. %[pathname] @r{insert the contents of the file given by @code{pathname}}
  4483. %(sexp) @r{evaluate elisp @code{(sexp)} and replace with the result}
  4484. %! @r{immediately store note after completing the template}
  4485. @r{(skipping the @kbd{C-c C-c} that normally triggers storing)}
  4486. %& @r{jump to target location immediately after storing note}
  4487. @end example
  4488. @noindent
  4489. For specific link types, the following keywords will be
  4490. defined@footnote{If you define your own link types (@pxref{Adding
  4491. hyperlink types}), any property you store with
  4492. @code{org-store-link-props} can be accessed in remember templates in a
  4493. similar way.}:
  4494. @example
  4495. Link type | Available keywords
  4496. -------------------+----------------------------------------------
  4497. bbdb | %:name %:company
  4498. bbdb | %::server %:port %:nick
  4499. vm, wl, mh, rmail | %:type %:subject %:message-id
  4500. | %:from %:fromname %:fromaddress
  4501. | %:to %:toname %:toaddress
  4502. | %: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}.}}
  4503. gnus | %:group, @r{for messages also all email fields}
  4504. w3, w3m | %:url
  4505. info | %:file %:node
  4506. calendar | %:date"
  4507. @end example
  4508. @noindent
  4509. To place the cursor after template expansion use:
  4510. @example
  4511. %? @r{After completing the template, position cursor here.}
  4512. @end example
  4513. @noindent
  4514. If you change your mind about which template to use, call
  4515. @code{org-remember} in the remember buffer. You may then select a new
  4516. template that will be filled with the previous context information.
  4517. @node Storing notes, Refiling notes, Remember templates, Remember
  4518. @subsection Storing notes
  4519. When you are finished preparing a note with @i{remember}, you have to press
  4520. @kbd{C-c C-c} to file the note away. If you have started the clock in the
  4521. remember buffer, you will first be asked if you want to clock out
  4522. now@footnote{To avoid this query, configure the variable
  4523. @code{org-remember-clock-out-on-exit}.}. If you answer @kbd{n}, the clock
  4524. will continue to run after the note was filed away.
  4525. The handler will then store the note in the file and under the headline
  4526. specified in the template, or it will use the default file and headlines.
  4527. The window configuration will be restored, sending you back to the working
  4528. context before the call to @code{remember}. To re-use the location found
  4529. during the last call to @code{remember}, exit the remember buffer with
  4530. @kbd{C-0 C-c C-c}, i.e. specify a zero prefix argument to @kbd{C-c C-c}.
  4531. Another special case is @kbd{C-2 C-c C-c} which files the note as a child of
  4532. the currently clocked item.
  4533. If you want to store the note directly to a different place, use
  4534. @kbd{C-1 C-c C-c} instead to exit remember@footnote{Configure the
  4535. variable @code{org-remember-store-without-prompt} to make this behavior
  4536. the default.}. The handler will then first prompt for a target file -
  4537. if you press @key{RET}, the value specified for the template is used.
  4538. Then the command offers the headings tree of the selected file, with the
  4539. cursor position at the default headline (if you had specified one in the
  4540. template). You can either immediately press @key{RET} to get the note
  4541. placed there. Or you can use the following keys to find a different
  4542. location:
  4543. @example
  4544. @key{TAB} @r{Cycle visibility.}
  4545. @key{down} / @key{up} @r{Next/previous visible headline.}
  4546. n / p @r{Next/previous visible headline.}
  4547. f / b @r{Next/previous headline same level.}
  4548. u @r{One level up.}
  4549. @c 0-9 @r{Digit argument.}
  4550. @end example
  4551. @noindent
  4552. Pressing @key{RET} or @key{left} or @key{right}
  4553. then leads to the following result.
  4554. @multitable @columnfractions 0.2 0.15 0.65
  4555. @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
  4556. @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
  4557. @item @tab @tab depending on @code{org-reverse-note-order}.
  4558. @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
  4559. @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
  4560. @item @tab @tab depending on @code{org-reverse-note-order}.
  4561. @item not on headline @tab @key{RET}
  4562. @tab at cursor position, level taken from context.
  4563. @end multitable
  4564. Before inserting the text into a tree, the function ensures that the text has
  4565. a headline, i.e. a first line that starts with a @samp{*}. If not, a
  4566. headline is constructed from the current date. If you have indented the text
  4567. of the note below the headline, the indentation will be adapted if inserting
  4568. the note into the tree requires demotion from level 1.
  4569. @node Refiling notes, , Storing notes, Remember
  4570. @subsection Refiling notes
  4571. @cindex refiling notes
  4572. Remember is usually used to quickly capture notes and tasks into one or
  4573. a few capture lists. When reviewing the captured data, you may want to
  4574. refile some of the entries into a different list, for example into a
  4575. project. Cutting, finding the right location and then pasting the note
  4576. is cumbersome. To simplify this process, you can use the following
  4577. special command:
  4578. @table @kbd
  4579. @kindex C-c C-w
  4580. @item C-c C-w
  4581. Refile the entry or region at point. This command offers possible locations
  4582. for refiling the entry and lets you select one with completion. The item (or
  4583. all items in the region) is filed below the target heading as a subitem.
  4584. Depending on @code{org-reverse-note-order}, it will be either the first or
  4585. last subitem.@*
  4586. By default, all level 1 headlines in the current buffer are considered to be
  4587. targets, but you can have more complex definitions across a number of files.
  4588. See the variable @code{org-refile-targets} for details. If you would like to
  4589. select a location via a file-path-like completion along the outline path, see
  4590. the variables @code{org-refile-use-outline-path} and
  4591. @code{org-outline-path-complete-in-steps}.
  4592. @kindex C-u C-c C-w
  4593. @item C-u C-c C-w
  4594. Use the refile interface to jump to a heading.
  4595. @kindex C-u C-u C-c C-w
  4596. @item C-u C-u C-c C-w
  4597. Jump to the location where @code{org-refile} last moved a tree to.
  4598. @end table
  4599. @node Attachments, , Remember, Capture
  4600. @section Attachments
  4601. @cindex attachments
  4602. It is often useful to associate reference material with an outline node/task.
  4603. Small chunks of plain text can simply be stored in the subtree of a project.
  4604. Hyperlinks (@pxref{Hyperlinks}) can be used to establish associations with
  4605. files that live elsewhere on your computer or in the cloud, like emails or
  4606. source code files belonging to a project. Another method is @i{attachments},
  4607. which are files located in a directory belonging to an outline node. Org
  4608. uses directories named by the unique ID of each entry. These directories are
  4609. located in the @file{data} directory which lives in the same directory where
  4610. your org-file lives@footnote{If you move entries or Org-files from one
  4611. directory to the next, you may want to configure @code{org-attach-directory}
  4612. to contain an absolute path.}. If you initialize this directory with
  4613. @code{git-init}, Org will automatically commit changes when it sees them.
  4614. The attachment system has been contributed to Org by John Wiegley.
  4615. @noindent The following commands deal with attachments.
  4616. @table @kbd
  4617. @kindex C-c C-a
  4618. @item C-c C-a
  4619. The dispatcher for commands related to the attachment system. After these
  4620. keys, a list of commands is displayed and you need to press an additional key
  4621. to select a command:
  4622. @table @kbd
  4623. @kindex C-c C-a a
  4624. @item a
  4625. Select a file and move it into the task's attachment directory. The file
  4626. will be copied, moved, or linked, depending on @code{org-attach-method}.
  4627. Note that hard links are not supported on all systems.
  4628. @kindex C-c C-a c
  4629. @kindex C-c C-a m
  4630. @kindex C-c C-a l
  4631. @item c/m/l
  4632. Attach a file using the copy/move/link method.
  4633. Note that hard links are not supported on all systems.
  4634. @kindex C-c C-a n
  4635. @item n
  4636. Create a new attachment as an Emacs buffer.
  4637. @kindex C-c C-a z
  4638. @item z
  4639. Synchronize the current task with its attachment directory, in case you added
  4640. attachments yourself.
  4641. @kindex C-c C-a o
  4642. @item o
  4643. Open current task's attachment. If there are more than one, prompt for a
  4644. file name first. Opening will follow the rules set by @code{org-file-apps}.
  4645. For more details, see the information on following hyperlings
  4646. (@pxref{Handling links}).
  4647. @kindex C-c C-a O
  4648. @item O
  4649. Also open the attachment, but force opening the file in Emacs.
  4650. @kindex C-c C-a f
  4651. @item f
  4652. Open the current task's attachment directory.
  4653. @kindex C-c C-a F
  4654. @item F
  4655. Also open the directory, but force using @code{dired} in Emacs.
  4656. @kindex C-c C-a d
  4657. @item d
  4658. Select and delete a single attachment.
  4659. @kindex C-c C-a D
  4660. @item D
  4661. Delete all of a task's attachments. A safer way is to open the directory in
  4662. dired and delete from there.
  4663. @end table
  4664. @end table
  4665. @node Agenda Views, Embedded LaTeX, Capture, Top
  4666. @chapter Agenda Views
  4667. @cindex agenda views
  4668. Due to the way Org works, TODO items, time-stamped items, and
  4669. tagged headlines can be scattered throughout a file or even a number of
  4670. files. To get an overview of open action items, or of events that are
  4671. important for a particular date, this information must be collected,
  4672. sorted and displayed in an organized way.
  4673. Org can select items based on various criteria, and display them
  4674. in a separate buffer. Seven different view types are provided:
  4675. @itemize @bullet
  4676. @item
  4677. an @emph{agenda} that is like a calendar and shows information
  4678. for specific dates,
  4679. @item
  4680. a @emph{TODO list} that covers all unfinished
  4681. action items,
  4682. @item
  4683. a @emph{match view}, showings headlines based on the tags, properties and
  4684. TODO state associated with them,
  4685. @item
  4686. a @emph{timeline view} that shows all events in a single Org file,
  4687. in time-sorted view,
  4688. @item
  4689. a @emph{keyword search view} that shows all entries from multiple files
  4690. that contain specified keywords.
  4691. @item
  4692. a @emph{stuck projects view} showing projects that currently don't move
  4693. along, and
  4694. @item
  4695. @emph{custom views} that are special tag/keyword searches and
  4696. combinations of different views.
  4697. @end itemize
  4698. @noindent
  4699. The extracted information is displayed in a special @emph{agenda
  4700. buffer}. This buffer is read-only, but provides commands to visit the
  4701. corresponding locations in the original Org files, and even to
  4702. edit these files remotely.
  4703. Two variables control how the agenda buffer is displayed and whether the
  4704. window configuration is restored when the agenda exits:
  4705. @code{org-agenda-window-setup} and
  4706. @code{org-agenda-restore-windows-after-quit}.
  4707. @menu
  4708. * Agenda files:: Files being searched for agenda information
  4709. * Agenda dispatcher:: Keyboard access to agenda views
  4710. * Built-in agenda views:: What is available out of the box?
  4711. * Presentation and sorting:: How agenda items are prepared for display
  4712. * Agenda commands:: Remote editing of Org trees
  4713. * Custom agenda views:: Defining special searches and views
  4714. * Agenda column view:: Using column view for collected entries
  4715. @end menu
  4716. @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
  4717. @section Agenda files
  4718. @cindex agenda files
  4719. @cindex files for agenda
  4720. The information to be shown is normally collected from all @emph{agenda
  4721. files}, the files listed in the variable
  4722. @code{org-agenda-files}@footnote{If the value of that variable is not a
  4723. list, but a single file name, then the list of agenda files will be
  4724. maintained in that external file.}. If a directory is part of this list,
  4725. all files with the extension @file{.org} in this directory will be part
  4726. of the list.
  4727. Thus even if you only work with a single Org file, this file should
  4728. be put into that list@footnote{When using the dispatcher, pressing
  4729. @kbd{<} before selecting a command will actually limit the command to
  4730. the current file, and ignore @code{org-agenda-files} until the next
  4731. dispatcher command.}. You can customize @code{org-agenda-files}, but
  4732. the easiest way to maintain it is through the following commands
  4733. @cindex files, adding to agenda list
  4734. @table @kbd
  4735. @kindex C-c [
  4736. @item C-c [
  4737. Add current file to the list of agenda files. The file is added to
  4738. the front of the list. If it was already in the list, it is moved to
  4739. the front. With a prefix argument, file is added/moved to the end.
  4740. @kindex C-c ]
  4741. @item C-c ]
  4742. Remove current file from the list of agenda files.
  4743. @kindex C-,
  4744. @kindex C-'
  4745. @item C-,
  4746. @itemx C-'
  4747. Cycle through agenda file list, visiting one file after the other.
  4748. @kindex M-x org-iswitchb
  4749. @item M-x org-iswitchb
  4750. Command to use an @code{iswitchb}-like interface to switch to and between Org
  4751. buffers.
  4752. @end table
  4753. @noindent
  4754. The Org menu contains the current list of files and can be used
  4755. to visit any of them.
  4756. If you would like to focus the agenda temporarily onto a file not in
  4757. this list, or onto just one file in the list or even only a subtree in a
  4758. file, this can be done in different ways. For a single agenda command,
  4759. you may press @kbd{<} once or several times in the dispatcher
  4760. (@pxref{Agenda dispatcher}). To restrict the agenda scope for an
  4761. extended period, use the following commands:
  4762. @table @kbd
  4763. @kindex C-c C-x <
  4764. @item C-c C-x <
  4765. Permanently restrict the agenda to the current subtree. When with a
  4766. prefix argument, or with the cursor before the first headline in a file,
  4767. the agenda scope is set to the entire file. This restriction remains in
  4768. effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
  4769. or @kbd{>} in the agenda dispatcher. If there is a window displaying an
  4770. agenda view, the new restriction takes effect immediately.
  4771. @kindex C-c C-x >
  4772. @item C-c C-x >
  4773. Remove the permanent restriction created by @kbd{C-c C-x <}.
  4774. @end table
  4775. @noindent
  4776. When working with @file{Speedbar}, you can use the following commands in
  4777. the Speedbar frame:
  4778. @table @kbd
  4779. @kindex <
  4780. @item < @r{in the speedbar frame}
  4781. Permanently restrict the agenda to the item at the cursor in the
  4782. Speedbar frame, either an Org file or a subtree in such a file.
  4783. If there is a window displaying an agenda view, the new restriction takes
  4784. effect immediately.
  4785. @kindex >
  4786. @item > @r{in the speedbar frame}
  4787. Lift the restriction again.
  4788. @end table
  4789. @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
  4790. @section The agenda dispatcher
  4791. @cindex agenda dispatcher
  4792. @cindex dispatching agenda commands
  4793. The views are created through a dispatcher that should be bound to a
  4794. global key, for example @kbd{C-c a} (@pxref{Installation}). In the
  4795. following we will assume that @kbd{C-c a} is indeed how the dispatcher
  4796. is accessed and list keyboard access to commands accordingly. After
  4797. pressing @kbd{C-c a}, an additional letter is required to execute a
  4798. command. The dispatcher offers the following default commands:
  4799. @table @kbd
  4800. @item a
  4801. Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
  4802. @item t @r{/} T
  4803. Create a list of all TODO items (@pxref{Global TODO list}).
  4804. @item m @r{/} M
  4805. Create a list of headlines matching a TAGS expression (@pxref{Matching
  4806. tags and properties}).
  4807. @item L
  4808. Create the timeline view for the current buffer (@pxref{Timeline}).
  4809. @item s
  4810. Create a list of entries selected by a boolean expression of keywords
  4811. and/or regular expressions that must or must not occur in the entry.
  4812. @item /
  4813. Search for a regular expression in all agenda files and additionally in
  4814. the files listed in @code{org-agenda-multi-occur-extra-files}. This
  4815. uses the Emacs command @code{multi-occur}. A prefix argument can be
  4816. used to specify the number of context lines for each match, default is
  4817. 1.
  4818. @item # @r{/} !
  4819. Create a list of stuck projects (@pxref{Stuck projects}).
  4820. @item <
  4821. Restrict an agenda command to the current buffer@footnote{For backward
  4822. compatibility, you can also press @kbd{1} to restrict to the current
  4823. buffer.}. After pressing @kbd{<}, you still need to press the character
  4824. selecting the command.
  4825. @item < <
  4826. If there is an active region, restrict the following agenda command to
  4827. the region. Otherwise, restrict it to the current subtree@footnote{For
  4828. backward compatibility, you can also press @kbd{0} to restrict to the
  4829. current buffer.}. After pressing @kbd{< <}, you still need to press the
  4830. character selecting the command.
  4831. @end table
  4832. You can also define custom commands that will be accessible through the
  4833. dispatcher, just like the default commands. This includes the
  4834. possibility to create extended agenda buffers that contain several
  4835. blocks together, for example the weekly agenda, the global TODO list and
  4836. a number of special tags matches. @xref{Custom agenda views}.
  4837. @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
  4838. @section The built-in agenda views
  4839. In this section we describe the built-in views.
  4840. @menu
  4841. * Weekly/daily agenda:: The calendar page with current tasks
  4842. * Global TODO list:: All unfinished action items
  4843. * Matching tags and properties:: Structured information with fine-tuned search
  4844. * Timeline:: Time-sorted view for single file
  4845. * Keyword search:: Finding entries by keyword
  4846. * Stuck projects:: Find projects you need to review
  4847. @end menu
  4848. @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
  4849. @subsection The weekly/daily agenda
  4850. @cindex agenda
  4851. @cindex weekly agenda
  4852. @cindex daily agenda
  4853. The purpose of the weekly/daily @emph{agenda} is to act like a page of a
  4854. paper agenda, showing all the tasks for the current week or day.
  4855. @table @kbd
  4856. @cindex org-agenda, command
  4857. @kindex C-c a a
  4858. @item C-c a a
  4859. Compile an agenda for the current week from a list of org files. The agenda
  4860. shows the entries for each day. With a numeric prefix@footnote{For backward
  4861. compatibility, the universal prefix @kbd{C-u} causes all TODO entries to be
  4862. listed before the agenda. This feature is deprecated, use the dedicated TODO
  4863. list, or a block agenda instead (@pxref{Block agenda}).} (like @kbd{C-u 2 1
  4864. C-c a a}) you may set the number of days to be displayed (see also the
  4865. variable @code{org-agenda-ndays})
  4866. @end table
  4867. Remote editing from the agenda buffer means, for example, that you can
  4868. change the dates of deadlines and appointments from the agenda buffer.
  4869. The commands available in the Agenda buffer are listed in @ref{Agenda
  4870. commands}.
  4871. @subsubheading Calendar/Diary integration
  4872. @cindex calendar integration
  4873. @cindex diary integration
  4874. Emacs contains the calendar and diary by Edward M. Reingold. The
  4875. calendar displays a three-month calendar with holidays from different
  4876. countries and cultures. The diary allows you to keep track of
  4877. anniversaries, lunar phases, sunrise/set, recurrent appointments
  4878. (weekly, monthly) and more. In this way, it is quite complementary to
  4879. Org. It can be very useful to combine output from Org with
  4880. the diary.
  4881. In order to include entries from the Emacs diary into Org mode's
  4882. agenda, you only need to customize the variable
  4883. @lisp
  4884. (setq org-agenda-include-diary t)
  4885. @end lisp
  4886. @noindent After that, everything will happen automatically. All diary
  4887. entries including holidays, anniversaries etc will be included in the
  4888. agenda buffer created by Org mode. @key{SPC}, @key{TAB}, and
  4889. @key{RET} can be used from the agenda buffer to jump to the diary
  4890. file in order to edit existing diary entries. The @kbd{i} command to
  4891. insert new entries for the current date works in the agenda buffer, as
  4892. well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
  4893. Sunrise/Sunset times, show lunar phases and to convert to other
  4894. calendars, respectively. @kbd{c} can be used to switch back and forth
  4895. between calendar and agenda.
  4896. If you are using the diary only for sexp entries and holidays, it is
  4897. faster to not use the above setting, but instead to copy or even move
  4898. the entries into an Org file. Org mode evaluates diary-style sexp
  4899. entries, and does it faster because there is no overhead for first
  4900. creating the diary display. Note that the sexp entries must start at
  4901. the left margin, no white space is allowed before them. For example,
  4902. the following segment of an Org file will be processed and entries
  4903. will be made in the agenda:
  4904. @example
  4905. * Birthdays and similar stuff
  4906. #+CATEGORY: Holiday
  4907. %%(org-calendar-holiday) ; special function for holiday names
  4908. #+CATEGORY: Ann
  4909. %%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
  4910. %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
  4911. @end example
  4912. @subsubheading Appointment reminders
  4913. @cindex @file{appt.el}
  4914. @cindex appointment reminders
  4915. Org can interact with Emacs appointments notification facility.
  4916. To add all the appointments of your agenda files, use the command
  4917. @code{org-agenda-to-appt}. This commands also lets you filter through
  4918. the list of your appointments and add only those belonging to a specific
  4919. category or matching a regular expression. See the docstring for
  4920. details.
  4921. @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
  4922. @subsection The global TODO list
  4923. @cindex global TODO list
  4924. @cindex TODO list, global
  4925. The global TODO list contains all unfinished TODO items, formatted and
  4926. collected into a single place.
  4927. @table @kbd
  4928. @kindex C-c a t
  4929. @item C-c a t
  4930. Show the global TODO list. This collects the TODO items from all
  4931. agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
  4932. @code{agenda-mode}, so there are commands to examine and manipulate
  4933. the TODO entries directly from that buffer (@pxref{Agenda commands}).
  4934. @kindex C-c a T
  4935. @item C-c a T
  4936. @cindex TODO keyword matching
  4937. Like the above, but allows selection of a specific TODO keyword. You
  4938. can also do this by specifying a prefix argument to @kbd{C-c a t}. With
  4939. a @kbd{C-u} prefix you are prompted for a keyword, and you may also
  4940. specify several keywords by separating them with @samp{|} as boolean OR
  4941. operator. With a numeric prefix, the Nth keyword in
  4942. @code{org-todo-keywords} is selected.
  4943. @kindex r
  4944. The @kbd{r} key in the agenda buffer regenerates it, and you can give
  4945. a prefix argument to this command to change the selected TODO keyword,
  4946. for example @kbd{3 r}. If you often need a search for a specific
  4947. keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
  4948. Matching specific TODO keywords can also be done as part of a tags
  4949. search (@pxref{Tag searches}).
  4950. @end table
  4951. Remote editing of TODO items means that you can change the state of a
  4952. TODO entry with a single key press. The commands available in the
  4953. TODO list are described in @ref{Agenda commands}.
  4954. @cindex sublevels, inclusion into TODO list
  4955. Normally the global TODO list simply shows all headlines with TODO
  4956. keywords. This list can become very long. There are two ways to keep
  4957. it more compact:
  4958. @itemize @minus
  4959. @item
  4960. Some people view a TODO item that has been @emph{scheduled} for
  4961. execution (@pxref{Timestamps}) as no longer @emph{open}. Configure the
  4962. variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
  4963. items from the global TODO list.
  4964. @item
  4965. TODO items may have sublevels to break up the task into subtasks. In
  4966. such cases it may be enough to list only the highest level TODO headline
  4967. and omit the sublevels from the global list. Configure the variable
  4968. @code{org-agenda-todo-list-sublevels} to get this behavior.
  4969. @end itemize
  4970. @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
  4971. @subsection Matching tags and properties
  4972. @cindex matching, of tags
  4973. @cindex matching, of properties
  4974. @cindex tags view
  4975. @cindex match view
  4976. If headlines in the agenda files are marked with @emph{tags}
  4977. (@pxref{Tags}), you can select headlines based on the tags that apply
  4978. to them and collect them into an agenda buffer.
  4979. @table @kbd
  4980. @kindex C-c a m
  4981. @item C-c a m
  4982. Produce a list of all headlines that match a given set of tags. The
  4983. command prompts for a selection criterion, which is a boolean logic
  4984. expression with tags, like @samp{+work+urgent-withboss} or
  4985. @samp{work|home} (@pxref{Tags}). If you often need a specific search,
  4986. define a custom command for it (@pxref{Agenda dispatcher}).
  4987. @kindex C-c a M
  4988. @item C-c a M
  4989. Like @kbd{C-c a m}, but only select headlines that are also TODO items
  4990. and force checking subitems (see variable
  4991. @code{org-tags-match-list-sublevels}). Matching specific TODO keywords
  4992. together with a tags match is also possible, see @ref{Tag searches}.
  4993. @end table
  4994. The commands available in the tags list are described in @ref{Agenda
  4995. commands}.
  4996. @node Timeline, Keyword search, Matching tags and properties, Built-in agenda views
  4997. @subsection Timeline for a single file
  4998. @cindex timeline, single file
  4999. @cindex time-sorted view
  5000. The timeline summarizes all time-stamped items from a single Org mode
  5001. file in a @emph{time-sorted view}. The main purpose of this command is
  5002. to give an overview over events in a project.
  5003. @table @kbd
  5004. @kindex C-c a L
  5005. @item C-c a L
  5006. Show a time-sorted view of the org file, with all time-stamped items.
  5007. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  5008. (scheduled or not) are also listed under the current date.
  5009. @end table
  5010. @noindent
  5011. The commands available in the timeline buffer are listed in
  5012. @ref{Agenda commands}.
  5013. @node Keyword search, Stuck projects, Timeline, Built-in agenda views
  5014. @subsection Keyword search
  5015. @cindex keyword search
  5016. @cindex searching, for keywords
  5017. This agenda view is a general text search facility for Org mode entries.
  5018. It is particularly useful to find notes.
  5019. @table @kbd
  5020. @kindex C-c a s
  5021. @item C-c a s
  5022. This is a special search that lets you select entries by keywords or
  5023. regular expression, using a boolean logic. For example, the search
  5024. string
  5025. @example
  5026. +computer +wifi -ethernet -@{8\.11[bg]@}
  5027. @end example
  5028. @noindent
  5029. will search for note entries that contain the keywords @code{computer}
  5030. and @code{wifi}, but not the keyword @code{ethernet}, and which are also
  5031. not matched by the regular expression @code{8\.11[bg]}, meaning to
  5032. exclude both 8.11b and 8.11g.
  5033. Note that in addition to the agenda files, this command will also search
  5034. the files listed in @code{org-agenda-text-search-extra-files}.
  5035. @end table
  5036. @node Stuck projects, , Keyword search, Built-in agenda views
  5037. @subsection Stuck projects
  5038. If you are following a system like David Allen's GTD to organize your
  5039. work, one of the ``duties'' you have is a regular review to make sure
  5040. that all projects move along. A @emph{stuck} project is a project that
  5041. has no defined next actions, so it will never show up in the TODO lists
  5042. Org mode produces. During the review, you need to identify such
  5043. projects and define next actions for them.
  5044. @table @kbd
  5045. @kindex C-c a #
  5046. @item C-c a #
  5047. List projects that are stuck.
  5048. @kindex C-c a !
  5049. @item C-c a !
  5050. Customize the variable @code{org-stuck-projects} to define what a stuck
  5051. project is and how to find it.
  5052. @end table
  5053. You almost certainly will have to configure this view before it will
  5054. work for you. The built-in default assumes that all your projects are
  5055. level-2 headlines, and that a project is not stuck if it has at least
  5056. one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
  5057. Let's assume that you, in your own way of using Org mode, identify
  5058. projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
  5059. indicate a project that should not be considered yet. Let's further
  5060. assume that the TODO keyword DONE marks finished projects, and that NEXT
  5061. and TODO indicate next actions. The tag @@SHOP indicates shopping and
  5062. is a next action even without the NEXT tag. Finally, if the project
  5063. contains the special word IGNORE anywhere, it should not be listed
  5064. either. In this case you would start by identifying eligible projects
  5065. with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
  5066. TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
  5067. are not stuck. The correct customization for this is
  5068. @lisp
  5069. (setq org-stuck-projects
  5070. '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
  5071. "\\<IGNORE\\>"))
  5072. @end lisp
  5073. @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
  5074. @section Presentation and sorting
  5075. @cindex presentation, of agenda items
  5076. Before displaying items in an agenda view, Org mode visually prepares
  5077. the items and sorts them. Each item occupies a single line. The line
  5078. starts with a @emph{prefix} that contains the @emph{category}
  5079. (@pxref{Categories}) of the item and other important information. You can
  5080. customize the prefix using the option @code{org-agenda-prefix-format}.
  5081. The prefix is followed by a cleaned-up version of the outline headline
  5082. associated with the item.
  5083. @menu
  5084. * Categories:: Not all tasks are equal
  5085. * Time-of-day specifications:: How the agenda knows the time
  5086. * Sorting of agenda items:: The order of things
  5087. @end menu
  5088. @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
  5089. @subsection Categories
  5090. @cindex category
  5091. The category is a broad label assigned to each agenda item. By default,
  5092. the category is simply derived from the file name, but you can also
  5093. specify it with a special line in the buffer, like this@footnote{For
  5094. backward compatibility, the following also works: If there are several
  5095. such lines in a file, each specifies the category for the text below it.
  5096. The first category also applies to any text before the first CATEGORY
  5097. line. However, using this method is @emph{strongly} deprecated as it is
  5098. incompatible with the outline structure of the document. The correct
  5099. method for setting multiple categories in a buffer is using a
  5100. property.}:
  5101. @example
  5102. #+CATEGORY: Thesis
  5103. @end example
  5104. @noindent
  5105. If you would like to have a special CATEGORY for a single entry or a
  5106. (sub)tree, give the entry a @code{:CATEGORY:} property with the location
  5107. as the value (@pxref{Properties and Columns}).
  5108. @noindent
  5109. The display in the agenda buffer looks best if the category is not
  5110. longer than 10 characters.
  5111. @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
  5112. @subsection Time-of-day specifications
  5113. @cindex time-of-day specification
  5114. Org mode checks each agenda item for a time-of-day specification. The
  5115. time can be part of the time stamp that triggered inclusion into the
  5116. agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
  5117. ranges can be specified with two time stamps, like
  5118. @c
  5119. @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
  5120. In the headline of the entry itself, a time(range) may also appear as
  5121. plain text (like @samp{12:45} or a @samp{8:30-1pm}). If the agenda
  5122. integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
  5123. specifications in diary entries are recognized as well.
  5124. For agenda display, Org mode extracts the time and displays it in a
  5125. standard 24 hour format as part of the prefix. The example times in
  5126. the previous paragraphs would end up in the agenda like this:
  5127. @example
  5128. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  5129. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  5130. 19:00...... The Vogon reads his poem
  5131. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  5132. @end example
  5133. @cindex time grid
  5134. If the agenda is in single-day mode, or for the display of today, the
  5135. timed entries are embedded in a time grid, like
  5136. @example
  5137. 8:00...... ------------------
  5138. 8:30-13:00 Arthur Dent lies in front of the bulldozer
  5139. 10:00...... ------------------
  5140. 12:00...... ------------------
  5141. 12:45...... Ford Prefect arrives and takes Arthur to the pub
  5142. 14:00...... ------------------
  5143. 16:00...... ------------------
  5144. 18:00...... ------------------
  5145. 19:00...... The Vogon reads his poem
  5146. 20:00...... ------------------
  5147. 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
  5148. @end example
  5149. The time grid can be turned on and off with the variable
  5150. @code{org-agenda-use-time-grid}, and can be configured with
  5151. @code{org-agenda-time-grid}.
  5152. @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
  5153. @subsection Sorting of agenda items
  5154. @cindex sorting, of agenda items
  5155. @cindex priorities, of agenda items
  5156. Before being inserted into a view, the items are sorted. How this is
  5157. done depends on the type of view.
  5158. @itemize @bullet
  5159. @item
  5160. For the daily/weekly agenda, the items for each day are sorted. The
  5161. default order is to first collect all items containing an explicit
  5162. time-of-day specification. These entries will be shown at the beginning
  5163. of the list, as a @emph{schedule} for the day. After that, items remain
  5164. grouped in categories, in the sequence given by @code{org-agenda-files}.
  5165. Within each category, items are sorted by priority (@pxref{Priorities}),
  5166. which is composed of the base priority (2000 for priority @samp{A}, 1000
  5167. for @samp{B}, and 0 for @samp{C}), plus additional increments for
  5168. overdue scheduled or deadline items.
  5169. @item
  5170. For the TODO list, items remain in the order of categories, but within
  5171. each category, sorting takes place according to priority
  5172. (@pxref{Priorities}).
  5173. @item
  5174. For tags matches, items are not sorted at all, but just appear in the
  5175. sequence in which they are found in the agenda files.
  5176. @end itemize
  5177. Sorting can be customized using the variable
  5178. @code{org-agenda-sorting-strategy}, and may also include criteria based on
  5179. the estimated effort of an entry (@pxref{Effort estimates}).
  5180. @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
  5181. @section Commands in the agenda buffer
  5182. @cindex commands, in agenda buffer
  5183. Entries in the agenda buffer are linked back to the org file or diary
  5184. file where they originate. You are not allowed to edit the agenda
  5185. buffer itself, but commands are provided to show and jump to the
  5186. original entry location, and to edit the org-files ``remotely'' from
  5187. the agenda buffer. In this way, all information is stored only once,
  5188. removing the risk that your agenda and note files may diverge.
  5189. Some commands can be executed with mouse clicks on agenda lines. For
  5190. the other commands, the cursor needs to be in the desired line.
  5191. @table @kbd
  5192. @tsubheading{Motion}
  5193. @cindex motion commands in agenda
  5194. @kindex n
  5195. @item n
  5196. Next line (same as @key{up} and @kbd{C-p}).
  5197. @kindex p
  5198. @item p
  5199. Previous line (same as @key{down} and @kbd{C-n}).
  5200. @tsubheading{View/Go to org file}
  5201. @kindex mouse-3
  5202. @kindex @key{SPC}
  5203. @item mouse-3
  5204. @itemx @key{SPC}
  5205. Display the original location of the item in another window.
  5206. With prefix arg, make sure that the entire entry is made visible in the
  5207. outline, not only the heading.
  5208. @c
  5209. @kindex L
  5210. @item L
  5211. Display original location and recenter that window.
  5212. @c
  5213. @kindex mouse-2
  5214. @kindex mouse-1
  5215. @kindex @key{TAB}
  5216. @item mouse-2
  5217. @itemx mouse-1
  5218. @itemx @key{TAB}
  5219. Go to the original location of the item in another window. Under Emacs
  5220. 22, @kbd{mouse-1} will also works for this.
  5221. @c
  5222. @kindex @key{RET}
  5223. @itemx @key{RET}
  5224. Go to the original location of the item and delete other windows.
  5225. @c
  5226. @kindex f
  5227. @item f
  5228. Toggle Follow mode. In Follow mode, as you move the cursor through
  5229. the agenda buffer, the other window always shows the corresponding
  5230. location in the org file. The initial setting for this mode in new
  5231. agenda buffers can be set with the variable
  5232. @code{org-agenda-start-with-follow-mode}.
  5233. @c
  5234. @kindex b
  5235. @item b
  5236. Display the entire subtree of the current item in an indirect buffer. With a
  5237. numeric prefix argument N, go up to level N and then take that tree. If N is
  5238. negative, go up that many levels. With a @kbd{C-u} prefix, do not remove the
  5239. previously used indirect buffer.
  5240. @c
  5241. @kindex l
  5242. @item l
  5243. Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
  5244. logging was on (variable @code{org-log-done}) are shown in the agenda, as are
  5245. entries that have been clocked on that day. You can configure the entry
  5246. types that should be included in log mode using the variable
  5247. @code{org-agenda-log-mode-items}. When called with a @kbd{C-u} prefix, show
  5248. all possible logbook entries, including state changes. When called with two
  5249. prefix args @kbd{C-u C-u}, show only logging information, nothing else.
  5250. @c
  5251. @kindex v
  5252. @item v
  5253. Toggle Archives mode. In archives mode, trees that are marked are also
  5254. scanned when producing the agenda. When you call this command with a
  5255. @kbd{C-u} prefix argument, even all archive files are included. To exit
  5256. archives mode, press @kbd{v} again.
  5257. @c
  5258. @kindex R
  5259. @item R
  5260. Toggle Clockreport mode. In clockreport mode, the daily/weekly agenda will
  5261. always show a table with the clocked times for the timespan and file scope
  5262. covered by the current agenda view. The initial setting for this mode in new
  5263. agenda buffers can be set with the variable
  5264. @code{org-agenda-start-with-clockreport-mode}.
  5265. @tsubheading{Change display}
  5266. @cindex display changing, in agenda
  5267. @kindex o
  5268. @item o
  5269. Delete other windows.
  5270. @c
  5271. @kindex d
  5272. @kindex w
  5273. @kindex m
  5274. @kindex y
  5275. @item d w m y
  5276. Switch to day/week/month/year view. When switching to day or week view,
  5277. this setting becomes the default for subsequent agenda commands. Since
  5278. month and year views are slow to create, they do not become the default.
  5279. A numeric prefix argument may be used to jump directly to a specific day
  5280. of the year, ISO week, month, or year, respectively. For example,
  5281. @kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When
  5282. setting day, week, or month view, a year may be encoded in the prefix
  5283. argument as well. For example, @kbd{200712 w} will jump to week 12 in
  5284. 2007. If such a year specification has only one or two digits, it will
  5285. be mapped to the interval 1938-2037.
  5286. @c
  5287. @kindex D
  5288. @item D
  5289. Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
  5290. @c
  5291. @kindex G
  5292. @item G
  5293. Toggle the time grid on and off. See also the variables
  5294. @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
  5295. @c
  5296. @kindex r
  5297. @item r
  5298. Recreate the agenda buffer, for example to reflect the changes
  5299. after modification of the time stamps of items with S-@key{left} and
  5300. S-@key{right}. When the buffer is the global TODO list, a prefix
  5301. argument is interpreted to create a selective list for a specific TODO
  5302. keyword.
  5303. @kindex g
  5304. @item g
  5305. Same as @kbd{r}.
  5306. @c
  5307. @kindex s
  5308. @kindex C-x C-s
  5309. @item s
  5310. @itemx C-x C-s
  5311. Save all Org buffers in the current Emacs session.
  5312. @c
  5313. @kindex @key{right}
  5314. @item @key{right}
  5315. Display the following @code{org-agenda-ndays} days. For example, if
  5316. the display covers a week, switch to the following week. With prefix
  5317. arg, go forward that many times @code{org-agenda-ndays} days.
  5318. @c
  5319. @kindex @key{left}
  5320. @item @key{left}
  5321. Display the previous dates.
  5322. @c
  5323. @kindex .
  5324. @item .
  5325. Go to today.
  5326. @c
  5327. @kindex C-c C-x C-c
  5328. @item C-c C-x C-c
  5329. Invoke column view (@pxref{Column view}) in the agenda buffer. The column
  5330. view format is taken from the entry at point, or (if there is no entry at
  5331. point), from the first entry in the agenda view. So whatever the format for
  5332. that entry would be in the original buffer (taken from a property, from a
  5333. @code{#+COLUMNS} line, or from the default variable
  5334. @code{org-columns-default-format}), will be used in the agenda.
  5335. @tsubheading{Secondary filtering and query editing}
  5336. @cindex filtering, by tag and effort, in agenda
  5337. @cindex tag filtering, in agenda
  5338. @cindex effort filtering, in agenda
  5339. @cindex query editing, in agenda
  5340. @kindex /
  5341. @item /
  5342. Filter the current agenda view with respect to a tag and/or effort estimates.
  5343. The difference between this and a custom agenda commands is that filtering is
  5344. very fast, so that you can switch quickly between different filters without
  5345. having to recreate the agenda.
  5346. You will be prompted for a tag selection letter. Pressing @key{TAB} at that
  5347. prompt will offer use completion to select a tag (including any tags that do
  5348. not have a selection character). The command then hides all entries that do
  5349. not contain or inherit this tag. When called with prefix arg, remove the
  5350. entries that @emph{do} have the tag. A second @kbd{/} at the prompt will
  5351. turn off the filter and unhide any hidden entries. If the first key you
  5352. press is either @kbd{+} or @kbd{-}, the previous filter will be narrowed by
  5353. requiring or forbidding the selected additional tag. Instead of pressing
  5354. @kbd{+} or @kbd{-} after @kbd{/}, you can also immediately use the @kbd{\}
  5355. command.
  5356. In order to filter for effort estimates, you should set-up allowed
  5357. efforts globally, for example
  5358. @lisp
  5359. (setq org-global-properties
  5360. '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
  5361. @end lisp
  5362. You can then filter for an effort by first typing an operator, one of @kbd{<},
  5363. @kbd{>}, and @kbd{=}, and then the one-digit index of an effort estimate in
  5364. your array of allowed values, where @kbd{0} means the 10th value. The filter
  5365. will then restrict to entries with effort smaller-or-equal, equal, or
  5366. larger-or-equal than the selected value. If the digits 0-9 are not used as
  5367. fast access keys to tags, you can also simply press the index digit directly
  5368. without an operator. In this case, @kbd{<} will be assumed.
  5369. @kindex \
  5370. @item \
  5371. Narrow the current agenda filter by an additional condition. When called with
  5372. prefix arg, remove the entries that @emph{do} have the tag, or that do match
  5373. the effort criterion. You can achieve the same effect by pressing @kbd{+} or
  5374. @kbd{-} as the first key after the @kbd{/} command.
  5375. @kindex [
  5376. @kindex ]
  5377. @kindex @{
  5378. @kindex @}
  5379. @item [ ] @{ @}
  5380. In the @i{search view} (@pxref{Keyword search}), these keys add new search
  5381. words (@kbd{[} and @kbd{]}) or new regular expressions (@kbd{@{} and
  5382. @kbd{@}}) to the query string. The opening bracket/brace will add a positive
  5383. search term prefixed by @samp{+}, indicating that this search term @i{must}
  5384. occur/match in the entry. The closing bracket/brace will add a negative
  5385. search term which @i{must not} occur/match in the entry for it to be
  5386. selected.
  5387. @tsubheading{Remote editing}
  5388. @cindex remote editing, from agenda
  5389. @item 0-9
  5390. Digit argument.
  5391. @c
  5392. @cindex undoing remote-editing events
  5393. @cindex remote editing, undo
  5394. @kindex C-_
  5395. @item C-_
  5396. Undo a change due to a remote editing command. The change is undone
  5397. both in the agenda buffer and in the remote buffer.
  5398. @c
  5399. @kindex t
  5400. @item t
  5401. Change the TODO state of the item, both in the agenda and in the
  5402. original org file.
  5403. @c
  5404. @kindex C-k
  5405. @item C-k
  5406. Delete the current agenda item along with the entire subtree belonging
  5407. to it in the original Org file. If the text to be deleted remotely
  5408. is longer than one line, the kill needs to be confirmed by the user. See
  5409. variable @code{org-agenda-confirm-kill}.
  5410. @c
  5411. @kindex a
  5412. @item a
  5413. Toggle the ARCHIVE tag for the current headline.
  5414. @c
  5415. @kindex A
  5416. @item A
  5417. Move the subtree corresponding to the current entry to its @emph{Archive
  5418. Sibling}.
  5419. @c
  5420. @kindex $
  5421. @item $
  5422. Archive the subtree corresponding to the current headline. This means the
  5423. entry will be moved to the configured archive location, most likely a
  5424. different file.
  5425. @c
  5426. @kindex T
  5427. @item T
  5428. Show all tags associated with the current item. This is useful if you have
  5429. turned off @code{org-agenda-show-inherited-tags}, but still want to see all
  5430. tags of a headline occasionally.
  5431. @c
  5432. @kindex :
  5433. @item :
  5434. Set tags for the current headline. If there is an active region in the
  5435. agenda, change a tag for all headings in the region.
  5436. @c
  5437. @kindex ,
  5438. @item ,
  5439. Set the priority for the current item. Org mode prompts for the
  5440. priority character. If you reply with @key{SPC}, the priority cookie
  5441. is removed from the entry.
  5442. @c
  5443. @kindex P
  5444. @item P
  5445. Display weighted priority of current item.
  5446. @c
  5447. @kindex +
  5448. @kindex S-@key{up}
  5449. @item +
  5450. @itemx S-@key{up}
  5451. Increase the priority of the current item. The priority is changed in
  5452. the original buffer, but the agenda is not resorted. Use the @kbd{r}
  5453. key for this.
  5454. @c
  5455. @kindex -
  5456. @kindex S-@key{down}
  5457. @item -
  5458. @itemx S-@key{down}
  5459. Decrease the priority of the current item.
  5460. @c
  5461. @kindex C-c C-a
  5462. @item C-c C-a
  5463. Dispatcher for all command related to attachments.
  5464. @c
  5465. @kindex C-c C-s
  5466. @item C-c C-s
  5467. Schedule this item
  5468. @c
  5469. @kindex C-c C-d
  5470. @item C-c C-d
  5471. Set a deadline for this item.
  5472. @c
  5473. @kindex k
  5474. @item k
  5475. Agenda actions, to set dates for selected items to the cursor date.
  5476. This command also works in the calendar! The command prompts for an
  5477. additonal key:
  5478. @example
  5479. m @r{Mark the entry at point for action. You can also make entries}
  5480. @r{in Org files with @kbd{C-c C-x C-k}.}
  5481. d @r{Set the deadline of the marked entry to the date at point.}
  5482. s @r{Schedule the marked entry at the date at point.}
  5483. r @r{Call @code{org-remember} with the cursor date as default date.}
  5484. @end example
  5485. Press @kbd{r} afterwards to refresh the agenda and see the effect of the
  5486. command.
  5487. @c
  5488. @kindex S-@key{right}
  5489. @item S-@key{right}
  5490. Change the time stamp associated with the current line by one day into the
  5491. future. With a numeric prefix argument, change it by that many days. For
  5492. example, @kbd{3 6 5 S-@key{right}} will change it by a year. The stamp is
  5493. changed in the original org file, but the change is not directly reflected in
  5494. the agenda buffer. Use the @kbd{r} key to update the buffer.
  5495. @c
  5496. @kindex S-@key{left}
  5497. @item S-@key{left}
  5498. Change the time stamp associated with the current line by one day
  5499. into the past.
  5500. @c
  5501. @kindex >
  5502. @item >
  5503. Change the time stamp associated with the current line to today.
  5504. The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
  5505. on my keyboard.
  5506. @c
  5507. @kindex I
  5508. @item I
  5509. Start the clock on the current item. If a clock is running already, it
  5510. is stopped first.
  5511. @c
  5512. @kindex O
  5513. @item O
  5514. Stop the previously started clock.
  5515. @c
  5516. @kindex X
  5517. @item X
  5518. Cancel the currently running clock.
  5519. @kindex J
  5520. @item J
  5521. Jump to the running clock in another window.
  5522. @tsubheading{Calendar commands}
  5523. @cindex calendar commands, from agenda
  5524. @kindex c
  5525. @item c
  5526. Open the Emacs calendar and move to the date at the agenda cursor.
  5527. @c
  5528. @item c
  5529. When in the calendar, compute and show the Org mode agenda for the
  5530. date at the cursor.
  5531. @c
  5532. @cindex diary entries, creating from agenda
  5533. @kindex i
  5534. @item i
  5535. Insert a new entry into the diary. Prompts for the type of entry
  5536. (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
  5537. entry in the diary, just as @kbd{i d} etc. would do in the calendar.
  5538. The date is taken from the cursor position.
  5539. @c
  5540. @kindex M
  5541. @item M
  5542. Show the phases of the moon for the three months around current date.
  5543. @c
  5544. @kindex S
  5545. @item S
  5546. Show sunrise and sunset times. The geographical location must be set
  5547. with calendar variables, see documentation of the Emacs calendar.
  5548. @c
  5549. @kindex C
  5550. @item C
  5551. Convert the date at cursor into many other cultural and historic
  5552. calendars.
  5553. @c
  5554. @kindex H
  5555. @item H
  5556. Show holidays for three month around the cursor date.
  5557. @item M-x org-export-icalendar-combine-agenda-files
  5558. Export a single iCalendar file containing entries from all agenda files.
  5559. This is a globally available command, and also available in the agenda menu.
  5560. @tsubheading{Exporting to a file}
  5561. @kindex C-x C-w
  5562. @item C-x C-w
  5563. @cindex exporting agenda views
  5564. @cindex agenda views, exporting
  5565. Write the agenda view to a file. Depending on the extension of the
  5566. selected file name, the view will be exported as HTML (extension
  5567. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
  5568. plain text (any other extension). Use the variable
  5569. @code{org-agenda-exporter-settings} to set options for @file{ps-print}
  5570. and for @file{htmlize} to be used during export.
  5571. @tsubheading{Quit and Exit}
  5572. @kindex q
  5573. @item q
  5574. Quit agenda, remove the agenda buffer.
  5575. @c
  5576. @kindex x
  5577. @cindex agenda files, removing buffers
  5578. @item x
  5579. Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
  5580. for the compilation of the agenda. Buffers created by the user to
  5581. visit org files will not be removed.
  5582. @end table
  5583. @node Custom agenda views, Agenda column view, Agenda commands, Agenda Views
  5584. @section Custom agenda views
  5585. @cindex custom agenda views
  5586. @cindex agenda views, custom
  5587. Custom agenda commands serve two purposes: to store and quickly access
  5588. frequently used TODO and tags searches, and to create special composite
  5589. agenda buffers. Custom agenda commands will be accessible through the
  5590. dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
  5591. @menu
  5592. * Storing searches:: Type once, use often
  5593. * Block agenda:: All the stuff you need in a single buffer
  5594. * Setting Options:: Changing the rules
  5595. * Exporting Agenda Views:: Writing agendas to files
  5596. * Using the agenda elsewhere:: Using agenda information in other programs
  5597. @end menu
  5598. @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
  5599. @subsection Storing searches
  5600. The first application of custom searches is the definition of keyboard
  5601. shortcuts for frequently used searches, either creating an agenda
  5602. buffer, or a sparse tree (the latter covering of course only the current
  5603. buffer).
  5604. @kindex C-c a C
  5605. Custom commands are configured in the variable
  5606. @code{org-agenda-custom-commands}. You can customize this variable, for
  5607. example by pressing @kbd{C-c a C}. You can also directly set it with
  5608. Emacs Lisp in @file{.emacs}. The following example contains all valid
  5609. search types:
  5610. @lisp
  5611. @group
  5612. (setq org-agenda-custom-commands
  5613. '(("w" todo "WAITING")
  5614. ("W" todo-tree "WAITING")
  5615. ("u" tags "+boss-urgent")
  5616. ("v" tags-todo "+boss-urgent")
  5617. ("U" tags-tree "+boss-urgent")
  5618. ("f" occur-tree "\\<FIXME\\>")
  5619. ("h" . "HOME+Name tags searches") ; description for "h" prefix
  5620. ("hl" tags "+home+Lisa")
  5621. ("hp" tags "+home+Peter")
  5622. ("hk" tags "+home+Kim")))
  5623. @end group
  5624. @end lisp
  5625. @noindent
  5626. The initial string in each entry defines the keys you have to press
  5627. after the dispatcher command @kbd{C-c a} in order to access the command.
  5628. Usually this will be just a single character, but if you have many
  5629. similar commands, you can also define two-letter combinations where the
  5630. first character is the same in several combinations and serves as a
  5631. prefix key@footnote{You can provide a description for a prefix key by
  5632. inserting a cons cell with the prefix and the description.}. The second
  5633. parameter is the search type, followed by the string or regular
  5634. expression to be used for the matching. The example above will
  5635. therefore define:
  5636. @table @kbd
  5637. @item C-c a w
  5638. as a global search for TODO entries with @samp{WAITING} as the TODO
  5639. keyword
  5640. @item C-c a W
  5641. as the same search, but only in the current buffer and displaying the
  5642. results as a sparse tree
  5643. @item C-c a u
  5644. as a global tags search for headlines marked @samp{:boss:} but not
  5645. @samp{:urgent:}
  5646. @item C-c a v
  5647. as the same search as @kbd{C-c a u}, but limiting the search to
  5648. headlines that are also TODO items
  5649. @item C-c a U
  5650. as the same search as @kbd{C-c a u}, but only in the current buffer and
  5651. displaying the result as a sparse tree
  5652. @item C-c a f
  5653. to create a sparse tree (again: current buffer only) with all entries
  5654. containing the word @samp{FIXME}
  5655. @item C-c a h
  5656. as a prefix command for a HOME tags search where you have to press an
  5657. additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
  5658. Peter, or Kim) as additional tag to match.
  5659. @end table
  5660. @node Block agenda, Setting Options, Storing searches, Custom agenda views
  5661. @subsection Block agenda
  5662. @cindex block agenda
  5663. @cindex agenda, with block views
  5664. Another possibility is the construction of agenda views that comprise
  5665. the results of @emph{several} commands, each of which creates a block in
  5666. the agenda buffer. The available commands include @code{agenda} for the
  5667. daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
  5668. for the global TODO list (as constructed with @kbd{C-c a t}), and the
  5669. matching commands discussed above: @code{todo}, @code{tags}, and
  5670. @code{tags-todo}. Here are two examples:
  5671. @lisp
  5672. @group
  5673. (setq org-agenda-custom-commands
  5674. '(("h" "Agenda and Home-related tasks"
  5675. ((agenda "")
  5676. (tags-todo "home")
  5677. (tags "garden")))
  5678. ("o" "Agenda and Office-related tasks"
  5679. ((agenda "")
  5680. (tags-todo "work")
  5681. (tags "office")))))
  5682. @end group
  5683. @end lisp
  5684. @noindent
  5685. This will define @kbd{C-c a h} to create a multi-block view for stuff
  5686. you need to attend to at home. The resulting agenda buffer will contain
  5687. your agenda for the current week, all TODO items that carry the tag
  5688. @samp{home}, and also all lines tagged with @samp{garden}. Finally the
  5689. command @kbd{C-c a o} provides a similar view for office tasks.
  5690. @node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
  5691. @subsection Setting options for custom commands
  5692. @cindex options, for custom agenda views
  5693. Org mode contains a number of variables regulating agenda construction
  5694. and display. The global variables define the behavior for all agenda
  5695. commands, including the custom commands. However, if you want to change
  5696. some settings just for a single custom view, you can do so. Setting
  5697. options requires inserting a list of variable names and values at the
  5698. right spot in @code{org-agenda-custom-commands}. For example:
  5699. @lisp
  5700. @group
  5701. (setq org-agenda-custom-commands
  5702. '(("w" todo "WAITING"
  5703. ((org-agenda-sorting-strategy '(priority-down))
  5704. (org-agenda-prefix-format " Mixed: ")))
  5705. ("U" tags-tree "+boss-urgent"
  5706. ((org-show-following-heading nil)
  5707. (org-show-hierarchy-above nil)))
  5708. ("N" search ""
  5709. ((org-agenda-files '("~org/notes.org"))
  5710. (org-agenda-text-search-extra-files nil)))))
  5711. @end group
  5712. @end lisp
  5713. @noindent
  5714. Now the @kbd{C-c a w} command will sort the collected entries only by
  5715. priority, and the prefix format is modified to just say @samp{ Mixed: }
  5716. instead of giving the category of the entry. The sparse tags tree of
  5717. @kbd{C-c a U} will now turn out ultra-compact, because neither the
  5718. headline hierarchy above the match, nor the headline following the match
  5719. will be shown. The command @kbd{C-c a N} will do a text search limited
  5720. to only a single file.
  5721. For command sets creating a block agenda,
  5722. @code{org-agenda-custom-commands} has two separate spots for setting
  5723. options. You can add options that should be valid for just a single
  5724. command in the set, and options that should be valid for all commands in
  5725. the set. The former are just added to the command entry, the latter
  5726. must come after the list of command entries. Going back to the block
  5727. agenda example (@pxref{Block agenda}), let's change the sorting strategy
  5728. for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
  5729. the results for GARDEN tags query in the opposite order,
  5730. @code{priority-up}. This would look like this:
  5731. @lisp
  5732. @group
  5733. (setq org-agenda-custom-commands
  5734. '(("h" "Agenda and Home-related tasks"
  5735. ((agenda)
  5736. (tags-todo "home")
  5737. (tags "garden"
  5738. ((org-agenda-sorting-strategy '(priority-up)))))
  5739. ((org-agenda-sorting-strategy '(priority-down))))
  5740. ("o" "Agenda and Office-related tasks"
  5741. ((agenda)
  5742. (tags-todo "work")
  5743. (tags "office")))))
  5744. @end group
  5745. @end lisp
  5746. As you see, the values and parenthesis setting is a little complex.
  5747. When in doubt, use the customize interface to set this variable - it
  5748. fully supports its structure. Just one caveat: When setting options in
  5749. this interface, the @emph{values} are just lisp expressions. So if the
  5750. value is a string, you need to add the double quotes around the value
  5751. yourself.
  5752. @node Exporting Agenda Views, Using the agenda elsewhere, Setting Options, Custom agenda views
  5753. @subsection Exporting Agenda Views
  5754. @cindex agenda views, exporting
  5755. If you are away from your computer, it can be very useful to have a
  5756. printed version of some agenda views to carry around. Org mode can
  5757. export custom agenda views as plain text, HTML@footnote{You need to
  5758. install Hrvoje Niksic' @file{htmlize.el}.} postscript, and iCalendar
  5759. files. If you want to do this only occasionally, use the command
  5760. @table @kbd
  5761. @kindex C-x C-w
  5762. @item C-x C-w
  5763. @cindex exporting agenda views
  5764. @cindex agenda views, exporting
  5765. Write the agenda view to a file. Depending on the extension of the
  5766. selected file name, the view will be exported as HTML (extension
  5767. @file{.html} or @file{.htm}), Postscript (extension @file{.ps}),
  5768. iCalendar (extension @file{.ics}), or plain text (any other extension).
  5769. Use the variable @code{org-agenda-exporter-settings} to
  5770. set options for @file{ps-print} and for @file{htmlize} to be used during
  5771. export, for example
  5772. @lisp
  5773. (setq org-agenda-exporter-settings
  5774. '((ps-number-of-columns 2)
  5775. (ps-landscape-mode t)
  5776. (htmlize-output-type 'css)))
  5777. @end lisp
  5778. @end table
  5779. If you need to export certain agenda views frequently, you can associate
  5780. any custom agenda command with a list of output file names
  5781. @footnote{If you want to store standard views like the weekly agenda
  5782. or the global TODO list as well, you need to define custom commands for
  5783. them in order to be able to specify file names.}. Here is an example
  5784. that first does define custom commands for the agenda and the global
  5785. todo list, together with a number of files to which to export them.
  5786. Then we define two block agenda commands and specify file names for them
  5787. as well. File names can be relative to the current working directory,
  5788. or absolute.
  5789. @lisp
  5790. @group
  5791. (setq org-agenda-custom-commands
  5792. '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
  5793. ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
  5794. ("h" "Agenda and Home-related tasks"
  5795. ((agenda "")
  5796. (tags-todo "home")
  5797. (tags "garden"))
  5798. nil
  5799. ("~/views/home.html"))
  5800. ("o" "Agenda and Office-related tasks"
  5801. ((agenda)
  5802. (tags-todo "work")
  5803. (tags "office"))
  5804. nil
  5805. ("~/views/office.ps" "~/calendars/office.ics"))))
  5806. @end group
  5807. @end lisp
  5808. The extension of the file name determines the type of export. If it is
  5809. @file{.html}, Org mode will use the @file{htmlize.el} package to convert
  5810. the buffer to HTML and save it to this file name. If the extension is
  5811. @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
  5812. postscript output. If the extension is @file{.ics}, iCalendar export is
  5813. run export over all files that were used to construct the agenda, and
  5814. limit the export to entries listed in the agenda now. Any other
  5815. extension produces a plain ASCII file.
  5816. The export files are @emph{not} created when you use one of those
  5817. commands interactively because this might use too much overhead.
  5818. Instead, there is a special command to produce @emph{all} specified
  5819. files in one step:
  5820. @table @kbd
  5821. @kindex C-c a e
  5822. @item C-c a e
  5823. Export all agenda views that have export file names associated with
  5824. them.
  5825. @end table
  5826. You can use the options section of the custom agenda commands to also
  5827. set options for the export commands. For example:
  5828. @lisp
  5829. (setq org-agenda-custom-commands
  5830. '(("X" agenda ""
  5831. ((ps-number-of-columns 2)
  5832. (ps-landscape-mode t)
  5833. (org-agenda-prefix-format " [ ] ")
  5834. (org-agenda-with-colors nil)
  5835. (org-agenda-remove-tags t))
  5836. ("theagenda.ps"))))
  5837. @end lisp
  5838. @noindent
  5839. This command sets two options for the postscript exporter, to make it
  5840. print in two columns in landscape format - the resulting page can be cut
  5841. in two and then used in a paper agenda. The remaining settings modify
  5842. the agenda prefix to omit category and scheduling information, and
  5843. instead include a checkbox to check off items. We also remove the tags
  5844. to make the lines compact, and we don't want to use colors for the
  5845. black-and-white printer. Settings specified in
  5846. @code{org-agenda-exporter-settings} will also apply, but the settings
  5847. in @code{org-agenda-custom-commands} take precedence.
  5848. @noindent
  5849. From the command line you may also use
  5850. @example
  5851. emacs -f org-batch-store-agenda-views -kill
  5852. @end example
  5853. @noindent
  5854. or, if you need to modify some parameters@footnote{Quoting may depend on the
  5855. system you use, please check th FAQ for examples.}
  5856. @example
  5857. emacs -eval '(org-batch-store-agenda-views \
  5858. org-agenda-ndays 30 \
  5859. org-agenda-start-day "2007-11-01" \
  5860. org-agenda-include-diary nil \
  5861. org-agenda-files (quote ("~/org/project.org")))' \
  5862. -kill
  5863. @end example
  5864. @noindent
  5865. which will create the agenda views restricted to the file
  5866. @file{~/org/project.org}, without diary entries and with 30 days
  5867. extent.
  5868. @node Using the agenda elsewhere, , Exporting Agenda Views, Custom agenda views
  5869. @subsection Using agenda information outside of Org
  5870. @cindex agenda, pipe
  5871. @cindex Scripts, for agenda processing
  5872. Org provides commands to access agenda information for the command
  5873. line in emacs batch mode. This extracted information can be sent
  5874. directly to a printer, or it can be read by a program that does further
  5875. processing of the data. The first of these commands is the function
  5876. @code{org-batch-agenda}, that produces an agenda view and sends it as
  5877. ASCII text to STDOUT. The command takes a single string as parameter.
  5878. If the string has length 1, it is used as a key to one of the commands
  5879. you have configured in @code{org-agenda-custom-commands}, basically any
  5880. key you can use after @kbd{C-c a}. For example, to directly print the
  5881. current TODO list, you could use
  5882. @example
  5883. emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
  5884. @end example
  5885. If the parameter is a string with 2 or more characters, it is used as a
  5886. tags/todo match string. For example, to print your local shopping list
  5887. (all items with the tag @samp{shop}, but excluding the tag
  5888. @samp{NewYork}), you could use
  5889. @example
  5890. emacs -batch -l ~/.emacs \
  5891. -eval '(org-batch-agenda "+shop-NewYork")' | lpr
  5892. @end example
  5893. @noindent
  5894. You may also modify parameters on the fly like this:
  5895. @example
  5896. emacs -batch -l ~/.emacs \
  5897. -eval '(org-batch-agenda "a" \
  5898. org-agenda-ndays 30 \
  5899. org-agenda-include-diary nil \
  5900. org-agenda-files (quote ("~/org/project.org")))' \
  5901. | lpr
  5902. @end example
  5903. @noindent
  5904. which will produce a 30 day agenda, fully restricted to the Org file
  5905. @file{~/org/projects.org}, not even including the diary.
  5906. If you want to process the agenda data in more sophisticated ways, you
  5907. can use the command @code{org-batch-agenda-csv} to get a comma-separated
  5908. list of values for each agenda item. Each line in the output will
  5909. contain a number of fields separated by commas. The fields in a line
  5910. are:
  5911. @example
  5912. category @r{The category of the item}
  5913. head @r{The headline, without TODO kwd, TAGS and PRIORITY}
  5914. type @r{The type of the agenda entry, can be}
  5915. todo @r{selected in TODO match}
  5916. tagsmatch @r{selected in tags match}
  5917. diary @r{imported from diary}
  5918. deadline @r{a deadline}
  5919. scheduled @r{scheduled}
  5920. timestamp @r{appointment, selected by timestamp}
  5921. closed @r{entry was closed on date}
  5922. upcoming-deadline @r{warning about nearing deadline}
  5923. past-scheduled @r{forwarded scheduled item}
  5924. block @r{entry has date block including date}
  5925. todo @r{The TODO keyword, if any}
  5926. tags @r{All tags including inherited ones, separated by colons}
  5927. date @r{The relevant date, like 2007-2-14}
  5928. time @r{The time, like 15:00-16:50}
  5929. extra @r{String with extra planning info}
  5930. priority-l @r{The priority letter if any was given}
  5931. priority-n @r{The computed numerical priority}
  5932. @end example
  5933. @noindent
  5934. Time and date will only be given if a timestamp (or deadline/scheduled)
  5935. lead to the selection of the item.
  5936. A CSV list like this is very easy to use in a post processing script.
  5937. For example, here is a Perl program that gets the TODO list from
  5938. Emacs/Org and prints all the items, preceded by a checkbox:
  5939. @example
  5940. @group
  5941. #!/usr/bin/perl
  5942. # define the Emacs command to run
  5943. $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
  5944. # run it and capture the output
  5945. $agenda = qx@{$cmd 2>/dev/null@};
  5946. # loop over all lines
  5947. foreach $line (split(/\n/,$agenda)) @{
  5948. # get the individual values
  5949. ($category,$head,$type,$todo,$tags,$date,$time,$extra,
  5950. $priority_l,$priority_n) = split(/,/,$line);
  5951. # proccess and print
  5952. print "[ ] $head\n";
  5953. @}
  5954. @end group
  5955. @end example
  5956. @node Agenda column view, , Custom agenda views, Agenda Views
  5957. @section Using column view in the agenda
  5958. @cindex column view, in agenda
  5959. @cindex agenda, column view
  5960. Column view (@pxref{Column view}) is normally used to view and edit
  5961. properties embedded in the hierarchical structure of an Org file. It can be
  5962. quite useful to use column view also from the agenda, where entries are
  5963. collected by certain criteria.
  5964. @table @kbd
  5965. @kindex C-c C-x C-c
  5966. @item C-c C-x C-c
  5967. Turn on column view in the agenda.
  5968. @end table
  5969. To understand how to use this properly, it is important to realize that the
  5970. entries in the agenda are no longer in their proper outline environment.
  5971. This causes the following issues:
  5972. @enumerate
  5973. @item
  5974. Org needs to make a decision which @code{COLUMNS} format to use. Since the
  5975. entries in the agenda are collected from different files, and different files
  5976. may have different @code{COLUMNS} formats, this is a non-trivial problem.
  5977. Org first checks if the variable @code{org-overriding-columns-format} is
  5978. currently set, and if yes takes the format from there. Otherwise it takes
  5979. the format associated with the first item in the agenda, or, if that item
  5980. does not have a specific format (defined in a property, or in it's file), it
  5981. uses @code{org-columns-default-format}.
  5982. @item
  5983. If any of the columns has a summary type defined (@pxref{Column attributes}),
  5984. turning on column view in the agenda will visit all relevant agenda files and
  5985. make sure that the computations of this property are up to date. This is
  5986. also true for the special @code{CLOCKSUM} property. Org will then sum the
  5987. values displayed in the agenda. In the daily/weekly agenda, the sums will
  5988. cover a single day, in all other views they cover the entire block. It is
  5989. vital to realize that the agenda may show the same entry @emph{twice} (for
  5990. example as scheduled and as a deadline), and it may show two entries from the
  5991. same hierarchy (for example a @emph{parent} and it's @emph{child}). In these
  5992. cases, the summation in the agenda will lead to incorrect results because
  5993. some values will count double.
  5994. @item
  5995. When the column view in the agenda shows the @code{CLOCKSUM}, that is always
  5996. the entire clocked time for this item. So even in the daily/weekly agenda,
  5997. the clocksum listed in column view may originate from times outside the
  5998. current view. This has the advantage that you can compare these values with
  5999. a column listing the planned total effort for a task - one of the major
  6000. applications for column view in the agenda. If you want information about
  6001. clocked time in the displayed period use clock table mode (press @kbd{R} in
  6002. the agenda).
  6003. @end enumerate
  6004. @node Embedded LaTeX, Exporting, Agenda Views, Top
  6005. @chapter Embedded LaTeX
  6006. @cindex @TeX{} interpretation
  6007. @cindex La@TeX{} interpretation
  6008. Plain ASCII is normally sufficient for almost all note taking. One
  6009. exception, however, are scientific notes which need to be able to contain
  6010. mathematical symbols and the occasional formula. La@TeX{}@footnote{La@TeX{}
  6011. is a macro system based on Donald E. Knuth's @TeX{} system. Many of the
  6012. features described here as ``La@TeX{}'' are really from @TeX{}, but for
  6013. simplicity I am blurring this distinction.} is widely used to typeset
  6014. scientific documents. Org mode supports embedding La@TeX{} code into its
  6015. files, because many academics are used to reading La@TeX{} source code, and
  6016. because it can be readily processed into images for HTML production.
  6017. It is not necessary to mark La@TeX{} macros and code in any special way.
  6018. If you observe a few conventions, Org mode knows how to find it and what
  6019. to do with it.
  6020. @menu
  6021. * Math symbols:: TeX macros for symbols and Greek letters
  6022. * Subscripts and superscripts:: Simple syntax for raising/lowering text
  6023. * LaTeX fragments:: Complex formulas made easy
  6024. * Processing LaTeX fragments:: Previewing LaTeX processing
  6025. * CDLaTeX mode:: Speed up entering of formulas
  6026. @end menu
  6027. @node Math symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
  6028. @section Math symbols
  6029. @cindex math symbols
  6030. @cindex TeX macros
  6031. You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
  6032. to indicate the Greek letter, or @samp{\to} to indicate an arrow.
  6033. Completion for these macros is available, just type @samp{\} and maybe a
  6034. few letters, and press @kbd{M-@key{TAB}} to see possible completions.
  6035. Unlike La@TeX{} code, Org mode allows these macros to be present
  6036. without surrounding math delimiters, for example:
  6037. @example
  6038. Angles are written as Greek letters \alpha, \beta and \gamma.
  6039. @end example
  6040. During HTML export (@pxref{HTML export}), these symbols are translated
  6041. into the proper syntax for HTML, for the above examples this is
  6042. @samp{&alpha;} and @samp{&rarr;}, respectively. If you need such a symbol
  6043. inside a word, terminate it like this: @samp{\Aacute@{@}stor}.
  6044. @node Subscripts and superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
  6045. @section Subscripts and superscripts
  6046. @cindex subscript
  6047. @cindex superscript
  6048. Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
  6049. and subscripts. Again, these can be used without embedding them in
  6050. math-mode delimiters. To increase the readability of ASCII text, it is
  6051. not necessary (but OK) to surround multi-character sub- and superscripts
  6052. with curly braces. For example
  6053. @example
  6054. The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
  6055. the sun is R_@{sun@} = 6.96 x 10^8 m.
  6056. @end example
  6057. To avoid interpretation as raised or lowered text, you can quote
  6058. @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
  6059. During HTML export (@pxref{HTML export}), subscript and superscripts
  6060. are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
  6061. @node LaTeX fragments, Processing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
  6062. @section LaTeX fragments
  6063. @cindex LaTeX fragments
  6064. With symbols, sub- and superscripts, HTML is pretty much at its end when
  6065. it comes to representing mathematical formulas@footnote{Yes, there is
  6066. MathML, but that is not yet fully supported by many browsers, and there
  6067. is no decent converter for turning La@TeX{} or ASCII representations of
  6068. formulas into MathML. So for the time being, converting formulas into
  6069. images seems the way to go.}. More complex expressions need a dedicated
  6070. formula processor. To this end, Org mode can contain arbitrary La@TeX{}
  6071. fragments. It provides commands to preview the typeset result of these
  6072. fragments, and upon export to HTML, all fragments will be converted to
  6073. images and inlined into the HTML document@footnote{The La@TeX{} export
  6074. will not use images for displaying La@TeX{} fragments but include these
  6075. fragments directly into the La@TeX{} code.}. For this to work you
  6076. need to be on a system with a working La@TeX{} installation. You also
  6077. need the @file{dvipng} program, available at
  6078. @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
  6079. will be used when processing a fragment can be configured with the
  6080. variable @code{org-format-latex-header}.
  6081. La@TeX{} fragments don't need any special marking at all. The following
  6082. snippets will be identified as La@TeX{} source code:
  6083. @itemize @bullet
  6084. @item
  6085. Environments of any kind. The only requirement is that the
  6086. @code{\begin} statement appears on a new line, preceded by only
  6087. whitespace.
  6088. @item
  6089. Text within the usual La@TeX{} math delimiters. To avoid conflicts with
  6090. currency specifications, single @samp{$} characters are only recognized
  6091. as math delimiters if the enclosed text contains at most two line breaks,
  6092. is directly attached to the @samp{$} characters with no whitespace in
  6093. between, and if the closing @samp{$} is followed by whitespace or
  6094. punctuation. For the other delimiters, there is no such restriction, so
  6095. when in doubt, use @samp{\(...\)} as inline math delimiters.
  6096. @end itemize
  6097. @noindent For example:
  6098. @example
  6099. \begin@{equation@} % arbitrary environments,
  6100. x=\sqrt@{b@} % even tables, figures
  6101. \end@{equation@} % etc
  6102. If $a^2=b$ and \( b=2 \), then the solution must be
  6103. either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
  6104. @end example
  6105. @noindent
  6106. If you need any of the delimiter ASCII sequences for other purposes, you
  6107. can configure the option @code{org-format-latex-options} to deselect the
  6108. ones you do not wish to have interpreted by the La@TeX{} converter.
  6109. @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
  6110. @section Processing LaTeX fragments
  6111. @cindex LaTeX fragments, preview
  6112. La@TeX{} fragments can be processed to produce a preview images of the
  6113. typeset expressions:
  6114. @table @kbd
  6115. @kindex C-c C-x C-l
  6116. @item C-c C-x C-l
  6117. Produce a preview image of the La@TeX{} fragment at point and overlay it
  6118. over the source code. If there is no fragment at point, process all
  6119. fragments in the current entry (between two headlines). When called
  6120. with a prefix argument, process the entire subtree. When called with
  6121. two prefix arguments, or when the cursor is before the first headline,
  6122. process the entire buffer.
  6123. @kindex C-c C-c
  6124. @item C-c C-c
  6125. Remove the overlay preview images.
  6126. @end table
  6127. During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
  6128. converted into images and inlined into the document if the following
  6129. setting is active:
  6130. @lisp
  6131. (setq org-export-with-LaTeX-fragments t)
  6132. @end lisp
  6133. @node CDLaTeX mode, , Processing LaTeX fragments, Embedded LaTeX
  6134. @section Using CDLaTeX to enter math
  6135. @cindex CDLaTeX
  6136. CDLaTeX mode is a minor mode that is normally used in combination with a
  6137. major La@TeX{} mode like AUCTeX in order to speed-up insertion of
  6138. environments and math templates. Inside Org mode, you can make use of
  6139. some of the features of CDLaTeX mode. You need to install
  6140. @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
  6141. AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
  6142. Don't use CDLaTeX mode itself under Org mode, but use the light
  6143. version @code{org-cdlatex-mode} that comes as part of Org mode. Turn it
  6144. on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
  6145. Org files with
  6146. @lisp
  6147. (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
  6148. @end lisp
  6149. When this mode is enabled, the following features are present (for more
  6150. details see the documentation of CDLaTeX mode):
  6151. @itemize @bullet
  6152. @kindex C-c @{
  6153. @item
  6154. Environment templates can be inserted with @kbd{C-c @{}.
  6155. @item
  6156. @kindex @key{TAB}
  6157. The @key{TAB} key will do template expansion if the cursor is inside a
  6158. La@TeX{} fragment@footnote{Org mode has a method to test if the cursor is
  6159. inside such a fragment, see the documentation of the function
  6160. @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
  6161. expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
  6162. correctly inside the first brace. Another @key{TAB} will get you into
  6163. the second brace. Even outside fragments, @key{TAB} will expand
  6164. environment abbreviations at the beginning of a line. For example, if
  6165. you write @samp{equ} at the beginning of a line and press @key{TAB},
  6166. this abbreviation will be expanded to an @code{equation} environment.
  6167. To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
  6168. @item
  6169. @kindex _
  6170. @kindex ^
  6171. Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
  6172. characters together with a pair of braces. If you use @key{TAB} to move
  6173. out of the braces, and if the braces surround only a single character or
  6174. macro, they are removed again (depending on the variable
  6175. @code{cdlatex-simplify-sub-super-scripts}).
  6176. @item
  6177. @kindex `
  6178. Pressing the backquote @kbd{`} followed by a character inserts math
  6179. macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
  6180. after the backquote, a help window will pop up.
  6181. @item
  6182. @kindex '
  6183. Pressing the normal quote @kbd{'} followed by another character modifies
  6184. the symbol before point with an accent or a font. If you wait more than
  6185. 1.5 seconds after the backquote, a help window will pop up. Character
  6186. modification will work only inside La@TeX{} fragments, outside the quote
  6187. is normal.
  6188. @end itemize
  6189. @node Exporting, Publishing, Embedded LaTeX, Top
  6190. @chapter Exporting
  6191. @cindex exporting
  6192. Org mode documents can be exported into a variety of other formats. For
  6193. printing and sharing of notes, ASCII export produces a readable and
  6194. simple version of an Org file. HTML export allows you to publish a
  6195. notes file on the web, while the XOXO format provides a solid base for
  6196. exchange with a broad range of other applications. La@TeX{} export lets
  6197. you use Org mode and its structured editing functions to easily create
  6198. La@TeX{} files. To incorporate entries with associated times like
  6199. deadlines or appointments into a desktop calendar program like iCal,
  6200. Org mode can also produce extracts in the iCalendar format. Currently
  6201. Org mode only supports export, not import of these different formats.
  6202. @menu
  6203. * Markup rules:: Which structures are recognized?
  6204. * Selective export:: Using tags to select and exclude trees
  6205. * Export options:: Per-file export settings
  6206. * The export dispatcher:: How to access exporter commands
  6207. * ASCII export:: Exporting to plain ASCII
  6208. * HTML export:: Exporting to HTML
  6209. * LaTeX and PDF export:: Exporting to LaTeX, and processing to PDF
  6210. * XOXO export:: Exporting to XOXO
  6211. * iCalendar export:: Exporting in iCalendar format
  6212. @end menu
  6213. @node Markup rules, Selective export, Exporting, Exporting
  6214. @section Markup rules
  6215. When exporting Org mode documents, the exporter tries to reflect the
  6216. structure of the document as accurately as possible in the back-end. Since
  6217. export targets like HTML or La@TeX{} allow much richer formatting, Org mode
  6218. has rules how to prepare text for rich export. This section summarizes the
  6219. markup rule used in an Org mode buffer.
  6220. @menu
  6221. * Document title:: How the document title is determined
  6222. * Headings and sections:: The main structure of the exported document
  6223. * Table of contents:: If, where, how to create a table of contents
  6224. * Initial text:: Text before the first headline
  6225. * Lists:: Plain lists are exported
  6226. * Paragraphs:: What determines beginning and ending
  6227. * Literal examples:: Source code and other examples
  6228. * Include files:: Include the contents of a file during export
  6229. * Tables exported:: Tables are exported richly
  6230. * Inlined images:: How to inline images during export
  6231. * Footnotes:: Numbers like [1]
  6232. * Emphasis and monospace:: To bold or not to bold
  6233. * TeX macros and LaTeX fragments:: Create special, rich export.
  6234. * Horizontal rules:: A line across the page
  6235. * Comment lines:: Some lines will not be exported
  6236. @end menu
  6237. @node Document title, Headings and sections, Markup rules, Markup rules
  6238. @subheading Document title
  6239. @cindex document title, markup rules
  6240. @noindent
  6241. The title of the exported document is taken from the special line
  6242. @example
  6243. #+TITLE: This is the title of the document
  6244. @end example
  6245. @noindent
  6246. If this line does not exist, the title is derived from the first non-empty,
  6247. non-comment line in the buffer. If no such line exists, or if you have
  6248. turned off exporting of the text before the first headline (see below), the
  6249. title will be the file name without extension.
  6250. If you are exporting only a subtree by marking is as the region, the heading
  6251. of the subtree will become the title of the document. If the subtree has a
  6252. property @code{EXPORT_TITLE}, that will take precedence.
  6253. @node Headings and sections, Table of contents, Document title, Markup rules
  6254. @subheading Headings and sections
  6255. @cindex headings and sections, markup rules
  6256. The outline structure of the document as described in @ref{Document
  6257. Structure} forms the basis for defining sections of the exported document.
  6258. However, since the outline structure is also used for (for example) lists of
  6259. tasks, only the first three outline levels will be used as headings. Deeper
  6260. levels will become itemized lists. You can change the location of this
  6261. switch, globally by setting the variable @code{org-headline-levels}, or on a
  6262. per file basis with a line
  6263. @example
  6264. #+OPTIONS: H:4
  6265. @end example
  6266. @node Table of contents, Initial text, Headings and sections, Markup rules
  6267. @subheading Table of contents
  6268. @cindex table of contents, markup rules
  6269. The table of contents is normally inserted directly before the first headline
  6270. of the file. If you would like to get it to a different location, insert the
  6271. string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
  6272. location. The depth of the table of contents is by default the same as the
  6273. number of headline levels, but you can choose a smaller number or turn off
  6274. the table of contents entirely by configuring the variable
  6275. @code{org-export-with-toc}, or on a per-file basis with a line like
  6276. @example
  6277. #+OPTIONS: toc:2 (only to two levels in TOC)
  6278. #+OPTIONS: toc:nil (no TOC at all)
  6279. @end example
  6280. @node Initial text, Lists, Table of contents, Markup rules
  6281. @subheading Text before the first headline
  6282. @cindex text before first headline, markup rules
  6283. @cindex #+TEXT
  6284. Org mode normally exports the text before the first headline, and even uses
  6285. the first line as the document title. The text will be fully marked up. If
  6286. you need to include literal HTML or La@TeX{} code, use the special constructs
  6287. described below in the sections for the individual exporters.
  6288. Some people like to use the space before the first headline for setup and
  6289. internal links and therefore would like to control the exported text before
  6290. the first headline in a different way. You can do so by setting the variable
  6291. @code{org-export-skip-text-before-1st-heading} to @code{t}. On a per-file
  6292. basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
  6293. @noindent
  6294. If you still want to have some text before the first headline, use the
  6295. @code{#+TEXT} construct:
  6296. @example
  6297. #+OPTIONS: skip:t
  6298. #+TEXT: This text will go before the *first* headline.
  6299. #+TEXT: [TABLE-OF-CONTENTS]
  6300. #+TEXT: This goes between the table of contents and the first headline
  6301. @end example
  6302. @node Lists, Paragraphs, Initial text, Markup rules
  6303. @subheading Lists
  6304. @cindex lists, markup rules
  6305. Plain lists as described in @ref{Plain lists} are translated to the back-ends
  6306. syntax for such lists. Most back-ends support unordered, ordered, and
  6307. description lists.
  6308. @node Paragraphs, Literal examples, Lists, Markup rules
  6309. @subheading Paragraphs, line breaks, and quoting
  6310. @cindex paragraphs, markup rules
  6311. Paragraphs are separated by at least one empty line. If you need to enforce
  6312. a line break within a paragraph, use @samp{\\} at the end of a line.
  6313. To keep the line breaks in a region, but otherwise use normal formatting, you
  6314. can use this construct, which can also be used to format poetry.
  6315. @example
  6316. #+BEGIN_VERSE
  6317. Great clouds overhead
  6318. Tiny black birds rise and fall
  6319. Snow covers Emacs
  6320. -- AlexSchroeder
  6321. #+END_VERSE
  6322. @end example
  6323. When quoting a passage from another document, it is customary to format this
  6324. as a paragraph that is indented on both the left and the right margin. You
  6325. can include quotations in Org mode documents like this:
  6326. @example
  6327. #+BEGIN_QUOTE
  6328. Everything should be made as simple as possible,
  6329. but not any simpler -- Albert Einstein
  6330. #+END_QUOTE
  6331. @end example
  6332. @node Literal examples, Include files, Paragraphs, Markup rules
  6333. @subheading Literal examples
  6334. @cindex literal examples, markup rules
  6335. You can include literal examples that should not be subjected to
  6336. markup. Such examples will be typeset in monospace, so this is well suited
  6337. for source code and similar examples.
  6338. @cindex #+BEGIN_EXAMPLE
  6339. @example
  6340. #+BEGIN_EXAMPLE
  6341. Some example from a text file.
  6342. #+END_EXAMPLE
  6343. @end example
  6344. For simplicity when using small examples, you can also start the example
  6345. lines with a colon:
  6346. @example
  6347. : Some example from a text file.
  6348. @end example
  6349. @cindex formatting source code, markup rules
  6350. If the example is source code from a programming language, or any other text
  6351. that can be marked up by font-lock in Emacs, you can ask for the example to
  6352. look like the fontified Emacs buffer@footnote{Currently this works only for
  6353. the HTML back-end, and requires the @file{htmlize.el} package version 1.34 or
  6354. later.}. This is done with the @samp{src} block, where you also need to
  6355. specify the name of the major mode that should be used to fontify the
  6356. example:
  6357. @cindex #+BEGIN_SRC
  6358. @example
  6359. #+BEGIN_SRC emacs-lisp
  6360. (defun org-xor (a b)
  6361. "Exclusive or."
  6362. (if a (not b) b))
  6363. #+END_SRC
  6364. @end example
  6365. @table @kbd
  6366. @kindex C-c '
  6367. @item C-c '
  6368. Edit the source code example at point in its native mode. This works by
  6369. switching to an indirect buffer, narrowing the buffer and switching to the
  6370. other mode. You need to exit by pressing @kbd{C-c '} again@footnote{Upon
  6371. exit, lines starting with @samp{*} or @samp{#} will get a comma prepended, to
  6372. keep them from being interpreted by Org as outline nodes or special
  6373. comments. These commas will be striped for editing with @kbd{C-c '}, and
  6374. also for export.}. Fixed-width
  6375. regions (where each line starts with a colon followed by a space) will be
  6376. edited using @code{artist-mode}@footnote{You may select a different-mode with
  6377. the variable @code{org-edit-fixed-width-region-mode}.} to allow creating
  6378. ASCII drawings easily. Using this command in an empty line will create a new
  6379. fixed-width region.
  6380. @end table
  6381. @node Include files, Tables exported, Literal examples, Markup rules
  6382. @subheading Include files
  6383. @cindex include files, markup rules
  6384. During export, you can include the content of another file. For example, to
  6385. include your .emacs file, you could use:
  6386. @cindex #+INCLUDE
  6387. @example
  6388. #+INCLUDE: "~/.emacs" src emacs-lisp
  6389. @end example
  6390. The optional second and third parameter are the markup (@samp{quote},
  6391. @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
  6392. language for formatting the contents. The markup is optional, if it is not
  6393. given, the text will be assumed to be in Org mode format and will be
  6394. processed normally. The include line will also allow additional keyword
  6395. parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
  6396. first line and for each following line. For example, to include a file as an
  6397. item, use
  6398. @example
  6399. #+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
  6400. @end example
  6401. @table @kbd
  6402. @kindex C-c '
  6403. @item C-c '
  6404. Visit the include file at point.
  6405. @end table
  6406. @node Tables exported, Inlined images, Include files, Markup rules
  6407. @subheading Tables
  6408. @cindex tables, markup rules
  6409. Both the native Org mode tables (@pxref{Tables}) and tables formatted with
  6410. the @file{table.el} package will be exported properly. For Org mode tables,
  6411. the lines before the first horizontal separator line will become table header
  6412. lines. You can use the following lines somewhere before the table to asssign
  6413. a caption and a label for cross references:
  6414. @example
  6415. #+CAPTION: This is the caption for the next table (or link)
  6416. #+LABEL: tbl:basic-data
  6417. @end example
  6418. @node Inlined images, Footnotes, Tables exported, Markup rules
  6419. @subheading Inlined Images
  6420. @cindex inlined images, markup rules
  6421. Some backends (HTML and LaTeX) allow to directly include images into the
  6422. exported document. Org does this, if a link to an image files does not have
  6423. a description part, for example @code{[[./img/a.jpg]]}. If you wish to
  6424. define a caption for the image and maybe a label for internal cross
  6425. references, you can use (before, but close to the link)
  6426. @example
  6427. #+CAPTION: This is the caption for the next figure link (or table)
  6428. #+LABEL: fig:SED-HR4049
  6429. @end example
  6430. You may also define additional attributes for the figure. As this is
  6431. backend-specific, see the sections about the individual backends for more
  6432. information.
  6433. @node Footnotes, Emphasis and monospace, Inlined images, Markup rules
  6434. @subheading Footnotes
  6435. @cindex footnotes, markup rules
  6436. @cindex @file{footnote.el}
  6437. @kindex C-c !
  6438. Numbers in square brackets are treated as footnote markers, and lines
  6439. starting with such a marker are interpreted as the footnote itself. You can
  6440. use the Emacs package @file{footnote.el} to create footnotes@footnote{The
  6441. @file{footnote} package uses @kbd{C-c !} to invoke its commands. This
  6442. binding conflicts with the Org mode command for inserting inactive time
  6443. stamps. You could use the variable @code{footnote-prefix} to switch
  6444. footnotes commands to another key. Or, if you are too used to this binding,
  6445. you could use @code{org-replace-disputed-keys} and @code{org-disputed-keys}
  6446. to change the settings in Org.}. For example:
  6447. @example
  6448. The Org homepage[1] now looks a lot better than it used to.
  6449. [1] The link is: http://orgmode.org
  6450. @end example
  6451. @node Emphasis and monospace, TeX macros and LaTeX fragments, Footnotes, Markup rules
  6452. @subheading Emphasis and monospace
  6453. @cindex underlined text, markup rules
  6454. @cindex bold text, markup rules
  6455. @cindex italic text, markup rules
  6456. @cindex verbatim text, markup rules
  6457. @cindex code text, markup rules
  6458. @cindex strike-through text, markup rules
  6459. You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
  6460. and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
  6461. in the code and verbatim string is not processed for Org mode specific
  6462. syntax, it is exported verbatim.
  6463. @node TeX macros and LaTeX fragments, Horizontal rules, Emphasis and monospace, Markup rules
  6464. @subheading @TeX{} macros and La@TeX{} fragments
  6465. @cindex LaTeX fragments, markup rules
  6466. @cindex TeX macros, markup rules
  6467. @cindex HTML entities
  6468. @cindex LaTeX entities
  6469. A @TeX{}-like syntax is used to specify special characters. Where possible,
  6470. these will be transformed into the native format of the exporter back-end.
  6471. Strings like @code{\alpha} will be exported as @code{&alpha;} in the HTML
  6472. output, and as @code{$\alpha$} in the La@TeX{} output. Similarly,
  6473. @code{\nbsp} will become @code{&nbsp;} in HTML and @code{~} in La@TeX{}.
  6474. This applies for a large number of entities, with names taken from both HTML
  6475. and La@TeX{}, see the variable @code{org-html-entities} for the complete
  6476. list. If you are unsure about a name, use @kbd{M-@key{TAB}} for completion
  6477. after having types the backslash and maybe a few characters
  6478. (@pxref{Completion}).
  6479. La@TeX{} fragments are converted into images for HTML export, and they are
  6480. written literally into the La@TeX{} export. See also @ref{Embedded LaTeX}.
  6481. Finally, @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
  6482. @samp{...} are all converted into special commands creating hyphens of
  6483. different lengths or a compact set of dots.
  6484. @node Horizontal rules, Comment lines, TeX macros and LaTeX fragments, Markup rules
  6485. @subheading Horizontal rules
  6486. @cindex horizontal rules, markup rules
  6487. A line consisting of only dashes, and at least 5 of them, will be
  6488. exported as a horizontal line (@samp{<hr/>} in HTML).
  6489. @node Comment lines, , Horizontal rules, Markup rules
  6490. @subheading Comment lines
  6491. @cindex comment lines
  6492. @cindex exporting, not
  6493. Lines starting with @samp{#} in column zero are treated as comments and will
  6494. never be exported. Also entire subtrees starting with the word
  6495. @samp{COMMENT} will never be exported. Finally, regions surrounded by
  6496. @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
  6497. @table @kbd
  6498. @kindex C-c ;
  6499. @item C-c ;
  6500. Toggle the COMMENT keyword at the beginning of an entry.
  6501. @end table
  6502. @node Selective export, Export options, Markup rules, Exporting
  6503. @section Selective export
  6504. @cindex export, selective by tags
  6505. You may use tags to select the parts of a document that should be exported,
  6506. or to exclude parts from export. This behavior is governed by two variables:
  6507. @code{org-export-select-tags} and @code{org-export-exclude-tags}.
  6508. Org first checks if any of the @emph{select} tags is present in the buffer.
  6509. If yes, all trees that do not carry one of these tags will be excluded. If a
  6510. selected tree is a subtree, the heading hierarchy above it will also be
  6511. selected for export, but not the text below those headings.
  6512. @noindent
  6513. If none of the select tags is found, the whole buffer will be selected for
  6514. export.
  6515. @noindent
  6516. Finally, all subtrees that are marked by any of the @emph{exclude} tags will
  6517. be removed from the export buffer.
  6518. @node Export options, The export dispatcher, Selective export, Exporting
  6519. @section Export options
  6520. @cindex options, for export
  6521. @cindex completion, of option keywords
  6522. The exporter recognizes special lines in the buffer which provide
  6523. additional information. These lines may be put anywhere in the file.
  6524. The whole set of lines can be inserted into the buffer with @kbd{C-c
  6525. C-e t}. For individual lines, a good way to make sure the keyword is
  6526. correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
  6527. (@pxref{Completion}).
  6528. @table @kbd
  6529. @kindex C-c C-e t
  6530. @item C-c C-e t
  6531. Insert template with export options, see example below.
  6532. @end table
  6533. @cindex #+TITLE:
  6534. @cindex #+AUTHOR:
  6535. @cindex #+DATE:
  6536. @cindex #+EMAIL:
  6537. @cindex #+LANGUAGE:
  6538. @cindex #+TEXT:
  6539. @cindex #+OPTIONS:
  6540. @cindex #+LINK_UP:
  6541. @cindex #+LINK_HOME:
  6542. @cindex #+EXPORT_SELECT_TAGS:
  6543. @cindex #+EXPORT_EXCLUDE_TAGS:
  6544. @example
  6545. #+TITLE: the title to be shown (default is the buffer name)
  6546. #+AUTHOR: the author (default taken from @code{user-full-name})
  6547. #+DATE: A date, fixed, of a format string for @code{format-time-string}
  6548. #+EMAIL: his/her email address (default from @code{user-mail-address})
  6549. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  6550. #+TEXT: Some descriptive text to be inserted at the beginning.
  6551. #+TEXT: Several lines may be given.
  6552. #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
  6553. #+LINK_UP: the ``up'' link of an exported page
  6554. #+LINK_HOME: the ``home'' link of an exported page
  6555. #+EXPORT_SELECT_TAGS: Tags that select a tree for export
  6556. #+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
  6557. @end example
  6558. @noindent
  6559. The OPTIONS line is a compact@footnote{If you want to configure many options
  6560. this way, you can use several OPTIONS lines.} form to specify export settings. Here
  6561. you can:
  6562. @cindex headline levels
  6563. @cindex section-numbers
  6564. @cindex table of contents
  6565. @cindex line-break preservation
  6566. @cindex quoted HTML tags
  6567. @cindex fixed-width sections
  6568. @cindex tables
  6569. @cindex @TeX{}-like syntax for sub- and superscripts
  6570. @cindex footnotes
  6571. @cindex special strings
  6572. @cindex emphasized text
  6573. @cindex @TeX{} macros
  6574. @cindex La@TeX{} fragments
  6575. @cindex author info, in export
  6576. @cindex time info, in export
  6577. @example
  6578. H: @r{set the number of headline levels for export}
  6579. num: @r{turn on/off section-numbers}
  6580. toc: @r{turn on/off table of contents, or set level limit (integer)}
  6581. \n: @r{turn on/off line-break-preservation}
  6582. @@: @r{turn on/off quoted HTML tags}
  6583. :: @r{turn on/off fixed-width sections}
  6584. |: @r{turn on/off tables}
  6585. ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
  6586. @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
  6587. @r{the simple @code{a_b} will be left as it is.}
  6588. -: @r{turn on/off conversion of special strings.}
  6589. f: @r{turn on/off footnotes like this[1].}
  6590. todo: @r{turn on/off inclusion of TODO keywords into exported text}
  6591. pri: @r{turn on/off priority cookies}
  6592. tags: @r{turn on/off inclusion of tags, may also be @code{not-in-toc}}
  6593. <: @r{turn on/off inclusion of any time/date stamps like DEADLINES}
  6594. *: @r{turn on/off emphasized text (bold, italic, underlined)}
  6595. TeX: @r{turn on/off simple @TeX{} macros in plain text}
  6596. LaTeX: @r{turn on/off La@TeX{} fragments}
  6597. skip: @r{turn on/off skipping the text before the first heading}
  6598. author: @r{turn on/off inclusion of author name/email into exported file}
  6599. creator: @r{turn on/off inclusion of creator info into exported file}
  6600. timestamp: @r{turn on/off inclusion creation time into exported file}
  6601. d: @r{turn on/off inclusion of drawers}
  6602. @end example
  6603. These options take effect in both the HTML and La@TeX{} export, except
  6604. for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
  6605. @code{nil} for the La@TeX{} export.
  6606. When exporting only a single subtree by selecting it with @kbd{C-c @@} before
  6607. calling an export command, the subtree can overrule some of the file's export
  6608. settings with properties @code{EXPORT_FILE_NAME}, @code{EXPORT_TITLE},
  6609. @code{EXPORT_TEXT}, and @code{EXPORT_OPTIONS}.
  6610. @node The export dispatcher, ASCII export, Export options, Exporting
  6611. @section The export dispatcher
  6612. @cindex dispatcher, for export commands
  6613. All export commands can be reached using the export dispatcher, which is a
  6614. prefix key that prompts for an additional key specifying the command.
  6615. Normally the entire file is exported, but if there is an active region that
  6616. contains one outline tree, the first heading is used as document title and
  6617. the subtrees are exported.
  6618. @table @kbd
  6619. @kindex C-c C-e
  6620. @item C-c C-e
  6621. Dispatcher for export and publishing commands. Displays a help-window
  6622. listing the additional key(s) needed to launch an export or publishing
  6623. command. The prefix arg is passed through to the exporter. A double prefix
  6624. @kbd{C-u C-u} causes most commands to be executed in the background, in a
  6625. separate emacs process@footnote{To make this behavior the default, customize
  6626. the variable @code{org-export-run-in-background}.}.
  6627. @kindex C-c C-e v
  6628. @item C-c C-e v
  6629. Like @kbd{C-c C-e}, but only export the text that is currently visible
  6630. (i.e. not hidden by outline visibility).
  6631. @kindex C-u C-u C-c C-e
  6632. @item C-u C-u C-c C-e
  6633. Call an the exporter, but reverse the setting of
  6634. @code{org-export-run-in-background}, i.e. request background processing if
  6635. not set, or force processing in the current Emacs process if st.
  6636. @end table
  6637. @node ASCII export, HTML export, The export dispatcher, Exporting
  6638. @section ASCII export
  6639. @cindex ASCII export
  6640. ASCII export produces a simple and very readable version of an Org mode
  6641. file.
  6642. @cindex region, active
  6643. @cindex active region
  6644. @cindex Transient mark mode
  6645. @table @kbd
  6646. @kindex C-c C-e a
  6647. @item C-c C-e a
  6648. Export as ASCII file. For an org file @file{myfile.org}, the ASCII file
  6649. will be @file{myfile.txt}. The file will be overwritten without
  6650. warning. If there is an active region, only the region will be
  6651. exported. If the selected region is a single tree@footnote{To select the
  6652. current subtree, use @kbd{C-c @@}.}, the tree head will
  6653. become the document title. If the tree head entry has or inherits an
  6654. @code{EXPORT_FILE_NAME} property, that name will be used for the
  6655. export.
  6656. @kindex C-c C-e v a
  6657. @item C-c C-e v a
  6658. Export only the visible part of the document.
  6659. @end table
  6660. @cindex headline levels, for exporting
  6661. In the exported version, the first 3 outline levels will become
  6662. headlines, defining a general document structure. Additional levels
  6663. will be exported as itemized lists. If you want that transition to occur
  6664. at a different level, specify it with a prefix argument. For example,
  6665. @example
  6666. @kbd{C-1 C-c C-e a}
  6667. @end example
  6668. @noindent
  6669. creates only top level headlines and does the rest as items. When
  6670. headlines are converted to items, the indentation of the text following
  6671. the headline is changed to fit nicely under the item. This is done with
  6672. the assumption that the first body line indicates the base indentation of
  6673. the body text. Any indentation larger than this is adjusted to preserve
  6674. the layout relative to the first line. Should there be lines with less
  6675. indentation than the first, these are left alone.
  6676. @node HTML export, LaTeX and PDF export, ASCII export, Exporting
  6677. @section HTML export
  6678. @cindex HTML export
  6679. Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
  6680. HTML formatting, in ways similar to John Gruber's @emph{markdown}
  6681. language, but with additional support for tables.
  6682. @menu
  6683. * HTML Export commands:: How to invoke HTML export
  6684. * Quoting HTML tags:: Using direct HTML in Org mode
  6685. * Links:: Transformation of links for HTML
  6686. * Images in HTML export::
  6687. * CSS support:: Changing the appearance of the output
  6688. * Javascript support:: Info and Folding in a web browser
  6689. @end menu
  6690. @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
  6691. @subsection HTML export commands
  6692. @cindex region, active
  6693. @cindex active region
  6694. @cindex Transient mark mode
  6695. @table @kbd
  6696. @kindex C-c C-e h
  6697. @item C-c C-e h
  6698. Export as HTML file @file{myfile.html}. For an org file @file{myfile.org},
  6699. the ASCII file will be @file{myfile.html}. The file will be overwritten
  6700. without warning. If there is an active region, only the region will be
  6701. exported. If the selected region is a single tree@footnote{To select the
  6702. current subtree, use @kbd{C-c @@}.}, the tree head will become the document
  6703. title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
  6704. property, that name will be used for the export.
  6705. @kindex C-c C-e b
  6706. @item C-c C-e b
  6707. Export as HTML file and immediately open it with a browser.
  6708. @kindex C-c C-e H
  6709. @item C-c C-e H
  6710. Export to a temporary buffer, do not create a file.
  6711. @kindex C-c C-e R
  6712. @item C-c C-e R
  6713. Export the active region to a temporary buffer. With a prefix argument, do
  6714. not produce the file header and footer, but just the plain HTML section for
  6715. the region. This is good for cut-and-paste operations.
  6716. @kindex C-c C-e v h
  6717. @kindex C-c C-e v b
  6718. @kindex C-c C-e v H
  6719. @kindex C-c C-e v R
  6720. @item C-c C-e v h
  6721. @item C-c C-e v b
  6722. @item C-c C-e v H
  6723. @item C-c C-e v R
  6724. Export only the visible part of the document.
  6725. @item M-x org-export-region-as-html
  6726. Convert the region to HTML under the assumption that it was Org mode
  6727. syntax before. This is a global command that can be invoked in any
  6728. buffer.
  6729. @item M-x org-replace-region-by-HTML
  6730. Replace the active region (assumed to be in Org mode syntax) by HTML
  6731. code.
  6732. @end table
  6733. @cindex headline levels, for exporting
  6734. In the exported version, the first 3 outline levels will become headlines,
  6735. defining a general document structure. Additional levels will be exported as
  6736. itemized lists. If you want that transition to occur at a different level,
  6737. specify it with a numeric prefix argument. For example,
  6738. @example
  6739. @kbd{C-2 C-c C-e b}
  6740. @end example
  6741. @noindent
  6742. creates two levels of headings and does the rest as items.
  6743. @node Quoting HTML tags, Links, HTML Export commands, HTML export
  6744. @subsection Quoting HTML tags
  6745. Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
  6746. @samp{&gt;} in HTML export. If you want to include simple HTML tags
  6747. which should be interpreted as such, mark them with @samp{@@} as in
  6748. @samp{@@<b>bold text@@</b>}. Note that this really works only for
  6749. simple tags. For more extensive HTML that should be copied verbatim to
  6750. the exported file use either
  6751. @example
  6752. #+HTML: Literal HTML code for export
  6753. @end example
  6754. @noindent or
  6755. @cindex #+BEGIN_HTML
  6756. @example
  6757. #+BEGIN_HTML
  6758. All lines between these markers are exported literally
  6759. #+END_HTML
  6760. @end example
  6761. @node Links, Images in HTML export, Quoting HTML tags, HTML export
  6762. @subsection Links
  6763. @cindex links, in HTML export
  6764. @cindex internal links, in HTML export
  6765. @cindex external links, in HTML export
  6766. Internal links (@pxref{Internal links}) will continue to work in HTML.
  6767. Automatic links created by radio targets (@pxref{Radio targets}) will also
  6768. work in the HTML file. Links to external files will still work if the HTML
  6769. file is in the same directory as the Org file. Links to other @file{.org}
  6770. files will be translated into HTML links under the assumption that an HTML
  6771. version also exists of the linked file. For information related to linking
  6772. files while publishing them to a publishing directory see @ref{Publishing
  6773. links}.
  6774. If you want to specify attributes for links, you can do so using a special
  6775. @code{#+ATTR_HTML} line to define attributes that wil be added to the
  6776. @code{<a>} or @code{<img>} tags. Here is an example that sets @code{alt} and
  6777. @code{title} attributes for an inlined image:
  6778. @example
  6779. #+ATTR_HTML: alt="This is image A" title="Image with no action"
  6780. [[./img/a.jpg]]
  6781. @end example
  6782. @node Images in HTML export, CSS support, Links, HTML export
  6783. @subsection Images
  6784. @cindex images, inline in HTML
  6785. @cindex inlining images in HTML
  6786. HTML export can inline images given as links in the Org file, and
  6787. it can make an image the clickable part of a link. By
  6788. default@footnote{but see the variable
  6789. @code{org-export-html-inline-images}}, images are inlined if a link does
  6790. not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
  6791. while @samp{[[file:myimg.jpg][the image]]} will just produce a link
  6792. @samp{the image} that points to the image. If the description part
  6793. itself is a @code{file:} link or a @code{http:} URL pointing to an
  6794. image, this image will be inlined and activated so that clicking on the
  6795. image will activate the link. For example, to include a thumbnail that
  6796. will link to a high resolution version of the image, you could use:
  6797. @example
  6798. [[file:highres.jpg][file:thumb.jpg]]
  6799. @end example
  6800. @noindent
  6801. and you could use @code{http} addresses just as well.
  6802. @node CSS support, Javascript support, Images in HTML export, HTML export
  6803. @subsection CSS support
  6804. @cindex CSS, for HTML export
  6805. @cindex HTML export, CSS
  6806. You can also give style information for the exported file. The HTML
  6807. exporter assigns the following CSS classes to appropriate parts of the
  6808. document - your style specifications may change these:
  6809. @example
  6810. .todo @r{TODO keywords}
  6811. .done @r{the DONE keyword}
  6812. .timestamp @r{time stamp}
  6813. .timestamp-kwd @r{keyword associated with a time stamp, like SCHEDULED}
  6814. .tag @r{tag in a headline}
  6815. .target @r{target for links}
  6816. @end example
  6817. Each exported files contains a compact default style that defines these
  6818. classes in a basic way@footnote{This style is defined in the constant
  6819. @code{org-export-html-style-default}, which you should not modify. To turn
  6820. inclusion of these defaults off, customize
  6821. @code{org-export-html-style-include-default}}. You may overwrite these
  6822. settings, or add to them by using the variables @code{org-export-html-style}
  6823. (for Org-wide settings) and @code{org-export-html-style-extra} (for more
  6824. granular settings, like file-local settings). To set the latter variable
  6825. individually for each file, you can use
  6826. @example
  6827. #+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
  6828. @end example
  6829. @noindent
  6830. For longer style definitions, you can use several such lines. You could also
  6831. directly write a @code{<style>} @code{</style>} section in this way, without
  6832. referring to an external file.
  6833. @c FIXME: More about header and footer styles
  6834. @c FIXME: Talk about links and targets.
  6835. @node Javascript support, , CSS support, HTML export
  6836. @subsection Javascript supported display of web pages
  6837. @emph{Sebastian Rose} has written a JavaScript program especially designed to
  6838. enhance the web viewing experience of HTML files created with Org. This
  6839. program allows you to view large files in two different ways. The first one is
  6840. an @emph{Info}-like mode where each section is displayed separately and
  6841. navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
  6842. as well, press @kbd{?} for an overview of the available keys). The second
  6843. view type is a @emph{folding} view much like Org provides inside Emacs.
  6844. The script is available at @url{http://orgmode.org/org-info.js} and you can
  6845. find the documentation for it at
  6846. @url{http://orgmode.org/worg/code/org-info-js/org-info.js.html}. We are
  6847. serving the script from our site, but if you use it a lot, you might not want
  6848. to be dependent on @url{orgmode.org} and prefer to install a local copy on
  6849. your own web server.
  6850. To use the script, you need to make sure that the @file{org-jsinfo.el} module
  6851. gets loaded. It should be loaded by default, but you can try @kbd{M-x
  6852. customize-variable @key{RET} org-modules @key{RET}} to convince yourself that
  6853. this is indeed the case. All it then takes to make use of the program is
  6854. adding a single line to the Org file:
  6855. @example
  6856. #+INFOJS_OPT: view:info toc:nil
  6857. @end example
  6858. @noindent
  6859. If this line is found, the HTML header will automatically contain the code
  6860. needed to invoke the script. Using the line above, you can set the following
  6861. viewing options:
  6862. @example
  6863. path: @r{The path to the script. The default is to grab the script from}
  6864. @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
  6865. @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
  6866. view: @r{Initial view when website is first shown. Possible values are:}
  6867. info @r{Info-like interface with one section per page.}
  6868. overview @r{Folding interface, initially showing only top-level.}
  6869. content @r{Folding interface, starting with all headlines visible.}
  6870. showall @r{Folding interface, all headlines and text visible.}
  6871. sdepth: @r{Maximum headline level that will still become an independent}
  6872. @r{section for info and folding modes. The default is taken from}
  6873. @r{@code{org-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
  6874. @r{If this is smaller than in @code{org-headline-levels}, each}
  6875. @r{info/folding section can still contain children headlines.}
  6876. toc: @r{Should the table of content @emph{initially} be visible?}
  6877. @r{Even when @code{nil}, you can always get to the toc with @kbd{i}.}
  6878. tdepth: @r{The depth of the table of contents. The defaults are taken from}
  6879. @r{the variables @code{org-headline-levels} and @code{org-export-with-toc}.}
  6880. ftoc: @r{Does the css of the page specify a fixed position for the toc?}
  6881. @r{If yes, the toc will never be displayed as a section.}
  6882. ltoc: @r{Should there be short contents (children) in each section?}
  6883. mouse: @r{Headings are highlighted when the mouse is over them. Should be}
  6884. @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
  6885. buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the}
  6886. @r{default), only one such button will be present.}
  6887. @end example
  6888. You can choose default values for these options by customizing the variable
  6889. @code{org-infojs-options}. If you always want to apply the script to your
  6890. pages, configure the variable @code{org-export-html-use-infojs}.
  6891. @node LaTeX and PDF export, XOXO export, HTML export, Exporting
  6892. @section LaTeX and PDF export
  6893. @cindex LaTeX export
  6894. @cindex PDF export
  6895. Org mode contains a La@TeX{} exporter written by Bastien Guerry. With
  6896. further processing, this backend is also used to produce PDF output. Since
  6897. the LaTeX output uses @file{hyperref} to implement links and cross
  6898. references, the PDF output file will be fully linked.
  6899. @menu
  6900. * LaTeX/PDF export commands:: Which key invode which commands
  6901. * Quoting LaTeX code:: Incorporating literal LaTeX code
  6902. * Sectioning structure:: Changing sectioning in LaTeX output
  6903. * Tables in LaTeX export:: Options for exporting tables to LaTeX
  6904. * Images in LaTeX export:: How to insert figures into LaTeX output
  6905. @end menu
  6906. @node LaTeX/PDF export commands, Quoting LaTeX code, LaTeX and PDF export, LaTeX and PDF export
  6907. @subsection LaTeX export commands
  6908. @table @kbd
  6909. @kindex C-c C-e l
  6910. @item C-c C-e l
  6911. Export as La@TeX{} file @file{myfile.tex}. For an org file
  6912. @file{myfile.org}, the ASCII file will be @file{myfile.tex}. The file will
  6913. be overwritten without warning. If there is an active region, only the
  6914. region will be exported. If the selected region is a single tree@footnote{To
  6915. select the current subtree, use @kbd{C-c @@}.}, the tree head will become the
  6916. document title. If the tree head entry has or inherits an
  6917. @code{EXPORT_FILE_NAME} property, that name will be used for the export.
  6918. @kindex C-c C-e L
  6919. @item C-c C-e L
  6920. Export to a temporary buffer, do not create a file.
  6921. @kindex C-c C-e v l
  6922. @kindex C-c C-e v L
  6923. @item C-c C-e v l
  6924. @item C-c C-e v L
  6925. Export only the visible part of the document.
  6926. @item M-x org-export-region-as-latex
  6927. Convert the region to La@TeX{} under the assumption that it was Org mode
  6928. syntax before. This is a global command that can be invoked in any
  6929. buffer.
  6930. @item M-x org-replace-region-by-latex
  6931. Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
  6932. code.
  6933. @kindex C-c C-e p
  6934. @item C-c C-e p
  6935. Export as LaTeX and then process to PDF.
  6936. @kindex C-c C-e d
  6937. @item C-c C-e d
  6938. Export as LaTeX and then process to PDF, then open the resulting PDF file.
  6939. @end table
  6940. @cindex headline levels, for exporting
  6941. In the exported version, the first 3 outline levels will become
  6942. headlines, defining a general document structure. Additional levels
  6943. will be exported as description lists. The exporter can ignore them or
  6944. convert them to a custom string depending on
  6945. @code{org-latex-low-levels}.
  6946. If you want that transition to occur at a different level, specify it
  6947. with a numeric prefix argument. For example,
  6948. @example
  6949. @kbd{C-2 C-c C-e l}
  6950. @end example
  6951. @noindent
  6952. creates two levels of headings and does the rest as items.
  6953. @node Quoting LaTeX code, Sectioning structure, LaTeX/PDF export commands, LaTeX and PDF export
  6954. @subsection Quoting LaTeX code
  6955. Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
  6956. inserted into the La@TeX{} file. Furthermore, you can add special code
  6957. that should only be present in La@TeX{} export with the following
  6958. constructs:
  6959. @example
  6960. #+LaTeX: Literal LaTeX code for export
  6961. @end example
  6962. @noindent or
  6963. @cindex #+BEGIN_LaTeX
  6964. @example
  6965. #+BEGIN_LaTeX
  6966. All lines between these markers are exported literally
  6967. #+END_LaTeX
  6968. @end example
  6969. @node Sectioning structure, Tables in LaTeX export, Quoting LaTeX code, LaTeX and PDF export
  6970. @subsection Sectioning structure
  6971. @cindex LaTeX class
  6972. @cindex LaTeX sectioning structure
  6973. By default, the La@TeX{} output uses the class @code{article}.
  6974. You can change this globally by setting a different value for
  6975. @code{org-export-latex-default-class} or locally by adding an option like
  6976. @code{#+LaTeX_CLASS: myclass} in your file. The class should be listed in
  6977. @code{org-export-latex-classes}, where you can also define the sectioning
  6978. structure for each class, as well as defining additonal classes.
  6979. @node Tables in LaTeX export, Images in LaTeX export, Sectioning structure, LaTeX and PDF export
  6980. @subsection Tables in LaTeX export
  6981. @cindex tables, in LaTeX export
  6982. For LaTeX export of a table, you can specify a label and a caption
  6983. (@pxref{Tables exported}). You can also use the @code{ATTR_LaTeX} line to
  6984. request a longtable environment for the table, so that it may span several
  6985. pages:
  6986. @example
  6987. #+CAPTION: A long table
  6988. #+LABEL: tbl:long
  6989. #+ATTR_LaTeX: longtable
  6990. | ..... | ..... |
  6991. | ..... | ..... |
  6992. @end example
  6993. @node Images in LaTeX export, , Tables in LaTeX export, LaTeX and PDF export
  6994. @subsection Images in LaTeX export
  6995. @cindex images, inline in LaTeX
  6996. @cindex inlining images in LaTeX
  6997. Images that are linked to without a description part in the link, like
  6998. @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]} will be inserted into the PDF
  6999. output files resulting from LaTeX output. Org will use an
  7000. @code{\includegraphics} macro to insert the image. If you have specified a
  7001. caption and/or a label as described in @ref{Markup rules}, the figure will
  7002. be wrappend into a @code{figure} environment and thus become a floating
  7003. element. Finally, you can use an @code{#+ATTR_LaTeX:} line to specify the
  7004. options that can be used in the optional argument of the
  7005. @code{\includegraphics} macro.
  7006. @example
  7007. #+CAPTION: The black-body emission of the disk around HR 4049
  7008. #+LABEL: fig:SED-HR4049
  7009. #+ATTR_LaTeX: width=5cm,angle=90
  7010. [[./img/sed-hr4049.pdf]]
  7011. @end example
  7012. @node XOXO export, iCalendar export, LaTeX and PDF export, Exporting
  7013. @section XOXO export
  7014. @cindex XOXO export
  7015. Org mode contains an exporter that produces XOXO-style output.
  7016. Currently, this exporter only handles the general outline structure and
  7017. does not interpret any additional Org mode features.
  7018. @table @kbd
  7019. @kindex C-c C-e x
  7020. @item C-c C-e x
  7021. Export as XOXO file @file{myfile.html}.
  7022. @kindex C-c C-e v
  7023. @item C-c C-e v x
  7024. Export only the visible part of the document.
  7025. @end table
  7026. @node iCalendar export, , XOXO export, Exporting
  7027. @section iCalendar export
  7028. @cindex iCalendar export
  7029. Some people like to use Org mode for keeping track of projects, but still
  7030. prefer a standard calendar application for anniversaries and appointments.
  7031. In this case it can be useful to have deadlines and other time-stamped items
  7032. in Org files show up in the calendar application. Org mode can export
  7033. calendar information in the standard iCalendar format. If you also want to
  7034. have TODO entries included in the export, configure the variable
  7035. @code{org-icalendar-include-todo}. iCalendar export will export plain time
  7036. stamps as VEVENT, and TODO items as VTODO. It will also create events from
  7037. deadlines that are in non-TODO items. Deadlines and scheduling dates in TODO
  7038. items will be used to set the start and due dates for the todo
  7039. entry@footnote{See the variables @code{org-icalendar-use-deadline} and
  7040. @code{org-icalendar-use-scheduled}.}. As categories, it will use the tags
  7041. locally defined in the heading, and the file/tree category@footnote{To add
  7042. inherited tags or the TODO state, configure the variable
  7043. @code{org-icalendar-categories}.}.
  7044. The iCalendar standard requires each entry to have a globally unique
  7045. identifier (UID). Org creates these identifiers during export. If you set
  7046. the variable @code{org-icalendar-store-UID}, the UID will be stored in the
  7047. @code{:ID:} property of the entry and re-used next time you report this
  7048. entry. Since a single entry can give rise to multiple iCalendar entries (as
  7049. a timestamp, a deadline, a scheduled item, and as a TODO item), Org adds
  7050. prefixes to the UID, depending on what triggered the inclusion of the entry.
  7051. In this way the UID remains unique, but a synchronization program can still
  7052. figure out from which entry all the different instances originate.
  7053. @table @kbd
  7054. @kindex C-c C-e i
  7055. @item C-c C-e i
  7056. Create iCalendar entries for the current file and store them in the same
  7057. directory, using a file extension @file{.ics}.
  7058. @kindex C-c C-e I
  7059. @item C-c C-e I
  7060. Like @kbd{C-c C-e i}, but do this for all files in
  7061. @code{org-agenda-files}. For each of these files, a separate iCalendar
  7062. file will be written.
  7063. @kindex C-c C-e c
  7064. @item C-c C-e c
  7065. Create a single large iCalendar file from all files in
  7066. @code{org-agenda-files} and write it to the file given by
  7067. @code{org-combined-agenda-icalendar-file}.
  7068. @end table
  7069. The export will honor SUMMARY, DESCRIPTION and LOCATION@footnote{The LOCATION
  7070. property can be inherited from higher in the hierarchy if you configure
  7071. @code{org-use-property-inheritance} accordingly.} properties if the selected
  7072. entries have them. If not, the summary will be derived from the headline,
  7073. and the description from the body (limited to
  7074. @code{org-icalendar-include-body} characters).
  7075. How this calendar is best read and updated, that depends on the application
  7076. you are using. The FAQ covers this issue.
  7077. @node Publishing, Miscellaneous, Exporting, Top
  7078. @chapter Publishing
  7079. @cindex publishing
  7080. Org includes@footnote{@file{org-publish.el} is not distributed with
  7081. Emacs 21, if you are still using Emacs 21, you need you need to download
  7082. this file separately.} a publishing management system that allows you to
  7083. configure automatic HTML conversion of @emph{projects} composed of
  7084. interlinked org files. This system is called @emph{org-publish}. You can
  7085. also configure org-publish to automatically upload your exported HTML
  7086. pages and related attachments, such as images and source code files, to
  7087. a web server. Org-publish turns Org into a web-site authoring tool.
  7088. You can also use Org-publish to convert files into La@TeX{}, or even
  7089. combine HTML and La@TeX{} conversion so that files are available in both
  7090. formats on the server@footnote{Since La@TeX{} files on a server are not
  7091. that helpful, you surely want to perform further conversion on them --
  7092. e.g. convert them to @code{PDF} format.}.
  7093. Org-publish has been contributed to Org by David O'Toole.
  7094. @menu
  7095. * Configuration:: Defining projects
  7096. * Sample configuration:: Example projects
  7097. * Triggering publication:: Publication commands
  7098. @end menu
  7099. @node Configuration, Sample configuration, Publishing, Publishing
  7100. @section Configuration
  7101. Publishing needs significant configuration to specify files, destination
  7102. and many other properties of a project.
  7103. @menu
  7104. * Project alist:: The central configuration variable
  7105. * Sources and destinations:: From here to there
  7106. * Selecting files:: What files are part of the project?
  7107. * Publishing action:: Setting the function doing the publishing
  7108. * Publishing options:: Tweaking HTML export
  7109. * Publishing links:: Which links keep working after publishing?
  7110. * Project page index:: Publishing a list of project files
  7111. @end menu
  7112. @node Project alist, Sources and destinations, Configuration, Configuration
  7113. @subsection The variable @code{org-publish-project-alist}
  7114. @cindex org-publish-project-alist
  7115. @cindex projects, for publishing
  7116. Org-publish is configured almost entirely through setting the value of
  7117. one variable, called @code{org-publish-project-alist}.
  7118. Each element of the list configures one project, and may be in one of
  7119. the two following forms:
  7120. @lisp
  7121. ("project-name" :property value :property value ...)
  7122. @r{or}
  7123. ("project-name" :components ("project-name" "project-name" ...))
  7124. @end lisp
  7125. In both cases, projects are configured by specifying property values.
  7126. A project defines the set of files that will be published, as well as
  7127. the publishing configuration to use when publishing those files. When
  7128. a project takes the second form listed above, the individual members
  7129. of the ``components'' property are taken to be components of the
  7130. project, which group together files requiring different publishing
  7131. options. When you publish such a ``meta-project'' all the components
  7132. will also publish. The @code{:components} are published in the sequence
  7133. provided.
  7134. @node Sources and destinations, Selecting files, Project alist, Configuration
  7135. @subsection Sources and destinations for files
  7136. @cindex directories, for publishing
  7137. Most properties are optional, but some should always be set. In
  7138. particular, org-publish needs to know where to look for source files,
  7139. and where to put published files.
  7140. @multitable @columnfractions 0.3 0.7
  7141. @item @code{:base-directory}
  7142. @tab Directory containing publishing source files
  7143. @item @code{:publishing-directory}
  7144. @tab Directory (possibly remote) where output files will be published.
  7145. @item @code{:preparation-function}
  7146. @tab Function called before starting the publishing process, for example to
  7147. run @code{make} for updating files to be published.
  7148. @item @code{:completion-function}
  7149. @tab Function called after finishing the publishing process, for example to
  7150. change permissions of the resulting files.
  7151. @end multitable
  7152. @noindent
  7153. @node Selecting files, Publishing action, Sources and destinations, Configuration
  7154. @subsection Selecting files
  7155. @cindex files, selecting for publishing
  7156. By default, all files with extension @file{.org} in the base directory
  7157. are considered part of the project. This can be modified by setting the
  7158. properties
  7159. @multitable @columnfractions 0.25 0.75
  7160. @item @code{:base-extension}
  7161. @tab Extension (without the dot!) of source files. This actually is a
  7162. regular expression.
  7163. @item @code{:exclude}
  7164. @tab Regular expression to match file names that should not be
  7165. published, even though they have been selected on the basis of their
  7166. extension.
  7167. @item @code{:include}
  7168. @tab List of files to be included regardless of @code{:base-extension}
  7169. and @code{:exclude}.
  7170. @end multitable
  7171. @node Publishing action, Publishing options, Selecting files, Configuration
  7172. @subsection Publishing action
  7173. @cindex action, for publishing
  7174. Publishing means that a file is copied to the destination directory and
  7175. possibly transformed in the process. The default transformation is to export
  7176. Org files as HTML files, and this is done by the function
  7177. @code{org-publish-org-to-html} which calls the HTML exporter (@pxref{HTML
  7178. export}). But you also can publish your files in La@TeX{} by using the
  7179. function @code{org-publish-org-to-latex} instead, or as PDF files using
  7180. @code{org-publish-org-to-pdf}. Other files like images only need to be
  7181. copied to the publishing destination. For non-Org files, you need to provide
  7182. your own publishing function:
  7183. @multitable @columnfractions 0.3 0.7
  7184. @item @code{:publishing-function}
  7185. @tab Function executing the publication of a file. This may also be a
  7186. list of functions, which will all be called in turn.
  7187. @end multitable
  7188. The function must accept two arguments: a property list containing at
  7189. least a @code{:publishing-directory} property, and the name of the file
  7190. to be published. It should take the specified file, make the necessary
  7191. transformation (if any) and place the result into the destination folder.
  7192. You can write your own publishing function, but @code{org-publish}
  7193. provides one for attachments (files that only need to be copied):
  7194. @code{org-publish-attachment}.
  7195. @node Publishing options, Publishing links, Publishing action, Configuration
  7196. @subsection Options for the HTML/LaTeX exporters
  7197. @cindex options, for publishing
  7198. The property list can be used to set many export options for the HTML
  7199. and La@TeX{} exporters. In most cases, these properties correspond to user
  7200. variables in Org. The table below lists these properties along
  7201. with the variable they belong to. See the documentation string for the
  7202. respective variable for details.
  7203. @multitable @columnfractions 0.32 0.68
  7204. @item @code{:link-up} @tab @code{org-export-html-link-up}
  7205. @item @code{:link-home} @tab @code{org-export-html-link-home}
  7206. @item @code{:language} @tab @code{org-export-default-language}
  7207. @item @code{:customtime} @tab @code{org-display-custom-times}
  7208. @item @code{:headline-levels} @tab @code{org-export-headline-levels}
  7209. @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
  7210. @item @code{:section-number-format} @tab @code{org-export-section-number-format}
  7211. @item @code{:table-of-contents} @tab @code{org-export-with-toc}
  7212. @item @code{:preserve-breaks} @tab @code{org-export-preserve-breaks}
  7213. @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
  7214. @item @code{:emphasize} @tab @code{org-export-with-emphasize}
  7215. @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
  7216. @item @code{:special-strings} @tab @code{org-export-with-special-strings}
  7217. @item @code{:footnotes} @tab @code{org-export-with-footnotes}
  7218. @item @code{:drawers} @tab @code{org-export-with-drawers}
  7219. @item @code{:tags} @tab @code{org-export-with-tags}
  7220. @item @code{:todo-keywords} @tab @code{org-export-with-todo-keywords}
  7221. @item @code{:priority} @tab @code{org-export-with-priority}
  7222. @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
  7223. @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
  7224. @item @code{:skip-before-1st-heading} @tab @code{org-export-skip-text-before-1st-heading}
  7225. @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
  7226. @item @code{:timestamps} @tab @code{org-export-with-timestamps}
  7227. @item @code{:author-info} @tab @code{org-export-author-info}
  7228. @item @code{:creator-info} @tab @code{org-export-creator-info}
  7229. @item @code{:tables} @tab @code{org-export-with-tables}
  7230. @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
  7231. @item @code{:style-include-default} @tab @code{org-export-html-style-include-default}
  7232. @item @code{:style} @tab @code{org-export-html-style}
  7233. @item @code{:style-extra} @tab @code{org-export-html-style-extra}
  7234. @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
  7235. @item @code{:inline-images} @tab @code{org-export-html-inline-images}
  7236. @item @code{:html-extension} @tab @code{org-export-html-extension}
  7237. @item @code{:html-table-tag} @tab @code{org-export-html-table-tag}
  7238. @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
  7239. @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
  7240. @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
  7241. @item @code{:preamble} @tab @code{org-export-html-preamble}
  7242. @item @code{:postamble} @tab @code{org-export-html-postamble}
  7243. @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
  7244. @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
  7245. @item @code{:author} @tab @code{user-full-name}
  7246. @item @code{:email} @tab @code{user-mail-address}
  7247. @item @code{:select-tags} @tab @code{org-export-select-tags}
  7248. @item @code{:exclude-tags} @tab @code{org-export-exclude-tags}
  7249. @end multitable
  7250. If you use several email addresses, separate them by a semi-column.
  7251. Most of the @code{org-export-with-*} variables have the same effect in
  7252. both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
  7253. @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
  7254. La@TeX{} export.
  7255. When a property is given a value in @code{org-publish-project-alist},
  7256. its setting overrides the value of the corresponding user variable (if
  7257. any) during publishing. Options set within a file (@pxref{Export
  7258. options}), however, override everything.
  7259. @node Publishing links, Project page index, Publishing options, Configuration
  7260. @subsection Links between published files
  7261. @cindex links, publishing
  7262. To create a link from one Org file to another, you would use
  7263. something like @samp{[[file:foo.org][The foo]]} or simply
  7264. @samp{file:foo.org.} (@pxref{Hyperlinks}). Upon publishing this link
  7265. becomes a link to @file{foo.html}. In this way, you can interlink the
  7266. pages of your "org web" project and the links will work as expected when
  7267. you publish them to HTML.
  7268. You may also link to related files, such as images. Provided you are
  7269. careful with relative pathnames, and provided you have also configured
  7270. @code{org-publish} to upload the related files, these links will work
  7271. too. See @ref{Complex example} for an example of this usage.
  7272. Sometime an Org file to be published may contain links that are
  7273. only valid in your production environment, but not in the publishing
  7274. location. In this case, use the property
  7275. @multitable @columnfractions 0.4 0.6
  7276. @item @code{:link-validation-function}
  7277. @tab Function to validate links
  7278. @end multitable
  7279. @noindent
  7280. to define a function for checking link validity. This function must
  7281. accept two arguments, the file name and a directory relative to which
  7282. the file name is interpreted in the production environment. If this
  7283. function returns @code{nil}, then the HTML generator will only insert a
  7284. description into the HTML file, but no link. One option for this
  7285. function is @code{org-publish-validate-link} which checks if the given
  7286. file is part of any project in @code{org-publish-project-alist}.
  7287. @node Project page index, , Publishing links, Configuration
  7288. @subsection Project page index
  7289. @cindex index, of published pages
  7290. The following properties may be used to control publishing of an
  7291. index of files or summary page for a given project.
  7292. @multitable @columnfractions 0.25 0.75
  7293. @item @code{:auto-index}
  7294. @tab When non-nil, publish an index during org-publish-current-project or
  7295. org-publish-all.
  7296. @item @code{:index-filename}
  7297. @tab Filename for output of index. Defaults to @file{index.org} (which
  7298. becomes @file{index.html}).
  7299. @item @code{:index-title}
  7300. @tab Title of index page. Defaults to name of file.
  7301. @item @code{:index-function}
  7302. @tab Plug-in function to use for generation of index.
  7303. Defaults to @code{org-publish-org-index}, which generates a plain list
  7304. of links to all files in the project.
  7305. @end multitable
  7306. @node Sample configuration, Triggering publication, Configuration, Publishing
  7307. @section Sample configuration
  7308. Below we provide two example configurations. The first one is a simple
  7309. project publishing only a set of Org files. The second example is
  7310. more complex, with a multi-component project.
  7311. @menu
  7312. * Simple example:: One-component publishing
  7313. * Complex example:: A multi-component publishing example
  7314. @end menu
  7315. @node Simple example, Complex example, Sample configuration, Sample configuration
  7316. @subsection Example: simple publishing configuration
  7317. This example publishes a set of Org files to the @file{public_html}
  7318. directory on the local machine.
  7319. @lisp
  7320. (setq org-publish-project-alist
  7321. '(("org"
  7322. :base-directory "~/org/"
  7323. :publishing-directory "~/public_html"
  7324. :section-numbers nil
  7325. :table-of-contents nil
  7326. :style "<link rel=\"stylesheet\"
  7327. href=\"../other/mystyle.css\"
  7328. type=\"text/css\">")))
  7329. @end lisp
  7330. @node Complex example, , Simple example, Sample configuration
  7331. @subsection Example: complex publishing configuration
  7332. This more complicated example publishes an entire website, including
  7333. org files converted to HTML, image files, emacs lisp source code, and
  7334. style sheets. The publishing-directory is remote and private files are
  7335. excluded.
  7336. To ensure that links are preserved, care should be taken to replicate
  7337. your directory structure on the web server, and to use relative file
  7338. paths. For example, if your org files are kept in @file{~/org} and your
  7339. publishable images in @file{~/images}, you'd link to an image with
  7340. @c
  7341. @example
  7342. file:../images/myimage.png
  7343. @end example
  7344. @c
  7345. On the web server, the relative path to the image should be the
  7346. same. You can accomplish this by setting up an "images" folder in the
  7347. right place on the web server, and publishing images to it.
  7348. @lisp
  7349. (setq org-publish-project-alist
  7350. '(("orgfiles"
  7351. :base-directory "~/org/"
  7352. :base-extension "org"
  7353. :publishing-directory "/ssh:user@@host:~/html/notebook/"
  7354. :publishing-function org-publish-org-to-html
  7355. :exclude "PrivatePage.org" ;; regexp
  7356. :headline-levels 3
  7357. :section-numbers nil
  7358. :table-of-contents nil
  7359. :style "<link rel=\"stylesheet\"
  7360. href=\"../other/mystyle.css\" type=\"text/css\">"
  7361. :auto-preamble t
  7362. :auto-postamble nil)
  7363. ("images"
  7364. :base-directory "~/images/"
  7365. :base-extension "jpg\\|gif\\|png"
  7366. :publishing-directory "/ssh:user@@host:~/html/images/"
  7367. :publishing-function org-publish-attachment)
  7368. ("other"
  7369. :base-directory "~/other/"
  7370. :base-extension "css\\|el"
  7371. :publishing-directory "/ssh:user@@host:~/html/other/"
  7372. :publishing-function org-publish-attachment)
  7373. ("website" :components ("orgfiles" "images" "other"))))
  7374. @end lisp
  7375. @node Triggering publication, , Sample configuration, Publishing
  7376. @section Triggering publication
  7377. Once org-publish is properly configured, you can publish with the
  7378. following functions:
  7379. @table @kbd
  7380. @item C-c C-e C
  7381. Prompt for a specific project and publish all files that belong to it.
  7382. @item C-c C-e P
  7383. Publish the project containing the current file.
  7384. @item C-c C-e F
  7385. Publish only the current file.
  7386. @item C-c C-e A
  7387. Publish all projects.
  7388. @end table
  7389. Org uses timestamps to track when a file has changed. The above
  7390. functions normally only publish changed files. You can override this and
  7391. force publishing of all files by giving a prefix argument.
  7392. @node Miscellaneous, Extensions, Publishing, Top
  7393. @chapter Miscellaneous
  7394. @menu
  7395. * Completion:: M-TAB knows what you need
  7396. * Customization:: Adapting Org to your taste
  7397. * In-buffer settings:: Overview of the #+KEYWORDS
  7398. * The very busy C-c C-c key:: When in doubt, press C-c C-c
  7399. * Clean view:: Getting rid of leading stars in the outline
  7400. * TTY keys:: Using Org on a tty
  7401. * Interaction:: Other Emacs packages
  7402. * Bugs:: Things which do not work perfectly
  7403. @end menu
  7404. @node Completion, Customization, Miscellaneous, Miscellaneous
  7405. @section Completion
  7406. @cindex completion, of @TeX{} symbols
  7407. @cindex completion, of TODO keywords
  7408. @cindex completion, of dictionary words
  7409. @cindex completion, of option keywords
  7410. @cindex completion, of tags
  7411. @cindex completion, of property keys
  7412. @cindex completion, of link abbreviations
  7413. @cindex @TeX{} symbol completion
  7414. @cindex TODO keywords completion
  7415. @cindex dictionary word completion
  7416. @cindex option keyword completion
  7417. @cindex tag completion
  7418. @cindex link abbreviations, completion of
  7419. Org supports in-buffer completion. This type of completion does
  7420. not make use of the minibuffer. You simply type a few letters into
  7421. the buffer and use the key to complete text right there.
  7422. @table @kbd
  7423. @kindex M-@key{TAB}
  7424. @item M-@key{TAB}
  7425. Complete word at point
  7426. @itemize @bullet
  7427. @item
  7428. At the beginning of a headline, complete TODO keywords.
  7429. @item
  7430. After @samp{\}, complete @TeX{} symbols supported by the exporter.
  7431. @item
  7432. After @samp{*}, complete headlines in the current buffer so that they
  7433. can be used in search links like @samp{[[*find this headline]]}.
  7434. @item
  7435. After @samp{:} in a headline, complete tags. The list of tags is taken
  7436. from the variable @code{org-tag-alist} (possibly set through the
  7437. @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
  7438. dynamically from all tags used in the current buffer.
  7439. @item
  7440. After @samp{:} and not in a headline, complete property keys. The list
  7441. of keys is constructed dynamically from all keys used in the current
  7442. buffer.
  7443. @item
  7444. After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
  7445. @item
  7446. After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
  7447. @samp{OPTIONS} which set file-specific options for Org mode. When the
  7448. option keyword is already complete, pressing @kbd{M-@key{TAB}} again
  7449. will insert example settings for this keyword.
  7450. @item
  7451. In the line after @samp{#+STARTUP: }, complete startup keywords,
  7452. i.e. valid keys for this line.
  7453. @item
  7454. Elsewhere, complete dictionary words using Ispell.
  7455. @end itemize
  7456. @end table
  7457. @node Customization, In-buffer settings, Completion, Miscellaneous
  7458. @section Customization
  7459. @cindex customization
  7460. @cindex options, for customization
  7461. @cindex variables, for customization
  7462. There are more than 180 variables that can be used to customize
  7463. Org. For the sake of compactness of the manual, I am not
  7464. describing the variables here. A structured overview of customization
  7465. variables is available with @kbd{M-x org-customize}. Or select
  7466. @code{Browse Org Group} from the @code{Org->Customization} menu. Many
  7467. settings can also be activated on a per-file basis, by putting special
  7468. lines into the buffer (@pxref{In-buffer settings}).
  7469. @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
  7470. @section Summary of in-buffer settings
  7471. @cindex in-buffer settings
  7472. @cindex special keywords
  7473. Org mode uses special lines in the buffer to define settings on a
  7474. per-file basis. These lines start with a @samp{#+} followed by a
  7475. keyword, a colon, and then individual words defining a setting. Several
  7476. setting words can be in the same line, but you can also have multiple
  7477. lines for the keyword. While these settings are described throughout
  7478. the manual, here is a summary. After changing any of those lines in the
  7479. buffer, press @kbd{C-c C-c} with the cursor still in the line to
  7480. activate the changes immediately. Otherwise they become effective only
  7481. when the file is visited again in a new Emacs session.
  7482. @table @kbd
  7483. @item #+ARCHIVE: %s_done::
  7484. This line sets the archive location for the agenda file. It applies for
  7485. all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
  7486. of the file. The first such line also applies to any entries before it.
  7487. The corresponding variable is @code{org-archive-location}.
  7488. @item #+CATEGORY:
  7489. This line sets the category for the agenda file. The category applies
  7490. for all subsequent lines until the next @samp{#+CATEGORY} line, or the
  7491. end of the file. The first such line also applies to any entries before it.
  7492. @item #+COLUMNS: %25ITEM .....
  7493. Set the default format for columns view. This format applies when
  7494. columns view is invoked in location where no @code{COLUMNS} property
  7495. applies.
  7496. @item #+CONSTANTS: name1=value1 ...
  7497. Set file-local values for constants to be used in table formulas. This
  7498. line set the local variable @code{org-table-formula-constants-local}.
  7499. The global version of this variable is
  7500. @code{org-table-formula-constants}.
  7501. @item #+FILETAGS: :tag1:tag2:tag3:
  7502. Set tags that can be inherited by any entry in the file, including the
  7503. top-level entries.
  7504. @item #+DRAWERS: NAME1 .....
  7505. Set the file-local set of drawers. The corresponding global variable is
  7506. @code{org-drawers}.
  7507. @item #+LINK: linkword replace
  7508. These lines (several are allowed) specify link abbreviations.
  7509. @xref{Link abbreviations}. The corresponding variable is
  7510. @code{org-link-abbrev-alist}.
  7511. @item #+PRIORITIES: highest lowest default
  7512. This line sets the limits and the default for the priorities. All three
  7513. must be either letters A-Z or numbers 0-9. The highest priority must
  7514. have a lower ASCII number that the lowest priority.
  7515. @item #+PROPERTY: Property_Name Value
  7516. This line sets a default inheritance value for entries in the current
  7517. buffer, most useful for specifying the allowed values of a property.
  7518. @item #+SETUPFILE: file
  7519. This line defines a file that holds more in-buffer setup. Normally this is
  7520. entirely ignored. Only when the buffer is parsed for option-setting lines
  7521. (i.e. when starting Org mode for a file, when pressing @kbd{C-c C-c} in a
  7522. settings line, or when exporting), then the contents of this file are parsed
  7523. as if they had been included in the buffer. In particlar, the file can be
  7524. any other Org mode file with internal setup. You can visit the file the
  7525. cursor is in the line with @kbd{C-c '}.
  7526. @item #+STARTUP:
  7527. This line sets options to be used at startup of Org mode, when an
  7528. Org file is being visited. The first set of options deals with the
  7529. initial visibility of the outline tree. The corresponding variable for
  7530. global default settings is @code{org-startup-folded}, with a default
  7531. value @code{t}, which means @code{overview}.
  7532. @cindex @code{overview}, STARTUP keyword
  7533. @cindex @code{content}, STARTUP keyword
  7534. @cindex @code{showall}, STARTUP keyword
  7535. @example
  7536. overview @r{top-level headlines only}
  7537. content @r{all headlines}
  7538. showall @r{no folding at all, show everything}
  7539. @end example
  7540. Then there are options for aligning tables upon visiting a file. This
  7541. is useful in files containing narrowed table columns. The corresponding
  7542. variable is @code{org-startup-align-all-tables}, with a default value
  7543. @code{nil}.
  7544. @cindex @code{align}, STARTUP keyword
  7545. @cindex @code{noalign}, STARTUP keyword
  7546. @example
  7547. align @r{align all tables}
  7548. noalign @r{don't align tables on startup}
  7549. @end example
  7550. Logging closing and reinstating TODO items, and clock intervals
  7551. (variables @code{org-log-done}, @code{org-log-note-clock-out}, and
  7552. @code{org-log-repeat}) can be configured using these options.
  7553. @cindex @code{logdone}, STARTUP keyword
  7554. @cindex @code{lognotedone}, STARTUP keyword
  7555. @cindex @code{nologdone}, STARTUP keyword
  7556. @cindex @code{lognoteclock-out}, STARTUP keyword
  7557. @cindex @code{nolognoteclock-out}, STARTUP keyword
  7558. @cindex @code{logrepeat}, STARTUP keyword
  7559. @cindex @code{lognoterepeat}, STARTUP keyword
  7560. @cindex @code{nologrepeat}, STARTUP keyword
  7561. @example
  7562. logdone @r{record a timestamp when an item is marked DONE}
  7563. lognotedone @r{record timestamp and a note when DONE}
  7564. nologdone @r{don't record when items are marked DONE}
  7565. logrepeat @r{record a time when reinstating a repeating item}
  7566. lognoterepeat @r{record a note when reinstating a repeating item}
  7567. nologrepeat @r{do not record when reinstating repeating item}
  7568. lognoteclock-out @r{record a note when clocking out}
  7569. nolognoteclock-out @r{don't record a note when clocking out}
  7570. @end example
  7571. Here are the options for hiding leading stars in outline headings, and for
  7572. indenting outlines. The corresponding variables are
  7573. @code{org-hide-leading-stars} and @code{org-odd-levels-only}, both with a
  7574. default setting @code{nil} (meaning @code{showstars} and @code{oddeven}).
  7575. @cindex @code{hidestars}, STARTUP keyword
  7576. @cindex @code{showstars}, STARTUP keyword
  7577. @cindex @code{odd}, STARTUP keyword
  7578. @cindex @code{even}, STARTUP keyword
  7579. @example
  7580. hidestars @r{make all but one of the stars starting a headline invisible.}
  7581. showstars @r{show all stars starting a headline}
  7582. indent @r{virtual indentation according to outline level}
  7583. noindent @r{no virtual indentation according to outline level}
  7584. odd @r{allow only odd outline levels (1,3,...)}
  7585. oddeven @r{allow all outline levels}
  7586. @end example
  7587. To turn on custom format overlays over time stamps (variables
  7588. @code{org-put-time-stamp-overlays} and
  7589. @code{org-time-stamp-overlay-formats}), use
  7590. @cindex @code{customtime}, STARTUP keyword
  7591. @example
  7592. customtime @r{overlay custom time format}
  7593. @end example
  7594. The following options influence the table spreadsheet (variable
  7595. @code{constants-unit-system}).
  7596. @cindex @code{constcgs}, STARTUP keyword
  7597. @cindex @code{constSI}, STARTUP keyword
  7598. @example
  7599. constcgs @r{@file{constants.el} should use the c-g-s unit system}
  7600. constSI @r{@file{constants.el} should use the SI unit system}
  7601. @end example
  7602. @item #+TAGS: TAG1(c1) TAG2(c2)
  7603. These lines (several such lines are allowed) specify the valid tags in
  7604. this file, and (potentially) the corresponding @emph{fast tag selection}
  7605. keys. The corresponding variable is @code{org-tag-alist}.
  7606. @item #+TBLFM:
  7607. This line contains the formulas for the table directly above the line.
  7608. @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS, #+DATE:
  7609. These lines provide settings for exporting files. For more details see
  7610. @ref{Export options}.
  7611. @item #+SEQ_TODO: #+TYP_TODO:
  7612. These lines set the TODO keywords and their interpretation in the
  7613. current file. The corresponding variables are @code{org-todo-keywords}
  7614. and @code{org-todo-interpretation}.
  7615. @end table
  7616. @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
  7617. @section The very busy C-c C-c key
  7618. @kindex C-c C-c
  7619. @cindex C-c C-c, overview
  7620. The key @kbd{C-c C-c} has many purposes in Org, which are all
  7621. mentioned scattered throughout this manual. One specific function of
  7622. this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
  7623. other circumstances it means something like @emph{Hey Org, look
  7624. here and update according to what you see here}. Here is a summary of
  7625. what this means in different contexts.
  7626. @itemize @minus
  7627. @item
  7628. If there are highlights in the buffer from the creation of a sparse
  7629. tree, or from clock display, remove these highlights.
  7630. @item
  7631. If the cursor is in one of the special @code{#+KEYWORD} lines, this
  7632. triggers scanning the buffer for these lines and updating the
  7633. information.
  7634. @item
  7635. If the cursor is inside a table, realign the table. This command
  7636. works even if the automatic table editor has been turned off.
  7637. @item
  7638. If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
  7639. the entire table.
  7640. @item
  7641. If the cursor is inside a table created by the @file{table.el} package,
  7642. activate that table.
  7643. @item
  7644. If the current buffer is a remember buffer, close the note and file it.
  7645. With a prefix argument, file it, without further interaction, to the
  7646. default location.
  7647. @item
  7648. If the cursor is on a @code{<<<target>>>}, update radio targets and
  7649. corresponding links in this buffer.
  7650. @item
  7651. If the cursor is in a property line or at the start or end of a property
  7652. drawer, offer property commands.
  7653. @item
  7654. If the cursor is in a plain list item with a checkbox, toggle the status
  7655. of the checkbox.
  7656. @item
  7657. If the cursor is on a numbered item in a plain list, renumber the
  7658. ordered list.
  7659. @item
  7660. If the cursor is on the @code{#+BEGIN} line of a dynamical block, the
  7661. block is updated.
  7662. @end itemize
  7663. @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
  7664. @section A cleaner outline view
  7665. @cindex hiding leading stars
  7666. @cindex dynamic indentation
  7667. @cindex odd-levels-only outlines
  7668. @cindex clean outline view
  7669. Some people find it noisy and distracting that the Org headlines are starting
  7670. with a potentially large number of stars, and that text below the headlines
  7671. is not indented. This is not really a problem when you are writing a book
  7672. where the outline headings are really section headlines. However, in a more
  7673. list-oriented outline, it is clear that an indented structure is a lot
  7674. cleaner, as can be seen by comparing the two columns in the following
  7675. example:
  7676. @example
  7677. @group
  7678. * Top level headline | * Top level headline
  7679. ** Second level | * Second level
  7680. *** 3rd level | * 3rd level
  7681. some text | some text
  7682. *** 3rd level | * 3rd level
  7683. more text | more text
  7684. * Another top level headline | * Another top level headline
  7685. @end group
  7686. @end example
  7687. @noindent
  7688. It is non-trivial to make such a look work in Emacs, but Org contains three
  7689. separate features that, combined, achieve just that.
  7690. @enumerate
  7691. @item
  7692. @emph{Indentation of text below headlines}@*
  7693. You may indent text below each headline to make the left boundary line up
  7694. with the headline, like
  7695. @example
  7696. *** 3rd level
  7697. more text, now indented
  7698. @end example
  7699. A good way to get this indentation is by hand, and Org supports this with
  7700. paragraph filling, line wrapping, and structure editing@footnote{See also the
  7701. variable @code{org-adapt-indentation}.} preserving or adapting the
  7702. indentation appropriate. A different approach would be to have a way to
  7703. automatically indent lines according to outline structure by adding overlays
  7704. or text properties. But I have not yet found a robust and efficient way to
  7705. do this in large files.
  7706. @item
  7707. @emph{Hiding leading stars}@* You can modify the display in such a way that
  7708. all leading stars become invisible. To do this in a global way, configure
  7709. the variable @code{org-hide-leading-stars} or change this on a per-file basis
  7710. with
  7711. @example
  7712. #+STARTUP: hidestars
  7713. @end example
  7714. @noindent
  7715. Note that the opposite behavior is selected with @code{showstars}.
  7716. With hidden stars, the tree becomes:
  7717. @example
  7718. @group
  7719. * Top level headline
  7720. * Second level
  7721. * 3rd level
  7722. ...
  7723. @end group
  7724. @end example
  7725. @noindent
  7726. Note that the leading stars are not truly replaced by whitespace, they
  7727. are only fontified with the face @code{org-hide} that uses the
  7728. background color as font color. If you are not using either white or
  7729. black background, you may have to customize this face to get the wanted
  7730. effect. Another possibility is to set this font such that the extra
  7731. stars are @i{almost} invisible, for example using the color
  7732. @code{grey90} on a white background.
  7733. @item
  7734. Things become cleaner still if you skip all the even levels and use only odd
  7735. levels 1, 3, 5..., effectively adding two stars to go from one outline level
  7736. to the next. In this way we get the outline view shown at the beginning of
  7737. this section. In order to make the structure editing and export commands
  7738. handle this convention correctly, configure the variable
  7739. @code{org-odd-levels-only}, or set this on a per-file basis with one of the
  7740. following lines:
  7741. @example
  7742. #+STARTUP: odd
  7743. #+STARTUP: oddeven
  7744. @end example
  7745. You can convert an Org file from single-star-per-level to the
  7746. double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
  7747. RET} in that file. The reverse operation is @kbd{M-x
  7748. org-convert-to-oddeven-levels}.
  7749. @end enumerate
  7750. @node TTY keys, Interaction, Clean view, Miscellaneous
  7751. @section Using Org on a tty
  7752. @cindex tty key bindings
  7753. Because Org contains a large number of commands, by default much of
  7754. Org's core commands are bound to keys that are generally not
  7755. accessible on a tty, such as the cursor keys (@key{left}, @key{right},
  7756. @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
  7757. together with modifiers like @key{Meta} and/or @key{Shift}. To access
  7758. these commands on a tty when special keys are unavailable, the following
  7759. alternative bindings can be used. The tty bindings below will likely be
  7760. more cumbersome; you may find for some of the bindings below that a
  7761. customized work-around suits you better. For example, changing a time
  7762. stamp is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
  7763. tty you would rather use @kbd{C-c .} to re-insert the timestamp.
  7764. @multitable @columnfractions 0.15 0.2 0.2
  7765. @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
  7766. @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
  7767. @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
  7768. @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
  7769. @item @kbd{M-@key{right}} @tab @kbd{C-c C-x i} @tab @kbd{@key{Esc} @key{right}}
  7770. @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
  7771. @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
  7772. @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
  7773. @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
  7774. @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
  7775. @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
  7776. @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
  7777. @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
  7778. @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab
  7779. @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab
  7780. @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab
  7781. @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab
  7782. @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
  7783. @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
  7784. @end multitable
  7785. @node Interaction, Bugs, TTY keys, Miscellaneous
  7786. @section Interaction with other packages
  7787. @cindex packages, interaction with other
  7788. Org lives in the world of GNU Emacs and interacts in various ways
  7789. with other code out there.
  7790. @menu
  7791. * Cooperation:: Packages Org cooperates with
  7792. * Conflicts:: Packages that lead to conflicts
  7793. @end menu
  7794. @node Cooperation, Conflicts, Interaction, Interaction
  7795. @subsection Packages that Org cooperates with
  7796. @table @asis
  7797. @cindex @file{calc.el}
  7798. @item @file{calc.el} by Dave Gillespie
  7799. Org uses the Calc package for implementing spreadsheet
  7800. functionality in its tables (@pxref{The spreadsheet}). Org
  7801. checks for the availability of Calc by looking for the function
  7802. @code{calc-eval} which should be autoloaded in your setup if Calc has
  7803. been installed properly. As of Emacs 22, Calc is part of the Emacs
  7804. distribution. Another possibility for interaction between the two
  7805. packages is using Calc for embedded calculations. @xref{Embedded Mode,
  7806. , Embedded Mode, Calc, GNU Emacs Calc Manual}.
  7807. @cindex @file{constants.el}
  7808. @item @file{constants.el} by Carsten Dominik
  7809. In a table formula (@pxref{The spreadsheet}), it is possible to use
  7810. names for natural constants or units. Instead of defining your own
  7811. constants in the variable @code{org-table-formula-constants}, install
  7812. the @file{constants} package which defines a large number of constants
  7813. and units, and lets you use unit prefixes like @samp{M} for
  7814. @samp{Mega} etc. You will need version 2.0 of this package, available
  7815. at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
  7816. the function @code{constants-get}, which has to be autoloaded in your
  7817. setup. See the installation instructions in the file
  7818. @file{constants.el}.
  7819. @item @file{cdlatex.el} by Carsten Dominik
  7820. @cindex @file{cdlatex.el}
  7821. Org mode can make use of the CDLaTeX package to efficiently enter
  7822. La@TeX{} fragments into Org files. See @ref{CDLaTeX mode}.
  7823. @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
  7824. @cindex @file{imenu.el}
  7825. Imenu allows menu access to an index of items in a file. Org mode
  7826. supports Imenu - all you need to do to get the index is the following:
  7827. @lisp
  7828. (add-hook 'org-mode-hook
  7829. (lambda () (imenu-add-to-menubar "Imenu")))
  7830. @end lisp
  7831. By default the index is two levels deep - you can modify the depth using
  7832. the option @code{org-imenu-depth}.
  7833. @item @file{remember.el} by John Wiegley
  7834. @cindex @file{remember.el}
  7835. Org cooperates with remember, see @ref{Remember}.
  7836. @file{Remember.el} is not part of Emacs, find it on the web.
  7837. @item @file{speedbar.el} by Eric M. Ludlam
  7838. @cindex @file{speedbar.el}
  7839. Speedbar is a package that creates a special frame displaying files and
  7840. index items in files. Org mode supports Speedbar and allows you to
  7841. drill into Org files directly from the Speedbar. It also allows to
  7842. restrict the scope of agenda commands to a file or a subtree by using
  7843. the command @kbd{<} in the Speedbar frame.
  7844. @cindex @file{table.el}
  7845. @item @file{table.el} by Takaaki Ota
  7846. @kindex C-c C-c
  7847. @cindex table editor, @file{table.el}
  7848. @cindex @file{table.el}
  7849. Complex ASCII tables with automatic line wrapping, column- and
  7850. row-spanning, and alignment can be created using the Emacs table
  7851. package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
  7852. and also part of Emacs 22).
  7853. When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org mode
  7854. will call @command{table-recognize-table} and move the cursor into the
  7855. table. Inside a table, the keymap of Org mode is inactive. In order
  7856. to execute Org mode-related commands, leave the table.
  7857. @table @kbd
  7858. @kindex C-c C-c
  7859. @item C-c C-c
  7860. Recognize @file{table.el} table. Works when the cursor is in a
  7861. table.el table.
  7862. @c
  7863. @kindex C-c ~
  7864. @item C-c ~
  7865. Insert a table.el table. If there is already a table at point, this
  7866. command converts it between the table.el format and the Org mode
  7867. format. See the documentation string of the command
  7868. @code{org-convert-table} for the restrictions under which this is
  7869. possible.
  7870. @end table
  7871. @file{table.el} is part of Emacs 22.
  7872. @cindex @file{footnote.el}
  7873. @item @file{footnote.el} by Steven L. Baur
  7874. Org mode recognizes numerical footnotes as provided by this package
  7875. (@pxref{Footnotes}).
  7876. @end table
  7877. @node Conflicts, , Cooperation, Interaction
  7878. @subsection Packages that lead to conflicts with Org mode
  7879. @table @asis
  7880. @cindex @file{allout.el}
  7881. @item @file{allout.el} by Ken Manheimer
  7882. Startup of Org may fail with the error message
  7883. @code{(wrong-type-argument keymapp nil)} when there is an outdated
  7884. version @file{allout.el} on the load path, for example the version
  7885. distributed with Emacs 21.x. Upgrade to Emacs 22 and this problem will
  7886. disappear. If for some reason you cannot do this, make sure that org.el
  7887. is loaded @emph{before} @file{allout.el}, for example by putting
  7888. @code{(require 'org)} early enough into your @file{.emacs} file.
  7889. @cindex @file{CUA.el}
  7890. @item @file{CUA.el} by Kim. F. Storm
  7891. Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by
  7892. CUA mode (as well as pc-select-mode and s-region-mode) to select and
  7893. extend the region. If you want to use one of these packages along with
  7894. Org, configure the variable @code{org-replace-disputed-keys}. When
  7895. set, Org will move the following key bindings in Org files, and
  7896. in the agenda buffer (but not during date selection).
  7897. @example
  7898. S-UP -> M-p S-DOWN -> M-n
  7899. S-LEFT -> M-- S-RIGHT -> M-+
  7900. @end example
  7901. Yes, these are unfortunately more difficult to remember. If you want
  7902. to have other replacement keys, look at the variable
  7903. @code{org-disputed-keys}.
  7904. @item @file{windmove.el} by Hovav Shacham
  7905. @cindex @file{windmove.el}
  7906. Also this package uses the @kbd{S-<cursor>} keys, so everything written
  7907. in the paragraph above about CUA mode also applies here.
  7908. @cindex @file{footnote.el}
  7909. @item @file{footnote.el} by Steven L. Baur
  7910. Org supports the syntax of the footnote package, but only the
  7911. numerical footnote markers. Also, the default key for footnote
  7912. commands, @kbd{C-c !} is already used by Org. You could use the
  7913. variable @code{footnote-prefix} to switch footnotes commands to another
  7914. key. Or, you could use @code{org-replace-disputed-keys} and
  7915. @code{org-disputed-keys} to change the settings in Org.
  7916. @end table
  7917. @node Bugs, , Interaction, Miscellaneous
  7918. @section Bugs
  7919. @cindex bugs
  7920. Here is a list of things that should work differently, but which I
  7921. have found too hard to fix.
  7922. @itemize @bullet
  7923. @item
  7924. If a table field starts with a link, and if the corresponding table
  7925. column is narrowed (@pxref{Narrow columns}) to a width too small to
  7926. display the link, the field would look entirely empty even though it is
  7927. not. To prevent this, Org throws an error. The work-around is to
  7928. make the column wide enough to fit the link, or to add some text (at
  7929. least 2 characters) before the link in the same field.
  7930. @item
  7931. Narrowing table columns does not work on XEmacs, because the
  7932. @code{format} function does not transport text properties.
  7933. @item
  7934. Text in an entry protected with the @samp{QUOTE} keyword should not
  7935. autowrap.
  7936. @item
  7937. When the application called by @kbd{C-c C-o} to open a file link fails
  7938. (for example because the application does not exist or refuses to open
  7939. the file), it does so silently. No error message is displayed.
  7940. @item
  7941. Recalculating a table line applies the formulas from left to right.
  7942. If a formula uses @emph{calculated} fields further down the row,
  7943. multiple recalculation may be needed to get all fields consistent. You
  7944. may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
  7945. recalculate until convergence.
  7946. @item
  7947. The exporters work well, but could be made more efficient.
  7948. @end itemize
  7949. @node Extensions, Hacking, Miscellaneous, Top
  7950. @appendix Extensions
  7951. This appendix lists the extension modules that have been written for Org.
  7952. Many of these extensions live in the @file{contrib} directory of the Org
  7953. distribution, others are available somewhere on the web.
  7954. @menu
  7955. * Extensions in the contrib directory:: These come with the Org distro
  7956. * Other extensions:: These you have to find on the web.
  7957. @end menu
  7958. @node Extensions in the contrib directory, Other extensions, Extensions, Extensions
  7959. @section Extensions in the @file{contrib} directory
  7960. A number of extension are distributed with Org when you download it from its
  7961. homepage. Please note that these extensions are @emph{not} distributed as
  7962. part of Emacs, so if you use Org as delivered with Emacs, you still need to
  7963. go to @url{http://orgmode.org} to get access to these modules.
  7964. @table @asis
  7965. @item @file{org-annotate-file.el} by @i{Philip Jackson}
  7966. Annotate a file with org syntax, in a separate file, with links back to
  7967. the annotated file.
  7968. @item @file{org-annotation-helper.el} by @i{Bastien Guerry and Daniel E. German}
  7969. Call @i{remember} directly from Firefox/Opera, or from Adobe Reader.
  7970. When activating a special link or bookmark, Emacs receives a trigger to
  7971. create a note with a link back to the website. Requires some setup, a
  7972. detailes description is in
  7973. @file{contrib/packages/org-annotation-helper}.
  7974. @item @file{org-bookmark.el} by @i{Tokuya Kameshima}
  7975. Support for links to Emacs bookmarks.
  7976. @item @file{org-depend.el} by @i{Carsten Dominik}
  7977. TODO dependencies for Org-mode. Make TODO state changes in one entry
  7978. trigger changes in another, or be blocked by the state of another
  7979. entry. Also, easily create chains of TODO items with exactly one
  7980. active item at any time.
  7981. @item @file{org-elisp-symbol.el} by @i{Bastien Guerry}
  7982. Org links to emacs-lisp symbols. This can create annotated links that
  7983. exactly point to the definition location of a variable of function.
  7984. @item @file{org-eval.el} by @i{Carsten Dominik}
  7985. The @code{<lisp>} tag, adapted from Emacs Wiki and Emacs Muse, allows
  7986. text to be included in a document that is the result of evaluating some
  7987. code. Other scripting languages like @code{perl} can be supported with
  7988. this package as well.
  7989. @item @file{org-eval-light.el} by @i{Eric Schulte}
  7990. User-controlled evaluation of code in an Org buffer.
  7991. @item @file{org-exp-blocks.el} by @i{Eric Schulte}
  7992. Preprocess user-defined blocks for export.
  7993. @item @file{org-expiry.el} by @i{Bastien Guerry}
  7994. Expiry mechanism for Org entries.
  7995. @item @file{org-indent.el} by @i{Carsten Dominik}
  7996. Dynamic indentation of Org outlines. The plan is to indent an outline
  7997. according to level, but so far this is too hard for a proper and stable
  7998. implementation. Still, it works somewhat.
  7999. @item @file{org-interactive-query.el} by @i{Christopher League}
  8000. Interactive modification of tags queries. After running a general
  8001. query in Org, this package allows to narrow down the results by adding
  8002. more tags or keywords.
  8003. @item @file{org-mairix.el} by @i{Georg C. F. Greve}
  8004. Hook mairix search into Org for different MUAs.
  8005. @item @file{org-man.el} by @i{Carsten Dominik}
  8006. Support for links to manpages in Org-mode.
  8007. @item @file{org-mtags.el} by @i{Carsten Dominik}
  8008. Support for some Muse-like tags in Org-mode. This package allows you
  8009. to write @code{<example>} and @code{<src>} and other syntax copied from
  8010. Emacs Muse, right inside an Org file. The goal here is to make it easy
  8011. to publish the same file using either org-publish or Muse.
  8012. @item @file{org-panel.el} by @i{Lennard Borgman}
  8013. Simplified and display-aided access to some Org commands.
  8014. @item @file{org-registry.el} by @i{Bastien Guerry}
  8015. A registry for Org links, to find out from where links point to a given
  8016. file or location.
  8017. @item @file{org2rem.el} by @i{Bastien Guerry}
  8018. Convert org appointments into reminders for the @file{remind} program.
  8019. @item @file{org-screen.el} by @i{Andrew Hyatt}
  8020. Visit screen sessions through Org-mode links.
  8021. @item @file{org-toc.el} by @i{Bastien Guerry}
  8022. Table of contents in a separate buffer, with fast access to sections
  8023. and easy visibility cycling.
  8024. @item @file{orgtbl-sqlinsert.el} by @i{Jason Riedy}
  8025. Convert Org-mode tables to SQL insertions. Documentation for this can
  8026. be found on the Worg pages.
  8027. @end table
  8028. @node Other extensions, , Extensions in the contrib directory, Extensions
  8029. @section Other extensions
  8030. @i{TO BE DONE}
  8031. @node Hacking, History and Acknowledgments, Extensions, Top
  8032. @appendix Hacking
  8033. This appendix covers some aspects where users can extend the functionality of
  8034. Org.
  8035. @menu
  8036. * Adding hyperlink types:: New custom link types
  8037. * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
  8038. * Dynamic blocks:: Automatically filled blocks
  8039. * Special agenda views:: Customized views
  8040. * Using the property API:: Writing programs that use entry properties
  8041. * Using the mapping API:: Mapping over all or selected entries
  8042. @end menu
  8043. @node Adding hyperlink types, Tables in arbitrary syntax, Hacking, Hacking
  8044. @section Adding hyperlink types
  8045. @cindex hyperlinks, adding new types
  8046. Org has a large number of hyperlink types built-in
  8047. (@pxref{Hyperlinks}). If you would like to add new link types, it
  8048. provides an interface for doing so. Let's look at an example file
  8049. @file{org-man.el} that will add support for creating links like
  8050. @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
  8051. emacs:
  8052. @lisp
  8053. ;;; org-man.el - Support for links to manpages in Org
  8054. (require 'org)
  8055. (org-add-link-type "man" 'org-man-open)
  8056. (add-hook 'org-store-link-functions 'org-man-store-link)
  8057. (defcustom org-man-command 'man
  8058. "The Emacs command to be used to display a man page."
  8059. :group 'org-link
  8060. :type '(choice (const man) (const woman)))
  8061. (defun org-man-open (path)
  8062. "Visit the manpage on PATH.
  8063. PATH should be a topic that can be thrown at the man command."
  8064. (funcall org-man-command path))
  8065. (defun org-man-store-link ()
  8066. "Store a link to a manpage."
  8067. (when (memq major-mode '(Man-mode woman-mode))
  8068. ;; This is a man page, we do make this link
  8069. (let* ((page (org-man-get-page-name))
  8070. (link (concat "man:" page))
  8071. (description (format "Manpage for %s" page)))
  8072. (org-store-link-props
  8073. :type "man"
  8074. :link link
  8075. :description description))))
  8076. (defun org-man-get-page-name ()
  8077. "Extract the page name from the buffer name."
  8078. ;; This works for both `Man-mode' and `woman-mode'.
  8079. (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
  8080. (match-string 1 (buffer-name))
  8081. (error "Cannot create link to this man page")))
  8082. (provide 'org-man)
  8083. ;;; org-man.el ends here
  8084. @end lisp
  8085. @noindent
  8086. You would activate this new link type in @file{.emacs} with
  8087. @lisp
  8088. (require 'org-man)
  8089. @end lisp
  8090. @noindent
  8091. Let's go through the file and see what it does.
  8092. @enumerate
  8093. @item
  8094. It does @code{(require 'org)} to make sure that @file{org.el} has been
  8095. loaded.
  8096. @item
  8097. The next line calls @code{org-add-link-type} to define a new link type
  8098. with prefix @samp{man}. The call also contains the name of a function
  8099. that will be called to follow such a link.
  8100. @item
  8101. The next line adds a function to @code{org-store-link-functions}, in
  8102. order to allow the command @kbd{C-c l} to record a useful link in a
  8103. buffer displaying a man page.
  8104. @end enumerate
  8105. The rest of the file defines the necessary variables and functions.
  8106. First there is a customization variable that determines which emacs
  8107. command should be used to display man pages. There are two options,
  8108. @code{man} and @code{woman}. Then the function to follow a link is
  8109. defined. It gets the link path as an argument - in this case the link
  8110. path is just a topic for the manual command. The function calls the
  8111. value of @code{org-man-command} to display the man page.
  8112. Finally the function @code{org-man-store-link} is defined. When you try
  8113. to store a link with @kbd{C-c l}, also this function will be called to
  8114. try to make a link. The function must first decide if it is supposed to
  8115. create the link for this buffer type, we do this by checking the value
  8116. of the variable @code{major-mode}. If not, the function must exit and
  8117. return the value @code{nil}. If yes, the link is created by getting the
  8118. manual topic from the buffer name and prefixing it with the string
  8119. @samp{man:}. Then it must call the command @code{org-store-link-props}
  8120. and set the @code{:type} and @code{:link} properties. Optionally you
  8121. can also set the @code{:description} property to provide a default for
  8122. the link description when the link is later inserted into an Org
  8123. buffer with @kbd{C-c C-l}.
  8124. @node Tables in arbitrary syntax, Dynamic blocks, Adding hyperlink types, Hacking
  8125. @section Tables and lists in arbitrary syntax
  8126. @cindex tables, in other modes
  8127. @cindex lists, in other modes
  8128. @cindex Orgtbl mode
  8129. Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
  8130. frequent feature request has been to make it work with native tables in
  8131. specific languages, for example La@TeX{}. However, this is extremely
  8132. hard to do in a general way, would lead to a customization nightmare,
  8133. and would take away much of the simplicity of the Orgtbl mode table
  8134. editor.
  8135. This appendix describes a different approach. We keep the Orgtbl mode
  8136. table in its native format (the @i{source table}), and use a custom
  8137. function to @i{translate} the table to the correct syntax, and to
  8138. @i{install} it in the right location (the @i{target table}). This puts
  8139. the burden of writing conversion functions on the user, but it allows
  8140. for a very flexible system.
  8141. Bastien added the ability to do the same with lists. You can use Org's
  8142. facilities to edit and structure lists by turning @code{orgstruct-mode}
  8143. on, then locally exporting such lists in another format (HTML, La@TeX{}
  8144. or Texinfo.)
  8145. @menu
  8146. * Radio tables:: Sending and receiving
  8147. * A LaTeX example:: Step by step, almost a tutorial
  8148. * Translator functions:: Copy and modify
  8149. * Radio lists:: Doing the same for lists
  8150. @end menu
  8151. @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
  8152. @subsection Radio tables
  8153. @cindex radio tables
  8154. To define the location of the target table, you first need to create two
  8155. lines that are comments in the current mode, but contain magic words for
  8156. Orgtbl mode to find. Orgtbl mode will insert the translated table
  8157. between these lines, replacing whatever was there before. For example:
  8158. @example
  8159. /* BEGIN RECEIVE ORGTBL table_name */
  8160. /* END RECEIVE ORGTBL table_name */
  8161. @end example
  8162. @noindent
  8163. Just above the source table, we put a special line that tells
  8164. Orgtbl mode how to translate this table and where to install it. For
  8165. example:
  8166. @example
  8167. #+ORGTBL: SEND table_name translation_function arguments....
  8168. @end example
  8169. @noindent
  8170. @code{table_name} is the reference name for the table that is also used
  8171. in the receiver lines. @code{translation_function} is the Lisp function
  8172. that does the translation. Furthermore, the line can contain a list of
  8173. arguments (alternating key and value) at the end. The arguments will be
  8174. passed as a property list to the translation function for
  8175. interpretation. A few standard parameters are already recognized and
  8176. acted upon before the translation function is called:
  8177. @table @code
  8178. @item :skip N
  8179. Skip the first N lines of the table. Hlines do count as separate lines for
  8180. this parameter!
  8181. @item :skipcols (n1 n2 ...)
  8182. List of columns that should be skipped. If the table has a column with
  8183. calculation marks, that column is automatically discarded as well.
  8184. Please note that the translator function sees the table @emph{after} the
  8185. removal of these columns, the function never knows that there have been
  8186. additional columns.
  8187. @end table
  8188. @noindent
  8189. The one problem remaining is how to keep the source table in the buffer
  8190. without disturbing the normal workings of the file, for example during
  8191. compilation of a C file or processing of a La@TeX{} file. There are a
  8192. number of different solutions:
  8193. @itemize @bullet
  8194. @item
  8195. The table could be placed in a block comment if that is supported by the
  8196. language. For example, in C mode you could wrap the table between
  8197. @samp{/*} and @samp{*/} lines.
  8198. @item
  8199. Sometimes it is possible to put the table after some kind of @i{END}
  8200. statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
  8201. in La@TeX{}.
  8202. @item
  8203. You can just comment the table line by line whenever you want to process
  8204. the file, and uncomment it whenever you need to edit the table. This
  8205. only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
  8206. make this comment-toggling very easy, in particular if you bind it to a
  8207. key.
  8208. @end itemize
  8209. @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
  8210. @subsection A LaTeX example of radio tables
  8211. @cindex LaTeX, and Orgtbl mode
  8212. The best way to wrap the source table in La@TeX{} is to use the
  8213. @code{comment} environment provided by @file{comment.sty}. It has to be
  8214. activated by placing @code{\usepackage@{comment@}} into the document
  8215. header. Orgtbl mode can insert a radio table skeleton@footnote{By
  8216. default this works only for La@TeX{}, HTML, and Texinfo. Configure the
  8217. variable @code{orgtbl-radio-tables} to install templates for other
  8218. modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
  8219. be prompted for a table name, lets say we use @samp{salesfigures}. You
  8220. will then get the following template:
  8221. @cindex #+ORGTBL: SEND
  8222. @example
  8223. % BEGIN RECEIVE ORGTBL salesfigures
  8224. % END RECEIVE ORGTBL salesfigures
  8225. \begin@{comment@}
  8226. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  8227. | | |
  8228. \end@{comment@}
  8229. @end example
  8230. @noindent
  8231. The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
  8232. @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
  8233. into the receiver location with name @code{salesfigures}. You may now
  8234. fill in the table, feel free to use the spreadsheet features@footnote{If
  8235. the @samp{#+TBLFM} line contains an odd number of dollar characters,
  8236. this may cause problems with font-lock in LaTeX mode. As shown in the
  8237. example you can fix this by adding an extra line inside the
  8238. @code{comment} environment that is used to balance the dollar
  8239. expressions. If you are using AUCTeX with the font-latex library, a
  8240. much better solution is to add the @code{comment} environment to the
  8241. variable @code{LaTeX-verbatim-environments}.}:
  8242. @example
  8243. % BEGIN RECEIVE ORGTBL salesfigures
  8244. % END RECEIVE ORGTBL salesfigures
  8245. \begin@{comment@}
  8246. #+ORGTBL: SEND salesfigures orgtbl-to-latex
  8247. | Month | Days | Nr sold | per day |
  8248. |-------+------+---------+---------|
  8249. | Jan | 23 | 55 | 2.4 |
  8250. | Feb | 21 | 16 | 0.8 |
  8251. | March | 22 | 278 | 12.6 |
  8252. #+TBLFM: $4=$3/$2;%.1f
  8253. % $ (optional extra dollar to keep font-lock happy, see footnote)
  8254. \end@{comment@}
  8255. @end example
  8256. @noindent
  8257. When you are done, press @kbd{C-c C-c} in the table to get the converted
  8258. table inserted between the two marker lines.
  8259. Now lets assume you want to make the table header by hand, because you
  8260. want to control how columns are aligned etc. In this case we make sure
  8261. that the table translator does skip the first 2 lines of the source
  8262. table, and tell the command to work as a @i{splice}, i.e. to not produce
  8263. header and footer commands of the target table:
  8264. @example
  8265. \begin@{tabular@}@{lrrr@}
  8266. Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
  8267. % BEGIN RECEIVE ORGTBL salesfigures
  8268. % END RECEIVE ORGTBL salesfigures
  8269. \end@{tabular@}
  8270. %
  8271. \begin@{comment@}
  8272. #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
  8273. | Month | Days | Nr sold | per day |
  8274. |-------+------+---------+---------|
  8275. | Jan | 23 | 55 | 2.4 |
  8276. | Feb | 21 | 16 | 0.8 |
  8277. | March | 22 | 278 | 12.6 |
  8278. #+TBLFM: $4=$3/$2;%.1f
  8279. \end@{comment@}
  8280. @end example
  8281. The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
  8282. Orgtbl mode. It uses a @code{tabular} environment to typeset the table
  8283. and marks horizontal lines with @code{\hline}. Furthermore, it
  8284. interprets the following parameters (see also @ref{Translator functions}):
  8285. @table @code
  8286. @item :splice nil/t
  8287. When set to t, return only table body lines, don't wrap them into a
  8288. tabular environment. Default is nil.
  8289. @item :fmt fmt
  8290. A format to be used to wrap each field, should contain @code{%s} for the
  8291. original field value. For example, to wrap each field value in dollars,
  8292. you could use @code{:fmt "$%s$"}. This may also be a property list with
  8293. column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
  8294. A function of one argument can be used in place of the strings; the
  8295. function must return a formatted string.
  8296. @item :efmt efmt
  8297. Use this format to print numbers with exponentials. The format should
  8298. have @code{%s} twice for inserting mantissa and exponent, for example
  8299. @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
  8300. may also be a property list with column numbers and formats, for example
  8301. @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
  8302. @code{efmt} has been applied to a value, @code{fmt} will also be
  8303. applied. Similar to @code{fmt}, functions of two arguments can be
  8304. supplied instead of strings.
  8305. @end table
  8306. @node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
  8307. @subsection Translator functions
  8308. @cindex HTML, and Orgtbl mode
  8309. @cindex translator function
  8310. Orgtbl mode has several translator functions built-in: @code{orgtbl-to-csv}
  8311. (comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values)
  8312. @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and @code{orgtbl-to-texinfo}.
  8313. Except for @code{orgtbl-to-html}@footnote{The HTML translator uses the same
  8314. code that produces tables during HTML export.}, these all use a generic
  8315. translator, @code{orgtbl-to-generic}. For example, @code{orgtbl-to-latex}
  8316. itself is a very short function that computes the column definitions for the
  8317. @code{tabular} environment, defines a few field and line separators and then
  8318. hands over to the generic translator. Here is the entire code:
  8319. @lisp
  8320. @group
  8321. (defun orgtbl-to-latex (table params)
  8322. "Convert the Orgtbl mode TABLE to LaTeX."
  8323. (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
  8324. org-table-last-alignment ""))
  8325. (params2
  8326. (list
  8327. :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
  8328. :tend "\\end@{tabular@}"
  8329. :lstart "" :lend " \\\\" :sep " & "
  8330. :efmt "%s\\,(%s)" :hline "\\hline")))
  8331. (orgtbl-to-generic table (org-combine-plists params2 params))))
  8332. @end group
  8333. @end lisp
  8334. As you can see, the properties passed into the function (variable
  8335. @var{PARAMS}) are combined with the ones newly defined in the function
  8336. (variable @var{PARAMS2}). The ones passed into the function (i.e. the
  8337. ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
  8338. would like to use the La@TeX{} translator, but wanted the line endings to
  8339. be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
  8340. overrule the default with
  8341. @example
  8342. #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
  8343. @end example
  8344. For a new language, you can either write your own converter function in
  8345. analogy with the La@TeX{} translator, or you can use the generic function
  8346. directly. For example, if you have a language where a table is started
  8347. with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
  8348. started with @samp{!BL!}, ended with @samp{!EL!} and where the field
  8349. separator is a TAB, you could call the generic translator like this (on
  8350. a single line!):
  8351. @example
  8352. #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
  8353. :lstart "!BL! " :lend " !EL!" :sep "\t"
  8354. @end example
  8355. @noindent
  8356. Please check the documentation string of the function
  8357. @code{orgtbl-to-generic} for a full list of parameters understood by
  8358. that function and remember that you can pass each of them into
  8359. @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
  8360. using the generic function.
  8361. Of course you can also write a completely new function doing complicated
  8362. things the generic translator cannot do. A translator function takes
  8363. two arguments. The first argument is the table, a list of lines, each
  8364. line either the symbol @code{hline} or a list of fields. The second
  8365. argument is the property list containing all parameters specified in the
  8366. @samp{#+ORGTBL: SEND} line. The function must return a single string
  8367. containing the formatted table. If you write a generally useful
  8368. translator, please post it on @code{emacs-orgmode@@gnu.org} so that
  8369. others can benefit from your work.
  8370. @node Radio lists, , Translator functions, Tables in arbitrary syntax
  8371. @subsection Radio lists
  8372. @cindex radio lists
  8373. @cindex org-list-insert-radio-list
  8374. Sending and receiving radio lists works exactly the same way than
  8375. sending and receiving radio tables (@pxref{Radio tables}) @footnote{You
  8376. need to load the @code{org-export-latex.el} package to use radio lists
  8377. since the relevant code is there for now.}. As for radio tables, you
  8378. can insert radio lists templates in HTML, La@TeX{} and Texinfo modes by
  8379. calling @code{org-list-insert-radio-list}.
  8380. Here are the differences with radio tables:
  8381. @itemize @minus
  8382. @item
  8383. Use @code{ORGLST} instead of @code{ORGTBL}.
  8384. @item
  8385. The available translation functions for radio lists don't take
  8386. parameters.
  8387. @item
  8388. `C-c C-c' will work when pressed on the first item of the list.
  8389. @end itemize
  8390. Here is a La@TeX{} example. Let's say that you have this in your
  8391. La@TeX{} file:
  8392. @example
  8393. % BEGIN RECEIVE ORGLST to-buy
  8394. % END RECEIVE ORGLST to-buy
  8395. \begin@{comment@}
  8396. #+ORGLIST: SEND to-buy orgtbl-to-latex
  8397. - a new house
  8398. - a new computer
  8399. + a new keyboard
  8400. + a new mouse
  8401. - a new life
  8402. \end@{comment@}
  8403. @end example
  8404. Pressing `C-c C-c' on @code{a new house} and will insert the converted
  8405. La@TeX{} list between the two marker lines.
  8406. @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
  8407. @section Dynamic blocks
  8408. @cindex dynamic blocks
  8409. Org documents can contain @emph{dynamic blocks}. These are
  8410. specially marked regions that are updated by some user-written function.
  8411. A good example for such a block is the clock table inserted by the
  8412. command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
  8413. Dynamic block are enclosed by a BEGIN-END structure that assigns a name
  8414. to the block and can also specify parameters for the function producing
  8415. the content of the block.
  8416. #+BEGIN:dynamic block
  8417. @example
  8418. #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
  8419. #+END:
  8420. @end example
  8421. Dynamic blocks are updated with the following commands
  8422. @table @kbd
  8423. @kindex C-c C-x C-u
  8424. @item C-c C-x C-u
  8425. Update dynamic block at point.
  8426. @kindex C-u C-c C-x C-u
  8427. @item C-u C-c C-x C-u
  8428. Update all dynamic blocks in the current file.
  8429. @end table
  8430. Updating a dynamic block means to remove all the text between BEGIN and
  8431. END, parse the BEGIN line for parameters and then call the specific
  8432. writer function for this block to insert the new content. If you want
  8433. to use the original content in the writer function, you can use the
  8434. extra parameter @code{:content}.
  8435. For a block with name @code{myblock}, the writer function is
  8436. @code{org-dblock-write:myblock} with as only parameter a property list
  8437. with the parameters given in the begin line. Here is a trivial example
  8438. of a block that keeps track of when the block update function was last
  8439. run:
  8440. @example
  8441. #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
  8442. #+END:
  8443. @end example
  8444. @noindent
  8445. The corresponding block writer function could look like this:
  8446. @lisp
  8447. (defun org-dblock-write:block-update-time (params)
  8448. (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
  8449. (insert "Last block update at: "
  8450. (format-time-string fmt (current-time)))))
  8451. @end lisp
  8452. If you want to make sure that all dynamic blocks are always up-to-date,
  8453. you could add the function @code{org-update-all-dblocks} to a hook, for
  8454. example @code{before-save-hook}. @code{org-update-all-dblocks} is
  8455. written in a way that is does nothing in buffers that are not in
  8456. @code{org-mode}.
  8457. @node Special agenda views, Using the property API, Dynamic blocks, Hacking
  8458. @section Special agenda views
  8459. @cindex agenda views, user-defined
  8460. Org provides a special hook that can be used to narrow down the
  8461. selection made by any of the agenda views. You may specify a function
  8462. that is used at each match to verify if the match should indeed be part
  8463. of the agenda view, and if not, how much should be skipped.
  8464. Let's say you want to produce a list of projects that contain a WAITING
  8465. tag anywhere in the project tree. Let's further assume that you have
  8466. marked all tree headings that define a project with the TODO keyword
  8467. PROJECT. In this case you would run a TODO search for the keyword
  8468. PROJECT, but skip the match unless there is a WAITING tag anywhere in
  8469. the subtree belonging to the project line.
  8470. To achieve this, you must write a function that searches the subtree for
  8471. the tag. If the tag is found, the function must return @code{nil} to
  8472. indicate that this match should not be skipped. If there is no such
  8473. tag, return the location of the end of the subtree, to indicate that
  8474. search should continue from there.
  8475. @lisp
  8476. (defun my-skip-unless-waiting ()
  8477. "Skip trees that are not waiting"
  8478. (let ((subtree-end (save-excursion (org-end-of-subtree t))))
  8479. (if (re-search-forward ":waiting:" subtree-end t)
  8480. nil ; tag found, do not skip
  8481. subtree-end))) ; tag not found, continue after end of subtree
  8482. @end lisp
  8483. Now you may use this function in an agenda custom command, for example
  8484. like this:
  8485. @lisp
  8486. (org-add-agenda-custom-command
  8487. '("b" todo "PROJECT"
  8488. ((org-agenda-skip-function 'my-skip-unless-waiting)
  8489. (org-agenda-overriding-header "Projects waiting for something: "))))
  8490. @end lisp
  8491. Note that this also binds @code{org-agenda-overriding-header} to get a
  8492. meaningful header in the agenda view.
  8493. A general way to create custom searches is to base them on a search for
  8494. entries with a certain level limit. If you want to study all entries with
  8495. your custom search function, simply do a search for @samp{LEVEL>0}, and then
  8496. use @code{org-agenda-skip-function} to select the entries you really want to
  8497. have.
  8498. You may also put a Lisp form into @code{org-agenda-skip-function}. In
  8499. particular, you may use the functions @code{org-agenda-skip-entry-if}
  8500. and @code{org-agenda-skip-subtree-if} in this form, for example:
  8501. @table @code
  8502. @item '(org-agenda-skip-entry-if 'scheduled)
  8503. Skip current entry if it has been scheduled.
  8504. @item '(org-agenda-skip-entry-if 'notscheduled)
  8505. Skip current entry if it has not been scheduled.
  8506. @item '(org-agenda-skip-entry-if 'deadline)
  8507. Skip current entry if it has a deadline.
  8508. @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
  8509. Skip current entry if it has a deadline, or if it is scheduled.
  8510. @item '(org-agenda-skip-entry 'regexp "regular expression")
  8511. Skip current entry if the regular expression matches in the entry.
  8512. @item '(org-agenda-skip-entry 'notregexp "regular expression")
  8513. Skip current entry unless the regular expression matches.
  8514. @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
  8515. Same as above, but check and skip the entire subtree.
  8516. @end table
  8517. Therefore we could also have written the search for WAITING projects
  8518. like this, even without defining a special function:
  8519. @lisp
  8520. (org-add-agenda-custom-command
  8521. '("b" todo "PROJECT"
  8522. ((org-agenda-skip-function '(org-agenda-skip-subtree-if
  8523. 'regexp ":waiting:"))
  8524. (org-agenda-overriding-header "Projects waiting for something: "))))
  8525. @end lisp
  8526. @node Using the property API, Using the mapping API, Special agenda views, Hacking
  8527. @section Using the property API
  8528. @cindex API, for properties
  8529. @cindex properties, API
  8530. Here is a description of the functions that can be used to work with
  8531. properties.
  8532. @defun org-entry-properties &optional pom which
  8533. Get all properties of the entry at point-or-marker POM.
  8534. This includes the TODO keyword, the tags, time strings for deadline,
  8535. scheduled, and clocking, and any additional properties defined in the
  8536. entry. The return value is an alist, keys may occur multiple times
  8537. if the property key was used several times.
  8538. POM may also be nil, in which case the current entry is used.
  8539. If WHICH is nil or `all', get all properties. If WHICH is
  8540. `special' or `standard', only get that subclass.
  8541. @end defun
  8542. @defun org-entry-get pom property &optional inherit
  8543. Get value of PROPERTY for entry at point-or-marker POM. By default,
  8544. this only looks at properties defined locally in the entry. If INHERIT
  8545. is non-nil and the entry does not have the property, then also check
  8546. higher levels of the hierarchy. If INHERIT is the symbol
  8547. @code{selective}, use inheritance if and only if the setting of
  8548. @code{org-use-property-inheritance} selects PROPERTY for inheritance.
  8549. @end defun
  8550. @defun org-entry-delete pom property
  8551. Delete the property PROPERTY from entry at point-or-marker POM.
  8552. @end defun
  8553. @defun org-entry-put pom property value
  8554. Set PROPERTY to VALUE for entry at point-or-marker POM.
  8555. @end defun
  8556. @defun org-buffer-property-keys &optional include-specials
  8557. Get all property keys in the current buffer.
  8558. @end defun
  8559. @defun org-insert-property-drawer
  8560. Insert a property drawer at point.
  8561. @end defun
  8562. @defun org-entry-put-multivalued-property pom property &rest values
  8563. Set PROPERTY at point-or-marker POM to VALUES. VALUES should be a list of
  8564. strings. They will be concatenated, with spaces as separators.
  8565. @end defun
  8566. @defun org-entry-get-multivalued-property pom property
  8567. Treat the value of the property PROPERTY as a whitespace-separated list of
  8568. values and return the values as a list of strings.
  8569. @end defun
  8570. @defun org-entry-add-to-multivalued-property pom property value
  8571. Treat the value of the property PROPERTY as a whitespace-separated list of
  8572. values and make sure that VALUE is in this list.
  8573. @end defun
  8574. @defun org-entry-remove-from-multivalued-property pom property value
  8575. Treat the value of the property PROPERTY as a whitespace-separated list of
  8576. values and make sure that VALUE is @emph{not} in this list.
  8577. @end defun
  8578. @defun org-entry-member-in-multivalued-property pom property value
  8579. Treat the value of the property PROPERTY as a whitespace-separated list of
  8580. values and check if VALUE is in this list.
  8581. @end defun
  8582. @node Using the mapping API, , Using the property API, Hacking
  8583. @section Using the mapping API
  8584. @cindex API, for mapping
  8585. @cindex mapping entries, API
  8586. Org has sophisticated mapping capabilities to find all entries satisfying
  8587. certain criteria. Internally, this functionality is used to produce agenda
  8588. views, but there is also an API that can be used to execute arbitrary
  8589. functions for each or selected entries. The main entry point for this API
  8590. is:
  8591. @defun org-map-entries func &optional match scope &rest skip
  8592. Call FUNC at each headline selected by MATCH in SCOPE.
  8593. FUNC is a function or a lisp form. The function will be called without
  8594. arguments, with the cursor positioned at the beginning of the headline.
  8595. The return values of all calls to the function will be collected and
  8596. returned as a list.
  8597. MATCH is a tags/property/todo match as it is used in the agenda match view.
  8598. Only headlines that are matched by this query will be considered during
  8599. the iteration. When MATCH is nil or t, all headlines will be
  8600. visited by the iteration.
  8601. SCOPE determines the scope of this command. It can be any of:
  8602. @example
  8603. nil @r{the current buffer, respecting the restriction if any}
  8604. tree @r{the subtree started with the entry at point}
  8605. file @r{the current buffer, without restriction}
  8606. file-with-archives
  8607. @r{the current buffer, and any archives associated with it}
  8608. agenda @r{all agenda files}
  8609. agenda-with-archives
  8610. @r{all agenda files with any archive files associated with them}
  8611. (file1 file2 ...)
  8612. @r{if this is a list, all files in the list will be scanned}
  8613. @end example
  8614. The remaining args are treated as settings for the skipping facilities of
  8615. the scanner. The following items can be given here:
  8616. @example
  8617. archive @r{skip trees with the archive tag}
  8618. comment @r{skip trees with the COMMENT keyword}
  8619. function or Lisp form
  8620. @r{will be used as value for @code{org-agenda-skip-function},}
  8621. @r{so whenever the the function returns t, FUNC}
  8622. @r{will not be called for that entry and search will}
  8623. @r{continue from the point where the function leaves it}
  8624. @end example
  8625. @end defun
  8626. The function given to that mapping routine can really do anything you like.
  8627. It can uce the property API (@pxref{Using the property API}) to gather more
  8628. information about the entry, or in order to change metadate in the entry.
  8629. Here are a couple of functions that might be handy:
  8630. @defun org-todo &optional arg
  8631. Change the TODO state of the entry, see the docstring of the functions for
  8632. the many possible values for the argument ARG.
  8633. @end defun
  8634. @defun org-priority &optional action
  8635. Change the priority of the entry, see the docstring of this function for the
  8636. possible values for ACTION.
  8637. @end defun
  8638. @defun org-toggle-tag tag &optional onoff
  8639. Toggle the tag TAG in the current entry. Setting ONOFF to either @code{on}
  8640. or @code{off} will not toggle tag, but ensure that it is either on or off.
  8641. @end defun
  8642. @defun org-promote
  8643. Promote the current entry.
  8644. @end defun
  8645. @defun org-demote
  8646. Demote the current entry.
  8647. @end defun
  8648. Here is a simple example that will turn all entries in the current file with
  8649. a tag @code{TOMORROW} into TODO entries with the keyword @code{UPCOMING}.
  8650. Entries in comment trees and in archive trees will be ignored.
  8651. @lisp
  8652. (org-map-entries
  8653. '(org-todo "UPCOMING")
  8654. "+TOMORROW" 'file 'archive 'comment)
  8655. @end lisp
  8656. The following example counts the number of entries with TODO keyword
  8657. @code{WAITING}, in all agenda files.
  8658. @lisp
  8659. (length (org-map-entries t "/+WAITING" 'agenda))
  8660. @end lisp
  8661. @node History and Acknowledgments, Main Index, Hacking, Top
  8662. @appendix History and Acknowledgments
  8663. @cindex acknowledgments
  8664. @cindex history
  8665. @cindex thanks
  8666. Org was borne in 2003, out of frustration over the user interface
  8667. of the Emacs Outline mode. I was trying to organize my notes and
  8668. projects, and using Emacs seemed to be the natural way to go. However,
  8669. having to remember eleven different commands with two or three keys per
  8670. command, only to hide and show parts of the outline tree, that seemed
  8671. entirely unacceptable to me. Also, when using outlines to take notes, I
  8672. constantly want to restructure the tree, organizing it parallel to my
  8673. thoughts and plans. @emph{Visibility cycling} and @emph{structure
  8674. editing} were originally implemented in the package
  8675. @file{outline-magic.el}, but quickly moved to the more general
  8676. @file{org.el}. As this environment became comfortable for project
  8677. planning, the next step was adding @emph{TODO entries}, basic @emph{time
  8678. stamps}, and @emph{table support}. These areas highlight the two main
  8679. goals that Org still has today: To create a new, outline-based,
  8680. plain text mode with innovative and intuitive editing features, and to
  8681. incorporate project planning functionality directly into a notes file.
  8682. A special thanks goes to @i{Bastien Guerry} who has not only writen a large
  8683. number of extensions to Org (most of them integrated into the core by now),
  8684. but has also helped the development and maintenance of Org so much that he
  8685. should be considered co-author of this package.
  8686. Since the first release, literally thousands of emails to me or on
  8687. @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
  8688. reports, feedback, new ideas, and sometimes patches and add-on code.
  8689. Many thanks to everyone who has helped to improve this package. I am
  8690. trying to keep here a list of the people who had significant influence
  8691. in shaping one or more aspects of Org. The list may not be
  8692. complete, if I have forgotten someone, please accept my apologies and
  8693. let me know.
  8694. @itemize @bullet
  8695. @item
  8696. @i{Russel Adams} came up with the idea for drawers.
  8697. @item
  8698. @i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
  8699. @item
  8700. @i{Christophe Bataillon} created the great unicorn logo that we use on the
  8701. Org-mode website.
  8702. @item
  8703. @i{Alex Bochannek} provided a patch for rounding time stamps.
  8704. @item
  8705. @i{Charles Cave}'s suggestion sparked the implementation of templates
  8706. for Remember.
  8707. @item
  8708. @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
  8709. specified time.
  8710. @item
  8711. @i{Gregory Chernov} patched support for lisp forms into table
  8712. calculations and improved XEmacs compatibility, in particular by porting
  8713. @file{nouline.el} to XEmacs.
  8714. @item
  8715. @i{Sacha Chua} suggested to copy some linking code from Planner.
  8716. @item
  8717. @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
  8718. came up with the idea of properties, and that there should be an API for
  8719. them.
  8720. @item
  8721. @i{Kees Dullemond} used to edit projects lists directly in HTML and so
  8722. inspired some of the early development, including HTML export. He also
  8723. asked for a way to narrow wide table columns.
  8724. @item
  8725. @i{Christian Egli} converted the documentation into Texinfo format,
  8726. patched CSS formatting into the HTML exporter, and inspired the agenda.
  8727. @item
  8728. @i{David Emery} provided a patch for custom CSS support in exported
  8729. HTML agendas.
  8730. @item
  8731. @i{Nic Ferrier} contributed mailcap and XOXO support.
  8732. @item
  8733. @i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
  8734. @item
  8735. @i{John Foerch} figured out how to make incremental search show context
  8736. around a match in a hidden outline tree.
  8737. @item
  8738. @i{Niels Giesen} had the idea to automatically archive DONE trees.
  8739. @item
  8740. @i{Bastien Guerry} wrote the La@TeX{} exporter and @file{org-bibtex.el}, and
  8741. has been prolific with patches, ideas, and bug reports.
  8742. @item
  8743. @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
  8744. @item
  8745. @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
  8746. task state change logging, and the clocktable. His clear explanations have
  8747. been critical when we started to adopt the GIT version control system.
  8748. @item
  8749. @i{Manuel Hermenegildo} has contributed various ideas, small fixed and
  8750. patches.
  8751. @item
  8752. @i{Phil Jackson} wrote @file{org-irc.el}.
  8753. @item
  8754. @i{Scott Jaderholm} proposed footnotes, control over whitespace between
  8755. folded entries, and column view for properties.
  8756. @item
  8757. @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
  8758. @item
  8759. @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
  8760. provided frequent feedback and some patches.
  8761. @item
  8762. @i{Jason F. McBrayer} suggested agenda export to CSV format.
  8763. @item
  8764. @i{Max Mikhanosha} came up with the idea of refiling.
  8765. @item
  8766. @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
  8767. basis.
  8768. @item
  8769. @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
  8770. happy.
  8771. @item
  8772. @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file
  8773. and to be able to quickly restrict the agenda to a subtree.
  8774. @item
  8775. @i{Todd Neal} provided patches for links to Info files and elisp forms.
  8776. @item
  8777. @i{Tim O'Callaghan} suggested in-file links, search options for general
  8778. file links, and TAGS.
  8779. @item
  8780. @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
  8781. into Japanese.
  8782. @item
  8783. @i{Oliver Oppitz} suggested multi-state TODO items.
  8784. @item
  8785. @i{Scott Otterson} sparked the introduction of descriptive text for
  8786. links, among other things.
  8787. @item
  8788. @i{Pete Phillips} helped during the development of the TAGS feature, and
  8789. provided frequent feedback.
  8790. @item
  8791. @i{T.V. Raman} reported bugs and suggested improvements.
  8792. @item
  8793. @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
  8794. control.
  8795. @item
  8796. @i{Kevin Rogers} contributed code to access VM files on remote hosts.
  8797. @item
  8798. @i{Sebastian Rose} wrote @file{org-info.js}, a Java script for displaying
  8799. webpages derived from Org using an Info-like, or a folding interface with
  8800. single key navigation.
  8801. @item
  8802. @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
  8803. conflict with @file{allout.el}.
  8804. @item
  8805. @i{Jason Riedy} generalized the send-receive mechanism for orgtbl tables with
  8806. extensive patches.
  8807. @item
  8808. @i{Philip Rooke} created the Org reference card, provided lots
  8809. of feedback, developed and applied standards to the Org documentation.
  8810. @item
  8811. @i{Christian Schlauer} proposed angular brackets around links, among
  8812. other things.
  8813. @item
  8814. @i{Eric Schulte} wrote @file{org-plot.el}.
  8815. @item
  8816. Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
  8817. @file{organizer-mode.el}.
  8818. @item
  8819. @i{Ilya Shlyakhter} proposed the Archive Sibling.
  8820. @item
  8821. @i{Stathis Sideris} wrote the @file{ditaa.jar} ASCII to PNG converter that is
  8822. now packaged into Org's @file{contrib} directory.
  8823. @item
  8824. @i{Daniel Sinder} came up with the idea of internal archiving by locking
  8825. subtrees.
  8826. @item
  8827. @i{Dale Smith} proposed link abbreviations.
  8828. @item
  8829. @i{James TD Smith} has contributed a large number of patches for useful
  8830. tweaks and features.
  8831. @item
  8832. @i{Adam Spiers} asked for global linking commands, inspired the link
  8833. extension system, added support for mairix, and proposed the mapping API.
  8834. @item
  8835. @i{Andy Stewart} contributed code to @file{org-w3m.el}, to copy HTML content
  8836. with links transformation to Org syntax.
  8837. @item
  8838. @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
  8839. chapter about publishing.
  8840. @item
  8841. @i{J@"urgen Vollmer} contributed code generating the table of contents
  8842. in HTML output.
  8843. @item
  8844. @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
  8845. keyword.
  8846. @item
  8847. @i{David Wainberg} suggested archiving, and improvements to the linking
  8848. system.
  8849. @item
  8850. @i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
  8851. @file{muse.el}, which have similar goals as Org. Initially the
  8852. development of Org was fully independent because I was not aware of the
  8853. existence of these packages. But with time I have accasionally looked
  8854. at John's code and learned a lot from it. John has also contributed a
  8855. number of great ideas and patches directly to Org, including the attachment
  8856. system (@file{org-attach.el}) and integration with Apple Mail
  8857. (@file{org-mac-message.el}).
  8858. @item
  8859. @i{Carsten Wimmer} suggested some changes and helped fix a bug in
  8860. linking to Gnus.
  8861. @item
  8862. @i{Roland Winkler} requested additional key bindings to make Org
  8863. work on a tty.
  8864. @item
  8865. @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
  8866. and contributed various ideas and code snippets.
  8867. @end itemize
  8868. @node Main Index, Key Index, History and Acknowledgments, Top
  8869. @unnumbered The Main Index
  8870. @printindex cp
  8871. @node Key Index, , Main Index, Top
  8872. @unnumbered Key Index
  8873. @printindex ky
  8874. @bye
  8875. @ignore
  8876. arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
  8877. @end ignore
  8878. @c Local variables:
  8879. @c ispell-local-dictionary: "en_US-w_accents"
  8880. @c ispell-local-pdict: "./.aspell.org.pws"
  8881. @c fill-column: 77
  8882. @c End: