[comp.emacs] Supercite 2.0 part 01 of 02

warsaw@cme.nist.gov (Barry A. Warsaw) (10/14/89)

Here is version 2.0 of Supercite, a citation package based on
Superyank 1.11 that was previously posted.  For those of you
unfamiliar with the package, it allows you to have quite a bit of
control over citing original messages in reply buffers (ever growled
at the hardcoded way emacs cites the original message?).  It also
provides what many people feel is a superior style of citations:
non-nested, author attributed citations.

From the supercite documentation:

There are two general forms of citation.  In "nested citations",
indication is made that the cited line was written by someone *other*
than the current message author, but no reference is made as to the
identity of the original author.  Here's an example of what a message
buffer would look like using nested citations after multiple replies:

     >>John originally wrote this
     >>and this as well
     > Jane said that John didn't know
     > what he was talking about
     And that's what I think too.

In "non-nested citations" each cited line begins with an informative
string referencing the original author.  Only the first level of
referencing will be shown; subsequent cites don't nest the references.
The same message described above might look like this if non-nested
citations were used:

     John> John originally wrote this
     John> and this as well
     Jane> Jane said that John didn't know
     Jane> what he was talking about
     And that's what I think too.

Notice that my inclusion of Jane's inclusion of John's original
message did not result in a cited line beginning with: "Jane>John> ".
Thus no nested citations.

Supercite 2.0 has been tested and *seems* to work well with RMAIL
18.54+, GNUS 3.12+, VM 4.37+, and MH-E 18.54+.  It probably works fine
with GNEWS as well. You may need to install some mods or overloads to
get it to work with these packages. All of this is described in the
documentation and can be relatively painless.

Supercite 2.0 is a *big* improvement over Superyank 1.11, being
totally rewritten and many nice features added. There are no diffs
between the versions available.  Below and in a following message are
the two shar files containing all the supercite code and support
files.  Also, the compressed shar files are available via anonymous
ftp at durer.cme.nist.gov [129.6.32.4] under
pub/supercite.shar.0{1,2}.Z

Enjoy.
-Barry

NAME: Barry A. Warsaw                USMAIL: National Institute of Standards
TELE: (301) 975-3460                         and Technology (formerly NBS)
UUCP: {...}!uunet!cme-durer!warsaw           Rm. B-124, Bldg. 220
ARPA: warsaw@cme.nist.gov                    Gaithersburg, MD 20899

P.S. I run a mailing list for supercite users.  Its just a mail
exploder, so if you're interested in getting on the list send mail to
request address below.

Send articles to supercite@cme.nist.gov or uunet!cme-durer!supercite
Send administrative queries/requests to supercite-request@cme.nist.gov
	or uunet!cme-durer!supercite-request

--cut here-------------------------------------------------------
#! /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 <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 2)."
# Contents:  ChangeLog README baw-alist.el mh-e.el.diff
#   rnewspost.el.diff sendmail.el.diff sup-misc.el
# Wrapped by warsaw@rtg on Fri Oct 13 18:46:08 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'ChangeLog' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ChangeLog'\"
else
echo shar: Extracting \"'ChangeLog'\" \(5144 characters\)
sed "s/^X//" >'ChangeLog' <<'END_OF_FILE'
XFri Oct 13 17:30:13 1989  Barry Warsaw  (warsaw at rtg)
X
X		* Shar it up and post.
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 5144 -ne `wc -c <'ChangeLog'`; then
    echo shar: \"'ChangeLog'\" unpacked with wrong size!
