sc.texi 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914
  1. \input texinfo @comment -*-texinfo-*-
  2. @comment 3.48
  3. @comment %**start of header (This is for running Texinfo on a region.)
  4. @setfilename ../../info/sc.info
  5. @settitle Supercite User's Manual
  6. @include docstyle.texi
  7. @iftex
  8. @finalout
  9. @end iftex
  10. @c @setchapternewpage odd % For book style double sided manual.
  11. @comment %**end of header (This is for running Texinfo on a region.)
  12. @copying
  13. This document describes Supercite, an Emacs package for citing and
  14. attributing replies to mail and news messages.
  15. Copyright @copyright{} 1993, 2001--2017 Free Software Foundation, Inc.
  16. @quotation
  17. Permission is granted to copy, distribute and/or modify this document
  18. under the terms of the GNU Free Documentation License, Version 1.3 or
  19. any later version published by the Free Software Foundation; with no
  20. Invariant Sections, with the Front-Cover Texts being ``A GNU Manual'',
  21. and with the Back-Cover Texts as in (a) below. A copy of the license
  22. is included in the section entitled ``GNU Free Documentation License''.
  23. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  24. modify this GNU manual.''
  25. @end quotation
  26. @end copying
  27. @c @smallbook
  28. @dircategory Emacs network features
  29. @direntry
  30. * SC: (sc). Supercite lets you cite parts of messages
  31. you're replying to, in flexible ways.
  32. @end direntry
  33. @titlepage
  34. @title Supercite User's Manual
  35. @subtitle cite and attribute mail and
  36. @subtitle news, in flexible ways
  37. @page
  38. @vskip 0pt plus 1filll
  39. @insertcopying
  40. @end titlepage
  41. @summarycontents
  42. @contents
  43. @ifnottex
  44. @node Top
  45. @top Supercite
  46. @insertcopying
  47. The manual is divided
  48. into the following chapters.
  49. @menu
  50. * Introduction::
  51. * Citations::
  52. * Information Keys and the Info Alist::
  53. * Reference Headers::
  54. * Getting Connected::
  55. * Replying and Yanking::
  56. * Selecting an Attribution::
  57. * Configuring the Citation Engine::
  58. * Post-yank Formatting Commands::
  59. * Hints to MUA Authors::
  60. * Thanks and History::
  61. * GNU Free Documentation License::
  62. * Concept Index::
  63. * Command Index::
  64. * Key Index::
  65. * Variable Index::
  66. @end menu
  67. @end ifnottex
  68. @node Introduction
  69. @chapter Introduction
  70. @cindex MUA
  71. @cindex NUA
  72. Supercite is a GNU Emacs package written entirely in Emacs Lisp. It
  73. interfaces to most of the commonly used Emacs mail user agents
  74. (@dfn{MUAs}) and news user agents (@dfn{NUAs}), and provides
  75. sophisticated facilities for the citing and attributing of message
  76. replies. Supercite has a very specific and limited role in the
  77. process of composing replies to both USENET network news and
  78. electronic mail.
  79. The preferred way to spell Supercite is with a capital @samp{S},
  80. lowercase @samp{upercite}.
  81. @menu
  82. * Usage Overview::
  83. * What Supercite Does Not Do::
  84. * What Supercite Does::
  85. @end menu
  86. @c FIXME: move it above the menu? --xfq
  87. Supercite is only useful in conjunction with MUAs and NUAs such as VM,
  88. Gnus, RMAIL, MH-E, etc. Supercite is typically called by the MUA after a
  89. reply buffer has been setup. Thereafter, Supercite's many commands and
  90. formatting styles are available in that reply buffer until the reply is
  91. sent. Supercite is re-initialized in each new reply buffer.
  92. @node Usage Overview
  93. @section Usage Overview
  94. @kindex r
  95. @kindex f
  96. @kindex C-c C-y
  97. @cindex yank
  98. @cindex cite, citing
  99. @cindex attribute, attributing
  100. Typical usage is as follows. You want to reply or followup to a
  101. message in your MUA@. You will probably hit @kbd{r} (i.e., ``reply'')
  102. or @kbd{f} (i.e., ``forward'') to begin composing the reply. In
  103. response, the MUA will create a reply buffer and initialize the
  104. outgoing mail headers appropriately. The body of the reply will
  105. usually be empty at this point. You now decide that you would like to
  106. include part of the original message in your reply. To do this, you
  107. @dfn{yank} the original message into the reply buffer, typically with
  108. a key stroke such as @kbd{C-c C-y}. This sequence will invoke an
  109. MUA-specific function which fills the body of the reply with the
  110. original message and then @dfn{attributes} this text to its author.
  111. This is called @dfn{citing} and its effect is to prefix every line
  112. from the original message with a special text tag. Most MUAs provide
  113. some default style of citing; by using Supercite you gain a wider
  114. flexibility in the look and style of citations. Supercite's only job
  115. is to cite the original message.
  116. @node What Supercite Does Not Do
  117. @section What Supercite Doesn't Do
  118. Because of this clear division of labor, there are useful features which
  119. are the sole responsibility of the MUA, even though it might seem that
  120. Supercite should provide them. For example, many people would like to
  121. be able to yank (and cite) only a portion of the original message.
  122. Since Supercite only modifies the text it finds in the reply buffer as
  123. set up by the MUA, it is the MUA's responsibility to do partial yanking.
  124. @xref{Reply Buffer Initialization}.
  125. @vindex mail-header-separator
  126. Another potentially useful thing would be for Supercite to set up the
  127. outgoing mail headers with information it gleans from the reply buffer.
  128. But by previously agreed upon convention, any text above the
  129. @code{mail-header-separator} which separates mail headers from message
  130. bodies cannot be modified by Supercite. Supercite, in fact, doesn't
  131. know anything about the meaning of these headers, and never ventures
  132. outside the designated region. @xref{Hints to MUA Authors}, for more
  133. details.
  134. @node What Supercite Does
  135. @section What Supercite Does
  136. @findex sc-cite-original
  137. Supercite is invoked for the first time on a reply buffer via your MUA's
  138. reply or forward command. This command will actually perform citations
  139. by calling a hook variable to which Supercite's top-level function
  140. @code{sc-cite-original} has been added. When @code{sc-cite-original} is
  141. executed, the original message must be set up in a very specific way,
  142. but this is handled automatically by the MUA@. @xref{Hints to MUA
  143. Authors}.
  144. @cindex info alist
  145. The first thing Supercite does, via @code{sc-cite-original}, is to parse
  146. through the original message's mail headers. It saves this data in an
  147. @dfn{information association list}, or @dfn{info alist}. The information
  148. in this list is used in a number of places throughout Supercite.
  149. @xref{Information Keys and the Info Alist}.
  150. @cindex nuking mail headers
  151. @cindex reference header
  152. After the mail header info is extracted, the headers are optionally
  153. removed (@dfn{nuked}) from the reply. Supercite then writes a
  154. @dfn{reference header} into the buffer. This reference header is a
  155. string carrying details about the citation it is about to perform.
  156. @cindex modeline
  157. Next, Supercite visits each line in the reply, transforming the line
  158. according to a customizable ``script''. Lines which were not previously
  159. cited in the original message are given a citation, while already cited
  160. lines remain untouched, or are coerced to your preferred style.
  161. Finally, Supercite installs a keymap into the reply buffer so that you
  162. have access to Supercite's post-yank formatting and reciting commands as
  163. you subsequently edit your reply. You can tell that Supercite has been
  164. installed into the reply buffer because that buffer's modeline will
  165. display the minor mode string @samp{SC}.
  166. @cindex filladapt
  167. @cindex gin-mode
  168. @vindex fill-prefix
  169. @findex fill-paragraph
  170. When the original message is cited by @code{sc-cite-original}, it will
  171. (optionally) be filled by Supercite. However, if you manually edit the
  172. cited text and want to re-fill it, you must use an add-on package such
  173. as @cite{filladapt} or @cite{gin-mode}. These packages can recognize
  174. Supercited text and will fill them appropriately. Emacs's built-in
  175. filling routines, e.g., @code{fill-paragraph}, do not recognize cited
  176. text and will not re-fill them properly because it cannot guess the
  177. @code{fill-prefix} being used.
  178. @xref{Post-yank Formatting Commands}, for details.
  179. As mentioned above, Supercite provides commands to recite or uncite
  180. regions of text in the reply buffer, and commands to perform other
  181. beautifications on the cited original text, maintaining consistent and
  182. informative citations throughout. Supercite tries to be as configurable
  183. as possible to allow for a wide range of personalized citation styles,
  184. but it is also immediately useful with the default configuration, once
  185. it has been properly connected to your MUA@. @xref{Getting Connected},
  186. for more details.
  187. @node Citations
  188. @chapter Citations
  189. @cindex nested citations
  190. @cindex citation
  191. A @dfn{citation} is the acknowledgment of the original author of a mail
  192. message in the body of the reply. There are two basic citation styles
  193. which Supercite supports. The first, called @dfn{nested citations} is
  194. an anonymous form of citation; in other words, an indication is made
  195. that the cited line was written by someone @emph{other} that the current
  196. message author (i.e., other than you, the person composing the reply),
  197. but no reference is made as to the identity of the original author.
  198. This style should look familiar since its use on the net is widespread.
  199. Here's an example of what a message buffer would look like using nested
  200. citations after multiple replies:
  201. @example
  202. >> John originally wrote this
  203. >> and this as well
  204. > Jane said that John didn't know
  205. > what he was talking about
  206. And that's what I think too.
  207. @end example
  208. @menu
  209. * Citation Elements::
  210. * Recognizing Citations::
  211. @end menu
  212. Note that multiple inclusions of the original messages result in a
  213. nesting of the @samp{@code{>}} characters. This can sometimes be quite
  214. confusing when many levels of citations are included since it may be
  215. difficult or impossible to figure out who actually participated in the
  216. thread, and multiple nesting of @samp{@code{>}} characters can sometimes
  217. make the message very difficult for the eye to scan.
  218. @cindex non-nested citations
  219. In @dfn{non-nested citations}, each cited line begins with an
  220. informative string attributing that line to the original author. Only
  221. the first level of attribution will be shown; subsequent citations
  222. don't nest the citation strings. The above dialog might look like
  223. this when non-nested citations are used:
  224. @example
  225. John> John originally wrote this
  226. John> and this as well
  227. Jane> Jane said that John didn't know
  228. Jane> what he was talking about
  229. And that's what I think too.
  230. @end example
  231. Notice here that my inclusion of Jane's inclusion of John's original
  232. message did not result in a line cited with @samp{Jane>John>}.
  233. @vindex sc-nested-citation-p
  234. @vindex nested-citation-p (sc-)
  235. Supercite supports both styles of citation, and the variable
  236. @code{sc-nested-citation-p} controls which style it will use when
  237. citing previously uncited text. When this variable is @code{nil} (the
  238. default), non-nested citations are used. When non-@code{nil}, nested
  239. citations are used.
  240. @node Citation Elements
  241. @section Citation Elements
  242. @cindex citation string
  243. @dfn{Citation strings} are composed of one or more elements.
  244. Non-nested citations are composed of four elements, three of which are
  245. directly user definable. The elements are concatenated together, in
  246. this order:
  247. @cindex citation leader
  248. @vindex citation-leader (sc-)
  249. @vindex sc-citation-leader
  250. @enumerate
  251. @item
  252. The @dfn{citation leader}. The citation leader is contained in the
  253. variable @code{sc-citation-leader}, and has the default value of a
  254. string containing four spaces.
  255. @cindex attribution string
  256. @item
  257. The @dfn{attribution string}. This element is supplied automatically by
  258. Supercite, based on your preferences and the original message's mail
  259. headers, though you may be asked to confirm Supercite's choice.
  260. @xref{Selecting an Attribution}, for more details.
  261. @cindex citation delimiter
  262. @vindex sc-citation-delimiter
  263. @vindex citation-delimiter (sc-)
  264. @item
  265. The @dfn{citation delimiter}. This string, contained in the variable
  266. @code{sc-citation-delimiter} visually separates the citation from the
  267. text of the line. This variable has a default value of @code{">"} and
  268. for best results, the string should consist of only a single character.
  269. @cindex citation separator
  270. @vindex citation-separator (sc-)
  271. @vindex sc-citation-separator
  272. @item
  273. The @dfn{citation separator}. The citation separator is contained in
  274. the variable @code{sc-citation-separator}, and has the default value of
  275. a string containing a single space.
  276. @end enumerate
  277. For example, suppose you were using the default values for the above
  278. variables, and Supercite provided the attribution string @samp{Jane}.
  279. In this case, the composed, non-nested citation string used might be
  280. something like
  281. @code{@asis{" Jane> "}}.
  282. This citation string will be inserted in front of
  283. every line in the original message that is not already cited.
  284. Nested citations, being simpler than non-nested citations, are composed
  285. of the same elements, sans the attribution string. Supercite is smart
  286. enough to not put additional spaces between citation delimiters for
  287. multi-level nested citations.
  288. @node Recognizing Citations
  289. @section Recognizing Citations
  290. Supercite also recognizes citations in the original article, and can
  291. transform these already cited lines in a number of ways. This is how
  292. Supercite suppresses the multiple citing of non-nested citations.
  293. Recognition of cited lines is controlled by variables analogous to
  294. those that make up the citation string as mentioned previously.
  295. @vindex sc-citation-leader-regexp
  296. @vindex citation-leader-regexp (sc-)
  297. @vindex sc-citation-delimiter-regexp
  298. @vindex citation-delimiter-regexp (sc-)
  299. @vindex sc-citation-separator-regexp
  300. @vindex citation-separator-regexp (sc-)
  301. @vindex sc-citation-root-regexp
  302. @vindex citation-root-regexp (sc-)
  303. @vindex sc-citation-nonnested-root-regexp
  304. @vindex citation-nonnested-root-regexp (sc-)
  305. The variable @code{sc-citation-leader-regexp} describes how citation
  306. leaders can look, by default it matches any number of spaces or tabs.
  307. Note that since the lisp function @code{looking-at} is used to do the
  308. matching, if you change this variable it need not start with a leading
  309. @code{"^"}.
  310. Similarly, the variables @code{sc-citation-delimiter-regexp} and
  311. @code{sc-citation-separator-regexp} respectively describe how citation
  312. delimiters and separators can look. They follow the same rule as
  313. @code{sc-citation-leader-regexp} above.
  314. When Supercite composes a citation string, it provides the attribution
  315. automatically. The analogous variable which handles recognition of the
  316. attribution part of citation strings is @code{sc-citation-root-regexp}.
  317. This variable describes the attribution root for both nested and
  318. non-nested citations. By default it can match zero-to-many alphanumeric
  319. characters (also ``.'', ``-'', and ``_''). But in some situations,
  320. Supercite has to determine whether it is looking at a nested or
  321. non-nested citation. Thus the variable
  322. @code{sc-citation-nonnested-root-regexp} is used to describe only
  323. non-nested citation roots. It is important to remember that if you
  324. change @code{sc-citation-root-regexp} you should always also change
  325. @code{sc-citation-nonnested-root-regexp}.
  326. @node Information Keys and the Info Alist
  327. @chapter Information Keys and the Info Alist
  328. @cindex information keys
  329. @cindex Info Alist
  330. @cindex information extracted from mail fields
  331. @findex sc-mail-field
  332. @findex mail-field (sc-)
  333. @dfn{Mail header information keys} are nuggets of information that
  334. Supercite extracts from the various mail headers of the original
  335. message, placed in the reply buffer by the MUA@. Information is kept
  336. in the @dfn{Info Alist} as key-value pairs, and can be retrieved for
  337. use in various places within Supercite, such as in header rewrite
  338. functions and attribution selection. Other bits of data, composed and
  339. created by Supercite, are also kept as key-value pairs in this alist.
  340. In the case of mail fields, the key is the name of the field, omitting
  341. the trailing colon. Info keys are always case insensitive (as are
  342. mail headers), and the value for a corresponding key can be retrieved
  343. from the alist with the @code{sc-mail-field} function. Thus, if the
  344. following fields were present in the original article:
  345. @example
  346. Date:@: 08 April 1991, 17:32:09 EST
  347. Subject:@: Better get out your asbestos suit
  348. @end example
  349. @vindex sc-mumble
  350. @vindex mumble (sc-)
  351. @noindent
  352. then, the following lisp constructs return:
  353. @example
  354. (sc-mail-field "date")
  355. ==> "08 April 1991, 17:32:09 EST"
  356. (sc-mail-field "subject")
  357. ==> "Better get out your asbestos suit"
  358. @end example
  359. Since the argument to @code{sc-mail-field} can be any string, it is
  360. possible that the mail field will not be present on the info alist
  361. (possibly because the mail header was not present in the original
  362. message). In this case, @code{sc-mail-field} will return the value of
  363. the variable @code{sc-mumble}.
  364. Supercite always places all mail fields found in the yanked original
  365. article into the info alist. If possible, Supercite will also places
  366. the following keys into the info alist:
  367. @table @code
  368. @cindex sc-attribution info field
  369. @cindex attribution info field (sc-)
  370. @item "sc-attribution"
  371. the selected attribution string.
  372. @cindex sc-citation info field
  373. @cindex citation info field (sc-)
  374. @item "sc-citation"
  375. the non-nested citation string.
  376. @cindex sc-from-address info field
  377. @cindex from-address info field (sc-)
  378. @item "sc-from-address"
  379. email address extracted from the @samp{From:@:} field.
  380. @cindex sc-reply-address info field
  381. @cindex reply-address info field (sc-)
  382. @item "sc-reply-address"
  383. email address extracted from the @samp{Reply-To:@:} field.
  384. @cindex sc-sender-address info field
  385. @cindex sender-address info field (sc-)
  386. @item "sc-sender-address"
  387. email address extracted from the @samp{Sender:@:} field.
  388. @cindex sc-emailname info field
  389. @cindex emailname info field (sc-)
  390. @item "sc-emailname"
  391. email terminus extracted from the @samp{From:@:} field.
  392. @cindex sc-initials info field
  393. @cindex initials info field (sc-)
  394. @item "sc-initials"
  395. the author's initials.
  396. @cindex sc-author info field
  397. @cindex author info field (sc-)
  398. @item "sc-author"
  399. the author's full name.
  400. @cindex sc-firstname info field
  401. @cindex firstname info field (sc-)
  402. @item "sc-firstname"
  403. the author's first name.
  404. @cindex sc-lastname info field
  405. @cindex lastname info field (sc-)
  406. @item "sc-lastname"
  407. the author's last name.
  408. @cindex sc-middlename-1 info field
  409. @cindex middlename-1 info field (sc-)
  410. @item "sc-middlename-1"
  411. the author's first middle name.
  412. @end table
  413. If the author's name has more than one middle name, they will appear as
  414. info keys with the appropriate index (e.g., @code{"sc-middlename-2"},
  415. @dots{}). @xref{Selecting an Attribution}.
  416. @node Reference Headers
  417. @chapter Reference Headers
  418. @cindex reference headers
  419. Supercite will insert an informative @dfn{reference header} at the
  420. beginning of the cited body of text, which display more detail about the
  421. original article and provides the mapping between the attribution and
  422. the original author in non-nested citations. Whereas the citation
  423. string usually only contains a portion of the original author's name,
  424. the reference header can contain such information as the author's full
  425. name, email address, the original article's subject, etc. In fact any
  426. information contained in the info alist can be inserted into a reference
  427. header.
  428. @menu
  429. * The Built-in Header Rewrite Functions::
  430. * Electric References::
  431. @end menu
  432. @cindex header rewrite functions
  433. @vindex sc-rewrite-header-list
  434. @vindex rewrite-header-list (sc-)
  435. There are a number of built-in @dfn{header rewrite functions} supplied
  436. by Supercite, but you can write your own custom header rewrite
  437. functions (perhaps using the built-in ones as examples). The variable
  438. @code{sc-rewrite-header-list} contains the list of such header rewrite
  439. functions. This list is consulted both when inserting the initial
  440. reference header, and when displaying @dfn{electric references}.
  441. @xref{Electric References}.
  442. @vindex sc-preferred-header-style
  443. @vindex preferred-header-style (sc-)
  444. When Supercite is initially run on a reply buffer (via
  445. @code{sc-cite-original}), it will automatically call one of these
  446. functions. The one it uses is defined in the variable
  447. @code{sc-preferred-header-style}. The value of this variable is an
  448. integer which is an index into the @code{sc-rewrite-header-list},
  449. beginning at zero.
  450. @node The Built-in Header Rewrite Functions
  451. @section The Built-in Header Rewrite Functions
  452. @cindex header rewrite functions, built-in
  453. Below are examples of the various built-in header rewrite functions.
  454. Please note the following: first, the text which appears in the
  455. examples below as @var{infokey} indicates that the corresponding value
  456. of the info key from the info alist will be inserted there.
  457. (@pxref{Information Keys and the Info Alist}). For example, in @code{sc-header-on-said}
  458. below, @var{date} and @var{from} correspond to the values of the
  459. @samp{Date:@:} and @samp{From:@:} mail headers respectively.
  460. @vindex sc-reference-tag-string
  461. @vindex reference-tag-string (sc-)
  462. Also, the string @code{">>>>>"} below is really the value of the
  463. variable @code{sc-reference-tag-string}. This variable is used in all
  464. built-in header rewrite functions, and you can customize its value to
  465. change the tag string globally.
  466. Finally, the references headers actually written may omit certain parts
  467. of the header if the info key associated with @var{infokey} is not
  468. present in the info alist. In fact, for all built-in headers, if the
  469. @samp{From:@:} field is not present in the mail headers, the entire
  470. reference header will be omitted (but this usually signals a serious
  471. problem either in your MUA or in Supercite's installation).
  472. @table @code
  473. @findex sc-no-header
  474. @findex no-header (sc-)
  475. @item sc-no-header
  476. This function produces no header. It should be used instead of
  477. @code{nil} to produce a blank header. This header can possibly
  478. contain a blank line after the @code{mail-header-separator} line.
  479. @item sc-no-blank-line-or-header
  480. @findex sc-no-blank-line-or-header
  481. @findex no-blank-line-or-header (sc-)
  482. This function is similar to @code{sc-no-header} except that any blank
  483. line after the @code{mail-header-separator} line will be removed.
  484. @item sc-header-on-said
  485. @findex sc-header-on-said
  486. @findex header-on-said (sc-)
  487. @code{>>>>> On @var{date}, @var{from} said:}
  488. @item sc-header-inarticle-writes
  489. @findex sc-header-inarticle-writes
  490. @findex header-inarticle-writes (sc-)
  491. @code{>>>>> In article @var{message-id}, @var{from} writes:}
  492. @item sc-header-regarding-adds
  493. @findex sc-header-regarding-adds
  494. @findex header-regarding-adds (sc-)
  495. @code{>>>>> Regarding @var{subject}; @var{from} adds:}
  496. @item sc-header-attributed-writes
  497. @findex sc-header-attributed-writes
  498. @findex header-attributed-writes (sc-)
  499. @code{>>>>> "@var{sc-attribution}" == @var{sc-author} <@var{sc-reply-address}> writes:}
  500. @item sc-header-author-writes
  501. @findex sc-header-author-writes
  502. @findex header-author-writes (sc-)
  503. @code{>>>>> @var{sc-author} writes:}
  504. @item sc-header-verbose
  505. @findex sc-header-verbose
  506. @findex header-verbose (sc-)
  507. @code{>>>>> On @var{date},}@*
  508. @code{>>>>> @var{sc-author}}@*
  509. @code{>>>>> from the organization of @var{organization}}@*
  510. @code{>>>>> who can be reached at:@: @var{sc-reply-address}}@*
  511. @code{>>>>> (whose comments are cited below with:@: "@var{sc-cite}")}@*
  512. @code{>>>>> had this to say in article @var{message-id}}@*
  513. @code{>>>>> in newsgroups @var{newsgroups}}@*
  514. @code{>>>>> concerning the subject of @var{subject}}@*
  515. @code{>>>>> see @var{references} for more details}
  516. @end table
  517. @node Electric References
  518. @section Electric References
  519. @cindex electric references
  520. By default, when Supercite cites the original message for the first
  521. time, it just goes ahead and inserts the reference header indexed by
  522. @code{sc-preferred-header-style}. However, you may want to select
  523. different reference headers based on the type of reply or forwarding
  524. you are doing. You may also want to preview the reference header
  525. before deciding whether to insert it into the reply buffer or
  526. not. Supercite provides an optional @dfn{electric reference} mode
  527. which you can drop into to give you this functionality.
  528. @vindex sc-electric-references-p
  529. @vindex electric-references-p (sc-)
  530. If the variable @code{sc-electric-references-p} is non-@code{nil},
  531. Supercite will bring up an electric reference mode buffer and place you
  532. into a recursive edit. The electric reference buffer is read-only, so
  533. you cannot directly modify the reference text until you exit electric
  534. references and insert the text into the reply buffer. But you can cycle
  535. through all the reference header rewrite functions in your
  536. @code{sc-rewrite-header-list}.
  537. You can also set a new preferred header style, jump to any header, or
  538. jump to the preferred header. The header will be shown in the electric
  539. reference buffer and the header index and function name will appear in
  540. the echo area.
  541. The following commands are available while in electric reference mode
  542. (shown here with their default key bindings):
  543. @table @asis
  544. @item @code{sc-eref-next} (@kbd{n})
  545. @findex sc-eref-next
  546. @findex eref-next (sc-)
  547. @kindex n
  548. @vindex sc-electric-circular-p
  549. @vindex electric-circular-p (sc-)
  550. Displays the next reference header in the electric reference buffer. If
  551. the variable @code{sc-electric-circular-p} is non-@code{nil}, invoking
  552. @code{sc-eref-next} while viewing the last reference header in the list
  553. will wrap around to the first header.
  554. @item @code{sc-eref-prev} (@kbd{p})
  555. @findex sc-eref-prev
  556. @findex eref-prev (sc-)
  557. @kindex p
  558. Displays the previous reference header in the electric reference buffer.
  559. If the variable @code{sc-electric-circular-p} is non-@code{nil},
  560. invoking @code{sc-eref-prev} will wrap around to the last header.
  561. @item @code{sc-eref-goto} (@kbd{g})
  562. @findex sc-eref-goto
  563. @findex eref-goto (sc-)
  564. @kindex g
  565. Goes to a specified reference header. The index (into the
  566. @code{sc-rewrite-header-list}) can be specified as a numeric argument to
  567. the command. Otherwise, Supercite will query you for the index in the
  568. minibuffer.
  569. @item @code{sc-eref-jump} (@kbd{j})
  570. @findex sc-eref-jump
  571. @findex eref-jump (sc-)
  572. @kindex j
  573. Display the preferred reference header, i.e., the one indexed by the current
  574. value of @code{sc-preferred-header-style}.
  575. @item @code{sc-eref-setn} (@kbd{s})
  576. @findex sc-eref-setn
  577. @findex eref-setn (sc-)
  578. @kindex s
  579. Set the preferred reference header (i.e.,
  580. @code{sc-preferred-header-style}) to the currently displayed header.
  581. @item @code{sc-eref-exit} (@kbd{C-j}, @key{RET}, and @key{ESC C-c})
  582. @kindex RET
  583. @kindex C-j
  584. @kindex q
  585. @findex sc-eref-exit
  586. @findex eref-exit (sc-)
  587. Exit from electric reference mode and insert the current header into the
  588. reply buffer.
  589. @item @code{sc-eref-abort} (@kbd{q}, @kbd{x})
  590. @findex sc-eref-abort
  591. @findex eref-abort (sc-)
  592. @kindex x
  593. Exit from electric reference mode without inserting the current header.
  594. @end table
  595. @vindex sc-electric-mode-hook
  596. @vindex electric-mode-hook (sc-)
  597. @noindent
  598. Supercite will execute the hook @code{sc-electric-mode-hook} before
  599. entering electric reference mode.
  600. @node Getting Connected
  601. @chapter Getting Connected
  602. @cindex citation interface specification
  603. @vindex mail-citation-hook
  604. @cindex .emacs file
  605. In most cases, all that is necessary to begin using Supercite is to add
  606. the following to @file{~.emacs}:
  607. @example
  608. (add-hook 'mail-citation-hook 'sc-cite-original)
  609. @end example
  610. @noindent For more details of the process, read on@dots{}
  611. Hitting @kbd{C-c C-y} in your MUA's reply buffer yanks and cites the
  612. original message into the reply buffer. In reality, the citation of the
  613. original message is performed via a call through a configurable hook
  614. variable. The name of this variable has been agreed to in advance as
  615. part of the @dfn{citation interface specification}. By default this
  616. hook variable has a @code{nil} value, which the MUA recognizes to mean,
  617. ``use your default citation function.'' When you add Supercite's
  618. citation function to the hook, thereby giving the variable a
  619. non-@code{nil} value, it tells the MUA to run the hook via
  620. @code{run-hooks} instead of using the default citation.
  621. Early in Supercite's development, the Supercite author, a few MUA
  622. authors, and some early Supercite users got together and agreed upon a
  623. standard interface between MUAs and citation packages (of which
  624. Supercite is currently the only known add-on @t{:-)}. Supercite can
  625. probably be used with most Emacs MUAs, with a greater or lesser degree
  626. of effort.
  627. To learn exactly how to connect Supercite to the software systems you
  628. are using, read the appropriate following sections. For details on the
  629. interface specifications, or if you are writing or maintaining an MUA,
  630. @pxref{Hints to MUA Authors}.
  631. @cindex autoload
  632. @cindex .emacs file
  633. @findex sc-cite-original
  634. @findex cite-original (sc-)
  635. The first thing that everyone should do, regardless of the MUA you are
  636. using is to set up Emacs so it will load Supercite at the appropriate
  637. time. This happens automatically if Supercite is distributed with your
  638. Emacs version. If not, you can set up an @dfn{autoload} for Supercite.
  639. To do the latter, put the following in your @file{.emacs} file:
  640. @example
  641. (autoload 'sc-cite-original "supercite" nil t)
  642. @end example
  643. @cindex point
  644. @cindex mark
  645. The function @code{sc-cite-original} is the top-level Supercite function
  646. designed to be run from the citation hook. It expects
  647. @samp{point} and @samp{mark} to be set around the region to cite, and it
  648. expects the original article's mail headers to be present within this
  649. region. Note that Supercite @emph{never} touches any text outside this
  650. region. Note further that the region need not be active
  651. for @code{sc-cite-original} to do its job.
  652. @xref{Hints to MUA Authors}.
  653. The other step in the getting connected process is to make sure your
  654. MUA calls @code{sc-cite-original} at the right time. As mentioned
  655. above, some MUAs handle this differently. Read the sections that follow
  656. pertaining to the MUAs you are using.
  657. @node Replying and Yanking
  658. @chapter Replying and Yanking
  659. This chapter explains what happens when you reply and yank an original
  660. message from an MUA.
  661. @menu
  662. * Reply Buffer Initialization::
  663. * Filling Cited Text::
  664. @end menu
  665. @node Reply Buffer Initialization
  666. @section Reply Buffer Initialization
  667. @findex sc-cite-original
  668. @findex cite-original (sc-)
  669. Executing @code{sc-cite-original} performs the following steps as it
  670. initializes the reply buffer:
  671. @enumerate
  672. @item
  673. @vindex sc-pre-hook
  674. @vindex pre-hook (sc-)
  675. @emph{Runs @code{sc-pre-hook}.}
  676. This hook variable is run before @code{sc-cite-original} does any other
  677. work. You could conceivably use this hook to set certain Supercite
  678. variables based on the reply buffer's mode or name (i.e., to do
  679. something different based on whether you are replying or following up to
  680. an article).
  681. @item
  682. @emph{Inserts Supercite's keymap.}
  683. @vindex sc-mode-map-prefix
  684. @vindex mode-map-prefix (sc-)
  685. @kindex C-c C-p
  686. @cindex keymap prefix
  687. Supercite provides a number of commands for performing post-yank
  688. modifications to the reply buffer. These commands are installed on
  689. Supercite's top-level keymap. Since Supercite has to interface with a
  690. wide variety of MUAs, it does not install all of its commands directly
  691. into the reply buffer's keymap. Instead, it puts its commands on a
  692. keymap prefix, then installs this prefix onto the buffer's keymap. What
  693. this means is that you typically have to type more characters to invoke
  694. a Supercite command, but Supercite's key bindings can be made much more
  695. consistent across MUAs.
  696. You can control what key Supercite uses as its keymap prefix by changing
  697. the variable @code{sc-mode-map-prefix}. By default, this variable is
  698. set to @code{C-c C-p}; a finger twister perhaps, but unfortunately the
  699. best default due to the scarcity of available key bindings in many MUAs.
  700. @item
  701. @emph{Turns on Supercite minor mode.}
  702. @cindex modeline
  703. The modeline of the reply buffer should indicate that Supercite is
  704. active in that buffer by displaying the string @samp{SC}.
  705. @item
  706. @emph{Sets the ``Undo Boundary.''}
  707. @cindex undo boundary
  708. Supercite sets an undo boundary before it begins to modify the original
  709. yanked text. This allows you to easily undo Supercite's changes to
  710. affect alternative citing styles.
  711. @item
  712. @emph{Processes the mail headers.}
  713. @vindex sc-confirm-always-p
  714. @vindex confirm-always-p (sc-)
  715. @vindex sc-mail-warn-if-non-rfc822-p
  716. @vindex mail-warn-if-non-rfc822-p (sc-)
  717. All previously retrieved info key-value pairs are deleted from the info
  718. alist, then the mail headers in the body of the yanked message are
  719. scanned. Info key-value pairs are created for each header found. Also,
  720. such useful information as the author's name and email address are
  721. extracted. If the variable @code{sc-mail-warn-if-non-rfc822-p} is
  722. non-@code{nil}, then Supercite will warn you if it finds a mail header
  723. that does not conform to RFC822. This is rare and indicates a problem
  724. either with your MUA or the original author's MUA, or some MTA (mail
  725. transport agent) along the way.
  726. @vindex sc-nuke-mail-headers
  727. @vindex sc-nuke-mail-header-list
  728. @vindex nuke-mail-headers (sc-)
  729. @vindex nuke-mail-header-list (sc-)
  730. Once the info keys have been extracted from the mail headers, the
  731. headers are nuked from the reply buffer. You can control exactly which
  732. headers are removed or kept, but by default, all headers are removed.
  733. There are two variables which control mail header nuking. The variable
  734. @code{sc-nuke-mail-headers} controls the overall behavior of the header
  735. nuking routines. By setting this variable to @code{'all}, you
  736. automatically nuke all mail headers. Likewise, setting this variable to
  737. @code{'none} inhibits nuking of any mail headers. In between these
  738. extremes, you can tell Supercite to nuke only a specified list of mail
  739. headers by setting this variable to @code{'specified}, or to keep only a
  740. specified list of headers by setting it to @code{'keep}.
  741. If @code{sc-nuke-mail-headers} is set to @code{'specified} or
  742. @code{'keep}, then the variable @code{sc-nuke-mail-header-list} is
  743. consulted for the list of headers to nuke or keep. This variable
  744. contains a list of regular expressions. If the mail header line matches
  745. a regular expression in this list, the header will be nuked or kept.
  746. The line is matched against the regexp using @code{looking-at} rooted at
  747. the beginning of the line.
  748. @vindex sc-blank-lines-after-headers
  749. @vindex blank-lines-after-headers (sc-)
  750. If the variable @code{sc-blank-lines-after-headers} is non-@code{nil},
  751. it contains the number of blank lines remaining in the buffer after mail
  752. headers are nuked. By default, only one blank line is left in the buffer.
  753. @item
  754. @emph{Selects the attribution and citation strings.}
  755. Once the mail headers have been processed, Supercite selects a
  756. attribution string and a citation string which it will use to cite the
  757. original message. @xref{Selecting an Attribution}, for details.
  758. @item
  759. @emph{Cites the message body.}
  760. @vindex sc-cite-region-limit
  761. @vindex cite-region-limit (sc-)b
  762. After the selection of the attribution and citation strings, Supercite
  763. cites the original message by inserting the citation string prefix in
  764. front of every uncited line. You may not want Supercite to
  765. automatically cite very long messages however. For example, some email
  766. could contain a smaller header section followed by a huge uuencoded
  767. message. It wouldn't make sense to cite the uuencoded message part when
  768. responding to the original author's short preface. For this reason,
  769. Supercite provides a variable which limits the automatic citation of
  770. long messages to a certain maximum number of lines. The variable is
  771. called @code{sc-cite-region-limit}. If this variable contains an
  772. integer, messages with more lines that this will not be cited at all,
  773. and a warning message will be displayed. Supercite has performed
  774. everything necessary, though, for you to manually cite only the small
  775. portion of the original message that you want to use.
  776. If @code{sc-cite-region-limit} contains a non-@code{nil} value, the
  777. original message will always be cited, regardless of its size. If the
  778. variable contains the value @code{nil}, the region will never be cited
  779. automatically. Use this if you always want to be able to edit and cite
  780. the message manually.
  781. @vindex sc-cite-blank-lines-p
  782. @vindex cite-blank-lines-p (sc-)
  783. The variable @code{sc-cite-blank-lines-p} controls whether blank lines
  784. in the original message should be cited or not. If this variable is
  785. non-@code{nil}, blank lines will be cited just like non-blank lines.
  786. Otherwise, blank lines will be treated as paragraph separators.
  787. Citing of the original message is highly configurable. Supercite's
  788. default setup does a pretty good job of citing many common forms of
  789. previously cited messages. But there are as many citation styles out
  790. there as people on the net, or just about! It would be impossible for
  791. Supercite to anticipate every style in existence, and you probably
  792. wouldn't encounter them all anyway. But you can configure Supercite to
  793. recognize those styles you see often.
  794. @xref{Configuring the Citation Engine}, for details.
  795. @item
  796. @emph{Runs @code{sc-post-hook}.}
  797. @vindex sc-post-hook
  798. @vindex post-hook (sc-)
  799. This variable is very similar to @code{sc-pre-hook}, except that it runs
  800. after @code{sc-cite-original} is finished. This hook is provided mostly
  801. for completeness and backward compatibility. Perhaps it could be used to
  802. reset certain variables set in @code{sc-pre-hook}.
  803. @end enumerate
  804. @node Filling Cited Text
  805. @section Filling Cited Text
  806. @cindex filling paragraphs
  807. @vindex sc-auto-fill-region-p
  808. @vindex auto-fill-region-p (sc-)
  809. @cindex filladapt
  810. @cindex gin-mode
  811. @findex sc-setup-filladapt
  812. @findex setup-filladapt (sc-)
  813. Supercite will automatically fill newly cited text from the original
  814. message unless the variable @code{sc-auto-fill-region-p} has a
  815. @code{nil} value. Supercite will also re-fill paragraphs when you
  816. manually cite or re-cite text.
  817. However, during normal editing, Supercite itself cannot be used to fill
  818. paragraphs. This is a change from version 2. There are other add-on
  819. lisp packages which do filling much better than Supercite ever did. The
  820. two best known are @dfn{filladapt} and @dfn{gin-mode}. Both work well
  821. with Supercite and both are available at the normal Emacs Lisp archive
  822. sites. @dfn{gin-mode} works pretty well out of the box, but if you use
  823. @dfn{filladapt}, you may want to run the function
  824. @code{sc-setup-filladapt} after loading @file{supercite}
  825. (e.g., using @code{with-eval-after-load}). This simply
  826. makes @dfn{filladapt} a little more Supercite savvy than its default
  827. setup.
  828. @vindex sc-fixup-whitespace-p
  829. @vindex fixup-whitespace-p (sc-)
  830. Also, Supercite will collapse leading whitespace between the citation
  831. string and the text on a line when the variable
  832. @code{sc-fixup-whitespace-p} is non-@code{nil}. The default value for
  833. this variable is @code{nil}.
  834. @vindex fill-prefix
  835. Its important to understand that Supercite's automatic filling (during
  836. the initial citation of the reply) is very fragile. That is because
  837. figuring out the @code{fill-prefix} for a particular paragraph is a
  838. really hard thing to do automatically. This is especially the case when
  839. the original message contains code or some other text where leading
  840. whitespace is important to preserve. For this reason, many Supercite
  841. users typically run with @code{sc-auto-fill-region-p} (and possibly also
  842. @code{sc-fixup-whitespace-p}) set to @code{nil}. They then manually
  843. fill each cited paragraph in the reply buffer.
  844. I usually run with both these variables containing their default values.
  845. When Supercite's automatic filling breaks on a particular message, I
  846. will use Emacs's undo feature to undo back before the citation was
  847. applied to the original message. Then I'll toggle the variables and
  848. manually cite those paragraphs that I don't want to fill or collapse
  849. whitespace on. @xref{Variable Toggling Shortcuts}.
  850. @kindex C-c C-p C-p
  851. If you find that Supercite's automatic filling is just too fragile for
  852. your tastes, you might consider one of these alternate approaches.
  853. Also, to make life easier, a shortcut function to toggle the state of
  854. both of these variables is provided on the key binding
  855. @kbd{C-c C-p C-p} (with the default value of @code{sc-mode-map-prefix};
  856. @pxref{Post-yank Formatting Commands}).
  857. You will noticed that the minor mode string will
  858. show the state of these variables as qualifier characters. When both
  859. variables are @code{nil}, the Supercite minor mode string will display
  860. @samp{SC}. When just @code{sc-auto-fill-region-p} is non-@code{nil}, the
  861. string will display @samp{SC:f}, and when just
  862. @code{sc-fixup-whitespace-p} is non-@code{nil}, the string will display
  863. @samp{SC:w}. When both variables are non-@code{nil}, the string will
  864. display @samp{SC:fw}. Note that the qualifiers chosen are mnemonics for
  865. the default bindings of the toggling function for each respective
  866. variable.
  867. @xref{Variable Toggling Shortcuts}.
  868. Why are these variables not set to @code{nil} by default? It is because
  869. many users won't manually fill paragraphs that are Supercited, and there
  870. have been widespread complaints on the net about mail and news messages
  871. containing lines greater than about 72 characters. So the default is to
  872. fill cited text.
  873. @node Selecting an Attribution
  874. @chapter Selecting an Attribution
  875. @cindex attribution list
  876. @vindex sc-preferred-attribution-list
  877. @vindex preferred-attribution-list (sc-)
  878. As you know, the attribution string is the part of the author's name
  879. that will be used to composed a non-nested citation string. Supercite
  880. scans the various mail headers present in the original article and uses
  881. a number of heuristics to extract strings which it puts into the
  882. @dfn{attribution association list} or @dfn{attribution alist}. This is
  883. analogous, but different than, the info alist previously mentioned. Each
  884. element in the attribution alist is a key-value pair containing such
  885. information as the author's first name, middle names, and last name, the
  886. author's initials, and the author's email terminus.
  887. @menu
  888. * Attribution Preferences::
  889. * Anonymous Attributions::
  890. * Author Names::
  891. @end menu
  892. @node Attribution Preferences
  893. @section Attribution Preferences
  894. When you cite an original message, you can tell Supercite which part of
  895. the author's name you would prefer it to use as the attribution. The
  896. variable @code{sc-preferred-attribution-list} controls this; it contains
  897. keys which are matched against the attribution alist in the given order.
  898. The first value of a key that produces a non-@code{nil}, non-empty
  899. string match is used as the attribution string, and if no keys match, a
  900. secondary mechanism is used to generate the attribution.
  901. @xref{Anonymous Attributions}.
  902. The following preferences are always available in the attribution alist
  903. (barring error):
  904. @table @code
  905. @item "emailname"
  906. the author's email terminus.
  907. @item "initials"
  908. the author's initials.
  909. @item "firstname"
  910. the author's first name.
  911. @item "lastname"
  912. the author's last name.
  913. @item "middlename-1"
  914. the author's first middle name.
  915. @item "sc-lastchoice"
  916. the last attribution string you have selected. This is useful when you
  917. recite paragraphs in the reply.
  918. @item "sc-consult"
  919. @vindex sc-attrib-selection-list
  920. @vindex attrib-selection-list (sc-)
  921. consults the customizable list @code{sc-attrib-selection-list} which can
  922. be used to select special attributions based on the value of any info
  923. key. See below for details.
  924. @item "x-attribution"
  925. the original author's suggestion for attribution string choice. See below
  926. for details.
  927. @end table
  928. Middle name indexes can be any positive integer greater than zero,
  929. though it is unlikely that many authors will have more than one middle
  930. name, if that many.
  931. At this point, let me digress into a discussion of etiquette. It is my
  932. belief that while the style of the citations is a reflection of the
  933. personal tastes of the replier (i.e., you), the attribution selection is
  934. ultimately the personal choice of the original author. In a sense it is
  935. his or her ``net nickname'', and therefore the author should have some
  936. say in the selection of attribution string. Imagine how you would feel
  937. if someone gave you a nickname that you didn't like?
  938. For this reason, Supercite recognizes a special mail header,
  939. @samp{X-Attribution:}, which if present, tells Supercite the attribution
  940. string preferred by the original author. It is the value of this header
  941. that is associated with the @code{"x-attribution"} key in the
  942. attribution alist. Currently, you can override the preference of this
  943. key by changing @code{sc-preferred-attribution-list}, but that isn't
  944. polite, and in the future Supercite may hard-code this. For now, it is
  945. suggested that if you change the order of the keys in this list, that
  946. @code{"x-attribution"} always be first, or possible second behind only
  947. @code{"sc-lastchoice"}. This latter is the default.
  948. @vindex sc-attrib-selection-list
  949. @vindex attrib-selection-list (sc-)
  950. The value @code{"sc-consult"} in @code{sc-preferred-attribution-list}
  951. has a special meaning during attribution selection. When Supercite
  952. encounters this preference, it begins processing a customizable list of
  953. attributions, contained in the variable @code{sc-attrib-selection-list}.
  954. Each element in this list contains lists of the following form:
  955. @example
  956. @group
  957. (@var{infokey} ((@var{regexp} . @var{attribution})
  958. (@var{regexp} . @var{attribution})
  959. (@dots{})))
  960. @end group
  961. @end example
  962. @noindent
  963. @findex sc-mail-field
  964. @findex mail-field (sc-)
  965. where @var{infokey} is a key for @code{sc-mail-field} and @var{regexp}
  966. is a regular expression to match against the @var{infokey}'s value. If
  967. @var{regexp} matches the @var{infokey}'s value, the @var{attribution} is
  968. used as the attribution string. Actually, @var{attribution} can be a
  969. string or a list; if it is a list, it is @code{eval}uated and the return
  970. value (which must be a string), is used as the attribution.
  971. This can be very useful for when you are replying to net acquaintances
  972. who do not use the @samp{X-Attribution:@:} mail header. You may know
  973. what nickname they would prefer to use, and you can set up this list to
  974. match against a specific mail field, e.g., @samp{From:@:}, allowing you
  975. to cite your friend's message with the appropriate attribution.
  976. @node Anonymous Attributions
  977. @section Anonymous Attributions
  978. @vindex sc-default-author-name
  979. @vindex default-author-name (sc-)
  980. @vindex sc-default-attribution
  981. @vindex default-attribution (sc-)
  982. When the author's name cannot be found in the @samp{From:@:} mail
  983. header, a fallback author name and attribution string must be supplied.
  984. The fallback author name is contained in the variable
  985. @code{sc-default-author-name} and the fallback attribution string is
  986. contained in the variable @code{sc-default-attribution}. Default values
  987. for these variables are @code{"Anonymous"} and @code{"Anon"},
  988. respectively. Note that in most circumstances, getting the default
  989. author name or attribution is a sign that something is set up
  990. incorrectly.
  991. @vindex sc-use-only-preference-p
  992. @vindex use-only-preference-p (sc-)
  993. Also, if the preferred attribution, which you specified in your
  994. @code{sc-preferred-attribution-list} variable cannot be found, a
  995. secondary method can be employed to find a valid attribution string. The
  996. variable @code{sc-use-only-preference-p} controls what happens in this
  997. case. If the variable's value is non-@code{nil}, then
  998. @code{sc-default-author-name} and @code{sc-default-attribution} are
  999. used, otherwise, the following steps are taken to find a valid
  1000. attribution string, and the first step to return a non-@code{nil},
  1001. non-empty string becomes the attribution:
  1002. @enumerate
  1003. @item
  1004. Use the last selected attribution, if there is one.
  1005. @item
  1006. Use the value of the @code{"x-attribution"} key.
  1007. @item
  1008. Use the author's first name.
  1009. @item
  1010. Use the author's last name.
  1011. @item
  1012. Use the author's initials.
  1013. @item
  1014. Find the first non-@code{nil}, non-empty attribution string in the
  1015. attribution alist.
  1016. @item
  1017. @code{sc-default-attribution} is used.
  1018. @end enumerate
  1019. @vindex sc-confirm-always-p
  1020. @vindex confirm-always-p (sc-)
  1021. Once the attribution string has been automatically selected, a number of
  1022. things can happen. If the variable @code{sc-confirm-always-p} is
  1023. non-@code{nil}, you are queried for confirmation of the chosen
  1024. attribution string. The possible values for completion are those strings
  1025. in the attribution alist, however you are not limited to these choices.
  1026. You can type any arbitrary string at the confirmation prompt. The string
  1027. you enter becomes the value associated with the @code{"sc-lastchoice"}
  1028. key in the attribution alist.
  1029. @vindex sc-downcase-p
  1030. @vindex downcase-p (sc-)
  1031. Once an attribution string has been selected, Supercite will force the
  1032. string to lower case if the variable @code{sc-downcase-p} is
  1033. non-@code{nil}.
  1034. @vindex sc-attribs-preselect-hook
  1035. @vindex attribs-preselect-hook (sc-)
  1036. @vindex sc-attribs-postselect-hook
  1037. @vindex attribs-postselect-hook (sc-)
  1038. Two hook variables provide even greater control of the attribution
  1039. selection process. The hook @code{sc-attribs-preselect-hook} is run
  1040. before any attribution is selected. Likewise, the hook
  1041. @code{sc-attribs-postselect-hook} is run after the attribution is
  1042. selected (and the corresponding citation string is built), but before
  1043. these values are committed for use by Supercite. During the
  1044. post-selection hook, the local variables @code{attribution} and
  1045. @code{citation} are bound to the appropriate strings. By changing these
  1046. variables in your hook functions, you change the attribution and
  1047. citation strings used by Supercite. One possible use of this would be
  1048. to override any automatically derived attribution string when it is only
  1049. one character long; e.g., you prefer to use @code{"initials"} but the
  1050. author only has one name.
  1051. @node Author Names
  1052. @section Author Names
  1053. @cindex author names
  1054. Supercite employs a number of heuristics to decipher the author's name
  1055. based on value of the @samp{From:@:} mail field of the original message.
  1056. Supercite can recognize almost all of the common @samp{From:@:} field
  1057. formats in use. If you encounter a @samp{From:@:} field that Supercite
  1058. cannot parse, please report this bug using @kbd{M-x report-emacs-bug}.
  1059. @vindex sc-titlecue-regexp
  1060. @vindex titlecue-regexp (sc-)
  1061. There are a number of Supercite variables that control how author names
  1062. are extracted from the @samp{From:@:} header. Some headers may contain a
  1063. descriptive title as in:
  1064. @example
  1065. From:@: computer!speedy!doe (John Xavier-Doe -- Decent Hacker)
  1066. @end example
  1067. Supercite knows which part of the @samp{From:@:} header is email address
  1068. and which part is author name, but in this case the string @code{"Decent
  1069. Hacker"} is not part of the author's name. You can tell Supercite to
  1070. ignore the title, while still recognizing hyphenated names through the
  1071. use of a regular expression in the variable @code{sc-titlecue-regexp}.
  1072. This variable has the default value of @code{"\\\\s +-+\\\\s +"}. Any
  1073. text after this regexp is encountered is ignored as noise.
  1074. @vindex sc-name-filter-alist
  1075. @vindex name-filter-alist (sc-)
  1076. Some @samp{From:@:} headers may contain extra titles in the name fields
  1077. not separated by a title cue, but which are nonetheless not part of the
  1078. author's name proper. Examples include the titles ``Dr.'', ``Mr.'',
  1079. ``Ms.'', ``Jr.'', ``Sr.'', and ``III'' (e.g., Thurston Howe, the Third).
  1080. Also, some companies prepend or append the name of the division,
  1081. organization, or project on the author's name. All of these titles are
  1082. noise which should be ignored. The variable @code{sc-name-filter-alist}
  1083. is used for this purpose. As implied by its name, this variable is an
  1084. association list, where each element is a cons cell of the form:
  1085. @example
  1086. (@var{regexp} . @var{position})
  1087. @end example
  1088. @noindent
  1089. where @var{regexp} is a regular expression that is matched (using
  1090. @code{string-match}) against each element of the @samp{From:@:} field's
  1091. author name. @var{position} is a position indicator, starting at zero.
  1092. Thus to strip out all titles of ``Dr.'', ``Mr.'', etc. from the name,
  1093. @code{sc-name-filter-alist} would have an entry such as:
  1094. @example
  1095. ("^\\(Mr\\|Mrs\\|Ms\\|Dr\\)[.]?$" . 0)
  1096. @end example
  1097. @noindent
  1098. which only removes them if they appear as the first word in the name.
  1099. The position indicator is an integer, or one of the two special symbols
  1100. @code{last} or @code{any}. @code{last} always matches against the last
  1101. word in the name field, while @code{any} matches against every word in
  1102. the name field.
  1103. @node Configuring the Citation Engine
  1104. @chapter Configuring the Citation Engine
  1105. @cindex Regi
  1106. @cindex frames (Regi)
  1107. @cindex entries (Regi)
  1108. At the heart of Supercite is a regular expression interpreting engine
  1109. called @dfn{Regi}. Regi operates by interpreting a data structure
  1110. called a Regi-frame (or just @dfn{frame}), which is a list of
  1111. Regi-entries (or just @dfn{entry}). Each entry contains a predicate,
  1112. typically a regular expression, which is matched against a line of text
  1113. in the current buffer. If the predicate matches true, an associated
  1114. expression is @code{eval}uated. In this way, an entire region of text
  1115. can be transformed in an @emph{awk}-like manner. Regi is used
  1116. throughout Supercite, from mail header information extraction, to header
  1117. nuking, to citing text.
  1118. @menu
  1119. * Using Regi::
  1120. * Frames You Can Customize::
  1121. @end menu
  1122. While the details of Regi are discussed below (@pxref{Using Regi}), only
  1123. those who wish to customize certain aspects of Supercite need concern
  1124. themselves with it. It is important to understand though, that any
  1125. conceivable citation style that can be described by a regular expression
  1126. can be recognized by Supercite. This leads to some interesting
  1127. applications. For example, if you regularly receive email from a
  1128. co-worker that uses an uncommon citation style (say one that employs a
  1129. @samp{|} or @samp{@}} character at the front of the line), it is
  1130. possible for Supercite to recognize this and @emph{coerce} the citation
  1131. to your preferred style, for consistency. In theory, it is possible for
  1132. Supercite to recognize such things as uuencoded messages or C code and
  1133. cite or fill those differently than normal text. None of this is
  1134. currently part of Supercite, but contributions are welcome!
  1135. @node Using Regi
  1136. @section Using Regi
  1137. @findex regi-interpret
  1138. @findex eval
  1139. @findex looking-at
  1140. Regi works by interpreting frames with the function
  1141. @code{regi-interpret}. A frame is a list of arbitrary size where each
  1142. element is a entry of the following form:
  1143. @example
  1144. (@var{pred} @var{func} [@var{negate-p} [@var{case-fold-search}]])
  1145. @end example
  1146. Regi starts with the first entry in a frame, evaluating the @var{pred}
  1147. of that entry against the beginning of the line that @samp{point} is on.
  1148. If the @var{pred} evaluates to true (or false if the optional
  1149. @var{negate-p} is non-@code{nil}), then the @var{func} for that entry is
  1150. @code{eval}uated. How processing continues is determined by the return
  1151. value for @var{func}, and is described below. If @var{pred} was false
  1152. the next entry in the frame is checked until all entries have been
  1153. matched against the current line. If no entry matches, @samp{point} is
  1154. moved forward one line and the frame is reset to the first entry.
  1155. @var{pred} can be a string, a variable, a list or one of the following
  1156. symbols: @code{t}, @code{begin}, @code{end}, or @code{every}. If
  1157. @var{pred} is a string, or a variable or list that @code{eval}uates to a
  1158. string, it is interpreted as a regular expression. This regexp is
  1159. matched against the current line, from the beginning, using
  1160. @code{looking-at}. This match folds case if the optional
  1161. @var{case-fold-search} is non-@code{nil}. If @var{pred} is not a
  1162. string, or does not @code{eval}uate to a string, it is interpreted as a
  1163. binary value (@code{nil} or non-@code{nil}).
  1164. The four special symbol values for @var{pred} are recognized:
  1165. @table @code
  1166. @item t
  1167. Always produces a true outcome.
  1168. @item begin
  1169. Always executed before the frame is interpreted. This can be used to
  1170. initialize some global variables for example.
  1171. @item end
  1172. Always executed after frame interpreting is completed. This can be used
  1173. to perform any necessary post-processing.
  1174. @item every
  1175. Executes whenever the frame is reset, usually after the entire frame has
  1176. been matched against the current line.
  1177. @end table
  1178. Note that @var{negate-p} and @var{case-fold-search} are ignored if
  1179. @var{pred} is one of these special symbols. Only the first occurrence of
  1180. each symbol in a frame is used; any duplicates are ignored. Also
  1181. note that for performance reasons, the entries associated with these
  1182. symbols are removed from the frame during the main interpreting loop.
  1183. Your @var{func} can return certain values which control continued Regi
  1184. processing. By default, if your @var{func} returns @code{nil} (as it
  1185. should be careful to do explicitly), Regi will reset the frame to the
  1186. first entry, and advance @samp{point} to the beginning of the next line.
  1187. If a list is returned from your function, it can contain any combination
  1188. of the following elements:
  1189. @table @asis
  1190. @item the symbol @code{continue}
  1191. This tells Regi to continue processing entries after a match, instead of
  1192. resetting the frame and moving @samp{point}. In this way, lines of text
  1193. can have multiple matches, but you have to be careful to avoid entering
  1194. infinite loops.
  1195. @item the symbol @code{abort}
  1196. This tells Regi to terminate frame processing. However, any @code{end}
  1197. entry is still processed.
  1198. @item the list @code{(frame . @var{newframe})}
  1199. This tells Regi to substitute @var{newframe} as the frame it is
  1200. interpreting. In other words, your @var{func} can modify the Regi frame
  1201. on the fly. @var{newframe} can be a variable containing a frame, or it
  1202. can be the frame in-lined.
  1203. @item the list @code{(step . @var{step})}
  1204. Tells Regi to move @var{step} number of lines forward as it continues
  1205. processing. By default, Regi moves forward one line. @var{step} can be
  1206. zero or negative of course, but watch out for infinite loops.
  1207. @end table
  1208. During execution of your @var{func}, the following variables will be
  1209. temporarily bound to some useful information:
  1210. @table @code
  1211. @item curline
  1212. The current line in the buffer that Regi is @code{looking-at}, as a string.
  1213. @item curframe
  1214. The current frame being interpreted.
  1215. @item curentry
  1216. The current frame entry being interpreted.
  1217. @end table
  1218. @node Frames You Can Customize
  1219. @section Frames You Can Customize
  1220. @vindex sc-nuke-mail-header
  1221. As mentioned earlier, Supercite uses various frames to perform
  1222. certain jobs such as mail header information extraction and mail header
  1223. nuking. However, these frames are not available for you to customize,
  1224. except through abstract interfaces such as @code{sc-nuke-mail-header},
  1225. et al.
  1226. @vindex sc-default-cite-frame
  1227. However, the citation frames Supercite uses provide a lot of customizing
  1228. power and are thus available to you to change to suit your needs. The
  1229. workhorse of citation is the frame contained in the variable
  1230. @code{sc-default-cite-frame}. This frame recognizes many situations,
  1231. such as blank lines, which it interprets as paragraph separators. It
  1232. also recognizes previously cited nested and non-nested citations in the
  1233. original message. By default it will coerce non-nested citations into
  1234. your preferred citation style, and it will add a level of citation to
  1235. nested citations. It will also simply cite uncited lines in your
  1236. preferred style.
  1237. @cindex unciting
  1238. @cindex reciting
  1239. @vindex sc-default-uncite-frame
  1240. @vindex sc-default-recite-frame
  1241. In a similar vein, there are default frames for @dfn{unciting} and
  1242. @dfn{reciting}, contained in the variables
  1243. @code{sc-default-uncite-frame} and @code{sc-default-recite-frame}
  1244. respectively.
  1245. As mentioned earlier (@pxref{Recognizing Citations}), citations are
  1246. recognized through the values of the regular expressions
  1247. @code{sc-citation-root-regexp}, et al. To recognize odd styles, you
  1248. could modify these variables, or you could modify the default citing
  1249. frame. Alternatively, you could set up association lists of frames for
  1250. recognizing specific alternative forms.
  1251. @vindex sc-cite-frame-alist
  1252. @vindex sc-uncite-frame-alist
  1253. @vindex sc-recite-frame-alist
  1254. For each of the actions---citing, unciting, and reciting---an alist is
  1255. consulted to find the frame to use (@code{sc-cite-frame-alist},
  1256. @code{sc-uncite-frame-alist}, and @code{sc-recite-frame-alist}
  1257. respectively). These frames can contain alists of the form:
  1258. @example
  1259. ((@var{infokey} (@var{regexp} . @var{frame}) (@var{regexp} . @var{frame}) @dots{})
  1260. (@var{infokey} (@var{regexp} . @var{frame}) (@var{regexp} . @var{frame}) @dots{})
  1261. (@dots{}))
  1262. @end example
  1263. @vindex sc-mail-field
  1264. @findex string-match
  1265. Where @var{infokey} is a key suitable for @code{sc-mail-field},
  1266. @var{regexp} is a regular expression which is @code{string-match}'d
  1267. against the value of the @code{sc-mail-field} key, and @var{frame} is
  1268. the frame to use if a match occurred. @var{frame} can be a variable
  1269. containing a frame or a frame in-lined.
  1270. When Supercite is about to cite, uncite, or recite a region, it consults
  1271. the appropriate alist and attempts to find a frame to use. If one
  1272. is not found from the alist, then the appropriate default frame is used.
  1273. @node Post-yank Formatting Commands
  1274. @chapter Post-yank Formatting Commands
  1275. @vindex sc-mode-map-prefix
  1276. @vindex mode-map-prefix (sc-)
  1277. @kindex C-c C-p
  1278. Once the original message has been yanked into the reply buffer, and
  1279. @code{sc-cite-original} has had a chance to do its thing, a number of
  1280. useful Supercite commands will be available to you. Since there is wide
  1281. variety in the keymaps that MUAs set up in their reply buffers, it is
  1282. next to impossible for Supercite to properly sprinkle its commands into
  1283. the existing keymap. For this reason Supercite places its commands on a
  1284. separate keymap, putting this keymap onto a prefix key in the reply
  1285. buffer. You can customize the prefix key Supercite uses by changing the
  1286. variable @code{sc-mode-map-prefix}. By default, the
  1287. @code{sc-mode-map-prefix} is @kbd{C-c C-p}; granted, not a great choice,
  1288. but unfortunately the best general solution so far. In the rest of this
  1289. chapter, we'll assume you've installed Supercite's keymap on the default
  1290. prefix.
  1291. @menu
  1292. * Citing Commands::
  1293. * Insertion Commands::
  1294. * Variable Toggling Shortcuts::
  1295. * Mail Field Commands::
  1296. * Miscellaneous Commands::
  1297. @end menu
  1298. @node Citing Commands
  1299. @section Commands to Manually Cite, Recite, and Uncite
  1300. @vindex sc-cite-region-limit
  1301. Probably the three most common post-yank formatting operations that you
  1302. will perform will be the manual citing, reciting, and unciting of
  1303. regions of text in the reply buffer. Often you may want to recite a
  1304. paragraph to use a nickname, or manually cite a message when setting
  1305. @code{sc-cite-region-limit} to @code{nil}. The following commands
  1306. perform these functions on the region of text between @samp{point} and
  1307. @samp{mark}. Each of them sets the @dfn{undo boundary} before modifying
  1308. the region so that the command can be undone in the standard Emacs
  1309. way.
  1310. Here is the list of Supercite citing commands:
  1311. @table @asis
  1312. @findex sc-cite-region
  1313. @findex cite-region (sc-)
  1314. @kindex C-c C-p c
  1315. @vindex sc-pre-cite-hook
  1316. @vindex pre-cite-hook (sc-)
  1317. @vindex sc-confirm-always-p
  1318. @vindex confirm-always-p
  1319. @kindex C-u
  1320. @item @code{sc-cite-region} (@kbd{C-c C-p c})
  1321. This command cites each line in the region of text by interpreting the
  1322. selected frame from @code{sc-cite-frame-alist}, or the default citing
  1323. frame @code{sc-default-cite-frame}. It runs the hook
  1324. @code{sc-pre-cite-hook} before interpreting the frame. With an optional
  1325. universal argument (@kbd{C-u}), it temporarily sets
  1326. @code{sc-confirm-always-p} to @code{t} so you can confirm the
  1327. attribution string for a single manual citing.
  1328. @xref{Configuring the Citation Engine}.
  1329. @findex sc-uncite-region
  1330. @findex uncite-region (sc-)
  1331. @kindex C-c C-p u
  1332. @item @code{sc-uncite-region} (@kbd{C-c C-p u})
  1333. This command removes any citation strings from the beginning of each
  1334. cited line in the region by interpreting the selected frame from
  1335. @code{sc-uncite-frame-alist}, or the default unciting frame
  1336. @code{sc-default-uncite-frame}. It runs the hook
  1337. @code{sc-pre-uncite-hook} before interpreting the frame.
  1338. @xref{Configuring the Citation Engine}.
  1339. @findex sc-recite-region
  1340. @findex recite-region (sc-)
  1341. @kindex C-c C-p r
  1342. @item @code{sc-recite-region} (@kbd{C-c C-p r})
  1343. This command recites each line the region by interpreting the selected
  1344. frame from @code{sc-recite-frame-alist}, or the default reciting frame
  1345. @code{sc-default-recite-frame}. It runs the hook
  1346. @code{sc-pre-recite-hook} before interpreting the frame.
  1347. @xref{Configuring the Citation Engine}.
  1348. @vindex sc-confirm-always-p
  1349. @vindex confirm-always-p (sc-)
  1350. Supercite will always ask you to confirm the attribution when reciting a
  1351. region, regardless of the value of @code{sc-confirm-always-p}.
  1352. @end table
  1353. @node Insertion Commands
  1354. @section Insertion Commands
  1355. These two functions insert various strings into the reply buffer.
  1356. @table @asis
  1357. @findex sc-insert-reference
  1358. @findex insert-reference (sc-)
  1359. @kindex C-c C-p w
  1360. @item @code{sc-insert-reference} (@kbd{C-c C-p w})
  1361. @vindex sc-preferred-header-style
  1362. @vindex preferred-header-style (sc-)
  1363. Inserts a reference header into the reply buffer at @samp{point}. With
  1364. no arguments, the header indexed by @code{sc-preferred-header-style} is
  1365. inserted. An optional numeric argument is the index into
  1366. @code{sc-rewrite-header-list} indicating which reference header to
  1367. write.
  1368. With just the universal argument (@kbd{C-u}), electric reference mode is
  1369. entered, regardless of the value of @code{sc-electric-references-p}.
  1370. @findex sc-insert-citation
  1371. @findex insert-citation (sc-)
  1372. @kindex C-c C-p i
  1373. @item @code{sc-insert-citation} (@kbd{C-c C-p i})
  1374. Inserts the current citation string at the beginning of the line that
  1375. @samp{point} is on. If the line is already cited, Supercite will issue
  1376. an error and will not cite the line.
  1377. @end table
  1378. @node Variable Toggling Shortcuts
  1379. @section Variable Toggling Shortcuts
  1380. @cindex toggling variables
  1381. Supercite defines a number of commands that make it easier for you to
  1382. toggle and set various Supercite variables as you are editing the reply
  1383. buffer. For example, you may want to turn off filling or whitespace
  1384. cleanup, but only temporarily. These toggling shortcut commands make
  1385. this easy to do.
  1386. @kindex C-c C-p C-t
  1387. Like Supercite commands in general, the toggling commands are placed on
  1388. a keymap prefix within the greater Supercite keymap. For the default
  1389. value of @code{sc-mode-map-prefix}, this will be
  1390. @kbd{C-c C-p C-t}.
  1391. The following commands toggle the value of certain Supercite variables
  1392. which take only a binary value:
  1393. @table @kbd
  1394. @item C-c C-p C-t b
  1395. Toggles the variable @code{sc-mail-nuke-blank-lines-p}.
  1396. @item C-c C-p C-t c
  1397. Toggles the variable @code{sc-confirm-always-p}.
  1398. @item C-c C-p C-t d
  1399. Toggles the variable @code{sc-downcase-p}.
  1400. @item C-c C-p C-t e
  1401. Toggles the variable @code{sc-electric-references-p}.
  1402. @item C-c C-p C-t f
  1403. Toggles the variable @code{sc-auto-fill-region-p}.
  1404. @item C-c C-p C-t o
  1405. Toggles the variable @code{sc-electric-circular-p}.
  1406. @item C-c C-p C-t s
  1407. Toggles the variable @code{sc-nested-citation-p}.
  1408. @item C-c C-p C-t u
  1409. Toggles the variable @code{sc-use-only-preferences-p}.
  1410. @item C-c C-p C-t w
  1411. Toggles the variable @code{sc-fixup-whitespace-p}.
  1412. @end table
  1413. @findex set-variable
  1414. The following commands let you set the value of multi-value variables,
  1415. in the same way that Emacs's @code{set-variable} does:
  1416. @table @kbd
  1417. @item C-c C-p C-t a
  1418. Sets the value of the variable @code{sc-preferred-attribution-list}.
  1419. @item C-c C-p C-t l
  1420. Sets the value of the variable @code{sc-cite-region-limit}.
  1421. @item C-c C-p C-t n
  1422. Sets the value of the variable @code{sc-mail-nuke-mail-headers}.
  1423. @item C-c C-p C-t N
  1424. Sets the value of the variable @code{sc-mail-header-nuke-list}.
  1425. @item C-c C-p C-t p
  1426. Sets the value of the variable @code{sc-preferred-header-style}.
  1427. @end table
  1428. @kindex C-c C-p C-p
  1429. One special command is provided to toggle both
  1430. @code{sc-auto-fill-region-p} and @code{sc-fixup-whitespace-p} together.
  1431. This is because you typically want to run Supercite with either variable
  1432. as @code{nil} or non-@code{nil}. The command to toggle these variables
  1433. together is bound on @kbd{C-c C-p C-p}.
  1434. Finally, the command @kbd{C-c C-p C-t h} (also @kbd{C-c C-p C-t ?})
  1435. brings up a Help message on the toggling keymap.
  1436. @node Mail Field Commands
  1437. @section Mail Field Commands
  1438. These commands allow you to view, modify, add, and delete various bits
  1439. of information from the info alist.
  1440. @xref{Information Keys and the Info Alist}.
  1441. @table @asis
  1442. @kindex C-c C-p f
  1443. @findex sc-mail-field-query
  1444. @findex mail-field-query (sc-)
  1445. @kindex C-c C-p f
  1446. @item @code{sc-mail-field-query} (@kbd{C-c C-p f})
  1447. Allows you to interactively view, modify, add, and delete info alist
  1448. key-value pairs. With no argument, you are prompted (with completion)
  1449. for a info key. The value associated with that key is displayed in the
  1450. minibuffer. With an argument, this command will first ask if you want
  1451. to view, modify, add, or delete an info key. Viewing is identical to
  1452. running the command with no arguments.
  1453. If you want to modify the value of a key, Supercite will first prompt
  1454. you (with completion) for the key of the value you want to change. It
  1455. will then put you in the minibuffer with the key's current value so you
  1456. can edit the value as you wish. When you hit @key{RET}, the key's value
  1457. is changed. Minibuffer history is kept for the values.
  1458. If you choose to delete a key-value pair, Supercite will prompt you (with
  1459. completion) for the key to delete.
  1460. If you choose to add a new key-value pair, Supercite firsts prompts you
  1461. for the key to add. Note that completion is turned on for this prompt,
  1462. but you can type any key name here, even one that does not yet exist.
  1463. After entering the key, Supercite prompts you for the key's value. It
  1464. is not an error to enter a key that already exists, but the new value
  1465. will override any old value. It will not replace it though; if you
  1466. subsequently delete the key-value pair, the old value will reappear.
  1467. @findex sc-mail-process-headers
  1468. @findex mail-process-headers (sc-)
  1469. @kindex C-c C-p g
  1470. @item @code{sc-mail-process-headers} (@kbd{C-c C-p g})
  1471. This command lets you re-initialize Supercite's info alist from any set
  1472. of mail headers in the region between @samp{point} and @samp{mark}.
  1473. This function is especially useful for replying to digest messages where
  1474. Supercite will initially set up its information for the digest
  1475. originator, but you want to cite each component article with the real
  1476. message author. Note that unless an error during processing occurs, any
  1477. old information is lost.
  1478. @end table
  1479. @node Miscellaneous Commands
  1480. @section Miscellaneous Commands
  1481. @table @asis
  1482. @findex sc-open-line
  1483. @findex open-line (sc-)
  1484. @findex open-line
  1485. @kindex C-c C-p o
  1486. @item @code{sc-open-line} (@kbd{C-c C-p o})
  1487. Similar to Emacs's standard @code{open-line} commands, but inserts the
  1488. citation string in front of the new line. As with @code{open-line},
  1489. an optional numeric argument inserts that many new lines.
  1490. @end table
  1491. @node Hints to MUA Authors
  1492. @chapter Hints to MUA Authors
  1493. In June of 1989, some discussion was held between the various MUA
  1494. authors, the Supercite author, and other Supercite users. These
  1495. discussions centered around the need for a standard interface between
  1496. MUAs and Supercite (or any future Supercite-like packages). This
  1497. interface was formally proposed by Martin Neitzel on Fri, 23 Jun 89, in
  1498. a mail message to the Supercite mailing list:
  1499. @example
  1500. Martin> Each news/mail-reader should provide a form of
  1501. Martin> mail-yank-original that
  1502. Martin> 1: inserts the original message incl. header into the
  1503. Martin> reply buffer; no indentation/prefixing is done, the header
  1504. Martin> tends to be a "full blown" version rather than to be
  1505. Martin> stripped down.
  1506. Martin> 2: 'point' is at the start of the header, 'mark' at the
  1507. Martin> end of the message body.
  1508. Martin> 3: (run-hooks 'mail-yank-hooks)
  1509. Martin> [Supercite] should be run as such a hook and merely
  1510. Martin> rewrite the message. This way it isn't anymore
  1511. Martin> [Supercite]'s job to gather the original from obscure
  1512. Martin> sources. [@dots{}]
  1513. @end example
  1514. @vindex mail-citation-hook
  1515. @vindex mail-yank-hooks
  1516. @cindex sendmail.el
  1517. @findex mail-yank-original
  1518. @findex defvar
  1519. This specification was adopted, but underwent a slight modification with
  1520. the release of Emacs 19. Instead of the variable
  1521. @code{mail-yank-hooks}, the hook variable that the MUA should provide is
  1522. @code{mail-citation-hook}. Richard Stallman suggests that the MUAs
  1523. should @code{defvar} @code{mail-citation-hook} to @code{nil} and perform
  1524. some default citing when that is the case.
  1525. If you are writing a new MUA package, or maintaining an existing MUA
  1526. package, you should make it conform to this interface so that your users
  1527. will be able to link Supercite easily and seamlessly. To do this, when
  1528. setting up a reply or forward buffer, your MUA should follow these
  1529. steps:
  1530. @enumerate
  1531. @item
  1532. Insert the original message, including the mail headers into the reply
  1533. buffer. At this point you should not modify the raw text in any way
  1534. (except for any necessary decoding, e.g., of quoted-printable text), and
  1535. you should place all the original headers into the body of the reply.
  1536. This means that many of the mail headers will be duplicated, one copy
  1537. above the @code{mail-header-separator} line and one copy below, however
  1538. there will probably be more headers below this line.
  1539. @item
  1540. Set @samp{point} to the beginning of the line containing the first mail
  1541. header in the body of the reply. Set @samp{mark} at the end of the
  1542. message text. It is very important that the region be set around the
  1543. text Supercite is to modify and that the mail headers are within this
  1544. region. Supercite will not venture outside the region for any reason,
  1545. and anything within the region is fair game, so don't put anything that
  1546. @strong{must} remain unchanged inside the region.
  1547. @item
  1548. Run the hook @code{mail-citation-hook}. You will probably want to
  1549. provide some kind of default citation functions in cases where the user
  1550. does not have Supercite installed. By default, your MUA should
  1551. @code{defvar} @code{mail-citation-hook} to @code{nil}, and in your
  1552. yanking function, check its value. If it finds
  1553. @code{mail-citation-hook} to be @code{nil}, it should perform some
  1554. default citing behavior. User who want to connect to Supercite then
  1555. need only add @code{sc-cite-original} to this list of hooks using
  1556. @code{add-hook}.
  1557. @end enumerate
  1558. If you do all this your MUA will join the ranks of those that conform to
  1559. this interface ``out of the box.''
  1560. @node Thanks and History
  1561. @chapter Thanks and History
  1562. The Supercite package was derived from its predecessor Superyank 1.11
  1563. which was inspired by various bits of code and ideas from Martin Neitzel
  1564. and Ashwin Ram. They were the folks who came up with the idea of
  1565. non-nested citations and implemented some rough code to provide this
  1566. style. Superyank and Supercite version 2 evolved to the point where much
  1567. of the attribution selection mechanism was automatic, and features have
  1568. been continuously added through the comments and suggestions of the
  1569. Supercite mailing list participants.
  1570. With version 3, Supercite underwent an almost complete rewrite,
  1571. benefiting in a number of ways, including vast improvements in the
  1572. speed of performance, a big reduction in size of the code and in the use
  1573. of Emacs resources, and a much cleaner and flexible internal
  1574. architecture. Most of this work was internal and not of very great
  1575. importance to the casual user. There were some changes at the
  1576. user-visible level, but for the most part, the Supercite configuration
  1577. variables from version 2 should still be relevant to version 3.
  1578. Hopefully Supercite version 3 is faster, smaller, and much more flexible
  1579. than its predecessors.
  1580. In the version 2 manual I thanked some specific people for their help in
  1581. developing Supercite 2. You folks know who you are and your continued
  1582. support is greatly appreciated. I wish to thank everyone on the
  1583. Supercite mailing list, especially the brave alpha testers, who helped
  1584. considerably in testing out the concepts and implementation of Supercite
  1585. version 3. Special thanks go out to the MUA and Emacs authors Kyle
  1586. Jones, Stephen Gildea, Richard Stallman, and Jamie Zawinski for coming
  1587. to a quick agreement on the new @code{mail-citation-hook} interface, and
  1588. for adding the magic lisp to their code to support this.
  1589. All who have helped and contributed have been greatly appreciated.
  1590. Supercite was written by Barry Warsaw.
  1591. @node GNU Free Documentation License
  1592. @appendix GNU Free Documentation License
  1593. @include doclicense.texi
  1594. @node Concept Index
  1595. @unnumbered Concept Index
  1596. @printindex cp
  1597. @node Command Index
  1598. @unnumbered Command Index
  1599. Since all supercite commands are prepended with the string
  1600. ``@code{sc-}'', each appears under its @code{sc-}@var{command} name and
  1601. its @var{command} name.
  1602. @iftex
  1603. @sp 2
  1604. @end iftex
  1605. @printindex fn
  1606. @node Key Index
  1607. @unnumbered Key Index
  1608. @printindex ky
  1609. @node Variable Index
  1610. @unnumbered Variable Index
  1611. Since all supercite variables are prepended with the string
  1612. ``@code{sc-}'', each appears under its @code{sc-}@var{variable} name and
  1613. its @var{variable} name.
  1614. @iftex
  1615. @sp 2
  1616. @end iftex
  1617. @printindex vr
  1618. @bye