gnus.el 150 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444
  1. ;;; gnus.el --- a newsreader for GNU Emacs
  2. ;; Copyright (C) 1987-1990, 1993-1998, 2000-2015 Free Software
  3. ;; Foundation, Inc.
  4. ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
  5. ;; Lars Magne Ingebrigtsen <larsi@gnus.org>
  6. ;; Keywords: news, mail
  7. ;; Version: 5.13
  8. ;; This file is part of GNU Emacs.
  9. ;; GNU Emacs is free software: you can redistribute it and/or modify
  10. ;; it under the terms of the GNU General Public License as published by
  11. ;; the Free Software Foundation, either version 3 of the License, or
  12. ;; (at your option) any later version.
  13. ;; GNU Emacs is distributed in the hope that it will be useful,
  14. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;; GNU General Public License for more details.
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  19. ;;; Commentary:
  20. ;;; Code:
  21. (eval '(run-hooks 'gnus-load-hook))
  22. (eval-when-compile (require 'cl))
  23. (require 'wid-edit)
  24. (require 'mm-util)
  25. (require 'nnheader)
  26. ;; These are defined afterwards with gnus-define-group-parameter
  27. (defvar gnus-ham-process-destinations)
  28. (defvar gnus-parameter-ham-marks-alist)
  29. (defvar gnus-parameter-spam-marks-alist)
  30. (defvar gnus-spam-autodetect)
  31. (defvar gnus-spam-autodetect-methods)
  32. (defvar gnus-spam-newsgroup-contents)
  33. (defvar gnus-spam-process-destinations)
  34. (defvar gnus-spam-resend-to)
  35. (defvar gnus-ham-resend-to)
  36. (defvar gnus-spam-process-newsgroups)
  37. (defgroup gnus nil
  38. "The coffee-brewing, all singing, all dancing, kitchen sink newsreader."
  39. :group 'news
  40. :group 'mail)
  41. (defgroup gnus-start nil
  42. "Starting your favorite newsreader."
  43. :group 'gnus)
  44. (defgroup gnus-format nil
  45. "Dealing with formatting issues."
  46. :group 'gnus)
  47. (defgroup gnus-charset nil
  48. "Group character set issues."
  49. :link '(custom-manual "(gnus)Charsets")
  50. :version "21.1"
  51. :group 'gnus)
  52. (defgroup gnus-cache nil
  53. "Cache interface."
  54. :link '(custom-manual "(gnus)Article Caching")
  55. :group 'gnus)
  56. (defgroup gnus-registry nil
  57. "Article Registry."
  58. :group 'gnus)
  59. (defgroup gnus-start-server nil
  60. "Server options at startup."
  61. :group 'gnus-start)
  62. ;; These belong to gnus-group.el.
  63. (defgroup gnus-group nil
  64. "Group buffers."
  65. :link '(custom-manual "(gnus)Group Buffer")
  66. :group 'gnus)
  67. (defgroup gnus-group-foreign nil
  68. "Foreign groups."
  69. :link '(custom-manual "(gnus)Foreign Groups")
  70. :group 'gnus-group)
  71. (defgroup gnus-group-new nil
  72. "Automatic subscription of new groups."
  73. :group 'gnus-group)
  74. (defgroup gnus-group-levels nil
  75. "Group levels."
  76. :link '(custom-manual "(gnus)Group Levels")
  77. :group 'gnus-group)
  78. (defgroup gnus-group-select nil
  79. "Selecting a Group."
  80. :link '(custom-manual "(gnus)Selecting a Group")
  81. :group 'gnus-group)
  82. (defgroup gnus-group-listing nil
  83. "Showing slices of the group list."
  84. :link '(custom-manual "(gnus)Listing Groups")
  85. :group 'gnus-group)
  86. (defgroup gnus-group-visual nil
  87. "Sorting the group buffer."
  88. :link '(custom-manual "(gnus)Group Buffer Format")
  89. :group 'gnus-group
  90. :group 'gnus-visual)
  91. (defgroup gnus-group-various nil
  92. "Various group options."
  93. :link '(custom-manual "(gnus)Scanning New Messages")
  94. :group 'gnus-group)
  95. ;; These belong to gnus-sum.el.
  96. (defgroup gnus-summary nil
  97. "Summary buffers."
  98. :link '(custom-manual "(gnus)Summary Buffer")
  99. :group 'gnus)
  100. (defgroup gnus-summary-exit nil
  101. "Leaving summary buffers."
  102. :link '(custom-manual "(gnus)Exiting the Summary Buffer")
  103. :group 'gnus-summary)
  104. (defgroup gnus-summary-marks nil
  105. "Marks used in summary buffers."
  106. :link '(custom-manual "(gnus)Marking Articles")
  107. :group 'gnus-summary)
  108. (defgroup gnus-thread nil
  109. "Ordering articles according to replies."
  110. :link '(custom-manual "(gnus)Threading")
  111. :group 'gnus-summary)
  112. (defgroup gnus-summary-format nil
  113. "Formatting of the summary buffer."
  114. :link '(custom-manual "(gnus)Summary Buffer Format")
  115. :group 'gnus-summary)
  116. (defgroup gnus-summary-choose nil
  117. "Choosing Articles."
  118. :link '(custom-manual "(gnus)Choosing Articles")
  119. :group 'gnus-summary)
  120. (defgroup gnus-summary-maneuvering nil
  121. "Summary movement commands."
  122. :link '(custom-manual "(gnus)Summary Maneuvering")
  123. :group 'gnus-summary)
  124. (defgroup gnus-picon nil
  125. "Show pictures of people, domains, and newsgroups."
  126. :group 'gnus-visual)
  127. (defgroup gnus-summary-mail nil
  128. "Mail group commands."
  129. :link '(custom-manual "(gnus)Mail Group Commands")
  130. :group 'gnus-summary)
  131. (defgroup gnus-summary-sort nil
  132. "Sorting the summary buffer."
  133. :link '(custom-manual "(gnus)Sorting the Summary Buffer")
  134. :group 'gnus-summary)
  135. (defgroup gnus-summary-visual nil
  136. "Highlighting and menus in the summary buffer."
  137. :link '(custom-manual "(gnus)Summary Highlighting")
  138. :group 'gnus-visual
  139. :group 'gnus-summary)
  140. (defgroup gnus-summary-various nil
  141. "Various summary buffer options."
  142. :link '(custom-manual "(gnus)Various Summary Stuff")
  143. :group 'gnus-summary)
  144. (defgroup gnus-summary-pick nil
  145. "Pick mode in the summary buffer."
  146. :link '(custom-manual "(gnus)Pick and Read")
  147. :prefix "gnus-pick-"
  148. :group 'gnus-summary)
  149. (defgroup gnus-summary-tree nil
  150. "Tree display of threads in the summary buffer."
  151. :link '(custom-manual "(gnus)Tree Display")
  152. :prefix "gnus-tree-"
  153. :group 'gnus-summary)
  154. ;; Belongs to gnus-uu.el
  155. (defgroup gnus-extract-view nil
  156. "Viewing extracted files."
  157. :link '(custom-manual "(gnus)Viewing Files")
  158. :group 'gnus-extract)
  159. ;; Belongs to gnus-score.el
  160. (defgroup gnus-score nil
  161. "Score and kill file handling."
  162. :group 'gnus)
  163. (defgroup gnus-score-kill nil
  164. "Kill files."
  165. :group 'gnus-score)
  166. (defgroup gnus-score-adapt nil
  167. "Adaptive score files."
  168. :group 'gnus-score)
  169. (defgroup gnus-score-default nil
  170. "Default values for score files."
  171. :group 'gnus-score)
  172. (defgroup gnus-score-expire nil
  173. "Expiring score rules."
  174. :group 'gnus-score)
  175. (defgroup gnus-score-decay nil
  176. "Decaying score rules."
  177. :group 'gnus-score)
  178. (defgroup gnus-score-files nil
  179. "Score and kill file names."
  180. :group 'gnus-score
  181. :group 'gnus-files)
  182. (defgroup gnus-score-various nil
  183. "Various scoring and killing options."
  184. :group 'gnus-score)
  185. ;; Other
  186. (defgroup gnus-visual nil
  187. "Options controlling the visual fluff."
  188. :group 'gnus
  189. :group 'faces)
  190. (defgroup gnus-agent nil
  191. "Offline support for Gnus."
  192. :group 'gnus)
  193. (defgroup gnus-files nil
  194. "Files used by Gnus."
  195. :group 'gnus)
  196. (defgroup gnus-dribble-file nil
  197. "Auto save file."
  198. :link '(custom-manual "(gnus)Auto Save")
  199. :group 'gnus-files)
  200. (defgroup gnus-newsrc nil
  201. "Storing Gnus state."
  202. :group 'gnus-files)
  203. (defgroup gnus-server nil
  204. "Options related to newsservers and other servers used by Gnus."
  205. :group 'gnus)
  206. (defgroup gnus-server-visual nil
  207. "Highlighting and menus in the server buffer."
  208. :group 'gnus-visual
  209. :group 'gnus-server)
  210. (defgroup gnus-message '((message custom-group))
  211. "Composing replies and followups in Gnus."
  212. :group 'gnus)
  213. (defgroup gnus-meta nil
  214. "Meta variables controlling major portions of Gnus.
  215. In general, modifying these variables does not take effect until Gnus
  216. is restarted, and sometimes reloaded."
  217. :group 'gnus)
  218. (defgroup gnus-various nil
  219. "Other Gnus options."
  220. :link '(custom-manual "(gnus)Various Various")
  221. :group 'gnus)
  222. (defgroup gnus-exit nil
  223. "Exiting Gnus."
  224. :link '(custom-manual "(gnus)Exiting Gnus")
  225. :group 'gnus)
  226. (defgroup gnus-fun nil
  227. "Frivolous Gnus extensions."
  228. :link '(custom-manual "(gnus)Exiting Gnus")
  229. :group 'gnus)
  230. (defconst gnus-version-number "5.13"
  231. "Version number for this version of Gnus.")
  232. (defconst gnus-version (format "Gnus v%s" gnus-version-number)
  233. "Version string for this version of Gnus.")
  234. (defcustom gnus-inhibit-startup-message nil
  235. "If non-nil, the startup message will not be displayed.
  236. This variable is used before `.gnus.el' is loaded, so it should
  237. be set in `.emacs' instead."
  238. :group 'gnus-start
  239. :type 'boolean)
  240. (unless (featurep 'gnus-xmas)
  241. (defalias 'gnus-extent-detached-p 'ignore)
  242. (defalias 'gnus-extent-start-open 'ignore)
  243. (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
  244. (defalias 'gnus-character-to-event 'identity)
  245. (defalias 'gnus-assq-delete-all 'assq-delete-all)
  246. (defalias 'gnus-add-text-properties 'add-text-properties)
  247. (defalias 'gnus-put-text-property 'put-text-property)
  248. (defvar gnus-mode-line-image-cache t)
  249. (if (fboundp 'find-image)
  250. (defun gnus-mode-line-buffer-identification (line)
  251. (let ((str (car-safe line))
  252. (load-path (append (mm-image-load-path) load-path)))
  253. (if (and (display-graphic-p)
  254. (stringp str)
  255. (string-match "^Gnus:" str))
  256. (progn (add-text-properties
  257. 0 5
  258. (list 'display
  259. (if (eq t gnus-mode-line-image-cache)
  260. (setq gnus-mode-line-image-cache
  261. (find-image
  262. '((:type xpm :file "gnus-pointer.xpm"
  263. :ascent center)
  264. (:type xbm :file "gnus-pointer.xbm"
  265. :ascent center))))
  266. gnus-mode-line-image-cache)
  267. 'help-echo (format
  268. "This is %s, %s."
  269. gnus-version (gnus-emacs-version)))
  270. str)
  271. (list str))
  272. line)))
  273. (defalias 'gnus-mode-line-buffer-identification 'identity))
  274. (defalias 'gnus-deactivate-mark 'deactivate-mark)
  275. (defalias 'gnus-window-edges 'window-edges)
  276. (defalias 'gnus-key-press-event-p 'numberp)
  277. ;;(defalias 'gnus-decode-rfc1522 'ignore)
  278. )
  279. ;; We define these group faces here to avoid the display
  280. ;; update forced when creating new faces.
  281. (defface gnus-group-news-1
  282. '((((class color)
  283. (background dark))
  284. (:foreground "PaleTurquoise" :bold t))
  285. (((class color)
  286. (background light))
  287. (:foreground "ForestGreen" :bold t))
  288. (t
  289. ()))
  290. "Level 1 newsgroup face."
  291. :group 'gnus-group)
  292. ;; backward-compatibility alias
  293. (put 'gnus-group-news-1-face 'face-alias 'gnus-group-news-1)
  294. (put 'gnus-group-news-1-face 'obsolete-face "22.1")
  295. (defface gnus-group-news-1-empty
  296. '((((class color)
  297. (background dark))
  298. (:foreground "PaleTurquoise"))
  299. (((class color)
  300. (background light))
  301. (:foreground "ForestGreen"))
  302. (t
  303. ()))
  304. "Level 1 empty newsgroup face."
  305. :group 'gnus-group)
  306. ;; backward-compatibility alias
  307. (put 'gnus-group-news-1-empty-face 'face-alias 'gnus-group-news-1-empty)
  308. (put 'gnus-group-news-1-empty-face 'obsolete-face "22.1")
  309. (defface gnus-group-news-2
  310. '((((class color)
  311. (background dark))
  312. (:foreground "turquoise" :bold t))
  313. (((class color)
  314. (background light))
  315. (:foreground "CadetBlue4" :bold t))
  316. (t
  317. ()))
  318. "Level 2 newsgroup face."
  319. :group 'gnus-group)
  320. ;; backward-compatibility alias
  321. (put 'gnus-group-news-2-face 'face-alias 'gnus-group-news-2)
  322. (put 'gnus-group-news-2-face 'obsolete-face "22.1")
  323. (defface gnus-group-news-2-empty
  324. '((((class color)
  325. (background dark))
  326. (:foreground "turquoise"))
  327. (((class color)
  328. (background light))
  329. (:foreground "CadetBlue4"))
  330. (t
  331. ()))
  332. "Level 2 empty newsgroup face."
  333. :group 'gnus-group)
  334. ;; backward-compatibility alias
  335. (put 'gnus-group-news-2-empty-face 'face-alias 'gnus-group-news-2-empty)
  336. (put 'gnus-group-news-2-empty-face 'obsolete-face "22.1")
  337. (defface gnus-group-news-3
  338. '((((class color)
  339. (background dark))
  340. (:bold t))
  341. (((class color)
  342. (background light))
  343. (:bold t))
  344. (t
  345. ()))
  346. "Level 3 newsgroup face."
  347. :group 'gnus-group)
  348. ;; backward-compatibility alias
  349. (put 'gnus-group-news-3-face 'face-alias 'gnus-group-news-3)
  350. (put 'gnus-group-news-3-face 'obsolete-face "22.1")
  351. (defface gnus-group-news-3-empty
  352. '((((class color)
  353. (background dark))
  354. ())
  355. (((class color)
  356. (background light))
  357. ())
  358. (t
  359. ()))
  360. "Level 3 empty newsgroup face."
  361. :group 'gnus-group)
  362. ;; backward-compatibility alias
  363. (put 'gnus-group-news-3-empty-face 'face-alias 'gnus-group-news-3-empty)
  364. (put 'gnus-group-news-3-empty-face 'obsolete-face "22.1")
  365. (defface gnus-group-news-4
  366. '((((class color)
  367. (background dark))
  368. (:bold t))
  369. (((class color)
  370. (background light))
  371. (:bold t))
  372. (t
  373. ()))
  374. "Level 4 newsgroup face."
  375. :group 'gnus-group)
  376. ;; backward-compatibility alias
  377. (put 'gnus-group-news-4-face 'face-alias 'gnus-group-news-4)
  378. (put 'gnus-group-news-4-face 'obsolete-face "22.1")
  379. (defface gnus-group-news-4-empty
  380. '((((class color)
  381. (background dark))
  382. ())
  383. (((class color)
  384. (background light))
  385. ())
  386. (t
  387. ()))
  388. "Level 4 empty newsgroup face."
  389. :group 'gnus-group)
  390. ;; backward-compatibility alias
  391. (put 'gnus-group-news-4-empty-face 'face-alias 'gnus-group-news-4-empty)
  392. (put 'gnus-group-news-4-empty-face 'obsolete-face "22.1")
  393. (defface gnus-group-news-5
  394. '((((class color)
  395. (background dark))
  396. (:bold t))
  397. (((class color)
  398. (background light))
  399. (:bold t))
  400. (t
  401. ()))
  402. "Level 5 newsgroup face."
  403. :group 'gnus-group)
  404. ;; backward-compatibility alias
  405. (put 'gnus-group-news-5-face 'face-alias 'gnus-group-news-5)
  406. (put 'gnus-group-news-5-face 'obsolete-face "22.1")
  407. (defface gnus-group-news-5-empty
  408. '((((class color)
  409. (background dark))
  410. ())
  411. (((class color)
  412. (background light))
  413. ())
  414. (t
  415. ()))
  416. "Level 5 empty newsgroup face."
  417. :group 'gnus-group)
  418. ;; backward-compatibility alias
  419. (put 'gnus-group-news-5-empty-face 'face-alias 'gnus-group-news-5-empty)
  420. (put 'gnus-group-news-5-empty-face 'obsolete-face "22.1")
  421. (defface gnus-group-news-6
  422. '((((class color)
  423. (background dark))
  424. (:bold t))
  425. (((class color)
  426. (background light))
  427. (:bold t))
  428. (t
  429. ()))
  430. "Level 6 newsgroup face."
  431. :group 'gnus-group)
  432. ;; backward-compatibility alias
  433. (put 'gnus-group-news-6-face 'face-alias 'gnus-group-news-6)
  434. (put 'gnus-group-news-6-face 'obsolete-face "22.1")
  435. (defface gnus-group-news-6-empty
  436. '((((class color)
  437. (background dark))
  438. ())
  439. (((class color)
  440. (background light))
  441. ())
  442. (t
  443. ()))
  444. "Level 6 empty newsgroup face."
  445. :group 'gnus-group)
  446. ;; backward-compatibility alias
  447. (put 'gnus-group-news-6-empty-face 'face-alias 'gnus-group-news-6-empty)
  448. (put 'gnus-group-news-6-empty-face 'obsolete-face "22.1")
  449. (defface gnus-group-news-low
  450. '((((class color)
  451. (background dark))
  452. (:foreground "DarkTurquoise" :bold t))
  453. (((class color)
  454. (background light))
  455. (:foreground "DarkGreen" :bold t))
  456. (t
  457. ()))
  458. "Low level newsgroup face."
  459. :group 'gnus-group)
  460. ;; backward-compatibility alias
  461. (put 'gnus-group-news-low-face 'face-alias 'gnus-group-news-low)
  462. (put 'gnus-group-news-low-face 'obsolete-face "22.1")
  463. (defface gnus-group-news-low-empty
  464. '((((class color)
  465. (background dark))
  466. (:foreground "DarkTurquoise"))
  467. (((class color)
  468. (background light))
  469. (:foreground "DarkGreen"))
  470. (t
  471. ()))
  472. "Low level empty newsgroup face."
  473. :group 'gnus-group)
  474. ;; backward-compatibility alias
  475. (put 'gnus-group-news-low-empty-face 'face-alias 'gnus-group-news-low-empty)
  476. (put 'gnus-group-news-low-empty-face 'obsolete-face "22.1")
  477. (defface gnus-group-mail-1
  478. '((((class color)
  479. (background dark))
  480. (:foreground "#e1ffe1" :bold t))
  481. (((class color)
  482. (background light))
  483. (:foreground "DeepPink3" :bold t))
  484. (t
  485. (:bold t)))
  486. "Level 1 mailgroup face."
  487. :group 'gnus-group)
  488. ;; backward-compatibility alias
  489. (put 'gnus-group-mail-1-face 'face-alias 'gnus-group-mail-1)
  490. (put 'gnus-group-mail-1-face 'obsolete-face "22.1")
  491. (defface gnus-group-mail-1-empty
  492. '((((class color)
  493. (background dark))
  494. (:foreground "#e1ffe1"))
  495. (((class color)
  496. (background light))
  497. (:foreground "DeepPink3"))
  498. (t
  499. (:italic t :bold t)))
  500. "Level 1 empty mailgroup face."
  501. :group 'gnus-group)
  502. ;; backward-compatibility alias
  503. (put 'gnus-group-mail-1-empty-face 'face-alias 'gnus-group-mail-1-empty)
  504. (put 'gnus-group-mail-1-empty-face 'obsolete-face "22.1")
  505. (defface gnus-group-mail-2
  506. '((((class color)
  507. (background dark))
  508. (:foreground "DarkSeaGreen1" :bold t))
  509. (((class color)
  510. (background light))
  511. (:foreground "HotPink3" :bold t))
  512. (t
  513. (:bold t)))
  514. "Level 2 mailgroup face."
  515. :group 'gnus-group)
  516. ;; backward-compatibility alias
  517. (put 'gnus-group-mail-2-face 'face-alias 'gnus-group-mail-2)
  518. (put 'gnus-group-mail-2-face 'obsolete-face "22.1")
  519. (defface gnus-group-mail-2-empty
  520. '((((class color)
  521. (background dark))
  522. (:foreground "DarkSeaGreen1"))
  523. (((class color)
  524. (background light))
  525. (:foreground "HotPink3"))
  526. (t
  527. (:bold t)))
  528. "Level 2 empty mailgroup face."
  529. :group 'gnus-group)
  530. ;; backward-compatibility alias
  531. (put 'gnus-group-mail-2-empty-face 'face-alias 'gnus-group-mail-2-empty)
  532. (put 'gnus-group-mail-2-empty-face 'obsolete-face "22.1")
  533. (defface gnus-group-mail-3
  534. '((((class color)
  535. (background dark))
  536. (:foreground "aquamarine1" :bold t))
  537. (((class color)
  538. (background light))
  539. (:foreground "magenta4" :bold t))
  540. (t
  541. (:bold t)))
  542. "Level 3 mailgroup face."
  543. :group 'gnus-group)
  544. ;; backward-compatibility alias
  545. (put 'gnus-group-mail-3-face 'face-alias 'gnus-group-mail-3)
  546. (put 'gnus-group-mail-3-face 'obsolete-face "22.1")
  547. (defface gnus-group-mail-3-empty
  548. '((((class color)
  549. (background dark))
  550. (:foreground "aquamarine1"))
  551. (((class color)
  552. (background light))
  553. (:foreground "magenta4"))
  554. (t
  555. ()))
  556. "Level 3 empty mailgroup face."
  557. :group 'gnus-group)
  558. ;; backward-compatibility alias
  559. (put 'gnus-group-mail-3-empty-face 'face-alias 'gnus-group-mail-3-empty)
  560. (put 'gnus-group-mail-3-empty-face 'obsolete-face "22.1")
  561. (defface gnus-group-mail-low
  562. '((((class color)
  563. (background dark))
  564. (:foreground "aquamarine2" :bold t))
  565. (((class color)
  566. (background light))
  567. (:foreground "DeepPink4" :bold t))
  568. (t
  569. (:bold t)))
  570. "Low level mailgroup face."
  571. :group 'gnus-group)
  572. ;; backward-compatibility alias
  573. (put 'gnus-group-mail-low-face 'face-alias 'gnus-group-mail-low)
  574. (put 'gnus-group-mail-low-face 'obsolete-face "22.1")
  575. (defface gnus-group-mail-low-empty
  576. '((((class color)
  577. (background dark))
  578. (:foreground "aquamarine2"))
  579. (((class color)
  580. (background light))
  581. (:foreground "DeepPink4"))
  582. (t
  583. (:bold t)))
  584. "Low level empty mailgroup face."
  585. :group 'gnus-group)
  586. ;; backward-compatibility alias
  587. (put 'gnus-group-mail-low-empty-face 'face-alias 'gnus-group-mail-low-empty)
  588. (put 'gnus-group-mail-low-empty-face 'obsolete-face "22.1")
  589. ;; Summary mode faces.
  590. (defface gnus-summary-selected '((t (:underline t)))
  591. "Face used for selected articles."
  592. :group 'gnus-summary)
  593. ;; backward-compatibility alias
  594. (put 'gnus-summary-selected-face 'face-alias 'gnus-summary-selected)
  595. (put 'gnus-summary-selected-face 'obsolete-face "22.1")
  596. (defface gnus-summary-cancelled
  597. '((((class color))
  598. (:foreground "yellow" :background "black")))
  599. "Face used for canceled articles."
  600. :group 'gnus-summary)
  601. ;; backward-compatibility alias
  602. (put 'gnus-summary-cancelled-face 'face-alias 'gnus-summary-cancelled)
  603. (put 'gnus-summary-cancelled-face 'obsolete-face "22.1")
  604. (defface gnus-summary-high-ticked
  605. '((((class color)
  606. (background dark))
  607. (:foreground "pink" :bold t))
  608. (((class color)
  609. (background light))
  610. (:foreground "firebrick" :bold t))
  611. (t
  612. (:bold t)))
  613. "Face used for high interest ticked articles."
  614. :group 'gnus-summary)
  615. ;; backward-compatibility alias
  616. (put 'gnus-summary-high-ticked-face 'face-alias 'gnus-summary-high-ticked)
  617. (put 'gnus-summary-high-ticked-face 'obsolete-face "22.1")
  618. (defface gnus-summary-low-ticked
  619. '((((class color)
  620. (background dark))
  621. (:foreground "pink" :italic t))
  622. (((class color)
  623. (background light))
  624. (:foreground "firebrick" :italic t))
  625. (t
  626. (:italic t)))
  627. "Face used for low interest ticked articles."
  628. :group 'gnus-summary)
  629. ;; backward-compatibility alias
  630. (put 'gnus-summary-low-ticked-face 'face-alias 'gnus-summary-low-ticked)
  631. (put 'gnus-summary-low-ticked-face 'obsolete-face "22.1")
  632. (defface gnus-summary-normal-ticked
  633. '((((class color)
  634. (background dark))
  635. (:foreground "pink"))
  636. (((class color)
  637. (background light))
  638. (:foreground "firebrick"))
  639. (t
  640. ()))
  641. "Face used for normal interest ticked articles."
  642. :group 'gnus-summary)
  643. ;; backward-compatibility alias
  644. (put 'gnus-summary-normal-ticked-face 'face-alias 'gnus-summary-normal-ticked)
  645. (put 'gnus-summary-normal-ticked-face 'obsolete-face "22.1")
  646. (defface gnus-summary-high-ancient
  647. '((((class color)
  648. (background dark))
  649. (:foreground "SkyBlue" :bold t))
  650. (((class color)
  651. (background light))
  652. (:foreground "RoyalBlue" :bold t))
  653. (t
  654. (:bold t)))
  655. "Face used for high interest ancient articles."
  656. :group 'gnus-summary)
  657. ;; backward-compatibility alias
  658. (put 'gnus-summary-high-ancient-face 'face-alias 'gnus-summary-high-ancient)
  659. (put 'gnus-summary-high-ancient-face 'obsolete-face "22.1")
  660. (defface gnus-summary-low-ancient
  661. '((((class color)
  662. (background dark))
  663. (:foreground "SkyBlue" :italic t))
  664. (((class color)
  665. (background light))
  666. (:foreground "RoyalBlue" :italic t))
  667. (t
  668. (:italic t)))
  669. "Face used for low interest ancient articles."
  670. :group 'gnus-summary)
  671. ;; backward-compatibility alias
  672. (put 'gnus-summary-low-ancient-face 'face-alias 'gnus-summary-low-ancient)
  673. (put 'gnus-summary-low-ancient-face 'obsolete-face "22.1")
  674. (defface gnus-summary-normal-ancient
  675. '((((class color)
  676. (background dark))
  677. (:foreground "SkyBlue"))
  678. (((class color)
  679. (background light))
  680. (:foreground "RoyalBlue"))
  681. (t
  682. ()))
  683. "Face used for normal interest ancient articles."
  684. :group 'gnus-summary)
  685. ;; backward-compatibility alias
  686. (put 'gnus-summary-normal-ancient-face 'face-alias 'gnus-summary-normal-ancient)
  687. (put 'gnus-summary-normal-ancient-face 'obsolete-face "22.1")
  688. (defface gnus-summary-high-undownloaded
  689. '((((class color)
  690. (background light))
  691. (:bold t :foreground "cyan4"))
  692. (((class color) (background dark))
  693. (:bold t :foreground "LightGray"))
  694. (t (:inverse-video t :bold t)))
  695. "Face used for high interest uncached articles."
  696. :group 'gnus-summary)
  697. ;; backward-compatibility alias
  698. (put 'gnus-summary-high-undownloaded-face 'face-alias 'gnus-summary-high-undownloaded)
  699. (put 'gnus-summary-high-undownloaded-face 'obsolete-face "22.1")
  700. (defface gnus-summary-low-undownloaded
  701. '((((class color)
  702. (background light))
  703. (:italic t :foreground "cyan4" :bold nil))
  704. (((class color) (background dark))
  705. (:italic t :foreground "LightGray" :bold nil))
  706. (t (:inverse-video t :italic t)))
  707. "Face used for low interest uncached articles."
  708. :group 'gnus-summary)
  709. ;; backward-compatibility alias
  710. (put 'gnus-summary-low-undownloaded-face 'face-alias 'gnus-summary-low-undownloaded)
  711. (put 'gnus-summary-low-undownloaded-face 'obsolete-face "22.1")
  712. (defface gnus-summary-normal-undownloaded
  713. '((((class color)
  714. (background light))
  715. (:foreground "cyan4" :bold nil))
  716. (((class color) (background dark))
  717. (:foreground "LightGray" :bold nil))
  718. (t (:inverse-video t)))
  719. "Face used for normal interest uncached articles."
  720. :group 'gnus-summary)
  721. ;; backward-compatibility alias
  722. (put 'gnus-summary-normal-undownloaded-face 'face-alias 'gnus-summary-normal-undownloaded)
  723. (put 'gnus-summary-normal-undownloaded-face 'obsolete-face "22.1")
  724. (defface gnus-summary-high-unread
  725. '((t
  726. (:bold t)))
  727. "Face used for high interest unread articles."
  728. :group 'gnus-summary)
  729. ;; backward-compatibility alias
  730. (put 'gnus-summary-high-unread-face 'face-alias 'gnus-summary-high-unread)
  731. (put 'gnus-summary-high-unread-face 'obsolete-face "22.1")
  732. (defface gnus-summary-low-unread
  733. '((t
  734. (:italic t)))
  735. "Face used for low interest unread articles."
  736. :group 'gnus-summary)
  737. ;; backward-compatibility alias
  738. (put 'gnus-summary-low-unread-face 'face-alias 'gnus-summary-low-unread)
  739. (put 'gnus-summary-low-unread-face 'obsolete-face "22.1")
  740. (defface gnus-summary-normal-unread
  741. '((t
  742. ()))
  743. "Face used for normal interest unread articles."
  744. :group 'gnus-summary)
  745. ;; backward-compatibility alias
  746. (put 'gnus-summary-normal-unread-face 'face-alias 'gnus-summary-normal-unread)
  747. (put 'gnus-summary-normal-unread-face 'obsolete-face "22.1")
  748. (defface gnus-summary-high-read
  749. '((((class color)
  750. (background dark))
  751. (:foreground "PaleGreen"
  752. :bold t))
  753. (((class color)
  754. (background light))
  755. (:foreground "DarkGreen"
  756. :bold t))
  757. (t
  758. (:bold t)))
  759. "Face used for high interest read articles."
  760. :group 'gnus-summary)
  761. ;; backward-compatibility alias
  762. (put 'gnus-summary-high-read-face 'face-alias 'gnus-summary-high-read)
  763. (put 'gnus-summary-high-read-face 'obsolete-face "22.1")
  764. (defface gnus-summary-low-read
  765. '((((class color)
  766. (background dark))
  767. (:foreground "PaleGreen"
  768. :italic t))
  769. (((class color)
  770. (background light))
  771. (:foreground "DarkGreen"
  772. :italic t))
  773. (t
  774. (:italic t)))
  775. "Face used for low interest read articles."
  776. :group 'gnus-summary)
  777. ;; backward-compatibility alias
  778. (put 'gnus-summary-low-read-face 'face-alias 'gnus-summary-low-read)
  779. (put 'gnus-summary-low-read-face 'obsolete-face "22.1")
  780. (defface gnus-summary-normal-read
  781. '((((class color)
  782. (background dark))
  783. (:foreground "PaleGreen"))
  784. (((class color)
  785. (background light))
  786. (:foreground "DarkGreen"))
  787. (t
  788. ()))
  789. "Face used for normal interest read articles."
  790. :group 'gnus-summary)
  791. ;; backward-compatibility alias
  792. (put 'gnus-summary-normal-read-face 'face-alias 'gnus-summary-normal-read)
  793. (put 'gnus-summary-normal-read-face 'obsolete-face "22.1")
  794. ;;;
  795. ;;; Gnus buffers
  796. ;;;
  797. (defvar gnus-buffers nil
  798. "List of buffers handled by Gnus.")
  799. (defun gnus-get-buffer-create (name)
  800. "Do the same as `get-buffer-create', but store the created buffer."
  801. (or (get-buffer name)
  802. (car (push (get-buffer-create name) gnus-buffers))))
  803. (defun gnus-add-buffer ()
  804. "Add the current buffer to the list of Gnus buffers."
  805. (push (current-buffer) gnus-buffers))
  806. (defmacro gnus-kill-buffer (buffer)
  807. "Kill BUFFER and remove from the list of Gnus buffers."
  808. `(let ((buf ,buffer))
  809. (when (gnus-buffer-exists-p buf)
  810. (setq gnus-buffers (delete (get-buffer buf) gnus-buffers))
  811. (kill-buffer buf))))
  812. (defun gnus-buffers ()
  813. "Return a list of live Gnus buffers."
  814. (while (and gnus-buffers
  815. (not (buffer-name (car gnus-buffers))))
  816. (pop gnus-buffers))
  817. (let ((buffers gnus-buffers))
  818. (while (cdr buffers)
  819. (if (buffer-name (cadr buffers))
  820. (pop buffers)
  821. (setcdr buffers (cddr buffers)))))
  822. gnus-buffers)
  823. ;;; Splash screen.
  824. (defvar gnus-group-buffer "*Group*"
  825. "Name of the Gnus group buffer.")
  826. (defface gnus-splash
  827. '((((class color)
  828. (background dark))
  829. (:foreground "#cccccc"))
  830. (((class color)
  831. (background light))
  832. (:foreground "#888888"))
  833. (t
  834. ()))
  835. "Face for the splash screen."
  836. :group 'gnus-start)
  837. ;; backward-compatibility alias
  838. (put 'gnus-splash-face 'face-alias 'gnus-splash)
  839. (put 'gnus-splash-face 'obsolete-face "22.1")
  840. (defun gnus-splash ()
  841. (save-excursion
  842. (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer))
  843. (let ((buffer-read-only nil))
  844. (erase-buffer)
  845. (unless gnus-inhibit-startup-message
  846. (gnus-group-startup-message)
  847. (sit-for 0)))))
  848. (defun gnus-indent-rigidly (start end arg)
  849. "Indent rigidly using only spaces and no tabs."
  850. (save-excursion
  851. (save-restriction
  852. (narrow-to-region start end)
  853. (let ((tab-width 8))
  854. (indent-rigidly start end arg)
  855. ;; We translate tabs into spaces -- not everybody uses
  856. ;; an 8-character tab.
  857. (goto-char (point-min))
  858. (while (search-forward "\t" nil t)
  859. (replace-match " " t t))))))
  860. ;;(format "%02x%02x%02x" 114 66 20) "724214"
  861. (defvar gnus-logo-color-alist
  862. '((flame "#cc3300" "#ff2200")
  863. (pine "#c0cc93" "#f8ffb8")
  864. (moss "#a1cc93" "#d2ffb8")
  865. (irish "#04cc90" "#05ff97")
  866. (sky "#049acc" "#05deff")
  867. (tin "#6886cc" "#82b6ff")
  868. (velvet "#7c68cc" "#8c82ff")
  869. (grape "#b264cc" "#cf7df")
  870. (labia "#cc64c2" "#fd7dff")
  871. (berry "#cc6485" "#ff7db5")
  872. (dino "#724214" "#1e3f03")
  873. (oort "#cccccc" "#888888")
  874. (storm "#666699" "#99ccff")
  875. (pdino "#9999cc" "#99ccff")
  876. (purp "#9999cc" "#666699")
  877. (no "#ff0000" "#ffff00")
  878. (neutral "#b4b4b4" "#878787")
  879. (ma "#2020e0" "#8080ff")
  880. (september "#bf9900" "#ffcc00"))
  881. "Color alist used for the Gnus logo.")
  882. (defcustom gnus-logo-color-style 'ma
  883. "*Color styles used for the Gnus logo."
  884. :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem)))
  885. gnus-logo-color-alist))
  886. :group 'gnus-xmas)
  887. (defvar gnus-logo-colors
  888. (cdr (assq gnus-logo-color-style gnus-logo-color-alist))
  889. "Colors used for the Gnus logo.")
  890. (declare-function image-size "image.c" (spec &optional pixels frame))
  891. (defun gnus-group-startup-message (&optional x y)
  892. "Insert startup message in current buffer."
  893. ;; Insert the message.
  894. (erase-buffer)
  895. (unless (and
  896. (fboundp 'find-image)
  897. (display-graphic-p)
  898. ;; Make sure the library defining `image-load-path' is
  899. ;; loaded (`find-image' is autoloaded) (and discard the
  900. ;; result). Else, we may get "defvar ignored because
  901. ;; image-load-path is let-bound" when calling `find-image'
  902. ;; below.
  903. (or (find-image '(nil (:type xpm :file "gnus.xpm"))) t)
  904. (let* ((data-directory (nnheader-find-etc-directory "images/gnus"))
  905. (image-load-path (cond (data-directory
  906. (list data-directory))
  907. ((boundp 'image-load-path)
  908. (symbol-value 'image-load-path))
  909. (t load-path)))
  910. (image (gnus-splash-svg-color-symbols (find-image
  911. `((:type svg :file "gnus.svg"
  912. :color-symbols
  913. (("#bf9900" . ,(car gnus-logo-colors))
  914. ("#ffcc00" . ,(cadr gnus-logo-colors))))
  915. (:type xpm :file "gnus.xpm"
  916. :color-symbols
  917. (("thing" . ,(car gnus-logo-colors))
  918. ("shadow" . ,(cadr gnus-logo-colors))))
  919. (:type png :file "gnus.png")
  920. (:type pbm :file "gnus.pbm"
  921. ;; Account for the pbm's background.
  922. :background ,(face-foreground 'gnus-splash)
  923. :foreground ,(face-background 'default))
  924. (:type xbm :file "gnus.xbm"
  925. ;; Account for the xbm's background.
  926. :background ,(face-foreground 'gnus-splash)
  927. :foreground ,(face-background 'default)))))))
  928. (when image
  929. (let ((size (image-size image)))
  930. (insert-char ?\n (max 0 (round (- (window-height)
  931. (or y (cdr size)) 1) 2)))
  932. (insert-char ?\ (max 0 (round (- (window-width)
  933. (or x (car size))) 2)))
  934. (insert-image image))
  935. (goto-char (point-min))
  936. t)))
  937. (insert
  938. (format "
  939. _ ___ _ _
  940. _ ___ __ ___ __ _ ___
  941. __ _ ___ __ ___
  942. _ ___ _
  943. _ _ __ _
  944. ___ __ _
  945. __ _
  946. _ _ _
  947. _ _ _
  948. _ _ _
  949. __ ___
  950. _ _ _ _
  951. _ _
  952. _ _
  953. _ _
  954. _
  955. __
  956. "))
  957. ;; And then hack it.
  958. (gnus-indent-rigidly (point-min) (point-max)
  959. (/ (max (- (window-width) (or x 46)) 0) 2))
  960. (goto-char (point-min))
  961. (forward-line 1)
  962. (let* ((pheight (count-lines (point-min) (point-max)))
  963. (wheight (window-height))
  964. (rest (- wheight pheight)))
  965. (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n)))
  966. ;; Fontify some.
  967. (put-text-property (point-min) (point-max) 'face 'gnus-splash)
  968. (goto-char (point-min))
  969. (setq mode-line-buffer-identification (concat " " gnus-version))
  970. (set-buffer-modified-p t)))
  971. (defun gnus-splash-svg-color-symbols (list)
  972. "Do color-symbol search-and-replace in svg file."
  973. (let ((type (plist-get (cdr list) :type))
  974. (file (plist-get (cdr list) :file))
  975. (color-symbols (plist-get (cdr list) :color-symbols)))
  976. (if (string= type "svg")
  977. (let ((data (with-temp-buffer (insert-file-contents file)
  978. (buffer-string))))
  979. (mapc (lambda (rule)
  980. (setq data (replace-regexp-in-string
  981. (concat "fill:" (car rule))
  982. (concat "fill:" (cdr rule)) data)))
  983. color-symbols)
  984. (cons (car list) (list :type type :data data)))
  985. list)))
  986. (eval-when (load)
  987. (let ((command (format "%s" this-command)))
  988. (when (string-match "gnus" command)
  989. (if (string-match "gnus-other-frame" command)
  990. (gnus-get-buffer-create gnus-group-buffer)
  991. (gnus-splash)))))
  992. ;;; Do the rest.
  993. (require 'gnus-util)
  994. (require 'nnheader)
  995. (defcustom gnus-parameters nil
  996. "Alist of group parameters.
  997. For example:
  998. ((\"mail\\\\..*\" (gnus-show-threads nil)
  999. (gnus-use-scoring nil)
  1000. (gnus-summary-line-format
  1001. \"%U%R%z%I%(%[%d:%ub%-23,23f%]%) %s\\n\")
  1002. (gcc-self . t)
  1003. (display . all))
  1004. (\"mail\\\\.me\" (gnus-use-scoring t))
  1005. (\"list\\\\..*\" (total-expire . t)
  1006. (broken-reply-to . t)))"
  1007. :version "22.1"
  1008. :group 'gnus-group-various
  1009. :type '(repeat (cons regexp
  1010. (repeat sexp))))
  1011. (defcustom gnus-parameters-case-fold-search 'default
  1012. "If it is t, ignore case of group names specified in `gnus-parameters'.
  1013. If it is nil, don't ignore case. If it is `default', which is for the
  1014. backward compatibility, use the value of `case-fold-search'."
  1015. :version "22.1"
  1016. :group 'gnus-group-various
  1017. :type '(choice :format "%{%t%}:\n %[Value Menu%] %v"
  1018. (const :tag "Use `case-fold-search'" default)
  1019. (const nil)
  1020. (const t)))
  1021. (defvar gnus-group-parameters-more nil)
  1022. (defmacro gnus-define-group-parameter (param &rest rest)
  1023. "Define a group parameter PARAM.
  1024. REST is a plist of following:
  1025. :type One of `bool', `list' or nil.
  1026. :function The name of the function.
  1027. :function-document The documentation of the function.
  1028. :parameter-type The type for customizing the parameter.
  1029. :parameter-document The documentation for the parameter.
  1030. :variable The name of the variable.
  1031. :variable-document The documentation for the variable.
  1032. :variable-group The group for customizing the variable.
  1033. :variable-type The type for customizing the variable.
  1034. :variable-default The default value of the variable."
  1035. (let* ((type (plist-get rest :type))
  1036. (parameter-type (plist-get rest :parameter-type))
  1037. (parameter-document (plist-get rest :parameter-document))
  1038. (function (or (plist-get rest :function)
  1039. (intern (format "gnus-parameter-%s" param))))
  1040. (function-document (or (plist-get rest :function-document) ""))
  1041. (variable (or (plist-get rest :variable)
  1042. (intern (format "gnus-parameter-%s-alist" param))))
  1043. (variable-document (or (plist-get rest :variable-document) ""))
  1044. (variable-group (plist-get rest :variable-group))
  1045. (variable-type (or (plist-get rest :variable-type)
  1046. `(quote (repeat
  1047. (list (regexp :tag "Group")
  1048. ,(car (cdr parameter-type)))))))
  1049. (variable-default (plist-get rest :variable-default)))
  1050. (list
  1051. 'progn
  1052. `(defcustom ,variable ,variable-default
  1053. ,variable-document
  1054. :group 'gnus-group-parameter
  1055. :group ',variable-group
  1056. :type ,variable-type)
  1057. `(setq gnus-group-parameters-more
  1058. (delq (assq ',param gnus-group-parameters-more)
  1059. gnus-group-parameters-more))
  1060. `(add-to-list 'gnus-group-parameters-more
  1061. (list ',param
  1062. ,parameter-type
  1063. ,parameter-document))
  1064. (if (eq type 'bool)
  1065. `(defun ,function (name)
  1066. ,function-document
  1067. (let ((params (gnus-group-find-parameter name))
  1068. val)
  1069. (cond
  1070. ((memq ',param params)
  1071. t)
  1072. ((setq val (assq ',param params))
  1073. (cdr val))
  1074. ((stringp ,variable)
  1075. (string-match ,variable name))
  1076. (,variable
  1077. (let ((alist ,variable)
  1078. elem value)
  1079. (while (setq elem (pop alist))
  1080. (when (and name
  1081. (string-match (car elem) name))
  1082. (setq alist nil
  1083. value (cdr elem))))
  1084. (if (consp value) (car value) value))))))
  1085. `(defun ,function (name)
  1086. ,function-document
  1087. (and name
  1088. (or (gnus-group-find-parameter name ',param ,(and type t))
  1089. (let ((alist ,variable)
  1090. elem value)
  1091. (while (setq elem (pop alist))
  1092. (when (and name
  1093. (string-match (car elem) name))
  1094. (setq alist nil
  1095. value (cdr elem))))
  1096. ,(if type
  1097. 'value
  1098. '(if (consp value) (car value) value))))))))))
  1099. (defcustom gnus-home-directory "~/"
  1100. "Directory variable that specifies the \"home\" directory.
  1101. All other Gnus file and directory variables are initialized from this variable.
  1102. Note that Gnus is mostly loaded when the `.gnus.el' file is read.
  1103. This means that other directory variables that are initialized
  1104. from this variable won't be set properly if you set this variable
  1105. in `.gnus.el'. Set this variable in `.emacs' instead."
  1106. :group 'gnus-files
  1107. :type 'directory)
  1108. (defcustom gnus-directory (or (getenv "SAVEDIR")
  1109. (nnheader-concat gnus-home-directory "News/"))
  1110. "*Directory variable from which all other Gnus file variables are derived.
  1111. Note that Gnus is mostly loaded when the `.gnus.el' file is read.
  1112. This means that other directory variables that are initialized from
  1113. this variable won't be set properly if you set this variable in `.gnus.el'.
  1114. Set this variable in `.emacs' instead."
  1115. :group 'gnus-files
  1116. :type 'directory)
  1117. (defcustom gnus-default-directory nil
  1118. "*Default directory for all Gnus buffers."
  1119. :group 'gnus-files
  1120. :type '(choice (const :tag "current" nil)
  1121. directory))
  1122. ;; Site dependent variables.
  1123. ;; Should this be obsolete?
  1124. (defcustom gnus-default-nntp-server nil
  1125. "The hostname of the default NNTP server.
  1126. The empty string, or nil, means to use the local host.
  1127. You may wish to set this on a site-wide basis.
  1128. If you want to change servers, you should use `gnus-select-method'."
  1129. :group 'gnus-server
  1130. :type '(choice (const :tag "local host" nil)
  1131. (string :tag "host name")))
  1132. (defcustom gnus-nntpserver-file "/etc/nntpserver"
  1133. "A file with only the name of the nntp server in it."
  1134. :group 'gnus-files
  1135. :group 'gnus-server
  1136. :type 'file)
  1137. (defun gnus-getenv-nntpserver ()
  1138. "Find default nntp server.
  1139. Check the NNTPSERVER environment variable and the
  1140. `gnus-nntpserver-file' file."
  1141. (or (getenv "NNTPSERVER")
  1142. (and (file-readable-p gnus-nntpserver-file)
  1143. (with-temp-buffer
  1144. (insert-file-contents gnus-nntpserver-file)
  1145. (when (re-search-forward "[^ \t\n\r]+" nil t)
  1146. (match-string 0))))))
  1147. ;; `M-x customize-variable RET gnus-select-method RET' should work without
  1148. ;; starting or even loading Gnus.
  1149. ;;;###autoload(when (fboundp 'custom-autoload)
  1150. ;;;###autoload (custom-autoload 'gnus-select-method "gnus"))
  1151. (defcustom gnus-select-method
  1152. (list 'nntp (or (gnus-getenv-nntpserver)
  1153. (when (and gnus-default-nntp-server
  1154. (not (string= gnus-default-nntp-server "")))
  1155. gnus-default-nntp-server)
  1156. "news"))
  1157. "Default method for selecting a newsgroup.
  1158. This variable should be a list, where the first element is how the
  1159. news is to be fetched, the second is the address.
  1160. For instance, if you want to get your news via \"flab.flab.edu\" using
  1161. NNTP, you could say:
  1162. \(setq gnus-select-method \\='(nntp \"flab.flab.edu\"))
  1163. If you want to use your local spool, say:
  1164. \(setq gnus-select-method (list \\='nnspool (system-name)))
  1165. If you use this variable, you must set `gnus-nntp-server' to nil.
  1166. There is a lot more to know about select methods and virtual servers -
  1167. see the manual for details."
  1168. ;; Emacs has set-after since 22.1.
  1169. ;set-after '(gnus-default-nntp-server)
  1170. :group 'gnus-server
  1171. :group 'gnus-start
  1172. :initialize 'custom-initialize-default
  1173. :type 'gnus-select-method)
  1174. (defcustom gnus-message-archive-method "archive"
  1175. "*Method used for archiving messages you've sent.
  1176. This should be a mail method.
  1177. See also `gnus-update-message-archive-method'."
  1178. :group 'gnus-server
  1179. :group 'gnus-message
  1180. :type '(choice (const :tag "Default archive method" "archive")
  1181. gnus-select-method))
  1182. (defcustom gnus-update-message-archive-method nil
  1183. "Non-nil means always update the saved \"archive\" method.
  1184. The archive method is initially set according to the value of
  1185. `gnus-message-archive-method' and is saved in the \"~/.newsrc.eld\" file
  1186. so that it may be used as a real method of the server which is named
  1187. \"archive\" ever since. If it once has been saved, it will never be
  1188. updated if the value of this variable is nil, even if you change the
  1189. value of `gnus-message-archive-method' afterward. If you want the
  1190. saved \"archive\" method to be updated whenever you change the value of
  1191. `gnus-message-archive-method', set this variable to a non-nil value."
  1192. :version "23.1"
  1193. :group 'gnus-server
  1194. :group 'gnus-message
  1195. :type 'boolean)
  1196. (defcustom gnus-message-archive-group '((format-time-string "sent.%Y-%m"))
  1197. "*Name of the group in which to save the messages you've written.
  1198. This can either be a string; a list of strings; or an alist
  1199. of regexps/functions/forms to be evaluated to return a string (or a list
  1200. of strings). The functions are called with the name of the current
  1201. group (or nil) as a parameter.
  1202. If you want to save your mail in one group and the news articles you
  1203. write in another group, you could say something like:
  1204. \(setq gnus-message-archive-group
  1205. '((if (message-news-p)
  1206. \"misc-news\"
  1207. \"misc-mail\")))
  1208. Normally the group names returned by this variable should be
  1209. unprefixed -- which implicitly means \"store on the archive server\".
  1210. However, you may wish to store the message on some other server. In
  1211. that case, just return a fully prefixed name of the group --
  1212. \"nnml+private:mail.misc\", for instance."
  1213. :version "24.1"
  1214. :group 'gnus-message
  1215. :type '(choice (const :tag "none" nil)
  1216. (const :tag "Weekly" ((format-time-string "sent.%Yw%U")))
  1217. (const :tag "Monthly" ((format-time-string "sent.%Y-%m")))
  1218. (const :tag "Yearly" ((format-time-string "sent.%Y")))
  1219. function
  1220. sexp
  1221. string))
  1222. (defcustom gnus-secondary-servers nil
  1223. "List of NNTP servers that the user can choose between interactively.
  1224. To make Gnus query you for a server, you have to give `gnus' a
  1225. non-numeric prefix - `C-u M-x gnus', in short."
  1226. :group 'gnus-server
  1227. :type '(repeat string))
  1228. (make-obsolete-variable 'gnus-secondary-servers 'gnus-select-method "24.1")
  1229. (defcustom gnus-secondary-select-methods nil
  1230. "A list of secondary methods that will be used for reading news.
  1231. This is a list where each element is a complete select method (see
  1232. `gnus-select-method').
  1233. If, for instance, you want to read your mail with the nnml back end,
  1234. you could set this variable:
  1235. \(setq gnus-secondary-select-methods \\='((nnml \"\")))"
  1236. :group 'gnus-server
  1237. :type '(repeat gnus-select-method))
  1238. (defcustom gnus-local-domain nil
  1239. "Local domain name without a host name.
  1240. The DOMAINNAME environment variable is used instead if it is defined.
  1241. If the function `system-name' returns the full Internet name, there is
  1242. no need to set this variable."
  1243. :group 'gnus-message
  1244. :type '(choice (const :tag "default" nil)
  1245. string))
  1246. (make-obsolete-variable 'gnus-local-domain nil "Emacs 24.1")
  1247. ;; Customization variables
  1248. (defcustom gnus-refer-article-method 'current
  1249. "Preferred method for fetching an article by Message-ID.
  1250. The value of this variable must be a valid select method as discussed
  1251. in the documentation of `gnus-select-method'.
  1252. It can also be a list of select methods, as well as the special symbol
  1253. `current', which means to use the current select method. If it is a
  1254. list, Gnus will try all the methods in the list until it finds a match."
  1255. :version "24.1"
  1256. :group 'gnus-server
  1257. :type '(choice (const :tag "default" nil)
  1258. (const current)
  1259. (const :tag "Google" (nnweb "refer" (nnweb-type google)))
  1260. gnus-select-method
  1261. sexp
  1262. (repeat :menu-tag "Try multiple"
  1263. :tag "Multiple"
  1264. :value (current (nnweb "refer" (nnweb-type google)))
  1265. (choice :tag "Method"
  1266. (const current)
  1267. (const :tag "Google"
  1268. (nnweb "refer" (nnweb-type google)))
  1269. gnus-select-method))))
  1270. (defcustom gnus-use-cross-reference t
  1271. "*Non-nil means that cross referenced articles will be marked as read.
  1272. If nil, ignore cross references. If t, mark articles as read in
  1273. subscribed newsgroups. If neither t nor nil, mark as read in all
  1274. newsgroups."
  1275. :group 'gnus-server
  1276. :type '(choice (const :tag "off" nil)
  1277. (const :tag "subscribed" t)
  1278. (sexp :format "all"
  1279. :value always)))
  1280. (defcustom gnus-process-mark ?#
  1281. "*Process mark."
  1282. :group 'gnus-group-visual
  1283. :group 'gnus-summary-marks
  1284. :type 'character)
  1285. (defcustom gnus-large-newsgroup 200
  1286. "*The number of articles which indicates a large newsgroup.
  1287. If the number of articles in a newsgroup is greater than this value,
  1288. confirmation is required for selecting the newsgroup.
  1289. If it is nil, no confirmation is required.
  1290. Also see `gnus-large-ephemeral-newsgroup'."
  1291. :group 'gnus-group-select
  1292. :type '(choice (const :tag "No limit" nil)
  1293. integer))
  1294. (defcustom gnus-use-long-file-name (not (memq system-type '(usg-unix-v)))
  1295. "Non-nil means that the default name of a file to save articles in is the group name.
  1296. If it's nil, the directory form of the group name is used instead.
  1297. If this variable is a list, and the list contains the element
  1298. `not-score', long file names will not be used for score files; if it
  1299. contains the element `not-save', long file names will not be used for
  1300. saving; and if it contains the element `not-kill', long file names
  1301. will not be used for kill files.
  1302. Note that the default for this variable varies according to what system
  1303. type you're using. On `usg-unix-v' this variable defaults to nil while
  1304. on all other systems it defaults to t."
  1305. :group 'gnus-start
  1306. :type '(radio (sexp :format "Non-nil\n"
  1307. :match (lambda (widget value)
  1308. (and value (not (listp value))))
  1309. :value t)
  1310. (const nil)
  1311. (checklist (const :format "%v " not-score)
  1312. (const :format "%v " not-save)
  1313. (const not-kill))))
  1314. (defcustom gnus-kill-files-directory gnus-directory
  1315. "*Name of the directory where kill files will be stored (default \"~/News\")."
  1316. :group 'gnus-score-files
  1317. :group 'gnus-score-kill
  1318. :type 'directory)
  1319. (defcustom gnus-save-score nil
  1320. "*If non-nil, save group scoring info."
  1321. :group 'gnus-score-various
  1322. :group 'gnus-start
  1323. :type 'boolean)
  1324. (defcustom gnus-use-undo t
  1325. "*If non-nil, allow undoing in Gnus group mode buffers."
  1326. :group 'gnus-meta
  1327. :type 'boolean)
  1328. (defcustom gnus-use-adaptive-scoring nil
  1329. "*If non-nil, use some adaptive scoring scheme.
  1330. If a list, then the values `word' and `line' are meaningful. The
  1331. former will perform adaption on individual words in the subject
  1332. header while `line' will perform adaption on several headers."
  1333. :group 'gnus-meta
  1334. :group 'gnus-score-adapt
  1335. :type '(set (const word) (const line)))
  1336. (defcustom gnus-use-cache 'passive
  1337. "*If nil, Gnus will ignore the article cache.
  1338. If `passive', it will allow entering (and reading) articles
  1339. explicitly entered into the cache. If anything else, use the
  1340. cache to the full extent of the law."
  1341. :group 'gnus-meta
  1342. :group 'gnus-cache
  1343. :type '(choice (const :tag "off" nil)
  1344. (const :tag "passive" passive)
  1345. (const :tag "active" t)))
  1346. (defcustom gnus-use-trees nil
  1347. "*If non-nil, display a thread tree buffer."
  1348. :group 'gnus-meta
  1349. :type 'boolean)
  1350. (defcustom gnus-keep-backlog 20
  1351. "*If non-nil, Gnus will keep read articles for later re-retrieval.
  1352. If it is a number N, then Gnus will only keep the last N articles
  1353. read. If it is neither nil nor a number, Gnus will keep all read
  1354. articles. This is not a good idea."
  1355. :group 'gnus-meta
  1356. :type '(choice (const :tag "off" nil)
  1357. integer
  1358. (sexp :format "all"
  1359. :value t)))
  1360. (defcustom gnus-suppress-duplicates nil
  1361. "*If non-nil, Gnus will mark duplicate copies of the same article as read."
  1362. :group 'gnus-meta
  1363. :type 'boolean)
  1364. (defcustom gnus-use-scoring t
  1365. "*If non-nil, enable scoring."
  1366. :group 'gnus-meta
  1367. :type 'boolean)
  1368. (defcustom gnus-summary-prepare-exit-hook
  1369. '(gnus-summary-expire-articles)
  1370. "*A hook called when preparing to exit from the summary buffer.
  1371. It calls `gnus-summary-expire-articles' by default."
  1372. :group 'gnus-summary-exit
  1373. :type 'hook)
  1374. (defcustom gnus-novice-user t
  1375. "*Non-nil means that you are a Usenet novice.
  1376. If non-nil, verbose messages may be displayed and confirmations may be
  1377. required."
  1378. :group 'gnus-meta
  1379. :type 'boolean)
  1380. (defcustom gnus-expert-user nil
  1381. "*Non-nil means that you will never be asked for confirmation about anything.
  1382. That doesn't mean *anything* anything; particularly destructive
  1383. commands will still require prompting."
  1384. :group 'gnus-meta
  1385. :type 'boolean)
  1386. (defcustom gnus-interactive-catchup t
  1387. "*If non-nil, require your confirmation when catching up a group."
  1388. :group 'gnus-group-select
  1389. :type 'boolean)
  1390. (defcustom gnus-interactive-exit t
  1391. "*If non-nil, require your confirmation when exiting Gnus.
  1392. If `quiet', update any active summary buffers automatically
  1393. first before exiting."
  1394. :group 'gnus-exit
  1395. :type '(choice boolean
  1396. (const quiet)))
  1397. (defcustom gnus-extract-address-components 'gnus-extract-address-components
  1398. "*Function for extracting address components from a From header.
  1399. Two pre-defined function exist: `gnus-extract-address-components',
  1400. which is the default, quite fast, and too simplistic solution, and
  1401. `mail-extract-address-components', which works much better, but is
  1402. slower."
  1403. :group 'gnus-summary-format
  1404. :type '(radio (function-item gnus-extract-address-components)
  1405. (function-item mail-extract-address-components)
  1406. (function :tag "Other")))
  1407. (defcustom gnus-shell-command-separator ";"
  1408. "String used to separate shell commands."
  1409. :group 'gnus-files
  1410. :type 'string)
  1411. (defcustom gnus-valid-select-methods
  1412. '(("nntp" post address prompt-address physical-address cloud)
  1413. ("nnspool" post address)
  1414. ("nnvirtual" post-mail virtual prompt-address)
  1415. ("nnmbox" mail respool address)
  1416. ("nnml" post-mail respool address)
  1417. ("nnmh" mail respool address)
  1418. ("nndir" post-mail prompt-address physical-address)
  1419. ("nneething" none address prompt-address physical-address)
  1420. ("nndoc" none address prompt-address)
  1421. ("nnbabyl" mail address respool)
  1422. ("nndraft" post-mail)
  1423. ("nnfolder" mail respool address)
  1424. ("nngateway" post-mail address prompt-address physical-address)
  1425. ("nnweb" none)
  1426. ("nnrss" none global)
  1427. ("nnagent" post-mail)
  1428. ("nnimap" post-mail address prompt-address physical-address respool
  1429. server-marks cloud)
  1430. ("nnmaildir" mail respool address server-marks)
  1431. ("nnnil" none))
  1432. "*An alist of valid select methods.
  1433. The first element of each list lists should be a string with the name
  1434. of the select method. The other elements may be the category of
  1435. this method (i. e., `post', `mail', `none' or whatever) or other
  1436. properties that this method has (like being respoolable).
  1437. If you implement a new select method, all you should have to change is
  1438. this variable. I think."
  1439. :group 'gnus-server
  1440. :type '(repeat (group (string :tag "Name")
  1441. (radio-button-choice (const :format "%v " post)
  1442. (const :format "%v " mail)
  1443. (const :format "%v " none)
  1444. (const post-mail))
  1445. (checklist :inline t :greedy t
  1446. (const :format "%v " address)
  1447. (const global)
  1448. (const :format "%v " prompt-address)
  1449. (const :format "%v " physical-address)
  1450. (const virtual)
  1451. (const :format "%v " respool)
  1452. (const server-marks))))
  1453. :version "24.1")
  1454. (defun gnus-redefine-select-method-widget ()
  1455. "Recomputes the select-method widget based on the value of
  1456. `gnus-valid-select-methods'."
  1457. (define-widget 'gnus-select-method 'list
  1458. "Widget for entering a select method."
  1459. :value '(nntp "")
  1460. :tag "Select Method"
  1461. :args `((choice :tag "Method"
  1462. ,@(mapcar (lambda (entry)
  1463. (list 'const :format "%v\n"
  1464. (intern (car entry))))
  1465. gnus-valid-select-methods)
  1466. (symbol :tag "other"))
  1467. (string :tag "Address")
  1468. (repeat :tag "Options"
  1469. :inline t
  1470. (list :format "%v"
  1471. variable
  1472. (sexp :tag "Value"))))))
  1473. (gnus-redefine-select-method-widget)
  1474. (defcustom gnus-updated-mode-lines '(group article summary tree)
  1475. "List of buffers that should update their mode lines.
  1476. The list may contain the symbols `group', `article', `tree' and
  1477. `summary'. If the corresponding symbol is present, Gnus will keep
  1478. that mode line updated with information that may be pertinent.
  1479. If this variable is nil, screen refresh may be quicker."
  1480. :group 'gnus-various
  1481. :type '(set (const group)
  1482. (const article)
  1483. (const summary)
  1484. (const tree)))
  1485. (defcustom gnus-mode-non-string-length 30
  1486. "*Max length of mode-line non-string contents.
  1487. If this is nil, Gnus will take space as is needed, leaving the rest
  1488. of the mode line intact."
  1489. :version "24.1"
  1490. :group 'gnus-various
  1491. :type '(choice (const nil)
  1492. integer))
  1493. ;; There should be special validation for this.
  1494. (define-widget 'gnus-email-address 'string
  1495. "An email address.")
  1496. (gnus-define-group-parameter
  1497. to-address
  1498. :function-document
  1499. "Return GROUP's to-address."
  1500. :variable-document
  1501. "*Alist of group regexps and correspondent to-addresses."
  1502. :variable-group gnus-group-parameter
  1503. :parameter-type '(gnus-email-address :tag "To Address")
  1504. :parameter-document "\
  1505. This will be used when doing followups and posts.
  1506. This is primarily useful in mail groups that represent closed
  1507. mailing lists--mailing lists where it's expected that everybody that
  1508. writes to the mailing list is subscribed to it. Since using this
  1509. parameter ensures that the mail only goes to the mailing list itself,
  1510. it means that members won't receive two copies of your followups.
  1511. Using `to-address' will actually work whether the group is foreign or
  1512. not. Let's say there's a group on the server that is called
  1513. `fa.4ad-l'. This is a real newsgroup, but the server has gotten the
  1514. articles from a mail-to-news gateway. Posting directly to this group
  1515. is therefore impossible--you have to send mail to the mailing list
  1516. address instead.
  1517. The gnus-group-split mail splitting mechanism will behave as if this
  1518. address was listed in gnus-group-split Addresses (see below).")
  1519. (gnus-define-group-parameter
  1520. to-list
  1521. :function-document
  1522. "Return GROUP's to-list."
  1523. :variable-document
  1524. "*Alist of group regexps and correspondent to-lists."
  1525. :variable-group gnus-group-parameter
  1526. :parameter-type '(gnus-email-address :tag "To List")
  1527. :parameter-document "\
  1528. This address will be used when doing a `a' in the group.
  1529. It is totally ignored when doing a followup--except that if it is
  1530. present in a news group, you'll get mail group semantics when doing
  1531. `f'.
  1532. The gnus-group-split mail splitting mechanism will behave as if this
  1533. address was listed in gnus-group-split Addresses (see below).")
  1534. (gnus-define-group-parameter
  1535. subscribed
  1536. :type bool
  1537. :function-document
  1538. "Return GROUP's subscription status."
  1539. :variable-document
  1540. "*Groups which are automatically considered subscribed."
  1541. :variable-group gnus-group-parameter
  1542. :parameter-type '(const :tag "Subscribed" t)
  1543. :parameter-document "\
  1544. Gnus assumed that you are subscribed to the To/List address.
  1545. When constructing a list of subscribed groups using
  1546. `gnus-find-subscribed-addresses', Gnus includes the To address given
  1547. above, or the list address (if the To address has not been set).")
  1548. (gnus-define-group-parameter
  1549. auto-expire
  1550. :type bool
  1551. :function gnus-group-auto-expirable-p
  1552. :function-document
  1553. "Check whether GROUP is auto-expirable or not."
  1554. :variable gnus-auto-expirable-newsgroups
  1555. :variable-default nil
  1556. :variable-document
  1557. "*Groups in which to automatically mark read articles as expirable.
  1558. If non-nil, this should be a regexp that should match all groups in
  1559. which to perform auto-expiry. This only makes sense for mail groups."
  1560. :variable-group nnmail-expire
  1561. :variable-type '(choice (const nil)
  1562. regexp)
  1563. :parameter-type '(const :tag "Automatic Expire" t)
  1564. :parameter-document
  1565. "All articles that are read will be marked as expirable.")
  1566. (gnus-define-group-parameter
  1567. total-expire
  1568. :type bool
  1569. :function gnus-group-total-expirable-p
  1570. :function-document
  1571. "Check whether GROUP is total-expirable or not."
  1572. :variable gnus-total-expirable-newsgroups
  1573. :variable-default nil
  1574. :variable-document
  1575. "*Groups in which to perform expiry of all read articles.
  1576. Use with extreme caution. All groups that match this regexp will be
  1577. expiring - which means that all read articles will be deleted after
  1578. \(say) one week. (This only goes for mail groups and the like, of
  1579. course.)"
  1580. :variable-group nnmail-expire
  1581. :variable-type '(choice (const nil)
  1582. regexp)
  1583. :parameter-type '(const :tag "Total Expire" t)
  1584. :parameter-document
  1585. "All read articles will be put through the expiry process
  1586. This happens even if they are not marked as expirable.
  1587. Use with caution.")
  1588. (gnus-define-group-parameter
  1589. charset
  1590. :function-document
  1591. "Return the default charset of GROUP."
  1592. :variable gnus-group-charset-alist
  1593. :variable-default
  1594. '(("\\(^\\|:\\)hk\\>\\|\\(^\\|:\\)tw\\>\\|\\<big5\\>" cn-big5)
  1595. ("\\(^\\|:\\)cn\\>\\|\\<chinese\\>" cn-gb-2312)
  1596. ("\\(^\\|:\\)fj\\>\\|\\(^\\|:\\)japan\\>" iso-2022-jp-2)
  1597. ("\\(^\\|:\\)tnn\\>\\|\\(^\\|:\\)pin\\>\\|\\(^\\|:\\)sci.lang.japan" iso-2022-7bit)
  1598. ("\\(^\\|:\\)relcom\\>" koi8-r)
  1599. ("\\(^\\|:\\)fido7\\>" koi8-r)
  1600. ("\\(^\\|:\\)\\(cz\\|hun\\|pl\\|sk\\|hr\\)\\>" iso-8859-2)
  1601. ("\\(^\\|:\\)israel\\>" iso-8859-1)
  1602. ("\\(^\\|:\\)han\\>" euc-kr)
  1603. ("\\(^\\|:\\)alt.chinese.text.big5\\>" chinese-big5)
  1604. ("\\(^\\|:\\)soc.culture.vietnamese\\>" vietnamese-viqr)
  1605. ("\\(^\\|:\\)\\(comp\\|rec\\|alt\\|sci\\|soc\\|news\\|gnu\\|bofh\\)\\>" iso-8859-1))
  1606. :variable-document
  1607. "Alist of regexps (to match group names) and default charsets to be used when reading."
  1608. :variable-group gnus-charset
  1609. :variable-type '(repeat (list (regexp :tag "Group")
  1610. (symbol :tag "Charset")))
  1611. :parameter-type '(symbol :tag "Charset")
  1612. :parameter-document "\
  1613. The default charset to use in the group.")
  1614. (gnus-define-group-parameter
  1615. post-method
  1616. :type list
  1617. :function-document
  1618. "Return a posting method for GROUP."
  1619. :variable gnus-post-method-alist
  1620. :variable-document
  1621. "Alist of regexps (to match group names) and method to be used when
  1622. posting an article."
  1623. :variable-group gnus-group-foreign
  1624. :parameter-type
  1625. '(choice :tag "Posting Method"
  1626. (const :tag "Use native server" native)
  1627. (const :tag "Use current server" current)
  1628. (list :convert-widget
  1629. (lambda (widget)
  1630. (list 'sexp :tag "Methods"
  1631. :value gnus-select-method))))
  1632. :parameter-document
  1633. "Posting method for this group.")
  1634. (gnus-define-group-parameter
  1635. large-newsgroup-initial
  1636. :type integer
  1637. :function-document
  1638. "Return GROUP's initial input of the number of articles."
  1639. :variable-document
  1640. "*Alist of group regexps and its initial input of the number of articles."
  1641. :variable-group gnus-group-parameter
  1642. :parameter-type '(choice :tag "Initial Input for Large Newsgroup"
  1643. (const :tag "All" nil)
  1644. (integer))
  1645. :parameter-document "\
  1646. This number will be prompted as the initial value of the number of
  1647. articles to list when the group is a large newsgroup (see
  1648. `gnus-large-newsgroup'). If it is nil, the default value is the
  1649. total number of articles in the group.")
  1650. ;; The Gnus registry's ignored groups
  1651. (gnus-define-group-parameter
  1652. registry-ignore
  1653. :type list
  1654. :function-document
  1655. "Whether this group should be ignored by the registry."
  1656. :variable gnus-registry-ignored-groups
  1657. :variable-default (mapcar
  1658. (lambda (g) (list g t))
  1659. '("delayed$" "drafts$" "queue$" "INBOX$"
  1660. "^nnmairix:" "^nnir:" "archive"))
  1661. :variable-document
  1662. "*Groups in which the registry should be turned off."
  1663. :variable-group gnus-registry
  1664. :variable-type '(repeat
  1665. (list
  1666. (regexp :tag "Group Name Regular Expression")
  1667. (boolean :tag "Ignored")))
  1668. :parameter-type '(boolean :tag "Group Ignored by the Registry")
  1669. :parameter-document
  1670. "Whether the Gnus Registry should ignore this group.")
  1671. ;; group parameters for spam processing added by Ted Zlatanov <tzz@lifelogs.com>
  1672. (defcustom gnus-install-group-spam-parameters t
  1673. "*Disable the group parameters for spam detection.
  1674. Enable if `G c' in XEmacs is giving you trouble, and make sure to submit a bug report."
  1675. :version "22.1"
  1676. :type 'boolean
  1677. :group 'gnus-start)
  1678. (when gnus-install-group-spam-parameters
  1679. (defvar gnus-group-spam-classification-spam t
  1680. "Spam group classification (requires spam.el).
  1681. This group contains spam messages. On summary entry, unread messages
  1682. will be marked as spam. On summary exit, the specified spam
  1683. processors will be invoked on spam-marked messages, then those
  1684. messages will be expired, so the spam processor will only see a
  1685. spam-marked message once.")
  1686. (defvar gnus-group-spam-classification-ham 'ask
  1687. "The ham value for the spam group parameter (requires spam.el).
  1688. On summary exit, the specified ham processors will be invoked on
  1689. ham-marked messages. Exercise caution, since the ham processor will
  1690. see the same message more than once because there is no ham message
  1691. registry.")
  1692. (gnus-define-group-parameter
  1693. spam-contents
  1694. :type list
  1695. :function-document
  1696. "The spam type (spam, ham, or neither) of the group."
  1697. :variable gnus-spam-newsgroup-contents
  1698. :variable-default nil
  1699. :variable-document
  1700. "*Group classification (spam, ham, or neither). Only
  1701. meaningful when spam.el is loaded. If non-nil, this should be a
  1702. list of group name regexps associated with a classification for
  1703. each one. In spam groups, new articles are marked as spam on
  1704. summary entry. There is other behavior associated with ham and
  1705. no classification when spam.el is loaded - see the manual."
  1706. :variable-group spam
  1707. :variable-type '(repeat
  1708. (list :tag "Group contents spam/ham classification"
  1709. (regexp :tag "Group")
  1710. (choice
  1711. (variable-item gnus-group-spam-classification-spam)
  1712. (variable-item gnus-group-spam-classification-ham)
  1713. (const :tag "Unclassified" nil))))
  1714. :parameter-type '(list :tag "Group contents spam/ham classification"
  1715. (choice :tag "Group contents classification for spam sorting"
  1716. (variable-item gnus-group-spam-classification-spam)
  1717. (variable-item gnus-group-spam-classification-ham)
  1718. (const :tag "Unclassified" nil)))
  1719. :parameter-document
  1720. "The spam classification (spam, ham, or neither) of this group.
  1721. When a spam group is entered, all unread articles are marked as
  1722. spam. There is other behavior associated with ham and no
  1723. classification when spam.el is loaded - see the manual.")
  1724. (gnus-define-group-parameter
  1725. spam-resend-to
  1726. :type list
  1727. :function-document
  1728. "The address to get spam resent (through spam-report-resend)."
  1729. :variable gnus-spam-resend-to
  1730. :variable-default nil
  1731. :variable-document
  1732. "The address to get spam resent (through spam-report-resend)."
  1733. :variable-group spam
  1734. :variable-type '(repeat
  1735. (list :tag "Group address for resending spam"
  1736. (regexp :tag "Group")
  1737. (string :tag "E-mail address for resending spam (requires the spam-use-resend exit processor)")))
  1738. :parameter-type 'string :tag "E-mail address for resending spam (requires the spam-use-resend exit processor)"
  1739. :parameter-document
  1740. "The address to get spam resent (through spam-report-resend).")
  1741. (gnus-define-group-parameter
  1742. ham-resend-to
  1743. :type list
  1744. :function-document
  1745. "The address to get ham resent (through spam-report-resend)."
  1746. :variable gnus-ham-resend-to
  1747. :variable-default nil
  1748. :variable-document
  1749. "The address to get ham resent (through spam-report-resend)."
  1750. :variable-group spam
  1751. :variable-type '(repeat
  1752. (list :tag "Group address for resending ham"
  1753. (regexp :tag "Group")
  1754. (string :tag "E-mail address for resending ham (requires the spam-use-resend exit processor)")))
  1755. :parameter-type 'string :tag "E-mail address for resending ham (requires the spam-use-resend exit processor)"
  1756. :parameter-document
  1757. "The address to get ham resent (through spam-report-resend).")
  1758. (defvar gnus-group-spam-exit-processor-ifile "ifile"
  1759. "OBSOLETE: The ifile summary exit spam processor.")
  1760. (defvar gnus-group-spam-exit-processor-stat "stat"
  1761. "OBSOLETE: The spam-stat summary exit spam processor.")
  1762. (defvar gnus-group-spam-exit-processor-bogofilter "bogofilter"
  1763. "OBSOLETE: The Bogofilter summary exit spam processor.")
  1764. (defvar gnus-group-spam-exit-processor-blacklist "blacklist"
  1765. "OBSOLETE: The Blacklist summary exit spam processor.")
  1766. (defvar gnus-group-spam-exit-processor-report-gmane "report-gmane"
  1767. "OBSOLETE: The Gmane reporting summary exit spam processor.
  1768. Only applicable to NNTP groups with articles from Gmane. See spam-report.el")
  1769. (defvar gnus-group-spam-exit-processor-spamoracle "spamoracle-spam"
  1770. "OBSOLETE: The spamoracle summary exit spam processor.")
  1771. (defvar gnus-group-ham-exit-processor-ifile "ifile-ham"
  1772. "OBSOLETE: The ifile summary exit ham processor.
  1773. Only applicable to non-spam (unclassified and ham) groups.")
  1774. (defvar gnus-group-ham-exit-processor-bogofilter "bogofilter-ham"
  1775. "OBSOLETE: The Bogofilter summary exit ham processor.
  1776. Only applicable to non-spam (unclassified and ham) groups.")
  1777. (defvar gnus-group-ham-exit-processor-stat "stat-ham"
  1778. "OBSOLETE: The spam-stat summary exit ham processor.
  1779. Only applicable to non-spam (unclassified and ham) groups.")
  1780. (defvar gnus-group-ham-exit-processor-whitelist "whitelist"
  1781. "OBSOLETE: The whitelist summary exit ham processor.
  1782. Only applicable to non-spam (unclassified and ham) groups.")
  1783. (defvar gnus-group-ham-exit-processor-BBDB "bbdb"
  1784. "OBSOLETE: The BBDB summary exit ham processor.
  1785. Only applicable to non-spam (unclassified and ham) groups.")
  1786. (defvar gnus-group-ham-exit-processor-copy "copy"
  1787. "OBSOLETE: The ham copy exit ham processor.
  1788. Only applicable to non-spam (unclassified and ham) groups.")
  1789. (defvar gnus-group-ham-exit-processor-spamoracle "spamoracle-ham"
  1790. "OBSOLETE: The spamoracle summary exit ham processor.
  1791. Only applicable to non-spam (unclassified and ham) groups.")
  1792. (gnus-define-group-parameter
  1793. spam-process
  1794. :type list
  1795. :parameter-type
  1796. '(choice
  1797. :tag "Spam Summary Exit Processor"
  1798. :value nil
  1799. (list :tag "Spam Summary Exit Processor Choices"
  1800. (set
  1801. (const :tag "Spam: Bogofilter" (spam spam-use-bogofilter))
  1802. (const :tag "Spam: Blacklist" (spam spam-use-blacklist))
  1803. (const :tag "Spam: Bsfilter" (spam spam-use-bsfilter))
  1804. (const :tag "Spam: Gmane Report" (spam spam-use-gmane))
  1805. (const :tag "Spam: Resend Message"(spam spam-use-resend))
  1806. (const :tag "Spam: ifile" (spam spam-use-ifile))
  1807. (const :tag "Spam: Spam Oracle" (spam spam-use-spamoracle))
  1808. (const :tag "Spam: Spam-stat" (spam spam-use-stat))
  1809. (const :tag "Spam: SpamAssassin" (spam spam-use-spamassassin))
  1810. (const :tag "Spam: CRM114" (spam spam-use-crm114))
  1811. (const :tag "Ham: BBDB" (ham spam-use-BBDB))
  1812. (const :tag "Ham: Bogofilter" (ham spam-use-bogofilter))
  1813. (const :tag "Ham: Bsfilter" (ham spam-use-bsfilter))
  1814. (const :tag "Ham: Copy" (ham spam-use-ham-copy))
  1815. (const :tag "Ham: Resend Message" (ham spam-use-resend))
  1816. (const :tag "Ham: ifile" (ham spam-use-ifile))
  1817. (const :tag "Ham: Spam Oracle" (ham spam-use-spamoracle))
  1818. (const :tag "Ham: Spam-stat" (ham spam-use-stat))
  1819. (const :tag "Ham: SpamAssassin" (ham spam-use-spamassassin))
  1820. (const :tag "Ham: CRM114" (ham spam-use-crm114))
  1821. (const :tag "Ham: Whitelist" (ham spam-use-whitelist))
  1822. (variable-item gnus-group-spam-exit-processor-ifile)
  1823. (variable-item gnus-group-spam-exit-processor-stat)
  1824. (variable-item gnus-group-spam-exit-processor-bogofilter)
  1825. (variable-item gnus-group-spam-exit-processor-blacklist)
  1826. (variable-item gnus-group-spam-exit-processor-spamoracle)
  1827. (variable-item gnus-group-spam-exit-processor-report-gmane)
  1828. (variable-item gnus-group-ham-exit-processor-bogofilter)
  1829. (variable-item gnus-group-ham-exit-processor-ifile)
  1830. (variable-item gnus-group-ham-exit-processor-stat)
  1831. (variable-item gnus-group-ham-exit-processor-whitelist)
  1832. (variable-item gnus-group-ham-exit-processor-BBDB)
  1833. (variable-item gnus-group-ham-exit-processor-spamoracle)
  1834. (variable-item gnus-group-ham-exit-processor-copy))))
  1835. :function-document
  1836. "Which spam or ham processors will be applied when the summary is exited."
  1837. :variable gnus-spam-process-newsgroups
  1838. :variable-default nil
  1839. :variable-document
  1840. "*Groups in which to automatically process spam or ham articles with
  1841. a backend on summary exit. If non-nil, this should be a list of group
  1842. name regexps that should match all groups in which to do automatic
  1843. spam processing, associated with the appropriate processor."
  1844. :variable-group spam
  1845. :variable-type
  1846. '(repeat :tag "Spam/Ham Processors"
  1847. (list :tag "Spam Summary Exit Processor Choices"
  1848. (regexp :tag "Group Regexp")
  1849. (set
  1850. :tag "Spam/Ham Summary Exit Processor"
  1851. (const :tag "Spam: Bogofilter" (spam spam-use-bogofilter))
  1852. (const :tag "Spam: Blacklist" (spam spam-use-blacklist))
  1853. (const :tag "Spam: Bsfilter" (spam spam-use-bsfilter))
  1854. (const :tag "Spam: Gmane Report" (spam spam-use-gmane))
  1855. (const :tag "Spam: Resend Message"(spam spam-use-resend))
  1856. (const :tag "Spam: ifile" (spam spam-use-ifile))
  1857. (const :tag "Spam: Spam-stat" (spam spam-use-stat))
  1858. (const :tag "Spam: Spam Oracle" (spam spam-use-spamoracle))
  1859. (const :tag "Spam: SpamAssassin" (spam spam-use-spamassassin))
  1860. (const :tag "Spam: CRM114" (spam spam-use-crm114))
  1861. (const :tag "Ham: BBDB" (ham spam-use-BBDB))
  1862. (const :tag "Ham: Bogofilter" (ham spam-use-bogofilter))
  1863. (const :tag "Ham: Bsfilter" (ham spam-use-bsfilter))
  1864. (const :tag "Ham: Copy" (ham spam-use-ham-copy))
  1865. (const :tag "Ham: Resend Message" (ham spam-use-resend))
  1866. (const :tag "Ham: ifile" (ham spam-use-ifile))
  1867. (const :tag "Ham: Spam-stat" (ham spam-use-stat))
  1868. (const :tag "Ham: Spam Oracle" (ham spam-use-spamoracle))
  1869. (const :tag "Ham: SpamAssassin" (ham spam-use-spamassassin))
  1870. (const :tag "Ham: CRM114" (ham spam-use-crm114))
  1871. (const :tag "Ham: Whitelist" (ham spam-use-whitelist))
  1872. (variable-item gnus-group-spam-exit-processor-ifile)
  1873. (variable-item gnus-group-spam-exit-processor-stat)
  1874. (variable-item gnus-group-spam-exit-processor-bogofilter)
  1875. (variable-item gnus-group-spam-exit-processor-blacklist)
  1876. (variable-item gnus-group-spam-exit-processor-spamoracle)
  1877. (variable-item gnus-group-spam-exit-processor-report-gmane)
  1878. (variable-item gnus-group-ham-exit-processor-bogofilter)
  1879. (variable-item gnus-group-ham-exit-processor-ifile)
  1880. (variable-item gnus-group-ham-exit-processor-stat)
  1881. (variable-item gnus-group-ham-exit-processor-whitelist)
  1882. (variable-item gnus-group-ham-exit-processor-BBDB)
  1883. (variable-item gnus-group-ham-exit-processor-spamoracle)
  1884. (variable-item gnus-group-ham-exit-processor-copy))))
  1885. :parameter-document
  1886. "Which spam or ham processors will be applied when the summary is exited.")
  1887. (gnus-define-group-parameter
  1888. spam-autodetect
  1889. :type list
  1890. :parameter-type
  1891. '(boolean :tag "Spam autodetection")
  1892. :function-document
  1893. "Should spam be autodetected (with spam-split) in this group?"
  1894. :variable gnus-spam-autodetect
  1895. :variable-default nil
  1896. :variable-document
  1897. "*Groups in which spam should be autodetected when they are entered.
  1898. Only unseen articles will be examined, unless
  1899. spam-autodetect-recheck-messages is set."
  1900. :variable-group spam
  1901. :variable-type
  1902. '(repeat
  1903. :tag "Autodetection setting"
  1904. (list
  1905. (regexp :tag "Group Regexp")
  1906. boolean))
  1907. :parameter-document
  1908. "Spam autodetection.
  1909. Only unseen articles will be examined, unless
  1910. spam-autodetect-recheck-messages is set.")
  1911. (gnus-define-group-parameter
  1912. spam-autodetect-methods
  1913. :type list
  1914. :parameter-type
  1915. '(choice :tag "Spam autodetection-specific methods"
  1916. (const none)
  1917. (const default)
  1918. (set :tag "Use specific methods"
  1919. (variable-item spam-use-blacklist)
  1920. (variable-item spam-use-gmane-xref)
  1921. (variable-item spam-use-regex-headers)
  1922. (variable-item spam-use-regex-body)
  1923. (variable-item spam-use-whitelist)
  1924. (variable-item spam-use-BBDB)
  1925. (variable-item spam-use-ifile)
  1926. (variable-item spam-use-spamoracle)
  1927. (variable-item spam-use-crm114)
  1928. (variable-item spam-use-spamassassin)
  1929. (variable-item spam-use-spamassassin-headers)
  1930. (variable-item spam-use-bsfilter)
  1931. (variable-item spam-use-bsfilter-headers)
  1932. (variable-item spam-use-stat)
  1933. (variable-item spam-use-blackholes)
  1934. (variable-item spam-use-hashcash)
  1935. (variable-item spam-use-bogofilter-headers)
  1936. (variable-item spam-use-bogofilter)))
  1937. :function-document
  1938. "Methods to be used for autodetection in each group"
  1939. :variable gnus-spam-autodetect-methods
  1940. :variable-default nil
  1941. :variable-document
  1942. "*Methods for autodetecting spam per group.
  1943. Requires the spam-autodetect parameter. Only unseen articles
  1944. will be examined, unless spam-autodetect-recheck-messages is
  1945. set."
  1946. :variable-group spam
  1947. :variable-type
  1948. '(repeat
  1949. :tag "Autodetection methods"
  1950. (list
  1951. (regexp :tag "Group Regexp")
  1952. (choice
  1953. (const none)
  1954. (const default)
  1955. (set :tag "Use specific methods"
  1956. (variable-item spam-use-blacklist)
  1957. (variable-item spam-use-gmane-xref)
  1958. (variable-item spam-use-regex-headers)
  1959. (variable-item spam-use-regex-body)
  1960. (variable-item spam-use-whitelist)
  1961. (variable-item spam-use-BBDB)
  1962. (variable-item spam-use-ifile)
  1963. (variable-item spam-use-spamoracle)
  1964. (variable-item spam-use-crm114)
  1965. (variable-item spam-use-stat)
  1966. (variable-item spam-use-blackholes)
  1967. (variable-item spam-use-hashcash)
  1968. (variable-item spam-use-spamassassin)
  1969. (variable-item spam-use-spamassassin-headers)
  1970. (variable-item spam-use-bsfilter)
  1971. (variable-item spam-use-bsfilter-headers)
  1972. (variable-item spam-use-bogofilter-headers)
  1973. (variable-item spam-use-bogofilter)))))
  1974. :parameter-document
  1975. "Spam autodetection methods.
  1976. Requires the spam-autodetect parameter. Only unseen articles
  1977. will be examined, unless spam-autodetect-recheck-messages is
  1978. set.")
  1979. (gnus-define-group-parameter
  1980. spam-process-destination
  1981. :type list
  1982. :parameter-type
  1983. '(choice :tag "Destination for spam-processed articles at summary exit"
  1984. (string :tag "Move to a group")
  1985. (repeat :tag "Move to multiple groups"
  1986. (string :tag "Destination group"))
  1987. (const :tag "Expire" nil))
  1988. :function-document
  1989. "Where spam-processed articles will go at summary exit."
  1990. :variable gnus-spam-process-destinations
  1991. :variable-default nil
  1992. :variable-document
  1993. "*Groups in which to explicitly send spam-processed articles to
  1994. another group, or expire them (the default). If non-nil, this should
  1995. be a list of group name regexps that should match all groups in which
  1996. to do spam-processed article moving, associated with the destination
  1997. group or nil for explicit expiration. This only makes sense for
  1998. mail groups."
  1999. :variable-group spam
  2000. :variable-type
  2001. '(repeat
  2002. :tag "Spam-processed articles destination"
  2003. (list
  2004. (regexp :tag "Group Regexp")
  2005. (choice
  2006. :tag "Destination for spam-processed articles at summary exit"
  2007. (string :tag "Move to a group")
  2008. (repeat :tag "Move to multiple groups"
  2009. (string :tag "Destination group"))
  2010. (const :tag "Expire" nil))))
  2011. :parameter-document
  2012. "Where spam-processed articles will go at summary exit.")
  2013. (gnus-define-group-parameter
  2014. ham-process-destination
  2015. :type list
  2016. :parameter-type
  2017. '(choice
  2018. :tag "Destination for ham articles at summary exit from a spam group"
  2019. (string :tag "Move to a group")
  2020. (repeat :tag "Move to multiple groups"
  2021. (string :tag "Destination group"))
  2022. (const :tag "Respool" respool)
  2023. (const :tag "Do nothing" nil))
  2024. :function-document
  2025. "Where ham articles will go at summary exit from a spam group."
  2026. :variable gnus-ham-process-destinations
  2027. :variable-default nil
  2028. :variable-document
  2029. "*Groups in which to explicitly send ham articles to
  2030. another group, or do nothing (the default). If non-nil, this should
  2031. be a list of group name regexps that should match all groups in which
  2032. to do ham article moving, associated with the destination
  2033. group or nil for explicit ignoring. This only makes sense for
  2034. mail groups, and only works in spam groups."
  2035. :variable-group spam
  2036. :variable-type
  2037. '(repeat
  2038. :tag "Ham articles destination"
  2039. (list
  2040. (regexp :tag "Group Regexp")
  2041. (choice
  2042. :tag "Destination for ham articles at summary exit from spam group"
  2043. (string :tag "Move to a group")
  2044. (repeat :tag "Move to multiple groups"
  2045. (string :tag "Destination group"))
  2046. (const :tag "Respool" respool)
  2047. (const :tag "Expire" nil))))
  2048. :parameter-document
  2049. "Where ham articles will go at summary exit from a spam group.")
  2050. (gnus-define-group-parameter
  2051. ham-marks
  2052. :type 'list
  2053. :parameter-type '(list :tag "Ham mark choices"
  2054. (set
  2055. (variable-item gnus-del-mark)
  2056. (variable-item gnus-read-mark)
  2057. (variable-item gnus-ticked-mark)
  2058. (variable-item gnus-killed-mark)
  2059. (variable-item gnus-kill-file-mark)
  2060. (variable-item gnus-low-score-mark)))
  2061. :parameter-document
  2062. "Marks considered ham (positively not spam). Such articles will be
  2063. processed as ham (non-spam) on group exit. When nil, the global
  2064. spam-ham-marks variable takes precedence."
  2065. :variable-default '((".*" ((gnus-del-mark
  2066. gnus-read-mark
  2067. gnus-killed-mark
  2068. gnus-kill-file-mark
  2069. gnus-low-score-mark))))
  2070. :variable-group spam
  2071. :variable-document
  2072. "*Groups in which to explicitly set the ham marks to some value.")
  2073. (gnus-define-group-parameter
  2074. spam-marks
  2075. :type 'list
  2076. :parameter-type '(list :tag "Spam mark choices"
  2077. (set
  2078. (variable-item gnus-spam-mark)
  2079. (variable-item gnus-killed-mark)
  2080. (variable-item gnus-kill-file-mark)
  2081. (variable-item gnus-low-score-mark)))
  2082. :parameter-document
  2083. "Marks considered spam.
  2084. Such articles will be processed as spam on group exit. When nil, the global
  2085. spam-spam-marks variable takes precedence."
  2086. :variable-default '((".*" ((gnus-spam-mark))))
  2087. :variable-group spam
  2088. :variable-document
  2089. "*Groups in which to explicitly set the spam marks to some value."))
  2090. (defcustom gnus-group-uncollapsed-levels 1
  2091. "Number of group name elements to leave alone when making a short group name."
  2092. :group 'gnus-group-visual
  2093. :type 'integer)
  2094. (defcustom gnus-group-use-permanent-levels nil
  2095. "*If non-nil, once you set a level, Gnus will use this level."
  2096. :group 'gnus-group-levels
  2097. :type 'boolean)
  2098. ;; Hooks.
  2099. (defcustom gnus-load-hook nil
  2100. "A hook run while Gnus is loaded."
  2101. :group 'gnus-start
  2102. :type 'hook)
  2103. (defcustom gnus-apply-kill-hook '(gnus-apply-kill-file)
  2104. "A hook called to apply kill files to a group.
  2105. This hook is intended to apply a kill file to the selected newsgroup.
  2106. The function `gnus-apply-kill-file' is called by default.
  2107. Since a general kill file is too heavy to use only for a few
  2108. newsgroups, I recommend you to use a lighter hook function. For
  2109. example, if you'd like to apply a kill file to articles which contains
  2110. a string `rmgroup' in subject in newsgroup `control', you can use the
  2111. following hook:
  2112. (setq gnus-apply-kill-hook
  2113. (list
  2114. (lambda ()
  2115. (cond ((string-match \"control\" gnus-newsgroup-name)
  2116. (gnus-kill \"Subject\" \"rmgroup\")
  2117. (gnus-expunge \"X\"))))))"
  2118. :group 'gnus-score-kill
  2119. :options '(gnus-apply-kill-file)
  2120. :type 'hook)
  2121. (defcustom gnus-group-change-level-function nil
  2122. "Function run when a group level is changed.
  2123. It is called with three parameters -- GROUP, LEVEL and OLDLEVEL."
  2124. :group 'gnus-group-levels
  2125. :type '(choice (const nil)
  2126. function))
  2127. ;;; Face thingies.
  2128. (defcustom gnus-visual
  2129. '(summary-highlight group-highlight article-highlight
  2130. mouse-face
  2131. summary-menu group-menu article-menu
  2132. tree-highlight menu highlight
  2133. browse-menu server-menu
  2134. page-marker tree-menu binary-menu pick-menu)
  2135. "*Enable visual features.
  2136. If `visual' is disabled, there will be no menus and few faces. Most of
  2137. the visual customization options below will be ignored. Gnus will use
  2138. less space and be faster as a result.
  2139. This variable can also be a list of visual elements to switch on. For
  2140. instance, to switch off all visual things except menus, you can say:
  2141. (setq gnus-visual '(menu))
  2142. Valid elements include `summary-highlight', `group-highlight',
  2143. `article-highlight', `mouse-face', `summary-menu', `group-menu',
  2144. `article-menu', `tree-highlight', `menu', `highlight', `browse-menu',
  2145. `server-menu', `page-marker', `tree-menu', `binary-menu', and`pick-menu'."
  2146. :group 'gnus-meta
  2147. :group 'gnus-visual
  2148. :type '(set (const summary-highlight)
  2149. (const group-highlight)
  2150. (const article-highlight)
  2151. (const mouse-face)
  2152. (const summary-menu)
  2153. (const group-menu)
  2154. (const article-menu)
  2155. (const tree-highlight)
  2156. (const menu)
  2157. (const highlight)
  2158. (const browse-menu)
  2159. (const server-menu)
  2160. (const page-marker)
  2161. (const tree-menu)
  2162. (const binary-menu)
  2163. (const pick-menu)))
  2164. ;; Byte-compiler warning.
  2165. (defvar gnus-visual)
  2166. ;; Find out whether the gnus-visual TYPE is wanted.
  2167. (defun gnus-visual-p (&optional type class)
  2168. (and gnus-visual ; Has to be non-nil, at least.
  2169. (if (not type) ; We don't care about type.
  2170. gnus-visual
  2171. (if (listp gnus-visual) ; It's a list, so we check it.
  2172. (or (memq type gnus-visual)
  2173. (memq class gnus-visual))
  2174. t))))
  2175. (defcustom gnus-mouse-face
  2176. (condition-case ()
  2177. (if (gnus-visual-p 'mouse-face 'highlight)
  2178. (if (boundp 'gnus-mouse-face)
  2179. (or gnus-mouse-face 'highlight)
  2180. 'highlight)
  2181. 'default)
  2182. (error 'highlight))
  2183. "*Face used for group or summary buffer mouse highlighting.
  2184. The line beneath the mouse pointer will be highlighted with this
  2185. face."
  2186. :group 'gnus-visual
  2187. :type 'face)
  2188. (defcustom gnus-article-save-directory gnus-directory
  2189. "*Name of the directory articles will be saved in (default \"~/News\")."
  2190. :group 'gnus-article-saving
  2191. :type 'directory)
  2192. (defvar gnus-plugged t
  2193. "Whether Gnus is plugged or not.")
  2194. (defcustom gnus-agent-cache t
  2195. "Controls use of the agent cache while plugged.
  2196. When set, Gnus will prefer using the locally stored content rather
  2197. than re-fetching it from the server. You also need to enable
  2198. `gnus-agent' for this to have any affect."
  2199. :version "22.1"
  2200. :group 'gnus-agent
  2201. :type 'boolean)
  2202. (defcustom gnus-default-charset 'undecided
  2203. "Default charset assumed to be used when viewing non-ASCII characters.
  2204. This variable is overridden on a group-to-group basis by the
  2205. `gnus-group-charset-alist' variable and is only used on groups not
  2206. covered by that variable."
  2207. :type 'symbol
  2208. :group 'gnus-charset)
  2209. ;; Fixme: Doc reference to agent.
  2210. (defcustom gnus-agent t
  2211. "Whether we want to use the Gnus agent or not.
  2212. You may customize gnus-agent to disable its use. However, some
  2213. back ends have started to use the agent as a client-side cache.
  2214. Disabling the agent may result in noticeable loss of performance."
  2215. :version "22.1"
  2216. :group 'gnus-agent
  2217. :type 'boolean)
  2218. (defcustom gnus-other-frame-function 'gnus
  2219. "Function called by the command `gnus-other-frame' when starting Gnus."
  2220. :group 'gnus-start
  2221. :type '(choice (function-item gnus)
  2222. (function-item gnus-no-server)
  2223. (function-item gnus-slave)
  2224. (function-item gnus-slave-no-server)))
  2225. (defcustom gnus-other-frame-resume-function 'gnus-group-get-new-news
  2226. "Function called by the command `gnus-other-frame' when resuming Gnus."
  2227. :version "24.4"
  2228. :group 'gnus-start
  2229. :type '(choice (function-item gnus)
  2230. (function-item gnus-group-get-new-news)
  2231. (function-item gnus-no-server)
  2232. (function-item gnus-slave)
  2233. (function-item gnus-slave-no-server)))
  2234. (defcustom gnus-other-frame-parameters nil
  2235. "Frame parameters used by `gnus-other-frame' to create a Gnus frame.
  2236. This should be an alist for Emacs, or a plist for XEmacs."
  2237. :group 'gnus-start
  2238. :type (if (featurep 'xemacs)
  2239. '(repeat (list :inline t :format "%v"
  2240. (symbol :tag "Property")
  2241. (sexp :tag "Value")))
  2242. '(repeat (cons :format "%v"
  2243. (symbol :tag "Parameter")
  2244. (sexp :tag "Value")))))
  2245. (defcustom gnus-user-agent '(emacs gnus type)
  2246. "Which information should be exposed in the User-Agent header.
  2247. Can be a list of symbols or a string. Valid symbols are `gnus'
  2248. \(show Gnus version\) and `emacs' \(show Emacs version\). In
  2249. addition to the Emacs version, you can add `codename' \(show
  2250. \(S\)XEmacs codename\) or either `config' \(show system
  2251. configuration\) or `type' \(show system type\). If you set it to
  2252. a string, be sure to use a valid format, see RFC 2616."
  2253. :version "22.1"
  2254. :group 'gnus-message
  2255. :type '(choice (list (set :inline t
  2256. (const gnus :tag "Gnus version")
  2257. (const emacs :tag "Emacs version")
  2258. (choice :tag "system"
  2259. (const type :tag "system type")
  2260. (const config :tag "system configuration"))
  2261. (const codename :tag "Emacs codename")))
  2262. (string)))
  2263. ;; Convert old (< 2005-01-10) symbol type values:
  2264. (when (symbolp gnus-user-agent)
  2265. (setq gnus-user-agent
  2266. (cond ((eq gnus-user-agent 'emacs-gnus-config)
  2267. '(emacs gnus config))
  2268. ((eq gnus-user-agent 'emacs-gnus-type)
  2269. '(emacs gnus type))
  2270. ((eq gnus-user-agent 'emacs-gnus)
  2271. '(emacs gnus))
  2272. ((eq gnus-user-agent 'gnus)
  2273. '(gnus))
  2274. (t gnus-user-agent)))
  2275. (gnus-message 1 "Converted `gnus-user-agent' to `%s'." gnus-user-agent)
  2276. (sit-for 1)
  2277. (if (get 'gnus-user-agent 'saved-value)
  2278. (customize-save-variable 'gnus-user-agent gnus-user-agent)
  2279. (gnus-message 1 "Edit your init file to make this change permanent.")
  2280. (sit-for 2)))
  2281. ;;; Internal variables
  2282. (defvar gnus-agent-gcc-header "X-Gnus-Agent-Gcc")
  2283. (defvar gnus-agent-meta-information-header "X-Gnus-Agent-Meta-Information")
  2284. (defvar gnus-agent-method-p-cache nil
  2285. ; Reset each time gnus-agent-covered-methods is changed else
  2286. ; gnus-agent-method-p may mis-report a methods status.
  2287. )
  2288. (defvar gnus-agent-target-move-group-header "X-Gnus-Agent-Move-To")
  2289. (defvar gnus-draft-meta-information-header "X-Draft-From")
  2290. (defvar gnus-group-get-parameter-function 'gnus-group-get-parameter)
  2291. (defvar gnus-original-article-buffer " *Original Article*")
  2292. (defvar gnus-newsgroup-name nil)
  2293. (defvar gnus-ephemeral-servers nil)
  2294. (defvar gnus-server-method-cache nil)
  2295. (defvar gnus-extended-servers nil)
  2296. ;; The carpal mode has been removed, but define the variable for
  2297. ;; backwards compatibility.
  2298. (defvar gnus-carpal nil)
  2299. (make-obsolete-variable 'gnus-carpal nil "Emacs 24.1")
  2300. (defvar gnus-agent-fetching nil
  2301. "Whether Gnus agent is in fetching mode.")
  2302. (defvar gnus-agent-covered-methods nil
  2303. "A list of servers, NOT methods, showing which servers are covered by the agent.")
  2304. (defvar gnus-command-method nil
  2305. "Dynamically bound variable that says what the current back end is.")
  2306. (defvar gnus-current-select-method nil
  2307. "The current method for selecting a newsgroup.")
  2308. (defvar gnus-tree-buffer "*Tree*"
  2309. "Buffer where Gnus thread trees are displayed.")
  2310. ;; Variable holding the user answers to all method prompts.
  2311. (defvar gnus-method-history nil)
  2312. ;; Variable holding the user answers to all mail method prompts.
  2313. (defvar gnus-mail-method-history nil)
  2314. ;; Variable holding the user answers to all group prompts.
  2315. (defvar gnus-group-history nil)
  2316. (defvar gnus-server-alist nil
  2317. "List of available servers.")
  2318. (defcustom gnus-cache-directory
  2319. (nnheader-concat gnus-directory "cache/")
  2320. "*The directory where cached articles will be stored."
  2321. :group 'gnus-cache
  2322. :type 'directory)
  2323. (defvar gnus-predefined-server-alist
  2324. `(("cache"
  2325. nnspool "cache"
  2326. (nnspool-spool-directory ,gnus-cache-directory)
  2327. (nnspool-nov-directory ,gnus-cache-directory)
  2328. (nnspool-active-file
  2329. ,(nnheader-concat gnus-cache-directory "active"))))
  2330. "List of predefined (convenience) servers.")
  2331. (defconst gnus-article-mark-lists
  2332. '((marked . tick) (replied . reply)
  2333. (expirable . expire) (killed . killed)
  2334. (bookmarks . bookmark) (dormant . dormant)
  2335. (scored . score) (saved . save)
  2336. (cached . cache) (downloadable . download)
  2337. (unsendable . unsend) (forwarded . forward)
  2338. (seen . seen) (unexist . unexist)))
  2339. (defconst gnus-article-special-mark-lists
  2340. '((seen range)
  2341. (unexist range)
  2342. (killed range)
  2343. (bookmark tuple)
  2344. (uid tuple)
  2345. (active tuple)
  2346. (score tuple)))
  2347. ;; Propagate flags to server, with the following exceptions:
  2348. ;; `seen' is private to each gnus installation
  2349. ;; `cache' is a internal gnus flag for each gnus installation
  2350. ;; `download' is a agent flag private to each gnus installation
  2351. ;; `unsend' are for nndraft groups only
  2352. ;; `score' is not a proper mark
  2353. ;; `bookmark': don't propagated it, or fix the bug in update-mark.
  2354. (defconst gnus-article-unpropagated-mark-lists
  2355. '(seen cache download unsend score bookmark unexist)
  2356. "Marks that shouldn't be propagated to back ends.
  2357. Typical marks are those that make no sense in a standalone back end,
  2358. such as a mark that says whether an article is stored in the cache
  2359. \(which doesn't make sense in a standalone back end).")
  2360. (defvar gnus-headers-retrieved-by nil)
  2361. (defvar gnus-article-reply nil)
  2362. (defvar gnus-override-method nil)
  2363. (defvar gnus-opened-servers nil)
  2364. (defvar gnus-current-kill-article nil)
  2365. (defvar gnus-have-read-active-file nil)
  2366. (defconst gnus-maintainer
  2367. "submit@debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)"
  2368. "The mail address of the Gnus maintainers.")
  2369. (defconst gnus-bug-package
  2370. "gnus"
  2371. "The package to use in the bug submission.")
  2372. (defvar gnus-info-nodes
  2373. '((gnus-group-mode "(gnus)Group Buffer")
  2374. (gnus-summary-mode "(gnus)Summary Buffer")
  2375. (gnus-article-mode "(gnus)Article Buffer")
  2376. (gnus-server-mode "(gnus)Server Buffer")
  2377. (gnus-browse-mode "(gnus)Browse Foreign Server")
  2378. (gnus-tree-mode "(gnus)Tree Display"))
  2379. "Alist of major modes and related Info nodes.")
  2380. (defvar gnus-summary-buffer "*Summary*")
  2381. (defvar gnus-article-buffer "*Article*")
  2382. (defvar gnus-server-buffer "*Server*")
  2383. (defvar gnus-slave nil
  2384. "Whether this Gnus is a slave or not.")
  2385. (defvar gnus-batch-mode nil
  2386. "Whether this Gnus is running in batch mode or not.")
  2387. (defvar gnus-variable-list
  2388. '(gnus-newsrc-options gnus-newsrc-options-n
  2389. gnus-newsrc-last-checked-date
  2390. gnus-newsrc-alist gnus-server-alist
  2391. gnus-killed-list gnus-zombie-list
  2392. gnus-topic-topology gnus-topic-alist
  2393. gnus-cloud-sequence
  2394. gnus-cloud-covered-servers
  2395. gnus-cloud-file-timestamps)
  2396. "Gnus variables saved in the quick startup file.")
  2397. (defvar gnus-newsrc-alist nil
  2398. "Assoc list of read articles.
  2399. `gnus-newsrc-hashtb' should be kept so that both hold the same information.")
  2400. (defvar gnus-registry-alist nil
  2401. "Assoc list of registry data.
  2402. gnus-registry.el will populate this if it's loaded.")
  2403. (defvar gnus-newsrc-hashtb nil
  2404. "Hashtable of `gnus-newsrc-alist'.")
  2405. (defvar gnus-killed-list nil
  2406. "List of killed newsgroups.")
  2407. (defvar gnus-killed-hashtb nil
  2408. "Hash table equivalent of `gnus-killed-list'.")
  2409. (defvar gnus-zombie-list nil
  2410. "List of almost dead newsgroups.")
  2411. (defvar gnus-description-hashtb nil
  2412. "Descriptions of newsgroups.")
  2413. (defvar gnus-list-of-killed-groups nil
  2414. "List of newsgroups that have recently been killed by the user.")
  2415. (defvar gnus-active-hashtb nil
  2416. "Hashtable of active articles.")
  2417. (defvar gnus-moderated-hashtb nil
  2418. "Hashtable of moderated newsgroups.")
  2419. ;; Save window configuration.
  2420. (defvar gnus-prev-winconf nil)
  2421. (defvar gnus-reffed-article-number nil)
  2422. (defvar gnus-dead-summary nil)
  2423. (defvar gnus-invalid-group-regexp "[: `'\"/]\\|^$"
  2424. "Regexp matching invalid groups.")
  2425. (defvar gnus-other-frame-object nil
  2426. "A frame object which will be created by `gnus-other-frame'.")
  2427. ;;; End of variables.
  2428. ;; Define some autoload functions Gnus might use.
  2429. (eval-and-compile
  2430. ;; This little mapcar goes through the list below and marks the
  2431. ;; symbols in question as autoloaded functions.
  2432. (mapc
  2433. (lambda (package)
  2434. (let ((interactive (nth 1 (memq ':interactive package))))
  2435. (mapcar
  2436. (lambda (function)
  2437. (let (keymap)
  2438. (when (consp function)
  2439. (setq keymap (car (memq 'keymap function)))
  2440. (setq function (car function)))
  2441. (unless (fboundp function)
  2442. (autoload function (car package) nil interactive keymap))))
  2443. (if (eq (nth 1 package) ':interactive)
  2444. (nthcdr 3 package)
  2445. (cdr package)))))
  2446. '(("info" :interactive t Info-goto-node)
  2447. ("pp" pp-to-string)
  2448. ("qp" quoted-printable-decode-region quoted-printable-decode-string)
  2449. ("ps-print" ps-print-preprint)
  2450. ("message" :interactive t
  2451. message-send-and-exit message-yank-original)
  2452. ("babel" babel-as-string)
  2453. ("nnmail" nnmail-split-fancy nnmail-article-group)
  2454. ("nnvirtual" nnvirtual-catchup-group nnvirtual-convert-headers)
  2455. ;; This is only used in message.el, which has an autoload.
  2456. ("rmailout" rmail-output)
  2457. ;; Next two used in gnus-util, which has autoloads, and contrib/sendmail.
  2458. ("rmail" rmail-count-new-messages rmail-show-message
  2459. ;; Next two only used in gnus-util.
  2460. rmail-summary-exists rmail-select-summary)
  2461. ;; Only used in gnus-util, which has an autoload.
  2462. ("rmailsum" rmail-update-summary)
  2463. ("gnus-xmas" gnus-xmas-splash)
  2464. ("score-mode" :interactive t gnus-score-mode)
  2465. ("gnus-mh" gnus-summary-save-article-folder
  2466. gnus-Folder-save-name gnus-folder-save-name)
  2467. ("gnus-mh" :interactive t gnus-summary-save-in-folder)
  2468. ("gnus-demon" gnus-demon-add-scanmail
  2469. gnus-demon-add-rescan gnus-demon-add-scan-timestamps
  2470. gnus-demon-add-disconnection gnus-demon-add-handler
  2471. gnus-demon-remove-handler)
  2472. ("gnus-demon" :interactive t
  2473. gnus-demon-init gnus-demon-cancel)
  2474. ("gnus-fun" gnus-convert-gray-x-face-to-xpm gnus-display-x-face-in-from
  2475. gnus-convert-image-to-gray-x-face gnus-convert-face-to-png
  2476. gnus-face-from-file)
  2477. ("gnus-salt" gnus-highlight-selected-tree gnus-possibly-generate-tree
  2478. gnus-tree-open gnus-tree-close)
  2479. ("gnus-srvr" gnus-enter-server-buffer gnus-server-set-info
  2480. gnus-server-server-name)
  2481. ("gnus-srvr" gnus-browse-foreign-server)
  2482. ("gnus-cite" :interactive t
  2483. gnus-article-highlight-citation gnus-article-hide-citation-maybe
  2484. gnus-article-hide-citation gnus-article-fill-cited-article
  2485. gnus-article-hide-citation-in-followups
  2486. gnus-article-fill-cited-long-lines)
  2487. ("gnus-kill" gnus-kill gnus-apply-kill-file-internal
  2488. gnus-kill-file-edit-file gnus-kill-file-raise-followups-to-author
  2489. gnus-execute gnus-expunge gnus-batch-kill gnus-batch-score)
  2490. ("gnus-registry" gnus-try-warping-via-registry
  2491. gnus-registry-handle-action)
  2492. ("gnus-cache" gnus-cache-possibly-enter-article gnus-cache-save-buffers
  2493. gnus-cache-possibly-remove-articles gnus-cache-request-article
  2494. gnus-cache-retrieve-headers gnus-cache-possibly-alter-active
  2495. gnus-cache-enter-remove-article gnus-cached-article-p
  2496. gnus-cache-open gnus-cache-close gnus-cache-update-article
  2497. gnus-cache-articles-in-group)
  2498. ("gnus-cache" :interactive t gnus-jog-cache gnus-cache-enter-article
  2499. gnus-cache-remove-article gnus-summary-insert-cached-articles)
  2500. ("gnus-score" :interactive t
  2501. gnus-summary-increase-score gnus-summary-set-score
  2502. gnus-summary-raise-thread gnus-summary-raise-same-subject
  2503. gnus-summary-raise-score gnus-summary-raise-same-subject-and-select
  2504. gnus-summary-lower-thread gnus-summary-lower-same-subject
  2505. gnus-summary-lower-score gnus-summary-lower-same-subject-and-select
  2506. gnus-summary-current-score gnus-score-delta-default
  2507. gnus-score-flush-cache gnus-score-close
  2508. gnus-possibly-score-headers gnus-score-followup-article
  2509. gnus-score-followup-thread)
  2510. ("gnus-score"
  2511. (gnus-summary-score-map keymap) gnus-score-save gnus-score-headers
  2512. gnus-current-score-file-nondirectory gnus-score-adaptive
  2513. gnus-score-find-trace gnus-score-file-name)
  2514. ("gnus-cus" :interactive t gnus-group-customize gnus-score-customize)
  2515. ("gnus-topic" :interactive t gnus-topic-mode)
  2516. ("gnus-topic" gnus-topic-remove-group gnus-topic-set-parameters
  2517. gnus-subscribe-topics)
  2518. ("gnus-salt" :interactive t gnus-pick-mode gnus-binary-mode)
  2519. ("gnus-uu" (gnus-uu-extract-map keymap) (gnus-uu-mark-map keymap))
  2520. ("gnus-uu" :interactive t
  2521. gnus-uu-digest-mail-forward gnus-uu-digest-post-forward
  2522. gnus-uu-mark-series gnus-uu-mark-region gnus-uu-mark-buffer
  2523. gnus-uu-mark-by-regexp gnus-uu-mark-all
  2524. gnus-uu-mark-sparse gnus-uu-mark-thread gnus-uu-decode-uu
  2525. gnus-uu-decode-uu-and-save gnus-uu-decode-unshar
  2526. gnus-uu-decode-unshar-and-save gnus-uu-decode-save
  2527. gnus-uu-decode-binhex gnus-uu-decode-uu-view
  2528. gnus-uu-decode-uu-and-save-view gnus-uu-decode-unshar-view
  2529. gnus-uu-decode-unshar-and-save-view gnus-uu-decode-save-view
  2530. gnus-uu-decode-binhex-view gnus-uu-unmark-thread
  2531. gnus-uu-mark-over gnus-uu-post-news gnus-uu-invert-processable)
  2532. ("gnus-uu" gnus-uu-delete-work-dir gnus-uu-unmark-thread)
  2533. ("gnus-msg" (gnus-summary-send-map keymap)
  2534. gnus-article-mail gnus-copy-article-buffer gnus-extended-version)
  2535. ("gnus-msg" :interactive t
  2536. gnus-group-post-news gnus-group-mail gnus-group-news
  2537. gnus-summary-post-news gnus-summary-news-other-window
  2538. gnus-summary-followup gnus-summary-followup-with-original
  2539. gnus-summary-cancel-article gnus-summary-supersede-article
  2540. gnus-post-news gnus-summary-reply gnus-summary-reply-with-original
  2541. gnus-summary-mail-forward gnus-summary-mail-other-window
  2542. gnus-summary-resend-message gnus-summary-resend-bounced-mail
  2543. gnus-summary-wide-reply gnus-summary-followup-to-mail
  2544. gnus-summary-followup-to-mail-with-original gnus-bug
  2545. gnus-summary-wide-reply-with-original
  2546. gnus-summary-post-forward gnus-summary-wide-reply-with-original
  2547. gnus-summary-post-forward)
  2548. ("gnus-picon" :interactive t gnus-treat-from-picon)
  2549. ("smiley" :interactive t smiley-region)
  2550. ("gnus-win" gnus-configure-windows gnus-add-configuration)
  2551. ("gnus-sum" gnus-summary-insert-line gnus-summary-read-group
  2552. gnus-list-of-unread-articles gnus-list-of-read-articles
  2553. gnus-offer-save-summaries gnus-make-thread-indent-array
  2554. gnus-summary-exit gnus-update-read-articles gnus-summary-last-subject
  2555. gnus-summary-skip-intangible gnus-summary-article-number
  2556. gnus-data-header gnus-data-find)
  2557. ("gnus-group" gnus-group-insert-group-line gnus-group-quit
  2558. gnus-group-list-groups gnus-group-first-unread-group
  2559. gnus-group-set-mode-line gnus-group-set-info gnus-group-save-newsrc
  2560. gnus-group-setup-buffer gnus-group-get-new-news
  2561. gnus-group-make-help-group gnus-group-update-group
  2562. gnus-group-iterate gnus-group-group-name)
  2563. ("gnus-bcklg" gnus-backlog-request-article gnus-backlog-enter-article
  2564. gnus-backlog-remove-article)
  2565. ("gnus-art" gnus-article-read-summary-keys gnus-article-save
  2566. gnus-article-prepare gnus-article-set-window-start
  2567. gnus-article-next-page gnus-article-prev-page
  2568. gnus-request-article-this-buffer gnus-article-mode
  2569. gnus-article-setup-buffer gnus-narrow-to-page
  2570. gnus-article-delete-invisible-text gnus-treat-article)
  2571. ("gnus-art" :interactive t
  2572. gnus-article-hide-headers gnus-article-hide-boring-headers
  2573. gnus-article-treat-overstrike
  2574. gnus-article-remove-cr gnus-article-remove-trailing-blank-lines
  2575. gnus-article-display-x-face gnus-article-de-quoted-unreadable
  2576. gnus-article-de-base64-unreadable
  2577. gnus-article-decode-HZ
  2578. gnus-article-wash-html
  2579. gnus-article-unsplit-urls
  2580. gnus-article-hide-pem gnus-article-hide-signature
  2581. gnus-article-strip-leading-blank-lines gnus-article-date-local
  2582. gnus-article-date-original gnus-article-date-lapsed
  2583. ;;gnus-article-show-all-headers
  2584. gnus-article-edit-mode gnus-article-edit-article
  2585. gnus-article-edit-done gnus-article-decode-encoded-words
  2586. gnus-start-date-timer gnus-stop-date-timer
  2587. gnus-mime-view-all-parts)
  2588. ("gnus-int" gnus-request-type)
  2589. ("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1
  2590. gnus-dribble-enter gnus-read-init-file gnus-dribble-touch
  2591. gnus-check-reasonable-setup)
  2592. ("gnus-dup" gnus-dup-suppress-articles gnus-dup-unsuppress-article
  2593. gnus-dup-enter-articles)
  2594. ("gnus-range" gnus-copy-sequence)
  2595. ("gnus-eform" gnus-edit-form)
  2596. ("gnus-logic" gnus-score-advanced)
  2597. ("gnus-undo" gnus-undo-mode gnus-undo-register)
  2598. ("gnus-async" gnus-async-request-fetched-article gnus-async-prefetch-next
  2599. gnus-async-prefetch-article gnus-async-prefetch-remove-group
  2600. gnus-async-halt-prefetch)
  2601. ("gnus-agent" gnus-open-agent gnus-agent-get-function
  2602. gnus-agent-save-active gnus-agent-method-p
  2603. gnus-agent-get-undownloaded-list gnus-agent-fetch-session
  2604. gnus-summary-set-agent-mark gnus-agent-save-group-info
  2605. gnus-agent-request-article gnus-agent-retrieve-headers
  2606. gnus-agent-store-article gnus-agent-group-covered-p)
  2607. ("gnus-agent" :interactive t
  2608. gnus-unplugged gnus-agentize gnus-agent-batch)
  2609. ("gnus-vm" :interactive t gnus-summary-save-in-vm
  2610. gnus-summary-save-article-vm)
  2611. ("compface" uncompface)
  2612. ("gnus-draft" :interactive t gnus-draft-mode gnus-group-send-queue)
  2613. ("gnus-mlspl" gnus-group-split gnus-group-split-fancy)
  2614. ("gnus-mlspl" :interactive t gnus-group-split-setup
  2615. gnus-group-split-update)
  2616. ("gnus-delay" gnus-delay-initialize))))
  2617. ;;; gnus-sum.el thingies
  2618. (defcustom gnus-summary-line-format "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n"
  2619. "*The format specification of the lines in the summary buffer.
  2620. It works along the same lines as a normal formatting string,
  2621. with some simple extensions.
  2622. %N Article number, left padded with spaces (string)
  2623. %S Subject (string)
  2624. %s Subject if it is at the root of a thread, and \"\"
  2625. otherwise (string)
  2626. %n Name of the poster (string)
  2627. %a Extracted name of the poster (string)
  2628. %A Extracted address of the poster (string)
  2629. %F Contents of the From: header (string)
  2630. %f Contents of the From: or To: headers (string)
  2631. %x Contents of the Xref: header (string)
  2632. %D Date of the article (string)
  2633. %d Date of the article (string) in DD-MMM format
  2634. %o Date of the article (string) in YYYYMMDD`T'HHMMSS
  2635. format
  2636. %M Message-id of the article (string)
  2637. %r References of the article (string)
  2638. %c Number of characters in the article (integer)
  2639. %k Pretty-printed version of the above (string)
  2640. For example, \"1.2k\" or \"0.4M\".
  2641. %L Number of lines in the article (integer)
  2642. %I Indentation based on thread level (a string of
  2643. spaces)
  2644. %B A complex trn-style thread tree (string)
  2645. The variables `gnus-sum-thread-*' can be used for
  2646. customization.
  2647. %T A string with two possible values: 80 spaces if the
  2648. article is on thread level two or larger and 0 spaces
  2649. on level one
  2650. %R \"A\" if this article has been replied to, \" \"
  2651. otherwise (character)
  2652. %U \"Read\" status of this article.
  2653. See Info node `(gnus)Marking Articles'
  2654. %[ Opening bracket (character, \"[\" or \"<\")
  2655. %] Closing bracket (character, \"]\" or \">\")
  2656. %> Spaces of length thread-level (string)
  2657. %< Spaces of length (- 20 thread-level) (string)
  2658. %i Article score (number)
  2659. %z Article zcore (character)
  2660. %t Number of articles under the current thread (number).
  2661. %e Whether the thread is empty or not (character).
  2662. %V Total thread score (number).
  2663. %P The line number (number).
  2664. %O Download mark (character).
  2665. %* If present, indicates desired cursor position
  2666. (instead of after first colon).
  2667. %u User defined specifier. The next character in the
  2668. format string should be a letter. Gnus will call the
  2669. function gnus-user-format-function-X, where X is the
  2670. letter following %u. The function will be passed the
  2671. current header as argument. The function should
  2672. return a string, which will be inserted into the
  2673. summary just like information from any other summary
  2674. specifier.
  2675. &user-date; Age sensitive date format. Various date format is
  2676. defined in `gnus-user-date-format-alist'.
  2677. The %U (status), %R (replied) and %z (zcore) specs have to be handled
  2678. with care. For reasons of efficiency, Gnus will compute what column
  2679. these characters will end up in, and \"hard-code\" that. This means that
  2680. it is invalid to have these specs after a variable-length spec. Well,
  2681. you might not be arrested, but your summary buffer will look strange,
  2682. which is bad enough.
  2683. The smart choice is to have these specs as far to the left as
  2684. possible.
  2685. This restriction may disappear in later versions of Gnus.
  2686. General format specifiers can also be used.
  2687. See Info node `(gnus)Formatting Variables'."
  2688. :link '(custom-manual "(gnus)Formatting Variables")
  2689. :type 'string
  2690. :group 'gnus-summary-format)
  2691. ;;;
  2692. ;;; Skeleton keymaps
  2693. ;;;
  2694. (defun gnus-suppress-keymap (keymap)
  2695. (suppress-keymap keymap)
  2696. (let ((keys `([delete] "\177" "\M-u"))) ;gnus-mouse-2
  2697. (while keys
  2698. (define-key keymap (pop keys) 'undefined))))
  2699. (defvar gnus-article-mode-map
  2700. (let ((keymap (make-sparse-keymap)))
  2701. (gnus-suppress-keymap keymap)
  2702. keymap))
  2703. (defvar gnus-summary-mode-map
  2704. (let ((keymap (make-keymap)))
  2705. (gnus-suppress-keymap keymap)
  2706. keymap))
  2707. (defvar gnus-group-mode-map
  2708. (let ((keymap (make-keymap)))
  2709. (gnus-suppress-keymap keymap)
  2710. keymap))
  2711. ;; Fix by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
  2712. ;; If you want the cursor to go somewhere else, set these two
  2713. ;; functions in some startup hook to whatever you want.
  2714. (defalias 'gnus-summary-position-point 'gnus-goto-colon)
  2715. (defalias 'gnus-group-position-point 'gnus-goto-colon)
  2716. ;;; Various macros and substs.
  2717. (defun gnus-header-from (header)
  2718. (mail-header-from header))
  2719. (defmacro gnus-gethash (string hashtable)
  2720. "Get hash value of STRING in HASHTABLE."
  2721. `(symbol-value (intern-soft ,string ,hashtable)))
  2722. (defmacro gnus-gethash-safe (string hashtable)
  2723. "Get hash value of STRING in HASHTABLE.
  2724. Return nil if not defined."
  2725. `(let ((sym (intern-soft ,string ,hashtable)))
  2726. (and (boundp sym) (symbol-value sym))))
  2727. (defmacro gnus-sethash (string value hashtable)
  2728. "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
  2729. `(set (intern ,string ,hashtable) ,value))
  2730. (put 'gnus-sethash 'edebug-form-spec '(form form form))
  2731. (defmacro gnus-group-unread (group)
  2732. "Get the currently computed number of unread articles in GROUP."
  2733. `(car (gnus-gethash ,group gnus-newsrc-hashtb)))
  2734. (defmacro gnus-group-entry (group)
  2735. "Get the newsrc entry for GROUP."
  2736. `(gnus-gethash ,group gnus-newsrc-hashtb))
  2737. (defmacro gnus-active (group)
  2738. "Get active info on GROUP."
  2739. `(gnus-gethash ,group gnus-active-hashtb))
  2740. (defmacro gnus-set-active (group active)
  2741. "Set GROUP's active info."
  2742. `(gnus-sethash ,group ,active gnus-active-hashtb))
  2743. ;; Info access macros.
  2744. (defmacro gnus-info-group (info)
  2745. `(nth 0 ,info))
  2746. (defmacro gnus-info-rank (info)
  2747. `(nth 1 ,info))
  2748. (defmacro gnus-info-read (info)
  2749. `(nth 2 ,info))
  2750. (defmacro gnus-info-marks (info)
  2751. `(nth 3 ,info))
  2752. (defmacro gnus-info-method (info)
  2753. `(nth 4 ,info))
  2754. (defmacro gnus-info-params (info)
  2755. `(nth 5 ,info))
  2756. (defmacro gnus-info-level (info)
  2757. `(let ((rank (gnus-info-rank ,info)))
  2758. (if (consp rank)
  2759. (car rank)
  2760. rank)))
  2761. (defmacro gnus-info-score (info)
  2762. `(let ((rank (gnus-info-rank ,info)))
  2763. (or (and (consp rank) (cdr rank)) 0)))
  2764. (defmacro gnus-info-set-group (info group)
  2765. `(setcar ,info ,group))
  2766. (defmacro gnus-info-set-rank (info rank)
  2767. `(setcar (nthcdr 1 ,info) ,rank))
  2768. (defmacro gnus-info-set-read (info read)
  2769. `(setcar (nthcdr 2 ,info) ,read))
  2770. (defmacro gnus-info-set-marks (info marks &optional extend)
  2771. (if extend
  2772. `(gnus-info-set-entry ,info ,marks 3)
  2773. `(setcar (nthcdr 3 ,info) ,marks)))
  2774. (defmacro gnus-info-set-method (info method &optional extend)
  2775. (if extend
  2776. `(gnus-info-set-entry ,info ,method 4)
  2777. `(setcar (nthcdr 4 ,info) ,method)))
  2778. (defmacro gnus-info-set-params (info params &optional extend)
  2779. (if extend
  2780. `(gnus-info-set-entry ,info ,params 5)
  2781. `(setcar (nthcdr 5 ,info) ,params)))
  2782. (defun gnus-info-set-entry (info entry number)
  2783. ;; Extend the info until we have enough elements.
  2784. (while (<= (length info) number)
  2785. (nconc info (list nil)))
  2786. ;; Set the entry.
  2787. (setcar (nthcdr number info) entry))
  2788. (defmacro gnus-info-set-level (info level)
  2789. `(let ((rank (cdr ,info)))
  2790. (if (consp (car rank))
  2791. (setcar (car rank) ,level)
  2792. (setcar rank ,level))))
  2793. (defmacro gnus-info-set-score (info score)
  2794. `(let ((rank (cdr ,info)))
  2795. (if (consp (car rank))
  2796. (setcdr (car rank) ,score)
  2797. (setcar rank (cons (car rank) ,score)))))
  2798. (defmacro gnus-get-info (group)
  2799. `(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb)))
  2800. (defun gnus-set-info (group info)
  2801. (setcar (nthcdr 2 (gnus-gethash group gnus-newsrc-hashtb))
  2802. info))
  2803. ;;; Load the compatibility functions.
  2804. (require 'gnus-ems)
  2805. ;;;
  2806. ;;; Shutdown
  2807. ;;;
  2808. (defvar gnus-shutdown-alist nil)
  2809. (defun gnus-add-shutdown (function &rest symbols)
  2810. "Run FUNCTION whenever one of SYMBOLS is shut down."
  2811. (push (cons function symbols) gnus-shutdown-alist))
  2812. (defun gnus-shutdown (symbol)
  2813. "Shut down everything that waits for SYMBOL."
  2814. (dolist (entry gnus-shutdown-alist)
  2815. (when (memq symbol (cdr entry))
  2816. (funcall (car entry)))))
  2817. ;;;
  2818. ;;; Gnus Utility Functions
  2819. ;;;
  2820. (defun gnus-find-subscribed-addresses ()
  2821. "Return a regexp matching the addresses of all subscribed mail groups.
  2822. It consists of the `to-address' or `to-list' parameter of all groups
  2823. with a `subscribed' parameter."
  2824. (let (group address addresses)
  2825. (dolist (entry (cdr gnus-newsrc-alist))
  2826. (setq group (car entry))
  2827. (when (gnus-parameter-subscribed group)
  2828. (setq address (mail-strip-quoted-names
  2829. (or (gnus-group-fast-parameter group 'to-address)
  2830. (gnus-group-fast-parameter group 'to-list))))
  2831. (when address
  2832. (add-to-list 'addresses address))))
  2833. (when addresses
  2834. (list (mapconcat 'regexp-quote addresses "\\|")))))
  2835. (defmacro gnus-string-or (&rest strings)
  2836. "Return the first element of STRINGS that is a non-blank string.
  2837. STRINGS will be evaluated in normal `or' order."
  2838. `(gnus-string-or-1 (list ,@strings)))
  2839. (defun gnus-string-or-1 (strings)
  2840. (let (string)
  2841. (while strings
  2842. (setq string (pop strings))
  2843. (if (string-match "^[ \t]*$" string)
  2844. (setq string nil)
  2845. (setq strings nil)))
  2846. string))
  2847. (defun gnus-version (&optional arg)
  2848. "Version number of this version of Gnus.
  2849. If ARG, insert string at point."
  2850. (interactive "P")
  2851. (if arg
  2852. (insert (message gnus-version))
  2853. (message gnus-version)))
  2854. (defun gnus-continuum-version (&optional version)
  2855. "Return VERSION as a floating point number."
  2856. (unless version
  2857. (setq version gnus-version))
  2858. (when (or (string-match "^\\([^ ]+\\)? ?Gnus v?\\([0-9.]+\\)$" version)
  2859. (string-match "^\\(.?\\)gnus-\\([0-9.]+\\)$" version))
  2860. (let ((alpha (and (match-beginning 1) (match-string 1 version)))
  2861. (number (match-string 2 version))
  2862. major minor least)
  2863. (unless (string-match
  2864. "\\([0-9]\\)\\.\\([0-9]+\\)\\.?\\([0-9]+\\)?" number)
  2865. (error "Invalid version string: %s" version))
  2866. (setq major (string-to-number (match-string 1 number))
  2867. minor (string-to-number (match-string 2 number))
  2868. least (if (match-beginning 3)
  2869. (string-to-number (match-string 3 number))
  2870. 0))
  2871. (string-to-number
  2872. (if (zerop major)
  2873. (format "%1.2f00%02d%02d"
  2874. (if (member alpha '("(ding)" "d"))
  2875. 4.99
  2876. (+ 5 (* 0.02
  2877. (abs
  2878. (- (mm-char-int (aref (downcase alpha) 0))
  2879. (mm-char-int ?t))))
  2880. -0.01))
  2881. minor least)
  2882. (format "%d.%02d%02d" major minor least))))))
  2883. (defun gnus-info-find-node (&optional nodename)
  2884. "Find Info documentation of Gnus."
  2885. (interactive)
  2886. ;; Enlarge info window if needed.
  2887. (let (gnus-info-buffer)
  2888. (Info-goto-node (or nodename (cadr (assq major-mode gnus-info-nodes))))
  2889. (setq gnus-info-buffer (current-buffer))
  2890. (gnus-configure-windows 'info)))
  2891. ;;;
  2892. ;;; gnus-interactive
  2893. ;;;
  2894. (defvar gnus-current-prefix-symbol nil
  2895. "Current prefix symbol.")
  2896. (defvar gnus-current-prefix-symbols nil
  2897. "List of current prefix symbols.")
  2898. (defun gnus-interactive (string &optional params)
  2899. "Return a list that can be fed to `interactive'.
  2900. See `interactive' for full documentation.
  2901. Adds the following specs:
  2902. y -- The current symbolic prefix.
  2903. Y -- A list of the current symbolic prefix(es).
  2904. A -- Article number.
  2905. H -- Article header.
  2906. g -- Group name."
  2907. (let ((i 0)
  2908. out c prompt)
  2909. (while (< i (length string))
  2910. (string-match ".\\([^\n]*\\)\n?" string i)
  2911. (setq c (aref string i))
  2912. (when (match-end 1)
  2913. (setq prompt (match-string 1 string)))
  2914. (setq i (match-end 0))
  2915. ;; We basically emulate just about everything that
  2916. ;; `interactive' does, but add the specs listed above.
  2917. (push
  2918. (cond
  2919. ((= c ?a)
  2920. (completing-read prompt obarray 'fboundp t))
  2921. ((= c ?b)
  2922. (read-buffer prompt (current-buffer) t))
  2923. ((= c ?B)
  2924. (read-buffer prompt (other-buffer (current-buffer))))
  2925. ((= c ?c)
  2926. (read-char))
  2927. ((= c ?C)
  2928. (completing-read prompt obarray 'commandp t))
  2929. ((= c ?d)
  2930. (point))
  2931. ((= c ?D)
  2932. (read-directory-name prompt nil default-directory 'lambda))
  2933. ((= c ?f)
  2934. (read-file-name prompt nil nil 'lambda))
  2935. ((= c ?F)
  2936. (read-file-name prompt))
  2937. ((= c ?k)
  2938. (read-key-sequence prompt))
  2939. ((= c ?K)
  2940. (error "Not implemented spec"))
  2941. ((= c ?e)
  2942. (error "Not implemented spec"))
  2943. ((= c ?m)
  2944. (mark))
  2945. ((= c ?N)
  2946. (error "Not implemented spec"))
  2947. ((= c ?n)
  2948. (string-to-number (read-from-minibuffer prompt)))
  2949. ((= c ?p)
  2950. (prefix-numeric-value current-prefix-arg))
  2951. ((= c ?P)
  2952. current-prefix-arg)
  2953. ((= c ?r)
  2954. 'gnus-prefix-nil)
  2955. ((= c ?s)
  2956. (read-string prompt))
  2957. ((= c ?S)
  2958. (intern (read-string prompt)))
  2959. ((= c ?v)
  2960. (read-variable prompt))
  2961. ((= c ?x)
  2962. (read-minibuffer prompt))
  2963. ((= c ?x)
  2964. (eval-minibuffer prompt))
  2965. ;; And here the new specs come.
  2966. ((= c ?y)
  2967. gnus-current-prefix-symbol)
  2968. ((= c ?Y)
  2969. gnus-current-prefix-symbols)
  2970. ((= c ?g)
  2971. (gnus-group-group-name))
  2972. ((= c ?A)
  2973. (gnus-summary-skip-intangible)
  2974. (or (get-text-property (point) 'gnus-number)
  2975. (gnus-summary-last-subject)))
  2976. ((= c ?H)
  2977. (gnus-data-header (gnus-data-find (gnus-summary-article-number))))
  2978. (t
  2979. (error "Non-implemented spec")))
  2980. out)
  2981. (cond
  2982. ((= c ?r)
  2983. (push (if (< (point) (mark)) (point) (mark)) out)
  2984. (push (if (> (point) (mark)) (point) (mark)) out))))
  2985. (setq out (delq 'gnus-prefix-nil out))
  2986. (nreverse out)))
  2987. (defun gnus-symbolic-argument (&optional arg)
  2988. "Read a symbolic argument and a command, and then execute command."
  2989. (interactive "P")
  2990. (let* ((in-command (this-command-keys))
  2991. (command in-command)
  2992. gnus-current-prefix-symbols
  2993. gnus-current-prefix-symbol
  2994. syms)
  2995. (while (equal in-command command)
  2996. (message "%s-" (key-description (this-command-keys)))
  2997. (push (intern (char-to-string (read-char))) syms)
  2998. (setq command (read-key-sequence nil t)))
  2999. (setq gnus-current-prefix-symbols (nreverse syms)
  3000. gnus-current-prefix-symbol (car gnus-current-prefix-symbols))
  3001. (call-interactively (key-binding command t))))
  3002. ;;; More various functions.
  3003. (defsubst gnus-check-backend-function (func group)
  3004. "Check whether GROUP supports function FUNC.
  3005. GROUP can either be a string (a group name) or a select method."
  3006. (ignore-errors
  3007. (let ((method (if (stringp group)
  3008. (car (gnus-find-method-for-group group))
  3009. group)))
  3010. (unless (featurep method)
  3011. (require method))
  3012. (fboundp (intern (format "%s-%s" method func))))))
  3013. (defun gnus-group-read-only-p (&optional group)
  3014. "Check whether GROUP supports editing or not.
  3015. If GROUP is nil, `gnus-newsgroup-name' will be checked instead. Note
  3016. that that variable is buffer-local to the summary buffers."
  3017. (let ((group (or group gnus-newsgroup-name)))
  3018. (not (gnus-check-backend-function 'request-replace-article group))))
  3019. (defun gnus-virtual-group-p (group)
  3020. "Say whether GROUP is virtual or not."
  3021. (memq 'virtual (assoc (symbol-name (car (gnus-find-method-for-group group)))
  3022. gnus-valid-select-methods)))
  3023. (defun gnus-news-group-p (group &optional article)
  3024. "Return non-nil if GROUP (and ARTICLE) come from a news server."
  3025. (cond ((gnus-member-of-valid 'post group) ;Ordinary news group
  3026. t) ;is news of course.
  3027. ((not (gnus-member-of-valid 'post-mail group)) ;Non-combined.
  3028. nil) ;must be mail then.
  3029. ((vectorp article) ;Has header info.
  3030. (eq (gnus-request-type group (mail-header-id article)) 'news))
  3031. ((null article) ;Hasn't header info
  3032. (eq (gnus-request-type group) 'news)) ;(unknown ==> mail)
  3033. ((< article 0) ;Virtual message
  3034. nil) ;we don't know, guess mail.
  3035. (t ;Has positive number
  3036. (eq (gnus-request-type group article) 'news)))) ;use it.
  3037. ;; Check whether to use long file names.
  3038. (defun gnus-use-long-file-name (symbol)
  3039. ;; The variable has to be set...
  3040. (and gnus-use-long-file-name
  3041. ;; If it isn't a list, then we return t.
  3042. (or (not (listp gnus-use-long-file-name))
  3043. ;; If it is a list, and the list contains `symbol', we
  3044. ;; return nil.
  3045. (not (memq symbol gnus-use-long-file-name)))))
  3046. ;; Generate a unique new group name.
  3047. (defun gnus-generate-new-group-name (leaf)
  3048. (let ((name leaf)
  3049. (num 0))
  3050. (while (gnus-group-entry name)
  3051. (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">")))
  3052. name))
  3053. (defun gnus-ephemeral-group-p (group)
  3054. "Say whether GROUP is ephemeral or not."
  3055. (gnus-group-get-parameter group 'quit-config t))
  3056. (defun gnus-group-quit-config (group)
  3057. "Return the quit-config of GROUP."
  3058. (gnus-group-get-parameter group 'quit-config t))
  3059. (defun gnus-kill-ephemeral-group (group)
  3060. "Remove ephemeral GROUP from relevant structures."
  3061. (gnus-sethash group nil gnus-newsrc-hashtb))
  3062. (defun gnus-simplify-mode-line ()
  3063. "Make mode lines a bit simpler."
  3064. (setq mode-line-modified (cdr gnus-mode-line-modified))
  3065. (when (listp mode-line-format)
  3066. (make-local-variable 'mode-line-format)
  3067. (setq mode-line-format (copy-sequence mode-line-format))
  3068. (when (equal (nth 3 mode-line-format) " ")
  3069. (setcar (nthcdr 3 mode-line-format) " "))))
  3070. ;;; Servers and groups.
  3071. (defsubst gnus-server-add-address (method)
  3072. (let ((method-name (symbol-name (car method))))
  3073. (if (and (memq 'address (assoc method-name gnus-valid-select-methods))
  3074. (not (assq (intern (concat method-name "-address")) method))
  3075. (memq 'physical-address (assq (car method)
  3076. gnus-valid-select-methods)))
  3077. (append method (list (list (intern (concat method-name "-address"))
  3078. (nth 1 method))))
  3079. method)))
  3080. (defsubst gnus-method-to-server (method &optional nocache no-enter-cache)
  3081. (catch 'server-name
  3082. (setq method (or method gnus-select-method))
  3083. ;; Perhaps it is already in the cache.
  3084. (unless nocache
  3085. (mapc (lambda (name-method)
  3086. (if (equal (cdr name-method) method)
  3087. (throw 'server-name (car name-method))))
  3088. gnus-server-method-cache))
  3089. (mapc
  3090. (lambda (server-alist)
  3091. (mapc (lambda (name-method)
  3092. (when (gnus-methods-equal-p (cdr name-method) method)
  3093. (unless (member name-method gnus-server-method-cache)
  3094. (push name-method gnus-server-method-cache))
  3095. (throw 'server-name (car name-method))))
  3096. server-alist))
  3097. (list gnus-server-alist
  3098. gnus-predefined-server-alist))
  3099. (let* ((name (if (member (cadr method) '(nil ""))
  3100. (format "%s" (car method))
  3101. (format "%s:%s" (car method) (cadr method))))
  3102. (name-method (cons name method)))
  3103. (when (and (not (member name-method gnus-server-method-cache))
  3104. (not no-enter-cache)
  3105. (not (assoc (car name-method) gnus-server-method-cache)))
  3106. (push name-method gnus-server-method-cache))
  3107. name)))
  3108. (defsubst gnus-server-to-method (server)
  3109. "Map virtual server names to select methods."
  3110. (or (and server (listp server) server)
  3111. (cdr (assoc server gnus-server-method-cache))
  3112. (let ((result
  3113. (or
  3114. ;; Perhaps this is the native server?
  3115. (and (equal server "native") gnus-select-method)
  3116. ;; It should be in the server alist.
  3117. (cdr (assoc server gnus-server-alist))
  3118. ;; It could be in the predefined server alist.
  3119. (cdr (assoc server gnus-predefined-server-alist))
  3120. ;; If not, we look through all the opened server
  3121. ;; to see whether we can find it there.
  3122. (let ((opened gnus-opened-servers))
  3123. (while (and opened
  3124. (not (equal server (format "%s:%s" (caaar opened)
  3125. (cadaar opened)))))
  3126. (pop opened))
  3127. (caar opened))
  3128. ;; It could be a named method, search all servers
  3129. (let ((servers gnus-secondary-select-methods))
  3130. (while (and servers
  3131. (not (equal server (format "%s:%s" (caar servers)
  3132. (cadar servers)))))
  3133. (pop servers))
  3134. (car servers))
  3135. ;; This could be some sort of foreign server that I
  3136. ;; simply haven't opened (yet). Do a brute-force scan
  3137. ;; of the entire gnus-newsrc-alist for the server name
  3138. ;; of every method. As a side-effect, loads the
  3139. ;; gnus-server-method-cache so this only happens once,
  3140. ;; if at all.
  3141. (let ((alist (cdr gnus-newsrc-alist))
  3142. method match)
  3143. (while alist
  3144. (setq method (gnus-info-method (pop alist)))
  3145. (when (and (not (stringp method))
  3146. (equal server
  3147. (gnus-method-to-server method nil t)))
  3148. (setq match method
  3149. alist nil)))
  3150. match))))
  3151. (when (and result
  3152. (not (assoc server gnus-server-method-cache)))
  3153. (push (cons server result) gnus-server-method-cache))
  3154. result)))
  3155. (defsubst gnus-server-get-method (group method)
  3156. ;; Input either a server name, and extended server name, or a
  3157. ;; select method, and return a select method.
  3158. (cond ((stringp method)
  3159. (gnus-server-to-method method))
  3160. ((equal method gnus-select-method)
  3161. gnus-select-method)
  3162. ((and (stringp (car method))
  3163. group)
  3164. (gnus-server-extend-method group method))
  3165. ((and method
  3166. (not group)
  3167. (equal (cadr method) ""))
  3168. method)
  3169. (t
  3170. (gnus-server-add-address method))))
  3171. (defmacro gnus-method-equal (ss1 ss2)
  3172. "Say whether two servers are equal."
  3173. `(let ((s1 ,ss1)
  3174. (s2 ,ss2))
  3175. (or (equal s1 s2)
  3176. (and (= (length s1) (length s2))
  3177. (progn
  3178. (while (and s1 (member (car s1) s2))
  3179. (setq s1 (cdr s1)))
  3180. (null s1))))))
  3181. (defun gnus-methods-equal-p (m1 m2)
  3182. (let ((m1 (or m1 gnus-select-method))
  3183. (m2 (or m2 gnus-select-method)))
  3184. (or (equal m1 m2)
  3185. (and (eq (car m1) (car m2))
  3186. (or (not (memq 'address (assoc (symbol-name (car m1))
  3187. gnus-valid-select-methods)))
  3188. (equal (nth 1 m1) (nth 1 m2)))))))
  3189. (defsubst gnus-sloppily-equal-method-parameters (m1 m2)
  3190. ;; Check parameters for sloppy equality.
  3191. (let ((p1 (copy-sequence (cddr m1)))
  3192. (p2 (copy-sequence (cddr m2)))
  3193. e1 e2)
  3194. (block nil
  3195. (while (setq e1 (pop p1))
  3196. (unless (setq e2 (assq (car e1) p2))
  3197. ;; The parameter doesn't exist in p2.
  3198. (return nil))
  3199. (setq p2 (delq e2 p2))
  3200. (unless (equal e1 e2)
  3201. (if (not (and (stringp (cadr e1))
  3202. (stringp (cadr e2))))
  3203. (return nil)
  3204. ;; Special-case string parameter comparison so that we
  3205. ;; can uniquify them.
  3206. (let ((s1 (cadr e1))
  3207. (s2 (cadr e2)))
  3208. (when (string-match "/$" s1)
  3209. (setq s1 (directory-file-name s1)))
  3210. (when (string-match "/$" s2)
  3211. (setq s2 (directory-file-name s2)))
  3212. (unless (equal s1 s2)
  3213. (return nil))))))
  3214. ;; If p2 now is empty, they were equal.
  3215. (null p2))))
  3216. (defun gnus-method-ephemeral-p (method)
  3217. (let ((equal nil))
  3218. (dolist (ephemeral gnus-ephemeral-servers)
  3219. (when (gnus-sloppily-equal-method-parameters method ephemeral)
  3220. (setq equal t)))
  3221. equal))
  3222. (defun gnus-methods-sloppily-equal (m1 m2)
  3223. ;; Same method.
  3224. (or
  3225. (eq m1 m2)
  3226. ;; Type and name are equal.
  3227. (and
  3228. (eq (car m1) (car m2))
  3229. (equal (cadr m1) (cadr m2))
  3230. (gnus-sloppily-equal-method-parameters m1 m2))))
  3231. (defun gnus-server-equal (m1 m2)
  3232. "Say whether two methods are equal."
  3233. (let ((m1 (cond ((null m1) gnus-select-method)
  3234. ((stringp m1) (gnus-server-to-method m1))
  3235. (t m1)))
  3236. (m2 (cond ((null m2) gnus-select-method)
  3237. ((stringp m2) (gnus-server-to-method m2))
  3238. (t m2))))
  3239. (gnus-method-equal m1 m2)))
  3240. (defun gnus-servers-using-backend (backend)
  3241. "Return a list of known servers using BACKEND."
  3242. (let ((opened gnus-opened-servers)
  3243. out)
  3244. (while opened
  3245. (when (eq backend (caaar opened))
  3246. (push (caar opened) out))
  3247. (pop opened))
  3248. out))
  3249. (defun gnus-archive-server-wanted-p ()
  3250. "Say whether the user wants to use the archive server."
  3251. (cond
  3252. ((or (not gnus-message-archive-method)
  3253. (not gnus-message-archive-group))
  3254. nil)
  3255. ((and gnus-message-archive-method gnus-message-archive-group)
  3256. t)
  3257. (t
  3258. (let ((active (cadr (assq 'nnfolder-active-file
  3259. gnus-message-archive-method))))
  3260. (and active
  3261. (file-exists-p active))))))
  3262. (defsubst gnus-method-to-server-name (method)
  3263. (concat
  3264. (format "%s" (car method))
  3265. (when (and
  3266. (or (assoc (format "%s" (car method))
  3267. (gnus-methods-using 'address))
  3268. (gnus-server-equal method gnus-message-archive-method))
  3269. (nth 1 method)
  3270. (not (string= (nth 1 method) "")))
  3271. (concat "+" (nth 1 method)))))
  3272. (defsubst gnus-method-to-full-server-name (method)
  3273. (format "%s+%s" (car method) (nth 1 method)))
  3274. (defun gnus-group-prefixed-name (group method &optional full)
  3275. "Return the whole name from GROUP and METHOD.
  3276. Call with full set to get the fully qualified group name (even if the
  3277. server is native)."
  3278. (when (stringp method)
  3279. (setq method (gnus-server-to-method method)))
  3280. (if (or (not method)
  3281. (and (not full) (gnus-server-equal method "native"))
  3282. ;;;!!! This might not be right. We'll see...
  3283. ;(string-match ":" group)
  3284. )
  3285. group
  3286. (concat (gnus-method-to-server-name method) ":" group)))
  3287. (defun gnus-group-full-name (group method)
  3288. "Return the full name from GROUP and METHOD, even if the method is native."
  3289. (gnus-group-prefixed-name group method t))
  3290. (defun gnus-group-guess-full-name-from-command-method (group)
  3291. "Guess the full name from GROUP, even if the method is native."
  3292. (if (gnus-group-prefixed-p group)
  3293. group
  3294. (gnus-group-full-name group gnus-command-method)))
  3295. (defun gnus-group-real-prefix (group)
  3296. "Return the prefix of the current group name."
  3297. (if (stringp group)
  3298. (if (string-match "^[^:]+:" group)
  3299. (substring group 0 (match-end 0))
  3300. "")
  3301. nil))
  3302. (defun gnus-group-short-name (group)
  3303. "Return the short group name."
  3304. (let ((prefix (gnus-group-real-prefix group)))
  3305. (if (< 0 (length prefix))
  3306. (substring group (length prefix) nil)
  3307. group)))
  3308. (defun gnus-group-prefixed-p (group)
  3309. "Return the prefix of the current group name."
  3310. (< 0 (length (gnus-group-real-prefix group))))
  3311. (declare-function gnus-group-decoded-name "gnus-group" (string))
  3312. (defun gnus-summary-buffer-name (group)
  3313. "Return the summary buffer name of GROUP."
  3314. (concat "*Summary " (gnus-group-decoded-name group) "*"))
  3315. (defun gnus-group-method (group)
  3316. "Return the server or method used for selecting GROUP.
  3317. You should probably use `gnus-find-method-for-group' instead."
  3318. (let ((prefix (gnus-group-real-prefix group)))
  3319. (if (equal prefix "")
  3320. gnus-select-method
  3321. (let ((servers gnus-opened-servers)
  3322. (server "")
  3323. backend possible found)
  3324. (if (string-match "^[^\\+]+\\+" prefix)
  3325. (setq backend (intern (substring prefix 0 (1- (match-end 0))))
  3326. server (substring prefix (match-end 0) (1- (length prefix))))
  3327. (setq backend (intern (substring prefix 0 (1- (length prefix))))))
  3328. (while servers
  3329. (when (eq (caaar servers) backend)
  3330. (setq possible (caar servers))
  3331. (when (equal (cadaar servers) server)
  3332. (setq found (caar servers))))
  3333. (pop servers))
  3334. (or (car (rassoc found gnus-server-alist))
  3335. found
  3336. (car (rassoc possible gnus-server-alist))
  3337. possible
  3338. (list backend server))))))
  3339. (defsubst gnus-native-method-p (method)
  3340. "Return whether METHOD is the native select method."
  3341. (gnus-method-equal method gnus-select-method))
  3342. (defsubst gnus-secondary-method-p (method)
  3343. "Return whether METHOD is a secondary select method."
  3344. (let ((methods gnus-secondary-select-methods)
  3345. (gmethod (inline (gnus-server-get-method nil method))))
  3346. (while (and methods
  3347. (not (gnus-method-equal
  3348. (inline (gnus-server-get-method nil (car methods)))
  3349. gmethod)))
  3350. (setq methods (cdr methods)))
  3351. methods))
  3352. (defun gnus-method-simplify (method)
  3353. "Return the shortest uniquely identifying string or method for METHOD."
  3354. (cond ((stringp method)
  3355. method)
  3356. ((gnus-native-method-p method)
  3357. nil)
  3358. ((gnus-secondary-method-p method)
  3359. (format "%s:%s" (nth 0 method) (nth 1 method)))
  3360. (t
  3361. method)))
  3362. (defun gnus-groups-from-server (server)
  3363. "Return a list of all groups that are fetched from SERVER."
  3364. (let ((alist (cdr gnus-newsrc-alist))
  3365. info groups)
  3366. (while (setq info (pop alist))
  3367. (when (gnus-server-equal (gnus-info-method info) server)
  3368. (push (gnus-info-group info) groups)))
  3369. (sort groups 'string<)))
  3370. (defun gnus-group-foreign-p (group)
  3371. "Say whether a group is foreign or not."
  3372. (and (not (gnus-group-native-p group))
  3373. (not (gnus-group-secondary-p group))))
  3374. (defun gnus-group-native-p (group)
  3375. "Say whether the group is native or not."
  3376. (not (string-match ":" group)))
  3377. (defun gnus-group-secondary-p (group)
  3378. "Say whether the group is secondary or not."
  3379. (gnus-secondary-method-p (gnus-find-method-for-group group)))
  3380. (defun gnus-parameters-get-parameter (group)
  3381. "Return the group parameters for GROUP from `gnus-parameters'."
  3382. (let ((case-fold-search (if (eq gnus-parameters-case-fold-search 'default)
  3383. case-fold-search
  3384. gnus-parameters-case-fold-search))
  3385. params-list)
  3386. (dolist (elem gnus-parameters)
  3387. (when (string-match (car elem) group)
  3388. (setq params-list
  3389. (nconc (gnus-expand-group-parameters
  3390. (car elem) (cdr elem) group)
  3391. params-list))))
  3392. params-list))
  3393. (defun gnus-expand-group-parameter (match value group)
  3394. "Use MATCH to expand VALUE in GROUP."
  3395. (let ((start (string-match match group)))
  3396. (if start
  3397. (let ((matched-string (substring group start (match-end 0))))
  3398. ;; Build match groups
  3399. (string-match match matched-string)
  3400. (replace-match value nil nil matched-string))
  3401. group)))
  3402. (defun gnus-expand-group-parameters (match parameters group)
  3403. "Go through PARAMETERS and expand them according to the match data."
  3404. (let (new)
  3405. (dolist (elem parameters)
  3406. (cond
  3407. ((and (stringp (cdr elem))
  3408. (string-match "\\\\[0-9&]" (cdr elem)))
  3409. (push (cons (car elem)
  3410. (gnus-expand-group-parameter match (cdr elem) group))
  3411. new))
  3412. ;; For `sieve' group parameters, perform substitutions for every
  3413. ;; string within the match rule. This allows for parameters such
  3414. ;; as:
  3415. ;; ("list\\.\\(.*\\)"
  3416. ;; (sieve header :is "list-id" "<\\1.domain.org>"))
  3417. ((eq 'sieve (car elem))
  3418. (push (mapcar (lambda (sieve-elem)
  3419. (if (and (stringp sieve-elem)
  3420. (string-match "\\\\[0-9&]" sieve-elem))
  3421. (gnus-expand-group-parameter match sieve-elem
  3422. group)
  3423. sieve-elem))
  3424. (cdr elem))
  3425. new))
  3426. (t
  3427. (push elem new))))
  3428. new))
  3429. (defun gnus-group-fast-parameter (group symbol &optional allow-list)
  3430. "For GROUP, return the value of SYMBOL.
  3431. You should call this in the `gnus-group-buffer' buffer.
  3432. The function `gnus-group-find-parameter' will do that for you."
  3433. ;; The speed trick: No cons'ing and quit early.
  3434. (let* ((params (funcall gnus-group-get-parameter-function group))
  3435. ;; Start easy, check the "real" group parameters.
  3436. (simple-results
  3437. (gnus-group-parameter-value params symbol allow-list t)))
  3438. (if simple-results
  3439. ;; Found results; return them.
  3440. (car simple-results)
  3441. ;; We didn't find it there, try `gnus-parameters'.
  3442. (let ((result nil)
  3443. (head nil)
  3444. (tail gnus-parameters))
  3445. ;; A good old-fashioned non-cl loop.
  3446. (while tail
  3447. (setq head (car tail)
  3448. tail (cdr tail))
  3449. ;; The car is regexp matching for matching the group name.
  3450. (when (string-match (car head) group)
  3451. ;; The cdr is the parameters.
  3452. (let ((this-result
  3453. (gnus-group-parameter-value (cdr head) symbol allow-list t)))
  3454. (when this-result
  3455. (setq result (car this-result))
  3456. ;; Expand if necessary.
  3457. (cond
  3458. ((and (stringp result) (string-match "\\\\[0-9&]" result))
  3459. (setq result (gnus-expand-group-parameter
  3460. (car head) result group)))
  3461. ;; For `sieve' group parameters, perform substitutions
  3462. ;; for every string within the match rule (see above).
  3463. ((eq symbol 'sieve)
  3464. (setq result
  3465. (mapcar (lambda (elem)
  3466. (if (stringp elem)
  3467. (gnus-expand-group-parameter (car head)
  3468. elem group)
  3469. elem))
  3470. result))))))))
  3471. ;; Done.
  3472. result))))
  3473. (defun gnus-group-find-parameter (group &optional symbol allow-list)
  3474. "Return the group parameters for GROUP.
  3475. If SYMBOL, return the value of that symbol in the group parameters.
  3476. If you call this function inside a loop, consider using the faster
  3477. `gnus-group-fast-parameter' instead."
  3478. (with-current-buffer (if (buffer-live-p (get-buffer gnus-group-buffer))
  3479. gnus-group-buffer
  3480. (current-buffer))
  3481. (if symbol
  3482. (gnus-group-fast-parameter group symbol allow-list)
  3483. (nconc
  3484. (copy-sequence
  3485. (funcall gnus-group-get-parameter-function group))
  3486. (gnus-parameters-get-parameter group)))))
  3487. (defun gnus-group-get-parameter (group &optional symbol allow-list)
  3488. "Return the group parameters for GROUP.
  3489. If SYMBOL, return the value of that symbol in the group parameters.
  3490. If ALLOW-LIST, also allow list as a result.
  3491. Most functions should use `gnus-group-find-parameter', which
  3492. also examines the topic parameters."
  3493. (let ((params (gnus-info-params (gnus-get-info group))))
  3494. (if symbol
  3495. (gnus-group-parameter-value params symbol allow-list)
  3496. params)))
  3497. (defun gnus-group-parameter-value (params symbol &optional
  3498. allow-list present-p)
  3499. "Return the value of SYMBOL in group PARAMS.
  3500. If ALLOW-LIST, also allow list as a result."
  3501. ;; We only wish to return group parameters (dotted lists) and
  3502. ;; not local variables, which may have the same names.
  3503. ;; But first we handle single elements...
  3504. (or (car (memq symbol params))
  3505. ;; Handle alist.
  3506. (let (elem)
  3507. (catch 'found
  3508. (while (setq elem (pop params))
  3509. (when (and (consp elem)
  3510. (eq (car elem) symbol)
  3511. (or allow-list
  3512. (atom (cdr elem))))
  3513. (throw 'found (if present-p (list (cdr elem))
  3514. (cdr elem)))))))))
  3515. (defun gnus-group-add-parameter (group param)
  3516. "Add parameter PARAM to GROUP."
  3517. (let ((info (gnus-get-info group)))
  3518. (when info
  3519. (gnus-group-remove-parameter group (if (consp param) (car param) param))
  3520. ;; Cons the new param to the old one and update.
  3521. (gnus-group-set-info (cons param (gnus-info-params info))
  3522. group 'params))))
  3523. (defun gnus-group-set-parameter (group name value)
  3524. "Set parameter NAME to VALUE in GROUP.
  3525. GROUP can also be an INFO structure."
  3526. (let ((info (if (listp group)
  3527. group
  3528. (gnus-get-info group))))
  3529. (when info
  3530. (gnus-group-remove-parameter group name)
  3531. (let ((old-params (gnus-info-params info))
  3532. (new-params (list (cons name value))))
  3533. (while old-params
  3534. (when (or (not (listp (car old-params)))
  3535. (not (eq (caar old-params) name)))
  3536. (setq new-params (append new-params (list (car old-params)))))
  3537. (setq old-params (cdr old-params)))
  3538. (if (listp group)
  3539. (gnus-info-set-params info new-params t)
  3540. (gnus-group-set-info new-params (gnus-info-group info) 'params))))))
  3541. (defun gnus-group-remove-parameter (group name)
  3542. "Remove parameter NAME from GROUP.
  3543. GROUP can also be an INFO structure."
  3544. (let ((info (if (listp group)
  3545. group
  3546. (gnus-get-info group))))
  3547. (when info
  3548. (let ((params (gnus-info-params info)))
  3549. (when params
  3550. (setq params (delq name params))
  3551. (while (assq name params)
  3552. (gnus-alist-pull name params))
  3553. (gnus-info-set-params info params))))))
  3554. (defun gnus-group-add-score (group &optional score)
  3555. "Add SCORE to the GROUP score.
  3556. If SCORE is nil, add 1 to the score of GROUP."
  3557. (let ((info (gnus-get-info group)))
  3558. (when info
  3559. (gnus-info-set-score info (+ (gnus-info-score info) (or score 1))))))
  3560. (defun gnus-short-group-name (group &optional levels)
  3561. "Collapse GROUP name LEVELS.
  3562. Select methods are stripped and any remote host name is stripped down to
  3563. just the host name."
  3564. (let* ((name "")
  3565. (foreign "")
  3566. (depth 0)
  3567. (skip 1)
  3568. (levels (or levels
  3569. gnus-group-uncollapsed-levels
  3570. (progn
  3571. (while (string-match "\\." group skip)
  3572. (setq skip (match-end 0)
  3573. depth (+ depth 1)))
  3574. depth))))
  3575. ;; Separate foreign select method from group name and collapse.
  3576. ;; If method contains a server, collapse to non-domain server name,
  3577. ;; otherwise collapse to select method.
  3578. (let* ((colon (string-match ":" group))
  3579. (server (and colon (substring group 0 colon)))
  3580. (plus (and server (string-match "+" server))))
  3581. (when server
  3582. (if plus
  3583. (setq foreign (substring server (+ 1 plus)
  3584. (string-match "\\." server))
  3585. group (substring group (+ 1 colon)))
  3586. (setq foreign server
  3587. group (substring group (+ 1 colon))))
  3588. (setq foreign (concat foreign ":")))
  3589. ;; Collapse group name leaving LEVELS uncollapsed elements
  3590. (let* ((slist (split-string group "/"))
  3591. (slen (length slist))
  3592. (dlist (split-string group "\\."))
  3593. (dlen (length dlist))
  3594. glist
  3595. glen
  3596. gsep
  3597. res)
  3598. (if (> slen dlen)
  3599. (setq glist slist
  3600. glen slen
  3601. gsep "/")
  3602. (setq glist dlist
  3603. glen dlen
  3604. gsep "."))
  3605. (setq levels (- glen levels))
  3606. (dolist (g glist)
  3607. (push (if (>= (decf levels) 0)
  3608. (if (zerop (length g))
  3609. ""
  3610. (substring g 0 1))
  3611. g)
  3612. res))
  3613. (concat foreign (mapconcat 'identity (nreverse res) gsep))))))
  3614. (defun gnus-narrow-to-body ()
  3615. "Narrow to the body of an article."
  3616. (narrow-to-region
  3617. (progn
  3618. (goto-char (point-min))
  3619. (or (search-forward "\n\n" nil t)
  3620. (point-max)))
  3621. (point-max)))
  3622. ;;;
  3623. ;;; Kill file handling.
  3624. ;;;
  3625. (defun gnus-apply-kill-file ()
  3626. "Apply a kill file to the current newsgroup.
  3627. Returns the number of articles marked as read."
  3628. (if (or (file-exists-p (gnus-newsgroup-kill-file nil))
  3629. (file-exists-p (gnus-newsgroup-kill-file gnus-newsgroup-name)))
  3630. (gnus-apply-kill-file-internal)
  3631. 0))
  3632. (defun gnus-kill-save-kill-buffer ()
  3633. (let ((file (gnus-newsgroup-kill-file gnus-newsgroup-name)))
  3634. (when (get-file-buffer file)
  3635. (with-current-buffer (get-file-buffer file)
  3636. (when (buffer-modified-p)
  3637. (save-buffer))
  3638. (kill-buffer (current-buffer))))))
  3639. (defcustom gnus-kill-file-name "KILL"
  3640. "Suffix of the kill files."
  3641. :group 'gnus-score-kill
  3642. :group 'gnus-score-files
  3643. :type 'string)
  3644. (defun gnus-newsgroup-kill-file (newsgroup)
  3645. "Return the name of a kill file name for NEWSGROUP.
  3646. If NEWSGROUP is nil, return the global kill file name instead."
  3647. (cond
  3648. ;; The global KILL file is placed at top of the directory.
  3649. ((or (null newsgroup)
  3650. (string-equal newsgroup ""))
  3651. (expand-file-name gnus-kill-file-name
  3652. gnus-kill-files-directory))
  3653. ;; Append ".KILL" to newsgroup name.
  3654. ((gnus-use-long-file-name 'not-kill)
  3655. (expand-file-name (concat (gnus-newsgroup-savable-name newsgroup)
  3656. "." gnus-kill-file-name)
  3657. gnus-kill-files-directory))
  3658. ;; Place "KILL" under the hierarchical directory.
  3659. (t
  3660. (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
  3661. "/" gnus-kill-file-name)
  3662. gnus-kill-files-directory))))
  3663. ;;; Server things.
  3664. (defun gnus-member-of-valid (symbol group)
  3665. "Find out if GROUP has SYMBOL as part of its \"valid\" spec."
  3666. (memq symbol (assoc
  3667. (symbol-name (car (gnus-find-method-for-group group)))
  3668. gnus-valid-select-methods)))
  3669. (defun gnus-method-option-p (method option)
  3670. "Return non-nil if select METHOD has OPTION as a parameter."
  3671. (when (stringp method)
  3672. (setq method (gnus-server-to-method method)))
  3673. (memq option (assoc (format "%s" (car method))
  3674. gnus-valid-select-methods)))
  3675. (defun gnus-similar-server-opened (method)
  3676. "Return non-nil if we have a similar server opened.
  3677. This is defined as a server with the same name, but different
  3678. parameters."
  3679. (let ((opened gnus-opened-servers)
  3680. open)
  3681. (while (and method opened)
  3682. (setq open (car (pop opened)))
  3683. ;; Type and name are the same...
  3684. (when (and (equal (car method) (car open))
  3685. (equal (cadr method) (cadr open))
  3686. ;; ... but the rest of the parameters differ.
  3687. (not (gnus-methods-sloppily-equal method open)))
  3688. (setq method nil)))
  3689. (not method)))
  3690. (defun gnus-server-extend-method (group method)
  3691. ;; This function "extends" a virtual server. If the server is
  3692. ;; "hello", and the select method is ("hello" (my-var "something"))
  3693. ;; in the group "alt.alt", this will result in a new virtual server
  3694. ;; called "hello+alt.alt".
  3695. (if (or (not (inline (gnus-similar-server-opened method)))
  3696. (not (cddr method)))
  3697. method
  3698. (let ((address-slot
  3699. (intern (format "%s-address" (car method)))))
  3700. (setq method
  3701. (if (assq address-slot (cddr method))
  3702. `(,(car method) ,(concat (cadr method) "+" group)
  3703. ,@(cddr method))
  3704. `(,(car method) ,(concat (cadr method) "+" group)
  3705. (,address-slot ,(cadr method))
  3706. ,@(cddr method))))
  3707. (push method gnus-extended-servers)
  3708. method)))
  3709. (defun gnus-server-status (method)
  3710. "Return the status of METHOD."
  3711. (nth 1 (assoc method gnus-opened-servers)))
  3712. (defun gnus-group-name-to-method (group)
  3713. "Guess a select method based on GROUP."
  3714. (if (string-match ":" group)
  3715. (let ((server (substring group 0 (match-beginning 0))))
  3716. (if (string-match "\\+" server)
  3717. (list (intern (substring server 0 (match-beginning 0)))
  3718. (substring server (match-end 0)))
  3719. (list (intern server) "")))
  3720. gnus-select-method))
  3721. (defun gnus-server-string (server)
  3722. "Return a readable string that describes SERVER."
  3723. (let* ((server (gnus-server-to-method server))
  3724. (address (nth 1 server)))
  3725. (if (and address
  3726. (not (zerop (length address))))
  3727. (format "%s using %s" address (car server))
  3728. (format "%s" (car server)))))
  3729. (defun gnus-same-method-different-name (method)
  3730. (let ((slot (intern (concat (symbol-name (car method)) "-address"))))
  3731. (unless (assq slot (cddr method))
  3732. (setq method
  3733. (append method (list (list slot (nth 1 method)))))))
  3734. (let ((methods gnus-extended-servers)
  3735. open found)
  3736. (while (and (not found)
  3737. (setq open (pop methods)))
  3738. (when (and (eq (car method) (car open))
  3739. (gnus-sloppily-equal-method-parameters method open))
  3740. (setq found open)))
  3741. found))
  3742. (defun gnus-find-method-for-group (group &optional info)
  3743. "Find the select method that GROUP uses."
  3744. (or gnus-override-method
  3745. (and (not group)
  3746. gnus-select-method)
  3747. (and (not (gnus-group-entry group))
  3748. ;; Killed or otherwise unknown group.
  3749. (or
  3750. ;; If we know a virtual server by that name, return its method.
  3751. (gnus-server-to-method (gnus-group-server group))
  3752. ;; Guess a new method as last resort.
  3753. (gnus-group-name-to-method group)))
  3754. (let ((info (or info (gnus-get-info group)))
  3755. method)
  3756. (if (or (not info)
  3757. (not (setq method (gnus-info-method info)))
  3758. (equal method "native"))
  3759. gnus-select-method
  3760. (setq method
  3761. (cond ((stringp method)
  3762. (inline (gnus-server-to-method method)))
  3763. ((stringp (cadr method))
  3764. (or
  3765. (inline
  3766. (gnus-same-method-different-name method))
  3767. (inline (gnus-server-extend-method group method))))
  3768. (t
  3769. method)))
  3770. (cond ((equal (cadr method) "")
  3771. method)
  3772. ((null (cadr method))
  3773. (list (car method) ""))
  3774. (t
  3775. (gnus-server-add-address method)))))))
  3776. (defun gnus-methods-using (feature)
  3777. "Find all methods that have FEATURE."
  3778. (let ((valids gnus-valid-select-methods)
  3779. outs)
  3780. (while valids
  3781. (when (memq feature (car valids))
  3782. (push (car valids) outs))
  3783. (setq valids (cdr valids)))
  3784. outs))
  3785. (autoload 'message-y-or-n-p "message" nil nil 'macro)
  3786. (defun gnus-read-group (prompt &optional default)
  3787. "Prompt the user for a group name.
  3788. Disallow invalid group names."
  3789. (let ((prefix "")
  3790. group)
  3791. (while (not group)
  3792. (when (string-match
  3793. gnus-invalid-group-regexp
  3794. (setq group (read-string (concat prefix prompt)
  3795. (cons (or default "") 0)
  3796. 'gnus-group-history)))
  3797. (let ((match (match-string 0 group)))
  3798. ;; Might be okay (e.g. for nnimap), so ask the user:
  3799. (unless (and (not (string-match "^$\\|:" match))
  3800. (message-y-or-n-p
  3801. "Proceed and create group anyway? " t
  3802. "The group name \"" group "\" contains a forbidden character: \"" match "\".
  3803. Usually, it's dangerous to create a group with this name, because it's not
  3804. supported by all back ends and servers. On IMAP servers it should work,
  3805. though. If you are really sure, you can proceed anyway and create the group.
  3806. You may customize the variable `gnus-invalid-group-regexp', which currently is
  3807. set to \"" gnus-invalid-group-regexp
  3808. "\", if you want to get rid of this query permanently."))
  3809. (setq prefix (format "Invalid group name: \"%s\". " group)
  3810. group nil)))))
  3811. group))
  3812. (defun gnus-read-method (prompt)
  3813. "Prompt the user for a method.
  3814. Allow completion over sensible values."
  3815. (let* ((open-servers
  3816. (mapcar (lambda (i) (cons (format "%s:%s" (caar i) (cadar i)) i))
  3817. gnus-opened-servers))
  3818. (valid-methods
  3819. (let (methods)
  3820. (dolist (method gnus-valid-select-methods)
  3821. (if (or (memq 'prompt-address method)
  3822. (not (assoc (format "%s:" (car method)) open-servers)))
  3823. (push method methods)))
  3824. methods))
  3825. (servers
  3826. (append valid-methods
  3827. open-servers
  3828. gnus-predefined-server-alist
  3829. gnus-server-alist))
  3830. (method
  3831. (gnus-completing-read
  3832. prompt (mapcar 'car servers)
  3833. t nil 'gnus-method-history)))
  3834. (cond
  3835. ((equal method "")
  3836. (setq method gnus-select-method))
  3837. ((assoc method gnus-valid-select-methods)
  3838. (let ((address (if (memq 'prompt-address
  3839. (assoc method gnus-valid-select-methods))
  3840. (read-string "Address: ")
  3841. "")))
  3842. (or (cadr (assoc (format "%s:%s" method address) open-servers))
  3843. (list (intern method) address))))
  3844. ((assoc method servers)
  3845. method)
  3846. (t
  3847. (list (intern method) "")))))
  3848. ;;; Agent functions
  3849. (defun gnus-agent-method-p (method-or-server)
  3850. "Say whether METHOD is covered by the agent."
  3851. (or (eq (car gnus-agent-method-p-cache) method-or-server)
  3852. (let* ((method (if (stringp method-or-server)
  3853. (gnus-server-to-method method-or-server)
  3854. method-or-server))
  3855. (server (gnus-method-to-server method t)))
  3856. (setq gnus-agent-method-p-cache
  3857. (cons method-or-server
  3858. (member server gnus-agent-covered-methods)))))
  3859. (cdr gnus-agent-method-p-cache))
  3860. (defun gnus-online (method)
  3861. (not
  3862. (if gnus-plugged
  3863. (eq (cadr (assoc method gnus-opened-servers)) 'offline)
  3864. (gnus-agent-method-p method))))
  3865. ;;; User-level commands.
  3866. ;;;###autoload
  3867. (defun gnus-slave-no-server (&optional arg)
  3868. "Read network news as a slave, without connecting to the local server."
  3869. (interactive "P")
  3870. (gnus-no-server arg t))
  3871. ;;;###autoload
  3872. (defun gnus-no-server (&optional arg slave)
  3873. "Read network news.
  3874. If ARG is a positive number, Gnus will use that as the startup
  3875. level. If ARG is nil, Gnus will be started at level 2. If ARG is
  3876. non-nil and not a positive number, Gnus will prompt the user for the
  3877. name of an NNTP server to use.
  3878. As opposed to `gnus', this command will not connect to the local
  3879. server."
  3880. (interactive "P")
  3881. (gnus-no-server-1 arg slave))
  3882. ;;;###autoload
  3883. (defun gnus-slave (&optional arg)
  3884. "Read news as a slave."
  3885. (interactive "P")
  3886. (gnus arg nil 'slave))
  3887. (defun gnus-delete-gnus-frame ()
  3888. "Delete gnus frame unless it is the only one.
  3889. Used for `gnus-exit-gnus-hook' in `gnus-other-frame'."
  3890. (when (and (frame-live-p gnus-other-frame-object)
  3891. (cdr (frame-list)))
  3892. (delete-frame gnus-other-frame-object))
  3893. (setq gnus-other-frame-object nil))
  3894. ;;;###autoload
  3895. (defun gnus-other-frame (&optional arg display)
  3896. "Pop up a frame to read news.
  3897. This will call one of the Gnus commands which is specified by the user
  3898. option `gnus-other-frame-function' (default `gnus') with the argument
  3899. ARG if Gnus is not running, otherwise pop up a Gnus frame and run the
  3900. command specified by `gnus-other-frame-resume-function'.
  3901. The optional second argument DISPLAY should be a standard display string
  3902. such as \"unix:0\" to specify where to pop up a frame. If DISPLAY is
  3903. omitted or the function `make-frame-on-display' is not available, the
  3904. current display is used."
  3905. (interactive "P")
  3906. (if (fboundp 'make-frame-on-display)
  3907. (unless display
  3908. (setq display (gnus-frame-or-window-display-name (selected-frame))))
  3909. (setq display nil))
  3910. (let ((alive (gnus-alive-p)))
  3911. (unless (and alive
  3912. (catch 'found
  3913. (walk-windows
  3914. (lambda (window)
  3915. (when (and (or (not display)
  3916. (equal display
  3917. (gnus-frame-or-window-display-name
  3918. window)))
  3919. (with-current-buffer (window-buffer window)
  3920. (string-match "\\`gnus-"
  3921. (symbol-name major-mode))))
  3922. (gnus-select-frame-set-input-focus
  3923. (setq gnus-other-frame-object (window-frame window)))
  3924. (select-window window)
  3925. (throw 'found t)))
  3926. 'ignore t)))
  3927. (gnus-select-frame-set-input-focus
  3928. (setq gnus-other-frame-object
  3929. (if display
  3930. (make-frame-on-display display gnus-other-frame-parameters)
  3931. (make-frame gnus-other-frame-parameters))))
  3932. (if alive
  3933. (progn (switch-to-buffer gnus-group-buffer)
  3934. (funcall gnus-other-frame-resume-function arg))
  3935. (funcall gnus-other-frame-function arg)
  3936. (add-hook 'gnus-exit-gnus-hook 'gnus-delete-gnus-frame)
  3937. ;; One might argue that `gnus-delete-gnus-frame' should not be called
  3938. ;; from `gnus-suspend-gnus-hook', but, on the other hand, one might
  3939. ;; argue that it should. No matter what you think, for the sake of
  3940. ;; those who want it to be called from it, please keep (defun
  3941. ;; gnus-delete-gnus-frame) even if you remove the next `add-hook'.
  3942. (add-hook 'gnus-suspend-gnus-hook 'gnus-delete-gnus-frame)))))
  3943. ;;;###autoload
  3944. (defun gnus (&optional arg dont-connect slave)
  3945. "Read network news.
  3946. If ARG is non-nil and a positive number, Gnus will use that as the
  3947. startup level. If ARG is non-nil and not a positive number, Gnus will
  3948. prompt the user for the name of an NNTP server to use."
  3949. (interactive "P")
  3950. ;; When using the development version of Gnus, load the gnus-load
  3951. ;; file.
  3952. (unless (string-match "^Gnus" gnus-version)
  3953. (load "gnus-load" nil t))
  3954. (unless (byte-code-function-p (symbol-function 'gnus))
  3955. (message "You should byte-compile Gnus")
  3956. (sit-for 2))
  3957. (let ((gnus-action-message-log (list nil)))
  3958. (gnus-1 arg dont-connect slave)
  3959. (gnus-final-warning)))
  3960. (declare-function debbugs-gnu "ext:debbugs-gnu"
  3961. (severities &optional packages archivedp suppress tags))
  3962. (defun gnus-list-debbugs ()
  3963. "List all open Gnus bug reports."
  3964. (interactive)
  3965. (require 'debbugs-gnu)
  3966. (debbugs-gnu nil "gnus"))
  3967. ;; Allow redefinition of Gnus functions.
  3968. (gnus-ems-redefine)
  3969. (provide 'gnus)
  3970. ;;; gnus.el ends here