fi
# end of 'ChangeLog'
fi
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(4490 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XThis is the distribution of SUPERCITE 2.0, an elisp utility to do nice
Xciting of reply messages for GNUemacs.
X
Xsupercite.el is the main file containing the citing functions, it
Xcalls functions defined in baw-alist.el so be sure both are on your
Xload-path.
X
Xsupercite 2.0 should run as is with VM 4.37+ after you make the hook
Xbindings as described in the documentation.  To run it with RMAIL
X(emacs 18.54 & 18.55), or with GNUS 3.12, you need to either install
Xthe sendmail and rnewspost context diffs, or use the overload
Xfunctions in sc-misc.el.  To run it with mh-e, also either install the
Xcontext diff or use the overload function.
X
XOnce you've got it installed and loaded, you can type "M-x sc-describe"
Xto get documentation on how to use it.  Below I've included the
Xpertinent information from the documentation on how to link supercite
Xin with the mail/news reader of your choice.
X
X==from supercite.el==============================
X
XFinally, some discussion on how to interface supercite with the
Xvarious mail/news readers you might be using is in order.  This
Xdiscussion is also useful for those who might be writing a mail/news
Xreader and want to let your users take advantage of Supercite.
X
XThe author runs a Supercite mailing list on which a number of
Xmail/news reader authors and other Supercite users participate.  A
Xwhile back some discussion was held and an interface between these
Xreaders and Supercite was agreed upon.  The ancestor to this package,
XSUPERYANK 1.11 was designed along an old inteface and this package,
XSUPERCITE 2.0 conforms to this new standard.  As of the date of this
Xwriting (12-Oct-1989) only VM 4.37 conforms to this standard as
Xdistributed. GNUS 3.12, RMAIL and MH-E all use functions distributed
Xwith EMACS 18.55 and patches are available to the appropriate files,
Xdistributed along with Supercite as: 
X
X     {rnewspost,sendmail,mh-e}.el.diff
X
XIf you do not want to install the diffs, or are not able to install
Xthem, check the file sc-misc.el.  This file contains overload
Xfunctions which can be selectively loaded to provide the necessary
Xfunctionality.  If you decide to go the overload route, be sure to set
X`sc-load-hook' to something like:
X
X     (setq sc-load-hook '(lambda () (load \"sc-misc\")))
X
XThe variables controlling overloading should be rather self
Xexplanatory in the sc-misc.el file.  This file also contains some
Xmiscellaneous extension to RMAIL. Also, in superyank version 1.11, the
Xfunction `mail-yank-original' was overloaded and bound to \"\\C-c
X\\C-y\". This functionality is provided in this release, but will no
Xlonger be supported.
X
XNow, with Supercite version 2.0, a hook is provided called
X`mail-yank-hooks' which is run *after* the text is yanked.  This way,
Xthe particular mail/news reader handles setting up the reply buffer
Xand yanking the appropriate text into the buffer, but leaves citing
Xthe lines up to external functions. Most readers will provide a simple
Xcitation function hooked in by default, for those who haven't yet
Xdiscovered this superior citation package.  Mh-e users should use
X`mh-yank-hooks' instead of `mail-yank-hooks'.  For these to work you
Xmust have installed diffs to {rnewspost,sendmail,mh-e}.el or used the
Xoverloaded functions supplied in sc-misc.el.
X
XThe mail/news reader should put the verbose mail headers at the top of
Xthe yanked text and leave POINT at the beginning of the headers.  MARK
Xshould point to the end of the yanked text.  Then it should run
X`mail-yank-hooks'.
X
XAdd some of this code to your .emacs file to use supercite 2.0:
X
X     (autoload 'sc-cite-original \"supercite\" \"Hookified Supercite 2.0\" t)
X     (autoload 'sc-cite          \"supercite\" \"Interactive Supercite 2.0\" t)
X     (autoload 'sc-describe      \"supercite\" \"Describe Supercite 2.0\" t)
X     (setq mail-yank-hooks 'sc-cite-original)
X     (setq mh-yank-hooks 'sc-cite-original)
X
X==================================================
X
XNAME: Barry A. Warsaw                USMAIL: National Institute of Standards
XTELE: (301) 975-3460                         and Technology (formerly NBS)
XUUCP: {...}!uunet!cme-durer!warsaw           Rm. B-124, Bldg. 220
XARPA: warsaw@cme.nist.gov                    Gaithersburg, MD 20899
X
XThis mailing list covers issues related to the advanced mail/news
Xcitation package called SUPERCITE.
X
XSend articles to supercite@cme.nist.gov or uunet!cme-durer!supercite
XSend administrative queries/requests to supercite-request@cme.nist.gov
X	or uunet!cme-durer!supercite-request
END_OF_FILE
if test 4490 -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'\" \(6063 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;; This file is distributed in the hope that it will be useful, but
X;; 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 author's official duty as
X;; an employee of the United States Government and is thus in the
X;; public domain.  You are free to use this software as you wish, but
X;; WITHOUT ANY WARRANTY WHATSOEVER.  It would be nice, though if when
X;; you use this code, you give due credit to the author.
X
X;; ======================================================================
X;; Author:
X;;
X;; NAME: Barry A. Warsaw                USMAIL: National Institute of Standards
X;; TELE: (301) 975-3460                         and Technology (formerly NBS)
X;; UUCP: {...}!uunet!cme-durer!warsaw           Rm. B-124, Bldg. 220
X;; ARPA: warsaw@cme.nist.gov                    Gaithersburg, MD 20899
X
X;; ======================================================================
X;; Modification history:
X;;
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;; ======================================================================
X;; features
X;;
X(provide 'baw-alist)
X
X
X;; ======================================================================
X;; sort an association list so that key-value pair containing key
X;; is at the head of the alist
X;;
X(defun asort (alist-symbol key)
X  "Sort the alist referenced by ALIST-SYMBOL so that the key-value
Xpair matching KEY is at the head of the list. Doesn't affect the order
Xof any other key-value pair.  Returns the sorted list."
X  (set alist-symbol
X       (sort (copy-alist (eval alist-symbol))
X	     (function (lambda (a b) (equal (car a) key))))))
X
X
X;; ======================================================================
X;; make an alist element
X;;
X(defun aelement (key value)
X  "Returns an alist element by making a list of a cons cell containing
XKEY as the car and VALUE as the cdr."
X  (list (cons key value)))
X
X
X;; ======================================================================
X;; return the head symbol of alist
X;;
X(defun aheadsym (alist)
X  "Return the key symbol at the head of ALIST."
X  (car (car alist)))
X
X
X;; ======================================================================
X;; check for "not headness" of key
X;;
X(defun anot-head-p (alist key)
X  "Check the ALIST to see if the key-value pair matching KEY is at the
Xhead of the list. Returns nil if ALIST is nil or if the key-value pair
Xis at the head of ALIST. Return t if key-value pair is not at the head
Xof ALIST.  ALIST is not altered."
X  (not (equal (aheadsym alist) key)))
X
X
X;; ======================================================================
X;; put the key value pair into the head of the alist
X;;
X(defun aput (alist-symbol key &optional value)
X  "Inserts into the alist referenced by ALIST-SYMBOL, the key-value
Xpair made from KEY and optionally, VALUE.  Returns the alist. If the
Xkey-value pair can be found in the alist, and the optional VALUE is
Xsupplied non-nil, then the returned alist will have the value
Xassociated with KEY set to VALUE.  If VALUE is not supplied or is nil,
Xthe key-value pair will not be modified, but will be moved to the head
Xof the alist. If the key-value pair cannot be found in the alist, it
Xwill be inserted into the head of the alist. Returns nil if ALIST is
Xnil."
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;; ======================================================================
X;; delete the key from alist
X;;
X(defun adelete (alist-symbol key)
X  "Deletes from the alist referenced by ALIST-SYMBOL, the key-value
Xpair matching KEY.  Returns the 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;; ======================================================================
X;; return the value associated with key
X;;
X(defun aget (alist key &optional keynil-p)
X  "Returns the value in ALIST that is associated with KEY. Optional
XKEYNIL-P describes what to do if the *value* associated with KEY is
Xnil.  If KEYNIL-P is not supplied or is nil, and the value is nil,
Xthen 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, then nil is
Xreturned.  Returns nil if ALIST is nil. ALIST remains unchanged."
X
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;; ======================================================================
X;; make an alist from one or two flat lists
X;;
X(defun amake (alist-symbol keylist &optional valuelist)
X  "Make an association list, ALIST-SYMBOL, where each car in KEYLIST
Xbecomes a key and is associated with the appropriate value in
XVALUELIST.  If VALUELIST is not supplied or is nil, then each key is
Xassociated with nil.  KEYLIST and VALUELIST should have the same
Xnumber of elements, but it isn't necessary; if VALUELIST is smaller,
Xremaining keys are associated with nil; if VALUELIST is larger, extra
Xvalues are ignored.  Returns the 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 6063 -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 '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 '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
if test -f 'sup-misc.el' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sup-misc.el'\"
else
echo shar: Extracting \"'sup-misc.el'\" \(9401 characters\)
sed "s/^X//" >'sup-misc.el' <<'END_OF_FILE'
X;; sup-misc.el -- Version 2.0
X
X;; This file contains miscellaneous support functions for the
X;; Supercite 2.0 package.  Things like non-hooked, overload support
X;; for RMAIL, mh-e and other `unconforming' email readers.  Also,
X;; other functions that have been contributed that aren't strictly
X;; supercite's responsibility, but help make things easier for
X;; supercite users.
X
X;; This file is distributed in the hope that it will be useful, but
X;; 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 the functions.
X
X;; ======================================================================
X;; Author (unless stated otherwise):
X;;
X;; NAME: Barry A. Warsaw                USMAIL: National Institute of Standards
X;; TELE: (301) 975-3460                         and Technology (formerly NBS)
X;; UUCP: {...}!uunet!cme-durer!warsaw           Rm. B-124, Bldg. 220
X;; ARPA: 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-durer!supercite
X;; Send administrative queries/requests to supercite-request@cme.nist.gov
X;;	or uunet!cme-durer!supercite-request
X
X(provide 'sup-misc)
X
X;; ======================================================================
X;; configure overloading
X;;
X(defvar sc-overload-rnewspost nil
X  "Set to non-nil to overload rnewspost.el diffs.")
X(defvar sc-overload-sendmail nil
X  "Set to non-nil to overload sendmail.el diffs.")
X(defvar sc-overload-mh-e nil
X  "Set to non-nil to overload mh-e diffs.")
X(defvar sc-use-version1-interface nil
X  "Set to non-nil to use version 1.11 interface.")
X(defvar sc-load-rmail-extensions nil
X  "Set to non-nil to load Khalid's rmail extensions.")
X
X
X(if sc-overload-rnewspost (progn
X
X;; ======================================================================
X;; overlay for diffs to rnewspost.el
X;;
X(defun news-reply-yank-original (arg)
X  "Insert the message being replied to, if any (in rmail).
XPuts point before the text and mark after.
XIndents each nonblank line ARG spaces (default 3).
XJust \\[universal-argument] as argument means don't indent
Xand 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, 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
X)) ;; end-if-overload-rnewspost
X(if sc-overload-sendmail (progn
X
X;; ======================================================================
X;; overlay for diffs to sendmail.el
X;;
X(defun mail-yank-original (arg)
X  "Insert the message being replied to, if any (in rmail).
XPuts point before the text and mark after.
XIndents each nonblank line ARG spaces (default 3).
XJust \\[universal-argument] as argument means don't indent
Xand 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, 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
Xregion to cite.")
X
X
X)) ;; end if-overload-sendmail
X(if sc-overload-mh-e (progn
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 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 (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 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 to run citation function. Expects POINT and MARK to be set to
Xthe region to cite.")
X
X)) ;; end overload mh-e
X(if sc-use-version1-interface (progn
X
X;; ======================================================================
X;; backward compatibility for superyank 1.11 (interactive version)
X;; author: Barry A. Warsaw (warsaw@cme.nist.gov, uunet!cme-durer!warsaw)
X;;
X(defun sc-yank-original (arg)
X  "Interactive version of the rewritten mail-yank-original function.
XThis is provided for backward compatibility with version 1.x but
Xshould not be used any more.  Instead use the hook-ized version
X`sc-cite-original'. Support for this function ends with this release."
X  (interactive "P")
X  (if mail-reply-buffer
X      (let* ((sc-confirm-always-p (if (consp arg)
X				      t
X				    sc-confirm-always-p)))
X	(delete-windows-on mail-reply-buffer)
X	(insert-buffer mail-reply-buffer)
X	(sc-cite-original))))
X
X
X)) ;; end use version1 interface
X(if sc-load-rmail-extensions (progn
X
X;; ======================================================================
X;; load rmail extensions provided by Khalid Satar
X;; Khalid Sattar                   JANET  : admin@uk.ac.exeter.cs
X;; Computer Science Dept.          UUCP   : admin@expya.uucp
X;; University of Exeter            BITNET : admin%uk.ac.exeter.cs@ukacrl
X;; Exeter, UK.                     Tel    : +44 392 264062
X;;
X(defun mail-rmail-next-mesg (arg)
X  "Pop RMAIL window and go the next unread message.  If ARG is
Xspecified then go ARG messages forward/backward"
X  (interactive "p")
X  (if (not mail-reply-buffer)
X      (error "You need to compose mail via rmail for this to work")
X    (let ((mail-buffer (current-buffer)))
X      (switch-to-buffer-other-window mail-reply-buffer)
X      (rmail-next-undeleted-message arg)
X      (switch-to-buffer-other-window mail-buffer))))
X     
X(defun mail-rmail-previous-mesg (arg)
X  "Pop RMAIL window and go the previous unread message.  If ARG is
Xspecified then go ARG messages backward"
X  (interactive "p")
X  (mail-rmail-next-mesg (- arg)))
X
X
X)) ;; end rmail extensions
END_OF_FILE
if test 9401 -ne `wc -c <'sup-misc.el'`; then
    echo shar: \"'sup-misc.el'\" unpacked with wrong size!
fi
# end of 'sup-misc.el'
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.
    echo "Check the README for installation info."
    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