Xref: utzoo comp.emacs:8801 gnu.emacs:3416 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cme!durer!warsaw From: warsaw@cme.nist.gov (Barry A. Warsaw) Newsgroups: comp.emacs,gnu.emacs Subject: Supercite 2.1 public release (shar 01 of 02) Message-ID: Date: 3 Aug 90 03:27:40 GMT Sender: news@cme.nist.gov Organization: National Institute of Standards and Technology Lines: 2189 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'ChangeLog' <<'END_OF_FILE' XThu Aug 2 22:40:42 1990 Barry Warsaw (warsaw at anthem) X X * shar it up, post to comp.emacs, gnu.emacs, elisp directory, X cme.nist.gov [129.6.32.4]. X XMon Jul 30 19:06:34 1990 Barry Warsaw (warsaw at anthem) X X * Added "cheapcite", a minimal supercite file. X X * Changed (obsolete function?) read-input to read-string. X XSat Jul 28 14:02:06 1990 Barry Warsaw (warsaw at anthem) X X * shar'd it up and posted to supercite list. X X * spell checked, updated README and docstring. X X * Added sc-version which displays version number. X XFri Jul 27 09:58:38 1990 Barry Warsaw (warsaw at anthem) X X * Removed the dependence on global variables sc-cite-context and X sc-force-confirmation-p. Now they are locally bound (via let) in X the contexts that need them. X X * Fixed sc-confirm so C-g in minibuffer aborts the cite or recite X function. Added a catch/throw to 'select-abort. Catch in sc-cite X and sc-recite, throw in sc-confirm (on C-g). X X * Rewrote the sc-describe doc string and moved the linking X information to the README, since by that time, you'll have read X the README and already figured out how to link it. X XWed Jul 25 10:23:16 1990 Barry Warsaw (warsaw at anthem) X X * Always check sc-preferred-header-style to be sure it is legal X before using. X X * Changed the logic for sc-insert-references to be more useful as X to when to enter electric mode. X X * Wrapped all evals of sc-rewrite-header-list functions in X condition-cases so we'd see and handle void-functions and other X errors. X XTue Jul 24 17:57:49 1990 Barry Warsaw (warsaw at anthem) X X * Significantly rewrote electric insert to live within a quasi X major mode. Uses recursive edit to strictly control key strokes X while doing electric referencing. Seems the best way to do it, X though perhaps a bit parental. X XFri Jul 20 09:48:15 1990 Barry Warsaw (warsaw at anthem) X X * Added circular references in electric reference mode. Added X control variable sc-electric-circular-p. X X * sc-load-hook removed. Its not really needed since sc-run-hook X basically performs the same function. X XThu Jul 19 12:49:08 1990 Barry Warsaw (warsaw at anthem) X X * sc-left-justify-p has been renamed sc-fixup-whitespace-p. X X * Made certain variables, most notably sc-gal-information and X sc-gal-attributions buffer local. X X * Cleaned up docstrings in baw-alists.el X X * Redesigned overload mechanism based on code supplied by X umerin@tc.nagasaki.go.jp. Overload file will now byte-compile and X overloading in general is quite a bit more clean. X XTue Jul 17 15:57:35 1990 Barry Warsaw (warsaw at anthem) X X * fixed some typos in the docstrings. X X * fixed sc-spoogify-docstring so that if the major mode is X preloaded, it will make a copy of the function property, modify X that docstring, then fset the major mode to this copy. X X * changed the string "newsgroup" to "newsgroups" in the defvar for X sc-mail-fields-list. Also in documentation. X X * added sc-glom-headers, an interactive function which lets you X set up sc-gal-* for any mail headers within region. X XFri Jul 13 14:26:47 1990 Barry Warsaw (warsaw at anthem) X X * sc-spoogify-docstring won't abort on error if major-mode is X preloaded. It just won't spoogify the docstring. X X * Added variable sc-nuke-mail-headers-p to control nuking or X non-nuking of mail headers after glomming useful info from them. X X * copied in mail-yank-clear-headers to sc-* to further reduce X dependence on sendmail.el. Renamed mail-yank-ignored-headers to X sc-*. X X * Fixed a bug in sc-cite not passing numeric arg correctly to X sc-insert-reference. Also fixed slight bug in sc-insert-reference. X X * clarified cite confirmation message and recite confirmation X message by adding sc-cite-context. X X * moved mail-fetch-field to supercite: sc-mail-fetch-field to X remove dependency of supercite on sendmail.el and mail-utils.el X X * Added sc-citation-leader. A composed citation string is now X build from (concat sc-citation-leader 'attribution' X sc-citation-delimiter and followed with sc-citation-separator. X X * move sup-misc.el to sc-misc.el X XFri Oct 13 17:30:13 1989 Barry Warsaw (warsaw at rtg) X X * Shar it up and post version 2.0. X X * moved supercite-misc.el to sup-misc.el and X baw-alist-utils.el to baw-alist.el for sake of users of X bogus UN*X's which can't handle long file names. X X * Merged in mh-e support as provided by Mark Baushke. X XThu Oct 12 17:50:55 1989 Barry Warsaw (warsaw at rtg) X X * Fixed small bug in sc-populate-alists. No space was being X put between last middlename and lastname. X X * Cleaned up documentation. Ready to post tomorrow. X XWed Oct 11 13:43:35 1989 Barry Warsaw (warsaw at rtg) X X * Moved sc-supercite to sc-describe. X X * Cleaned up code and documentation for distribution. I'll be X watching for bugs to pop up before release. X X * Added sc-leached-keymap for better documentation. X X * Changed default value of sc-cite-regexp to include possible X whitespace around attribution text and mulitple ">" characters. X X * Changed all symbol prefixes from sy- to sc- in both the X supercite.el and supercite-misc.el files. X X * Added cute hack so that description of supercite bindings are X leached onto the docstring of the current buffer's major-mode X function. "C-h m" after supercite is loaded will show the X supercite keybindings in the *Help* buffer. X XTue Oct 10 17:30:32 1989 Barry Warsaw (warsaw at rtg) X X * Fixed a bug in the creation of the "sc-author" field which was X putting a bogus space at the end of the author's name. Also added X all the other name fields to the "sc-gal-information" alist. You X can now access "sc-firstname", "sc-lastname", and all X "sc-middlename-N". X X * Added an attribution style that I use. X sc-header-attributed-writes. X X * Parameterized the ">>>>>" prefix on the reference header. Some X people find this annoying, I like it. X XSun Oct 8 22:08:11 1989 Barry Warsaw (warsaw at rtg) X X * Added binding for sc-insert-reference for mh-e mode. X XWed Oct 4 18:54:43 1989 Barry Warsaw (warsaw at rtg) X X * Fixed bug in searching for author names in certain From: lines X which didn't find names with dots (abbreviations) and dashes. X X * Added per-interface keymaps which allow you to define different X keybindings based on the major-mode of the buffer which supercite X is leaching onto. X XTue Oct 3 20:01:17 1989 Barry Warsaw (warsaw at rtg) X X * Fixed bug in sc-{re,un}cite which bombed out if first line in X region was blank. These functions now search for attribution X prefix on first non-blank line in region. X XMon Sep 25 10:30:32 1989 Barry Warsaw (warsaw at rtg) X X * Modified diffs and overloads to mh-e stuff as per ks and mdb X X * Fixed conditional loads in supercite-misc.el X X * Added (require 'sendmail) X XThu Sep 21 10:17:23 1989 Barry Warsaw (warsaw at rtg) X X * Posted 2.0gamma to supercite list. X X * Added overload functions to supercite-misc.el X X * Fixed some bugs in electric-reference functions X X * After citing a yanked region, leave point (or mark if X point>mark) on first non-blank line. X XWed Sep 13 18:10:45 1989 Barry Warsaw (warsaw at rtg) X X * Added electric reference header selection. Now you don't have to X remember which integer pointed to which reference style! X XTue Sep 12 18:23:47 1989 Barry Warsaw (warsaw at rtg) X X * Fixed some bugs in paragraph filling and made the whole thing X more robust and simple. X X * Added exchange of point and mark when point > mark. Exchange is X only visible internal to sc- functions. Order of point and mark X are restored after citing. X X * Added some new mail headers to clean. X XWed Sep 6 18:45:11 1989 Barry Warsaw (warsaw at rtg) X X * Remerged files by popular demand. Added page delimiters. X XFri Sep 1 18:37:59 1989 Barry Warsaw (warsaw at rtg) X X * Modified documentation and updated the public domain notice. X X * Restored "C-c q" binding of sc-fill-paragraph-manually. X XTue Aug 29 18:54:27 1989 Barry Warsaw (warsaw at rtg) X X * Added sc-modify-info function. X X * Fixed sc-left-justify-p to use fixup-whitespace (which makes X more sense). X XMon Aug 21 10:07:06 1989 Barry Warsaw (warsaw at rtg) X X * Posted 2.0beta version to mailing list. X X * Added sc-uncite function. X XFri Aug 18 16:49:43 1989 Barry Warsaw (warsaw at rtg) X X * Split files for managability. X XThu Aug 17 21:43:33 1989 Barry Warsaw (warsaw at rtg) X X * Added alist utilites and rewrote major portions of code to X utilize these association lists for keeping track of important X information. X XMon Aug 14 17:09:11 1989 Barry Warsaw (warsaw at rtg) X X * Added facility to remember which attribution was last used. This X last used attribution is presented to the user as the preferred X choice for the next attribution. X XMon Jul 31 18:52:41 1989 Barry Warsaw (warsaw at rtg) X X * Modified some documentation. X XThu Jul 27 17:01:49 1989 Barry Warsaw (warsaw at rtg) X X * Added some better filling functions and hookified the paragraph X fill function so you can use whatever you want. X XWed Jul 5 21:15:45 1989 Barry Warsaw (warsaw at rtg) X X * Totally rewrote version 2.0 based on superyank 1.11. This X included major modifications of almost every bit of code in the X package. Much too numerous to mention here. END_OF_FILE if test 9247 -ne `wc -c <'ChangeLog'`; then echo shar: \"'ChangeLog'\" unpacked with wrong size! fi # end of 'ChangeLog' fi if test -f 'MANIFEST' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'MANIFEST'\" else echo shar: Extracting \"'MANIFEST'\" \(764 characters\) sed "s/^X//" >'MANIFEST' <<'END_OF_FILE' X File Name Archive # Description X----------------------------------------------------------- X ChangeLog 1 Differences from v2.0. X MANIFEST 1 This shipping list X README 1 Introduction to supercite v2.1. X baw-alist.el 1 Association list utilities. X cheapcite.el 1 Cheapcite version 2.1. (minimalist's supercite) X mh-e.el.diff 1 Context diff patch file for mh-e.el. X rnewspost.el.diff 1 Context diff patch file for rnewspost.el. X sc-electric.el 1 Electric insert mode. X sc-oloads.el 1 Overloading functions. X sendmail.el.diff 1 Context diff patch file for sendmail.el. X supercite.el 2 Supercite version 2.1. END_OF_FILE if test 764 -ne `wc -c <'MANIFEST'`; then echo shar: \"'MANIFEST'\" unpacked with wrong size! fi # end of 'MANIFEST' fi if test -f 'README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README'\" else echo shar: Extracting \"'README'\" \(10460 characters\) sed "s/^X//" >'README' <<'END_OF_FILE' XThis is the distribution of Supercite 2.1, an elisp utility to do Xfancy citing of reply messages for GNU emacs. This is the second Xrelease of the supercite package. This version fixes bugs, clarifies Xissues, and occasionally adds features to version 2.0, originally Xreleased in October '89. The ancestor to this package was Superyank X1.11. X X X-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* X XMajor changes since version 2.0: X X 1) Overloading has been entirely rewritten, based on code donated X by umerin@tc.nagasaki.go.jp. The overload file has been X renamed to sc-oloads.el, and this file can now be byte X compiled. Also, overloading in general has been entirely X cleaned up. Not so much of a hack now. :-) X X 2) Citation strings are now built from 4 parts, the citation X leader, the attribution string, the citation delimiter, and X the citation separator. The citation leader is the added X feature. X X 3) Removed all dependence on sendmail.el and mail-utils.el. X X 4) Various bug fixes and typos, including sc-spoogify-docstring. X X 5) Made the alists buffer local so you could have more than 1 X reply buffer going in the same emacs session. X X 6) Completely rewrote electric reference insert mode. It now X pops you into a recursive-edit. I think this version is much X more usable. X X 7) Some new functions and variables, most notably: X sc-glom-headers (Command) X sc-version (Command) X sc-nuke-mail-headers-p (Variable) X sc-citation-leader (Variable) X sc-fixup-whitespace-p (Variable -- was sc-left-justify-p) X sc-electric-circular-p X X 8) Added "cheapcite", a minimalist supercite package for those X who are daunted by the complexity and/or size of supercite. X X XFor more information on changes since Version 2.0, see the ChangeLog file. X X X-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* X XThis package should contain the following files: X X supercite.el -- the main elisp file X cheapcite.el -- the minimalist supercite X sc-oloads.el -- overloading functions X sc-electric.el -- supercite's electric reference insert mode X baw-alist.el -- association list utilities X mh-e.el.diff -- patch file to mh-e.el X rnewspost.el.diff -- patch file to rnewspost.el X sendmail.el.diff -- patch file to sendmail.el X README -- this file X ChangeLog -- history of changes file X XSupercite 2.1 has been tested and is known to work with VM 4.37-41 Xout of the box. Supercite will work with GNUS 3.12-13, RMAIL, RNEWS, XMH, perhaps GNEWS, PCMAIL, and other packages, once the supplied Xpatches are installed, or the proper functions have been overloaded X(see below). X XOnce you've got it linked, installed, and loaded you can find out more Xinformation on using supercite by typing "M-x sc-describe". The rest Xof this README describes how to interface supercite with the various Xmail/news packages you might be using. X X X-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* X XThe author runs a Supercite mailing list on which a number of mail and Xnews package authors and other supercite users participate. Back in XJune of '89, some discussion was held and an interface between these Xpackages and Supercite was agreed upon. The ancestor to this package, XSuperyank 1.11 was designed along an old interface and this package, XSupercite 2.1 conforms to this new standard. When version 2.0 was Xreleased back in October '89, only VM 4.37 conforms to this standard Xas distributed, and today (27-Jul-1990) VM is still the only package Xwhich interfaces with supercite 'from the box'. It is rumored that Xemacs v19 will include the agreed upon interface, allowing GNUS X3.12-13, RMAIL, RNEWS and MH-E to use supercite with no modification Xto distribution code. However until such time as this, you must apply Xthe specified patches, or use the appropriate overloaded functions to Xaccess supercite from the mail/news package of your choice. Using Xeither the patches or the overloads, you *should* be able to use Xsupercite with: VM, GNUS, RMAIL, MH, RNEWS, GNEWS, PCMAIL, and perhaps Xothers. X XThe interface mentioned above was formally proposed by Martin Neitzel Xon Fri, 23 Jun 89, in a mail message to the supercite mailing list: X X Martin> Each news/mail-reader should provide a form of X Martin> mail-yank-original that X X Martin> 1: inserts the original message incl. header into the X Martin> reply buffer; no indentation/prefixing is done, the header X Martin> tends to be a "full blown" version rather than to be X Martin> stripped down. X X Martin> 2: `point' is at the start of the header, `mark' at the X Martin> end of the message body. X X Martin> 3: (run-hooks 'mail-yank-hooks) X X Martin> [Supercite] should be run as such a hook and merely X Martin> rewrite the message. This way it isn't anymore X Martin> [supercite]'s job to gather the original from obscure X Martin> sources. [...] X XSupercite 2.1 conforms to this interface, as does VM. So, to access Xsupercite from VM (or other packages, once overloading or patching has Xbeen completed), simply add this to your .emacs file: X X (autoload 'sc-cite-original "supercite" "Hookified Supercite 2.1" t) X (autoload 'sc-cite "supercite" "Interactive Supercite 2.1" t) X (setq mail-yank-hooks 'sc-cite-original) X (setq mh-yank-hooks 'sc-cite-original) ; for mh-e users X XIf supercite is too complex or large for your tastes, but you still Xwant to use some of the flavor of supercite, then cheapcite might be Xjust for you. Lots of supercite's fancier features, such as automatic Xattribution extraction, electric referencing, per-interface keymaps, Xetc., have been yanked from cheapcite. You still get nested and Xnon-nested citations, and cheapcite conforms to the same interface as Xsupercite (and understands many of the same variables and commands). XCheapcite is meant to be a replacement for supercite; I don't think Xthey'll live together very well in the same emacs session. To link to Xcheapcite instead of supercite, just change the autoload lines above Xto: X X (autoload 'sc-cite-original "cheapcite" "Hookified Cheapcite 2.1" t) X (autoload 'sc-cite "cheapcite" "Interactive Cheapcite 2.1" t) X XAlmost everything else remains the same. X X X-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* X XTo link supercite (or cheapcite) with the mail/news package you're Xusing (if it is not VM) you will either have to patch certain files Xwhich are distributed with emacs 18.55, or go the overload route. To Xpatch, apply these context diff files using the 'patch' utility X(available, I believe on prep.ai.mit.edu, among other places): X X rnewspost.el.diff X sendmail.el.diff X mh-e.el.diff X XThe really important one is sendmail.el.diff which will let supercite Xwork with GNUS, RMAIL and RNEWS. The rnewspost.el.diff file just Xcleans some stuff up for use with RNEWS and GNUS. If you use MH-E Xmode, install mh-e.el.diff. X XIf for some reason you cannot install the diff files, don't fret, you Xcan use supercite by going the overload route. I have completely Xrewritten this part of supercite (based on code donated by Masanobu XUmeda) since v2.0, and it should now be clearer and easier to use. XRefer to the sc-oloads.el file during this discussion. X XThere is a variable, called sc-overload-functions which maintains a Xlist of overload pairs. The first symbol in the pair is the symbol of Xthe function to overload. The second symbol is the symbol of the Xsupercite equivalent function which provides the enhanced (for hooking Xup the supercite package) functionality. By default, Xsc-overload-functions contains the pairings needed to link supercite Xwith most of the major known mail/news packages. X XThere is a function, also called sc-overload-functions which will scan Xthis overload pairing list, setting the function cell of any fbound, Xoriginal function symbol with the supercite equivalent function. In Xthis way, overloading is accomplished. If the original symbol is not Xyet fbound (say, because GNUS was not yet loaded, so Xnews-reply-yank-original wasn't yet bound), supercite will skip this Xpairing. X XThe final piece of the puzzle is to determine a hook in your mail/news Xreader package which gets run after the package is loaded (so the Xoriginal function will be fbound), but before the original package Xyanks in and cites the text. You will set this hook to load Xsupercite, and perform the overloading. I have analyzed the major Xpackages available to find hooks which I think will work. They are: X X mail-setup-hook (for packages using sendmail.el) X news-reply-mode-hook (for packages using rnewspost.el) X mh-letter-mode-hook (for packages using mh-e.el) X XSo, if you are using one of the major news/mail packages, this is all Xyou should need to add to your .emacs file to get supercite linked in Xat the proper time: X X (defun my-sc-overload-hook-func () X (require 'sc-oloads) X (sc-overload-functions)) X X (setq mail-setup-hook 'my-sc-overload-hook-func) X (setq news-reply-mode-hook 'my-sc-overload-hook-func) X (setq mh-letter-mode-hook 'my-sc-overload-hook-func) X XIf you are not using one of these mail/news packages, simply find an Xappropriate hook within that package and set it to run Xmy-sc-overload-hook-func. Please inform the author of any hook Xfunctions you find, so that I can update this README for future releases. X X X-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* X XEnjoy, and please send the author your compliments, questions, Xsuggestions and bug reports. Don't forget, if you're interested in Xdiscussing supercite and/or cheapcite, join the mailing list by Xsending mail to the supercite-request address below. X X-Barry X X XNAME: Barry A. Warsaw USMAIL: National Institute of XTELE: (301) 975-3460 Standards and Technology XUUCP: uunet!cme.nist.gov!warsaw Rm. B-124, Bldg. 220 XINET: warsaw@cme.nist.gov Gaithersburg, MD 20899 X XGet on the Supercite mailing list: X XSend articles to: X INET: supercite@cme.nist.gov X UUCP: uunet!cme.nist.gov!supercite X XSend administrivia (additions/deletions to list, etc) to: X INET: supercite-request@cme.nist.gov X UUCP: uunet!cme.nist.gov!supercite-request X X X+++ Local Variables: --- X+++ tab-width: 4 --- X+++ End: --- END_OF_FILE if test 10460 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'baw-alist.el' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'baw-alist.el'\" else echo shar: Extracting \"'baw-alist.el'\" \(5466 characters\) sed "s/^X//" >'baw-alist.el' <<'END_OF_FILE' X;; baw-alist.el -- Version 1.0 X X;; association list utilities providing insertion, deletion, sorting X;; fetching off key-value pairs in association lists. X X;; ========== Disclaimer ========== X;; This software is distributed in the hope that it will be useful, X;; but WITHOUT ANY WARRANTY. No author or distributor accepts X;; responsibility to anyone for the consequences of using it or for X;; whether it serves any particular purpose or works at all, unless he X;; says so in writing. X X;; This software was written as part of the supercite author's X;; official duty as an employee of the United States Government and is X;; thus in the public domain. You are free to use that particular X;; software as you wish, but WITHOUT ANY WARRANTY WHATSOEVER. It X;; would be nice, though if when you use any of this code, you give X;; due credit to the author. X X;; ========== Author (unless otherwise stated) ========== X;; NAME: Barry A. Warsaw USMAIL: National Institute of X;; TELE: (301) 975-3460 Standards and Technology X;; UUCP: uunet!cme.nist.gov!warsaw Rm. B-124, Bldg. 220 X;; INET: warsaw@cme.nist.gov Gaithersburg, MD 20899 X X;; ========== Modification History ========== X;; modified: 19-Jul-1990 baw (conform doc strings) X;; modified: 13-Jul-1990 baw (cleaned up a bit) X;; modified: 6-Sep-1989 baw (create alists from flat lists) X;; modified: 1-Sep-1989 baw (updated pd notice) X;; created : 17-Aug-1989 baw X X(provide 'baw-alist) X X X(defun asort (alist-symbol key) X "Move a specified key-value pair to the head of an alist. XThe alist is referenced by ALIST-SYMBOL. Key-value pair to move to Xhead is one matching KEY. Returns the sorted list and doesn't affect Xthe order of any other key-value pair. Side effect sets alist to new Xsorted list." X (set alist-symbol X (sort (copy-alist (eval alist-symbol)) X (function (lambda (a b) (equal (car a) key)))))) X X X(defun aelement (key value) X "Makes a list of a cons cell containing car of KEY and cdr of VALUE. XThe returned list is suitable as an element of an alist." X (list (cons key value))) X X X(defun aheadsym (alist) X "Return the key symbol at the head of ALIST." X (car (car alist))) X X X(defun anot-head-p (alist key) X "Find out if a specified key-value pair is not at the head of an alist. XThe alist to check is specified by ALIST and the key-value pair is the Xone matching the supplied KEY. Returns nil if ALIST is nil, or if Xkey-value pair is at the head of the alist. Returns t if key-value Xpair is not at the head of alist. ALIST is not altered." X (not (equal (aheadsym alist) key))) X X X(defun aput (alist-symbol key &optional value) X "Inserts a key-value pair into an alist. XThe alist is referenced by ALIST-SYMBOL. The key-value pair is made Xfrom KEY and optionally, VALUE. Returns the altered alist or nil if XALIST is nil. X XIf the key-value pair referenced by KEY can be found in the alist, and XVALUE is supplied non-nil, then the value of KEY will be set to VALUE. XIf VALUE is not supplied, or is nil, the key-value pair will not be Xmodified, but will be moved to the head of the alist. If the key-value Xpair cannot be found in the alist, it will be inserted into the head Xof the alist (with value nil if VALUE is nil or not supplied)." X (let ((elem (aelement key value)) X alist) X (asort alist-symbol key) X (setq alist (eval alist-symbol)) X (cond ((null alist) (set alist-symbol elem)) X ((anot-head-p alist key) (set alist-symbol (nconc elem alist))) X (value (setcar alist (car elem))) X (t alist)))) X X X(defun adelete (alist-symbol key) X "Delete a key-value pair from the alist. XAlist is referenced by ALIST-SYMBOL and the key-value pair to remove Xis pair matching KEY. Returns the altered alist." X (asort alist-symbol key) X (let ((alist (eval alist-symbol))) X (cond ((null alist) nil) X ((anot-head-p alist key) alist) X (t (set alist-symbol (cdr alist)))))) X X X(defun aget (alist key &optional keynil-p) X "Returns the value in ALIST that is associated with KEY. XOptional KEYNIL-P describes what to do if the value associated with XKEY is nil. If KEYNIL-P is not supplied or is nil, and the value is Xnil, then KEY is returned. If KEYNIL-P is non-nil, then nil would be Xreturned. X XIf no key-value pair matching KEY could be found in ALIST, or ALIST is Xnil then nil is returned. ALIST is not altered." X (let ((copy (copy-alist alist))) X (cond ((null alist) nil) X ((progn (asort 'copy key) X (anot-head-p copy key)) nil) X ((cdr (car copy))) X (keynil-p nil) X ((car (car copy))) X (t nil)))) X X X(defun amake (alist-symbol keylist &optional valuelist) X "Make an association list. XThe association list is attached to the alist referenced by XALIST-SYMBOL. Each element in the KEYLIST becomes a key and is Xassociated with the value in VALUELIST with the same index. If XVALUELIST is not supplied or is nil, then each key in KEYLIST is Xassociated with nil. X XKEYLIST and VALUELIST should have the same number of elements, but Xthis isn't enforced. If VALUELIST is smaller than KEYLIST, remaining Xkeys are associated with nil. If VALUELIST is larger than KEYLIST, Xextra values are ignored. Returns the created alist." X (let ((keycar (car keylist)) X (keycdr (cdr keylist)) X (valcar (car valuelist)) X (valcdr (cdr valuelist))) X (cond ((null keycdr) X (aput alist-symbol keycar valcar)) X (t X (amake alist-symbol keycdr valcdr) X (aput alist-symbol keycar valcar)))) X (eval alist-symbol)) END_OF_FILE if test 5466 -ne `wc -c <'baw-alist.el'`; then echo shar: \"'baw-alist.el'\" unpacked with wrong size! fi # end of 'baw-alist.el' fi if test -f 'cheapcite.el' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'cheapcite.el'\" else echo shar: Extracting \"'cheapcite.el'\" \(25766 characters\) sed "s/^X//" >'cheapcite.el' <<'END_OF_FILE' X;; ====================================================================== X;; cheapcite.el -- Version 2.1 X X;; ====================================================================== X;; This a small package which does interactive citations (both nested X;; and non-nested), ala supercite, but without all the fancy features. X;; It is supplied for folks who want some of the citing parts of X;; supercite without all the (what they consider) extra cruft. An X;; understandable desire. X X;; cheapcite interfaces to mail and news readers exactly the same (de X;; facto standard) way that supercite does, so refer to all X;; documentation relating to supercite interfacing for more details. X X;; cheapcite uses many of the same variable and function names as X;; supercite; it is meant to be used instead of supercite not along X;; with supercite. Use one or the other. X X;; ========== Disclaimer ========== X;; This software is distributed in the hope that it will be useful, X;; but WITHOUT ANY WARRANTY. No author or distributor accepts X;; responsibility to anyone for the consequences of using it or for X;; whether it serves any particular purpose or works at all, unless he X;; says so in writing. X X;; Some of this software was written as part of the supercite author's X;; official duty as an employee of the United States Government and is X;; thus in the public domain. You are free to use that particular X;; software as you wish, but WITHOUT ANY WARRANTY WHATSOEVER. It X;; would be nice, though if when you use any of this code, you give X;; due credit to the author. X X;; Other parts of this code were written by other people. Wherever X;; possible, credit to that author, and the copy* notice supplied by X;; the author are included with that code. X X;; ========== Author (unless otherwise stated) ========== X;; NAME: Barry A. Warsaw USMAIL: National Institute of X;; TELE: (301) 975-3460 Standards and Technology X;; UUCP: uunet!cme.nist.gov!warsaw Rm. B-124, Bldg. 220 X;; INET: warsaw@cme.nist.gov Gaithersburg, MD 20899 X X;; Want to be on the Supercite mailing list? X;; X;; Send articles to supercite@cme.nist.gov or uunet!cme.nist.gov!supercite X;; Send administrative queries/requests to supercite-request@cme.nist.gov X;; or uunet!cme.nist.gov!supercite-request X X(provide 'cheapcite) X X X X;; ====================================================================== X;; start of user defined variables X;; ====================================================================== X X(defvar sc-nested-citation-p nil X "*Controls whether to use nested or non-nested citation style.") X X(defvar sc-citation-leader "" X "*String used at the front of a composed citation.") X X(defvar sc-citation-delimiter ">" X "*String to use at the end of a composed citation. XThis string is used in both nested and non-nested citations. For best Xresults, use a single character with no trailing space.") X X(defvar sc-citation-separator " " X "*String used to separate the composed citation and the cited line. XNormally this character is a single space character though often a Xsingle tab character is used.") X X(defvar sc-cite-regexp "\\s *[a-zA-Z0-9]*\\s *>+\\s *" X "*Regular expression describing how a already cited line begins. XThe regexp is only used at the beginning of a line, so it doesn't need Xto start with a '^'.") X X(defvar sc-fill-paragraph-hook 'sc-fill-paragraph X "*Hook for filling a paragraph. XThis hook gets executed when you fill a paragraph either manually or Xautomagically. It expects point to be within the extent of the Xparagraph that is going to be filled.") X X(defvar sc-auto-fill-region-p nil X "*If non-nil, automatically fill each paragraph after it has been cited.") X X(defvar sc-fixup-whitespace-p nil X "*If non-nil, delete all leading white space before citing.") X X(defvar sc-nuke-mail-headers-p t X "*Nuke or don't nuke mail headers. XIf non-nil, nuke mail headers after gleaning useful information form Xthem. If nil, don't nuke mail headers.") X X(defvar sc-run-hook nil X "*User definable hook. XRuns after sc-cite-original executes.") X X(defvar sc-load-hook nil X "*User definable hook. XRuns after cheapcite is loaded. Set your customizations here.") X X(defvar sc-rewrite-header-hook 'sc-standard-header X "*User definable hook. XRuns before original mail headers are nuked. Set it to a function Xwhich will write a header for you. See sc-mail-fetch-field for how to Xinclude information in your header, and sc-standard-header for an Xexample function. X XNOTE: do not use 'insert' in your function. Use 'insert-before-markers`.") X X(defvar sc-default-keymap X '(lambda () X (local-set-key "\C-c\C-t" 'sc-cite) X (local-set-key "\C-c\C-a" 'sc-recite) X (local-set-key "\C-c\C-u" 'sc-uncite) X (local-set-key "\C-c\C-i" 'sc-insert-citation) X (local-set-key "\C-c\C-o" 'sc-open-line) X (local-set-key "\C-c\C-q" 'sc-fill-paragraph-manually) X (local-set-key "\C-c\q" 'sc-fill-paragraph-manually) X (local-set-key "\C-c\C-v" 'sc-version) X (local-set-key "\C-c?" 'sc-describe) X ) X "*Variable which contains function to set keymap.") X X;; ********************************************************************** X;; end of user defined variables X;; ********************************************************************** X X X X;; ====================================================================== X;; global variables, not user accessable X X(defconst sc-version-number "2.1") X X;; when rnewspost.el patch is installed (or function is overloaded) X;; this should be nil since cheapcite now does this itself. X(setq news-reply-header-hook nil) X X(make-variable-buffer-local 'sc-fill-arg) X(make-variable-buffer-local 'sc-attribution-string) X(make-variable-buffer-local 'sc-citation-string) X(setq-default sc-fill-arg nil) X(setq-default sc-attribution-string "") X(setq-default sc-citation-string "") X X X;; the new citation style means we can clean out other headers in X;; addition to those previously cleaned out. anyway, we create our X;; own headers. cleans out mail, gnus, vm and other headers. add to X;; this for other mail or news readers you may be using. X X(setq sc-mail-yank-ignored-headers X (concat X "^via:\\|^origin:\\|^status:\\|^received:\\|^remailed\\|" X "^[a-z-]*message-id:\\|^\\(summary-\\)?line[s]?:\\|^cc:\\|" X "^subject:\\|^\\(\\(in-\\)?reply-\\)?to:\\|^sender:\\|^replied:\\|" X "^\\(\\(return\\|reply\\)-\\)?path:\\|^\\(posted-\\)?date:\\|" X "^\\(mail-\\)?from:\\|^newsgroup[s]?:\\|^organization:\\|^keywords:\\|" X "^distribution:\\|^xref:\\|^references:\\|^x-mailer:\\|" X "^\\(x-\\)?followup-to:\\|^x-vm-attributes:\\|^expires:\\|" X "^approved:\\|^apparently-to:\\|^summary:\\|" X "^x-vm-attributes:\\|^x-vm-v[0-9]+-data:")) X X X X;; ====================================================================== X;; nuking mail headers X X(defun sc-mail-yank-clear-headers (start end) X "Nuke mail headers between START and END. XUse sc-mail-yank-ignored-headers to determine which headers to nuke." X (save-excursion X (goto-char start) X (if (search-forward "\n\n" end t) X (save-restriction X (narrow-to-region start (point)) X (goto-char start) X (while (let ((case-fold-search t)) X (re-search-forward sc-mail-yank-ignored-headers nil t)) X (beginning-of-line) X (delete-region (point) X (progn (re-search-forward "\n[^ \t]") X (forward-char -1) X (point)))))))) X X X(defun sc-mail-fetch-field (field) X "Return the value of the header field FIELD. XThe buffer is expected to be narrowed to just the headers of the Xmessage." X (save-excursion X (goto-char (point-min)) X (let ((case-fold-search t) X (name (concat "^" (regexp-quote field) "[ \t]*:[ \t]*"))) X (goto-char (point-min)) X (if (re-search-forward name nil t) X (let ((opoint (point))) X (while (progn (forward-line 1) X (looking-at "[ \t]"))) X (buffer-substring opoint (1- (point)))))))) X X X(defun sc-standard-header () X "Write a standard reference header." X (insert-before-markers ">>>>> " X (or (sc-mail-fetch-field "from") X "Some anonymous person") X " writes:\n\n")) X X X X;; ====================================================================== X;; this section queries the user for necessary information X X(defun sc-query (default) X "Query for an attribution string with the DEFAULT choice. XReturns the string entered by the user, if non-empty and non-nil, or XDEFAULT otherwise." X (let* ((prompt (concat X (cond ((eq sc-cite-context 'citing) "Cite") X ((eq sc-cite-context 'reciting) "Recite") X (t (error "Cheapcite Error: sc-cite-context invalid!")) X ) X " with attribution string: " X (if (not (string= default "")) X (concat "(default " default ") ")) X )) X (query (read-string prompt))) X (if (or (null query) X (string= query "")) X default X query))) X X X X;; ====================================================================== X;; this section contains paragraph filling support X X(defun sc-guess-fill-prefix () X "Guess the fill prefix used on the current line. XUse various heuristics to find the fill prefix. Search begins on first Xnon-blank line in the region delineated by point and mark. X X 1) If fill-prefix is already bound to the empty string, return X nil. X X 2) If fill-prefix is already bound, but not to the empty X string, return the value of fill-prefix. X X 3) If the current line starts with the last chosen citation X string, then that string is returned. X X 4) If the current line starts with a string matching the regular X expression, sc-cite-regexp, then that string is returned. X X 5) Nil is returned." X (save-excursion X ;; scan for first non-blank line in the region X (beginning-of-line) X (while (and (< (point) (mark)) X (eolp)) X (forward-line 1)) X (let ((citation sc-citation-string)) X (cond X ((string= fill-prefix "") nil) X (fill-prefix) X ((looking-at (regexp-quote citation)) citation) X ((looking-at sc-cite-regexp) X (buffer-substring X (point) (progn X (re-search-forward (concat sc-cite-regexp "\\s *") X (point-max) nil) X (point)))) X ((looking-at (concat ".*" sc-citation-delimiter "\\s *")) X (buffer-substring X (point) (progn (re-search-forward (concat ".*" sc-citation-delimiter X "\\s *")) X (point)))) X (t nil))))) X X X(defun sc-consistant-cite-p (prefix) X "Check current paragraph for consistant citation. XScans to paragraph delineated by (forward|backward)-paragraph to see Xif all lines start with PREFIX. Returns t if entire paragraph is Xconsistantly cited, nil otherwise." X (save-excursion X (let ((end (progn (forward-paragraph) X (beginning-of-line) X (or (not (eolp)) X (forward-char -1)) X (point))) X (start (progn (backward-paragraph) X (beginning-of-line) X (or (not (eolp)) X (forward-char 1)) X (point))) X (badline t)) X (goto-char start) X (beginning-of-line) X (while (and (< (point) end) X badline) X (setq badline (looking-at prefix)) X (forward-line 1)) X badline))) X X X(defun sc-fill-start (fill-prefix) X "Find buffer position of start of region which begins with FILL-PREFIX. XRestrict scan to current paragraph." X (save-excursion X (let ((badline nil) X (top (save-excursion X (backward-paragraph) X (beginning-of-line) X (or (not (eolp)) X (forward-char 1)) X (point)))) X (while (and (not badline) X (> (point) top)) X (forward-line -1) X (setq badline (not (looking-at fill-prefix))))) X (forward-line 1) X (point))) X X X(defun sc-fill-end (fill-prefix) X "Find the buffer position of end of region which begins with FILL-PREFIX. XRestrict scan to current paragraph." X (save-excursion X (let ((badline nil) X (bot (save-excursion X (forward-paragraph) X (beginning-of-line) X (or (not (eolp)) X (forward-char -1)) X (point)))) X (while (and (not badline) X (< (point) bot)) X (beginning-of-line) X (setq badline (not (looking-at fill-prefix))) X (forward-line 1))) X (forward-line -1) X (point))) X X X(defun sc-fill-paragraph () X "Cheapcite's paragraph fill function. XFill the paragraph containing or following point. Use Xsc-guess-fill-prefix to find the fill-prefix for the paragraph. X XIf the paragraph is inconsistantly cited (mixed fill-prefix), then the Xuser is queried to restrict the the fill to only those lines around Xpoint which begin with the fill prefix. X XThe variable sc-fill-arg is passed to fill-paragraph and Xfill-region-as-paragraph which controls justification of the Xparagraph. sc-fill-arg is set by sc-fill-paragraph-manually." X (save-excursion X (let ((pnt (point)) X (fill-prefix (sc-guess-fill-prefix))) X (cond X ((not fill-prefix) X (fill-paragraph sc-fill-arg)) X ((sc-consistant-cite-p fill-prefix) X (fill-paragraph sc-fill-arg)) X ((y-or-n-p "Inconsistent citation found. Restrict? ") X (message "") X (fill-region-as-paragraph (progn (goto-char pnt) X (sc-fill-start fill-prefix)) X (progn (goto-char pnt) X (sc-fill-end fill-prefix)) X sc-fill-arg)) X (t X (message "") X (progn X (setq fill-prefix sc-citation-string) X (fill-paragraph sc-fill-arg)) X )) X ))) X X X X;; ====================================================================== X;; region citing and unciting X X(defun sc-cite-region (start end) X "Cite the region between START and END." X (save-excursion X (set-mark end) X (goto-char start) X (beginning-of-line) X (let ((fstart (point)) X (fend (point))) X (while (< (point) (mark)) X ;; remove leading whitespace if desired X (and sc-fixup-whitespace-p X (fixup-whitespace)) X ;; if end of line then perhaps autofill X (cond ((eolp) X (or (= fstart fend) X (not sc-auto-fill-region-p) X (save-excursion (set-mark fend) X (goto-char (/ (+ fstart fend 1) 2)) X (run-hooks 'sc-fill-paragraph-hook))) X (setq fstart (point) X fend (point))) X ;; not end of line so perhap cite it X ((not (looking-at sc-cite-regexp)) X (insert (or sc-citation-string ""))) X (sc-nested-citation-p sc-citation-delimiter) X ) X (setq fend (point)) X (forward-line 1))))) X X X(defun sc-uncite-region (start end cite-regexp) X "Uncite the previously cited region between START and END. XCITE-REGEXP describes how a cited line of texts starts. Unciting also Xauto-fills paragraph if sc-auto-fill-region-p is non-nil." X (save-excursion X (set-mark end) X (goto-char start) X (beginning-of-line) X (let ((fstart (point)) X (fend (point))) X (while (< (point) (mark)) X ;; if end of line, then perhaps autofill X (cond ((eolp) X (or (= fstart fend) X (not sc-auto-fill-region-p) X (save-excursion (set-mark fend) X (goto-char (/ (+ fstart fend 1) 2)) X (run-hooks 'sc-fill-paragraph-hook))) X (setq fstart (point) X fend (point))) X ;; not end of line so perhaps uncite it X ((looking-at cite-regexp) X (save-excursion X (save-restriction X (narrow-to-region (progn (beginning-of-line) X (point)) X (progn (end-of-line) X (point))) X (beginning-of-line) X (delete-region (point-min) X (progn (re-search-forward cite-regexp X (point-max) X t) X (match-end 0))))))) X (setq fend (point)) X (forward-line 1))))) X X X X;; ====================================================================== X;; top level interactive functions which can be bound to keystrokes X X(defun sc-cite () X "Cite the region of text between point and mark. X XThe mail header lines should be at the top of the region, with the Xbody of the reply following. These mail header lines will be parse Xfirst for useful information, then deleted." X (interactive) X (undo-boundary) X (let ((xchange (if (> (mark) (point)) nil X (exchange-point-and-mark) X t)) X (sc-cite-context 'citing)) X (setq sc-attribution-string (sc-query sc-attribution-string)) X (setq sc-citation-string (concat sc-citation-leader X sc-attribution-string X sc-citation-delimiter X sc-citation-separator)) X (sc-cite-region (point) (mark)) X ;; leave point on first cited line X (while (and (< (point) (mark)) X (not (looking-at (if sc-nested-citation-p X sc-citation-delimiter X sc-citation-string)))) X (forward-line 1)) X (and xchange X (exchange-point-and-mark)) X )) X X X(defun sc-uncite () X "Uncite the region between point and mark." X (interactive) X (undo-boundary) X (let ((xchange (if (> (mark) (point)) nil X (exchange-point-and-mark) X t)) X (fp (or (sc-guess-fill-prefix) X ""))) X (sc-uncite-region (point) (mark) (regexp-quote fp)) X (and xchange X (exchange-point-and-mark)) X )) X X X(defun sc-recite () X "Recite the region by first unciting then citing the text." X (interactive) X (undo-boundary) X (let ((xchange (if (> (mark) (point)) nil X (exchange-point-and-mark) X t)) X (sc-cite-context 'reciting)) X (setq sc-attribution-string (sc-query sc-attribution-string)) X (sc-uncite-region (point) (mark) (regexp-quote (sc-guess-fill-prefix))) X (setq sc-citation-string (concat sc-citation-leader X sc-attribution-string X sc-citation-delimiter X sc-citation-separator)) X (sc-cite-region (point) (mark)) X (and xchange X (exchange-point-and-mark)) X )) X X X(defun sc-insert-citation () X "Insert citation string at beginning of current line." X (interactive) X (save-excursion X (beginning-of-line) X (insert sc-attribution-string))) X X X(defun sc-open-line (arg) X "Insert a newline and leave point before it. XAlso inserts the guessed prefix at the beginning of the new line. With Xnumeric ARG, inserts that many newlines." X (interactive "p") X (save-excursion X (let ((start (point)) X (string (sc-guess-fill-prefix))) X (open-line arg) X (goto-char start) X (forward-line 1) X (while (< 0 arg) X (insert string) X (forward-line 1) X (setq arg (- arg 1)))))) X X X(defun sc-fill-paragraph-manually (arg) X "Fill current cited paragraph. XReally just runs the hook sc-fill-paragraph-hook, however it does set Xthe global variable sc-fill-arg to the value of ARG. This is Xcurrently the only way to pass an argument to a hookified function." X (interactive "P") X (setq sc-fill-arg arg) X (run-hooks 'sc-fill-paragraph-hook)) X X X(defun sc-version () X "Show cheapcite version." X (interactive) X (message "Using Cheapcite %s" sc-version-number)) X X X X;; ====================================================================== X;; leach onto current mode X X(defun sc-append-current-keymap () X "Append some useful key bindings to the current local key map." X (run-hooks 'sc-default-keymap) X (setq sc-leached-keymap (current-local-map)) X ) X X X(defun sc-snag-all-keybindings () X "Snag all keybindings in major-modes current keymap." X (let* ((curkeymap (current-local-map)) X (symregexp ".*sc-.*\n") X (docstring (substitute-command-keys "\\{curkeymap}")) X (start 0) X (maxend (length docstring)) X (spooge "")) X (while (and (< start maxend) X (string-match symregexp docstring start)) X (setq spooge (concat spooge (substring docstring X (match-beginning 0) X (match-end 0)))) X (setq start (match-end 0))) X spooge)) X X X(defun sc-spoogify-docstring () X "Modifies (makes into spooge) the docstring for the current major mode. XThis will leach the keybinding descriptions for cheapcite onto the end Xof the current major mode's docstring. If major mode is preloaded, Xthis function will first make a copy of the list associated with the Xmode, then modify this copy." X (let* ((symfunc (symbol-function major-mode)) X (doc-cdr (nthcdr 2 symfunc)) X (doc-str (documentation major-mode))) X (cond X ;; is a docstring even provided? X ((not (stringp doc-str))) X ;; have we already leached on? X ((string-match "Cheapcite" doc-str)) X ;; lets build the new doc string X (t X (let ((newdoc-str (concat doc-str " X XThe major mode for this buffer has been modified to include the XCheapcite 2.1 package for handling attributions and citations of Xoriginal messages in email replies. For more information on this Xpackage, type \"\\[sc-describe]\" (see below). The following keys are Xbound to Cheapcite commands: X X" X (sc-snag-all-keybindings)))) X (condition-case nil X (setcar doc-cdr newdoc-str) X (error X ;; the major mode must be preloaded, make a copy first X (setq symfunc (copy-sequence (symbol-function major-mode)) X doc-cdr (nthcdr 2 symfunc)) X (setcar doc-cdr newdoc-str) X (fset major-mode symfunc) X )) X )) X ))) X X X;; ====================================================================== X;; this section contains default hooks and hook support for execution X X(defun sc-cite-original () X "Hook version of sc-cite. X XThis is callable from the various mail and news readers' reply Xfunction according to the predefined standard. Type X\"\\[sc-describe]\" for more details. Sc-cite-original does not do Xany yanking of the original message but it does require a few things: X X 1) The reply buffer is the current buffer. X X 2) The original message has been yanked and inserted into the X reply buffer. X X 3) Verbose mail headers from the original message have been X inserted into the reply buffer directly before the text of the X original message. X X 4) Point is at the beginning of the verbose headers. X X 5) Mark is at the end of the body of text to be cited." X (let ((headers (point-marker))) X (run-hooks 'sc-rewrite-header-hook) X (goto-char headers)) X (let ((start (region-beginning)) X (end (region-end))) X (if sc-nuke-mail-headers-p X (sc-mail-yank-clear-headers start end)) X (sc-cite) X (sc-append-current-keymap) X (sc-spoogify-docstring) X (run-hooks 'sc-run-hook) X )) X X X X;; ====================================================================== X;; describe this package X X(defun sc-describe () X "Describe the Cheapcite 2.1 package. X XThis package provides a subset of the features provided by the Xsupercite 2.1 package. Cheapcite is mainly intended for folks who Xwant to have more control over citations of original mail/news Xmessages, but don't like the complexity and/or size of supercite. Some Xfolks will undoubtably think cheapcite is too complex for its Xfunctionality and they can easily ignore both supercite and cheapcite. X XThis help string basically outlines the differences between cheapcite Xand supercite. You should be familiar with supercite's concepts Xbefore you read this help string. X XAuthor: X XNAME: Barry A. Warsaw USMAIL: National Institute of XTELE: (301) 975-3460 Standards and Technology XUUCP: uunet!cme.nist.gov!warsaw Rm. B-124, Bldg. 220 XINET: warsaw@cme.nist.gov Gaithersburg, MD 20899 X XGet on the Supercite mailing list: X XSend articles to: X INET: supercite@cme.nist.gov X UUCP: uunet!cme.nist.gov!supercite X XSend administrivia (additions/deletions to list, etc) to: X INET: supercite-request@cme.nist.gov X UUCP: uunet!cme.nist.gov!supercite-request X X-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* X XCheapcite understands these supercite variables, which have almost Xidentical function within the cheapcite package: X X sc-nested-citation-p X sc-citation-leader X sc-citation-delimiter X sc-citation-separator X sc-cite-regexp X sc-fill-paragraph-hook X sc-auto-fill-region-p X sc-fixup-whitespace-p X sc-nuke-mail-headers-p X sc-run-hook X sc-load-hook X sc-default-keymap X XCheapcite has no concept of global alists (gal's) and no information Xis gleaned from mail headers before they are nuked. Cheapcite does Xnot attempt to decipher an attribution string from mail headers, Xinstead, it queries the user for an attribution string every time it Xtries to cite a body of text. Cheapcite does remember the last Xattribution string entered by you and will use that as a default. X XSince no information is gleaned from mail headers, cheapcite can't Xreally rewrite reference headers. Instead, a hook is executed before Xthe mail headers are nuked: X X Variable: sc-rewrite-header-hook X Hook which executes a reference header rewrite function on X the buffer *before* the original mail headers are nuked. X X NOTE: be sure to use 'insert-before-markers' instead of X 'insert' in the function set in this hook. X Default: 'sc-standard-header. X XYou can use sc-mail-fetch-field to get coarse information from the Xoriginal mail headers. X X-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* X XCheapcite provides these commands with similar functionality to their Xsupercite equivalents: X X sc-cite X sc-uncite X sc-recite X sc-insert-citation X sc-open-line X sc-fill-paragraph-manually X sc-version X XCheapcite will also leach onto the current local keymap in a manner Xsimilar to supercite, however cheapcite has no notion of a Xper-interface keymap. It will only use sc-default-keymap to set the Xdesired keybindings. X X X-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* X XIf this explanation of cheapcite seems terse, you're right. But then, Xthat's the purpose of cheapcite. I've really attempted to pair down Xsupercite as much as I could, while maintaining the flavor of the Xpackage. X XEnjoy, and please send the author your compliments, questions, Xsuggestions and bug reports. Don't forget, if you're interested in Xdiscussing supercite and/or cheapcite, join the mailing list by Xsending mail to the request line mentioned above." X (interactive) X (describe-function 'sc-describe)) X X X;; ====================================================================== X;; load hook X(run-hooks 'sc-load-hook) END_OF_FILE if test 25766 -ne `wc -c <'cheapcite.el'`; then echo shar: \"'cheapcite.el'\" unpacked with wrong size! fi # end of 'cheapcite.el' fi if test -f 'mh-e.el.diff' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mh-e.el.diff'\" else echo shar: Extracting \"'mh-e.el.diff'\" \(3006 characters\) sed "s/^X//" >'mh-e.el.diff' <<'END_OF_FILE' X*** lisp/mh-e.el Thu Sep 1 11:21:53 1988 X--- lisp.local/mh-e.el Fri Sep 22 11:16:58 1989 X*************** X*** 1819,1822 **** X--- 1819,1824 ---- X X X+ ;; mod 22-Sep-1989 mdb:: mdb@ESD.3Com.COM, {3comvax,auspex,sun}!bridge2!mdb X+ ;; modified to conditionally use mhl instead of always using it. X (defun mh-insert-letter (prefix-provided folder msg) X "Insert a message from any folder into the current letter. X*************** X*** 1835,1844 **** X (save-restriction X (narrow-to-region (point) (point)) X! (let ((start (point-min))) X (if (equal msg "") (setq msg (format "%d" mh-sent-from-msg))) X! (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear" X! (mh-expand-file-name msg X! (mh-expand-file-name X! folder))) X (when (not prefix-provided) X (mh-clean-msg-header start mh-invisible-headers mh-visible-headers) X--- 1837,1849 ---- X (save-restriction X (narrow-to-region (point) (point)) X! (let ((start (point-min)) X! (msg-filename (mh-expand-file-name msg (mh-expand-file-name folder)))) X (if (equal msg "") (setq msg (format "%d" mh-sent-from-msg))) X! (if mhl-formfile X! (if (stringp mhl-formfile) X! (mh-exec-lib-cmd-output X! "mhl" "-nobell" "-noclear" "-form" mhl-formfile msg-filename) X! (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear" msg-filename)) X! (insert-file-contents msg-filename t)) X (when (not prefix-provided) X (mh-clean-msg-header start mh-invisible-headers mh-visible-headers) X*************** X*** 1883,1892 **** X (error "There is no current message."))) X X (defun mh-insert-prefix-string (ins-string) X ;; Preface each line in the current buffer with STRING. X! (goto-char (point-min)) X! (while (not (eobp)) X! (insert ins-string) X! (forward-line 1))) X X X--- 1888,1921 ---- X (error "There is no current message."))) X X+ ;; mod 7-Sep-1989 mdb: mdb@ESD.3Com.COM, {3comvax,auspex,sun}!bridge2!mdb X+ ;; generalized, hookified citations X (defun mh-insert-prefix-string (ins-string) X ;; Preface each line in the current buffer with STRING. X! (setq mh-ins-string ins-string) X! (save-excursion X! (set-mark (point-max)) X! (goto-char (point-min)) X! ;; (while (not (eobp)) X! ;; (insert ins-string) X! ;; (forward-line 1))) X! (run-hooks 'mh-yank-hooks))) X! X! ;; added 7-Sep-1988 mdb: mdb@ESD.3Com.COM, {3comvax,auspex,sun}!bridge2!mdb X! ;; generalized, hookified citations X! (defvar mh-ins-string nil X! "A temporary set by mh-insert-prefix prior to running mh-yank-hooks .") X! X! ;; added 7-Sep-1988 mdb: mdb@ESD.3Com.COM, {3comvax,auspex,sun}!bridge2!mdb X! ;; generalized, hookified citations X! (defvar mh-yank-hooks X! '(lambda () X! (save-excursion X! (goto-char (point)) X! (or (bolp) (forward-line 1)) X! (while (< (point) (mark)) X! (insert mh-ins-string) X! (forward-line 1)))) X! "Hook to run citation function. Expects POINT and MARK to be set to X! the region to cite.") X X END_OF_FILE if test 3006 -ne `wc -c <'mh-e.el.diff'`; then echo shar: \"'mh-e.el.diff'\" unpacked with wrong size! fi # end of 'mh-e.el.diff' fi if test -f 'rnewspost.el.diff' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'rnewspost.el.diff'\" else echo shar: Extracting \"'rnewspost.el.diff'\" \(917 characters\) sed "s/^X//" >'rnewspost.el.diff' <<'END_OF_FILE' X*** rnewspost.el.orig Thu Jun 29 22:38:15 1989 X--- rnewspost.el Fri Jul 28 18:38:12 1989 X*************** X*** 118,123 **** X (mail-yank-original arg) X (exchange-point-and-mark) X! (insert "In article " news-reply-yank-message-id X! " " news-reply-yank-from " writes:\n\n")) X X (defun news-reply-newsgroups () X--- 118,132 ---- X (mail-yank-original arg) X (exchange-point-and-mark) X! ;; added 14-Jun-1989 baw: warsaw@cme.nist.gov, uunet!cme-durer!warsaw X! ;; generalized, hookified citations X! (run-hooks 'news-reply-header-hook)) X! X! ;; added 14-Jun-1989 baw: warsaw@cme.nist.gov, uunet!cme-durer!warsaw X! ;; generalized, hookified citations X! (defvar news-reply-header-hook X! '(lambda () X! (insert "In article " news-reply-yank-message-id X! " " news-reply-yank-from " writes:\n\n")) X! "Hook for inserting a header at the top of a yanked message.") X X (defun news-reply-newsgroups () END_OF_FILE if test 917 -ne `wc -c <'rnewspost.el.diff'`; then echo shar: \"'rnewspost.el.diff'\" unpacked with wrong size! fi # end of 'rnewspost.el.diff' fi if test -f 'sc-electric.el' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sc-electric.el'\" else echo shar: Extracting \"'sc-electric.el'\" \(6889 characters\) sed "s/^X//" >'sc-electric.el' <<'END_OF_FILE' X;; sc-electric.el -- Version 2.1 X X;; ========== Introduction ========== X;; This file contains sc-electric mode for viewing reference headers. X;; It is loaded automatically by supercite.el when needed. X X;; ========== Disclaimer ========== X;; This software is distributed in the hope that it will be useful, X;; but WITHOUT ANY WARRANTY. No author or distributor accepts X;; responsibility to anyone for the consequences of using it or for X;; whether it serves any particular purpose or works at all, unless he X;; says so in writing. X X;; Some of this software was written as part of the supercite author's X;; official duty as an employee of the United States Government and is X;; thus in the public domain. You are free to use that particular X;; software as you wish, but WITHOUT ANY WARRANTY WHATSOEVER. It X;; would be nice, though if when you use any of this code, you give X;; due credit to the author. X X;; Other parts of this code were written by other people. Wherever X;; possible, credit to that author, and the copy* notice supplied by X;; the author are included with that code. X X;; ========== Author (unless otherwise stated) ========== X;; NAME: Barry A. Warsaw USMAIL: National Institute of X;; TELE: (301) 975-3460 Standards and Technology X;; UUCP: uunet!cme.nist.gov!warsaw Rm. B-124, Bldg. 220 X;; INET: warsaw@cme.nist.gov Gaithersburg, MD 20899 X X;; Want to be on the Supercite mailing list? X;; X;; Send articles to supercite@cme.nist.gov or uunet!cme.nist.gov!supercite X;; Send administrative queries/requests to supercite-request@cme.nist.gov X;; or uunet!cme.nist.gov!supercite-request X X(provide 'sc-electric) X X X;; ====================================================================== X;; set up vars for major mode X X(defconst sc-electric-bufname "*sc-erefs*" X "*Supercite's electric buffer name.") X X X(defvar sc-electric-mode-hook nil X "*Hook for sc-electric-mode.") X X X X;; ====================================================================== X;; sc-electric-mode X X(defun sc-electric-mode (&optional arg) X "Quasi major mode for viewing supercite reference headers. XCommands are: \\{sc-electric-mode-map} XSc-electric-mode is not intended to be run interactively, but rather Xaccessed through supercite's electric reference feature. See Xsc-insert-reference for more details. Optional ARG is the initial Xheader style to use, unless not supplied or invalid, in which case Xsc-preferred-header-style is used." X (let ((gal sc-gal-information) X (sc-eref-style (if arg ;; assume passed arg is okay X arg X (if (and (natnump sc-preferred-header-style) X (sc-valid-index-p sc-preferred-header-style)) X sc-preferred-header-style X 0))) X (gmap (current-global-map)) X (lmap (current-local-map)) X (mmap (copy-keymap minibuffer-local-map)) X chr X ) X (get-buffer-create sc-electric-bufname) X (save-excursion X (set-buffer sc-electric-bufname) X (kill-all-local-variables) X (setq sc-gal-information gal) X (sc-eref-show sc-eref-style) X (setq buffer-read-only t) X (setq mode-name "Supercite-Electric-References") X (setq major-mode 'sc-electric-mode) X (run-hooks 'sc-electric-mode-hook) X ) X (display-buffer sc-electric-bufname) X ;; set up keymaps in current buffer X (use-global-map (copy-keymap gmap)) X (suppress-keymap (current-global-map)) X (use-local-map sc-electric-mode-map) X (setq chr 0) X (while (<= chr 9) X (define-key minibuffer-local-map (int-to-string chr) X 'self-insert-command) X (setq chr (1+ chr)) X ) X (define-key minibuffer-local-map "-" 'undefined) X ;; enter command loop X (recursive-edit) X (if sc-eref-style X (condition-case nil X (eval (nth sc-eref-style sc-rewrite-header-list)) X (error nil) X )) X ;; now restore state X (use-local-map lmap) X (use-global-map gmap) X (setq minibuffer-local-map mmap) X )) X X X X;; ====================================================================== X;; functions for electric mode X X(defun sc-eref-index (index) X "Check INDEX to be sure it is a valid index into sc-rewrite-header-list. XIf sc-electric-circular-p is non-nil, then list is considered circular Xso that movement across the ends of the list wraparound." X (let ((last (1- (length sc-rewrite-header-list)))) X (cond ((sc-valid-index-p index) index) X ((< index 0) X (if sc-electric-circular-p last X (progn (error "No preceding reference headers in list.") 0))) X ((> index last) X (if sc-electric-circular-p 0 X (progn (error "No following reference headers in list.") last))) X ) X )) X X X(defun sc-eref-show (index) X "Show reference INDEX in sc-rewrite-header-list." X (setq sc-eref-style (sc-eref-index index)) X (save-excursion X (set-buffer sc-electric-bufname) X (let ((ref (nth sc-eref-style sc-rewrite-header-list)) X (buffer-read-only nil)) X (erase-buffer) X (goto-char (point-min)) X (condition-case err X (progn X (eval ref) X (message "Showing reference header %d." sc-eref-style) X ) X (void-function X (progn (message X "Symbol's function definition is void: %s (Header %d)" X (symbol-name (car (cdr err))) X sc-eref-style) X (beep) X )) X )))) X X X X;; ====================================================================== X;; interactive commands X X(defun sc-eref-describe () X "Describe supercite electric reference mode." X (interactive) X (save-excursion X (set-buffer sc-electric-bufname) X (describe-mode))) X X X(defun sc-eref-next () X "Display next reference in minibuffer." X (interactive) X (sc-eref-show (1+ sc-eref-style))) X X X(defun sc-eref-prev () X "Display previous reference in minibuffer." X (interactive) X (sc-eref-show (1- sc-eref-style))) X X X(defun sc-eref-setn () X "Set reference header selected as preferred." X (interactive) X (setq sc-preferred-header-style sc-eref-style) X (message "Preferred reference style set to header %d." sc-eref-style)) X X X(defun sc-eref-goto (refnum) X "Show reference style indexed by REFNUM. XIf REFNUM is an invalid index, don't go to that reference and return Xnil." X (interactive "NGoto Reference Number: ") X (if (sc-valid-index-p refnum) X (sc-eref-show refnum) X (error "Invalid reference number: %d. (Range: [%d, %d])" X refnum 0 (1- length sc-rewrite-header-list)) X )) X X X(defun sc-eref-jump () X "Set reference header to preferred header." X (interactive) X (sc-eref-show sc-preferred-header-style)) X X X(defun sc-eref-abort () X "Exit from electric referencing without inserting reference." X (interactive) X (setq sc-eref-style nil) X (delete-windows-on sc-electric-bufname) X (kill-buffer sc-electric-bufname) X (exit-recursive-edit)) X X X(defun sc-eref-exit () X "Exit from electric referencing and insert selected reference." X (interactive) X (delete-windows-on sc-electric-bufname) X (kill-buffer sc-electric-bufname) X (exit-recursive-edit)) END_OF_FILE if test 6889 -ne `wc -c <'sc-electric.el'`; then echo shar: \"'sc-electric.el'\" unpacked with wrong size! fi # end of 'sc-electric.el' fi if test -f 'sc-oloads.el' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sc-oloads.el'\" else echo shar: Extracting \"'sc-oloads.el'\" \(9666 characters\) sed "s/^X//" >'sc-oloads.el' <<'END_OF_FILE' X;; sc-oloads.el -- Version 2.1 X X;; ========== Introduction ========== X;; This file contains overloading facilities for supercite. Supercite X;; interfaces to various news and mail reading packages in a standard X;; way, as determined in 1989 by the supercite mailing list X;; participants. Many mail/news package authors participated in the X;; discussion and the standard is an outcome of those discussions. X X;; As of the date of this writing (18-Jul-1990), only VM 4.40+ conform X;; to the standard out-of-the-package. Since RMAIL, GNUS, RNEWS, MH X;; and other packages utilize elisp in the emacs 18.55 distribution, X;; and since this distribution does not conform to the standard, X;; patches are necessary to enable these packages to use supercite. X X;; It is preferrable to install the patches that are supplied with X;; supercite, however, that is not always possible. This package will X;; let you overload certain functions which should provide access to X;; supercite for most of the mail/news readers I currently know about. X;; Packages supported (I hope): GNUS 3.12 and up, VM 4.40 and up, X;; RMAIL and RNEWS for 18.55, MH, probably GNEWS and PCMAIL. Are X;; there others? X X;; ========== Disclaimer ========== X;; This software is distributed in the hope that it will be useful, X;; but WITHOUT ANY WARRANTY. No author or distributor accepts X;; responsibility to anyone for the consequences of using it or for X;; whether it serves any particular purpose or works at all, unless he X;; says so in writing. X X;; Some of this software was written as part of the supercite author's X;; official duty as an employee of the United States Government and is X;; thus in the public domain. You are free to use that particular X;; software as you wish, but WITHOUT ANY WARRANTY WHATSOEVER. It X;; would be nice, though if when you use any of this code, you give X;; due credit to the author. X X;; Other parts of this code were written by other people. Wherever X;; possible, credit to that author, and the copy* notice supplied by X;; the author are included with that code. X X;; ========== Author (unless otherwise stated) ========== X;; NAME: Barry A. Warsaw USMAIL: National Institute of X;; TELE: (301) 975-3460 Standards and Technology X;; UUCP: uunet!cme.nist.gov!warsaw Rm. B-124, Bldg. 220 X;; INET: warsaw@cme.nist.gov Gaithersburg, MD 20899 X X;; Want to be on the Supercite mailing list? X;; X;; Send articles to supercite@cme.nist.gov or uunet!cme.nist.gov!supercite X;; Send administrative queries/requests to supercite-request@cme.nist.gov X;; or uunet!cme.nist.gov!supercite-request X X(provide 'sc-oloads) X X X;; ====================================================================== X;; functions which do the overloading X;; based on code supplied by umerin@tc.nagasaki.go.jp X X(defvar sc-overload-functions X '((mail-yank-original sc-mail-yank-original) X (news-reply-yank-original sc-news-reply-yank-original) X (mh-insert-letter sc-mh-insert-letter) X (mh-insert-prefix-string sc-mh-insert-prefix-string) X ) X "*Functions overloaded by supercite. XIt is a list of '(original overload)', where original is the original Xfunction symbol, overload is the supercite equivalent function.") X X X(defun sc-overload-functions () X "Overload functions defined by the variable sc-overload-functions. XIf the original symbol is not yet bound, it will not be overloaded. XAlso, if the symbol has already been overloaded, it will not be Xoverloaded again." X (let ((binding nil) X (overloads sc-overload-functions)) X (while overloads X (setq binding (car overloads)) X (setq overloads (cdr overloads)) X (and (fboundp (car binding)) X (not (get (car binding) 'sc-overloaded)) X (progn X (fset (car binding) (symbol-function (car (cdr binding)))) X (put (car binding) 'sc-overloaded 'sc-overloaded)) X ) X ))) X X X X;; ====================================================================== X;; sendmail.el overload functions. This is the heart of supercite X;; conformance by packages which rely on distribution emacs elisp. You X;; should almost always overload this function. X X(defun sc-mail-yank-original (arg) X "Supercite version of mail-yank-original. XThis function is the workhorse which many packages rely upon to do Xciting. It inserts the message being replied to in the reply buffer. XPuts point before the mail headers and mark after body of text. X XCitation is accomplished by running the hook mail-yank-hooks and is Xthus user configurable. Default is to indent each nonblank line ARG Xspaces (default 3). Just \\[universal-argument] as argument means Xdon't indent and don't delete any header fields." X (interactive "P") X (if mail-reply-buffer X (let ((start (point))) X (delete-windows-on mail-reply-buffer) X (insert-buffer mail-reply-buffer) X (if (consp arg) X nil X ;; mod 28-Jul-1989 baw: warsaw@cme.nist.gov, X ;; generalized, hookified citations X (run-hooks 'mail-yank-hooks)) X (exchange-point-and-mark) X (if (not (eolp)) (insert ?\n))))) X X;; added 28-Jul-1989 baw: warsaw@cme.nist.gov X;; generalized, hookified citations X(defvar mail-indention-spaces 3 X "*Set to number of spaces to indent when yanking a reply.") X X X;; added 28-Jul-1989 baw: warsaw@cme.nist.gov X;; generalized, hookified citations X(defvar mail-yank-hooks X "*Hook for citing a yanked original message in a reply buffer." X '(lambda () X (indent-rigidly (point) (mark) mail-indention-spaces)) X "Hook to run citation function. XExpects point and mark to be set to the region to cite.") X X X X;; ====================================================================== X;; rnewspost.el overload functions. Not strictly necessary for supercite X;; to work but it reduces the amount of manual cleaning the user has to X;; do for GNUS and other news readers. X X(defun sc-news-reply-yank-original (arg) X "Supercite version of news-reply-yank-original. XInsert the message being replied to in the reply buffer. Puts point Xbefore the mail headers and mark after body of the text. Calls Xmail-yank-original to actually yank the message into the buffer and Xcite text. X XIf mail-yank-original is not overloaded by supercite, each nonblank Xline is indented ARG spaces (default 3). Just \\[universal-argument] Xas ARG means don't indent and don't delete any header fields." X (interactive "P") X (mail-yank-original arg) X (exchange-point-and-mark) X ;; added 14-Jun-1989 baw: warsaw@cme.nist.gov X ;; generalized, hookified citations X (run-hooks 'news-reply-header-hook)) X X X;; added 14-Jun-1989 baw: warsaw@cme.nist.gov generalized, hookified X;; citations (modified 18-Jul-1990) X(defvar news-reply-header-hook X "*Hook which handles insertion of a reference header." X '(lambda () X (insert "In article " news-reply-yank-message-id X " " news-reply-yank-from " writes:\n\n")) X "Hook for inserting a header at the top of a yanked message.") X X X X;; ====================================================================== X;; mh-e diffs supplied by Mark D. Baushke X;; Internet: mdb@ESD.3Com.COM X;; UUCP: {3comvax,auspex,sun}!bridge2!mdb X;; X;; mod 22-Sep-1989 mdb:: mdb@ESD.3Com.COM, {3comvax,auspex,sun}!bridge2!mdb X;; modified to conditionally use mhl instead of always using it. X(defun sc-mh-insert-letter (prefix-provided folder msg) X "Insert a message from any folder into the current letter. XRemoves the message's headers using mh-invisible-headers. XPrefixes each non-blank line with mh-ins-buf-prefix (default \">> \"). XIf (optional) prefix argument provided, do not indent and do not delete Xheaders. XLeaves the mark before the letter and point after it." X (interactive X (list current-prefix-arg X (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) X (read-input (format "Message number%s: " X (if mh-sent-from-msg X (format " [%d]" mh-sent-from-msg) X ""))))) X (save-restriction X (narrow-to-region (point) (point)) X (let ((start (point-min)) X (msg-filename (mh-expand-file-name msg X (mh-expand-file-name folder)))) X (if (equal msg "") (setq msg (format "%d" mh-sent-from-msg))) X (if mhl-formfile X (if (stringp mhl-formfile) X (mh-exec-lib-cmd-output X "mhl" "-nobell" "-noclear" "-form" mhl-formfile msg-filename) X (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear" msg-filename)) X (insert-file-contents msg-filename t)) X (when (not prefix-provided) X (mh-clean-msg-header start mh-invisible-headers mh-visible-headers) X (set-mark start) ; since mh-clean-msg-header moves it X (mh-insert-prefix-string mh-ins-buf-prefix))))) X X;; mod 7-Sep-1989 mdb: mdb@ESD.3Com.COM, {3comvax,auspex,sun}!bridge2!mdb X;; generalized, hookified citations X(defun sc-mh-insert-prefix-string (ins-string) X ;; Preface each line in the current buffer with STRING. X (setq mh-ins-string ins-string) X (save-excursion X (set-mark (point-max)) X (goto-char (point-min)) X (run-hooks 'mh-yank-hooks))) X X;; added 7-Sep-1988 mdb: mdb@ESD.3Com.COM, {3comvax,auspex,sun}!bridge2!mdb X;; generalized, hookified citations X(defvar mh-ins-string nil X "A temporary set by mh-insert-prefix prior to running mh-yank-hooks .") X X;; added 7-Sep-1988 mdb: mdb@ESD.3Com.COM, {3comvax,auspex,sun}!bridge2!mdb X;; generalized, hookified citations X(defvar mh-yank-hooks X '(lambda () X (save-excursion X (goto-char (point)) X (or (bolp) (forward-line 1)) X (while (< (point) (mark)) X (insert mh-ins-string) X (forward-line 1)))) X "Hook which will add attribution to another message being quoted. When Xthis hook gets run, point is at the beginning of the region to be cited Xand mark is at the end.") END_OF_FILE if test 9666 -ne `wc -c <'sc-oloads.el'`; then echo shar: \"'sc-oloads.el'\" unpacked with wrong size! fi # end of 'sc-oloads.el' fi if test -f 'sendmail.el.diff' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sendmail.el.diff'\" else echo shar: Extracting \"'sendmail.el.diff'\" \(1226 characters\) sed "s/^X//" >'sendmail.el.diff' <<'END_OF_FILE' X*** sendmail.el.orig Thu Jun 29 22:38:16 1989 X--- sendmail.el Fri Jul 28 19:06:33 1989 X*************** X*** 378,386 **** X (if (consp arg) X nil X! (mail-yank-clear-headers start (mark)) X! (indent-rigidly start (mark) X! (if arg (prefix-numeric-value arg) 3))) X (exchange-point-and-mark) X (if (not (eolp)) (insert ?\n))))) X X (defun mail-yank-clear-headers (start end) X--- 378,400 ---- X (if (consp arg) X nil X! ;; mod 28-Jul-1989 baw: warsaw@cme.nist.gov, uunet!cme-durer!warsaw X! ;; generalized, hookified citations X! (run-hooks 'mail-yank-hooks)) X (exchange-point-and-mark) X (if (not (eolp)) (insert ?\n))))) X+ X+ ;; added 28-Jul-1989 baw: warsaw@cme.nist.gov, uunet!cme-durer!warsaw X+ ;; generalized, hookified citations X+ (defvar mail-indention-spaces 3 X+ "Set to number of spaces to indent when yanking a reply.") X+ X+ ;; added 28-Jul-1989 baw: warsaw@cme.nist.gov, uunet!cme-durer!warsaw X+ ;; generalized, hookified citations X+ (defvar mail-yank-hooks X+ '(lambda () X+ (indent-rigidly (point) (mark) mail-indention-spaces)) X+ "Hook to run citation function. Expects POINT and MARK to be set to the X+ region to cite.") X+ X X (defun mail-yank-clear-headers (start end) END_OF_FILE if test 1226 -ne `wc -c <'sendmail.el.diff'`; then echo shar: \"'sendmail.el.diff'\" unpacked with wrong size! fi # end of 'sendmail.el.diff' fi echo shar: End of archive 1 \(of 2\). cp /dev/null ark1isdone MISSING="" for I in 1 2 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked both archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0