From decwrl!wuarchive!cs.utexas.edu!uunet!allbery Fri Nov  3 19:54:07 PST 1989
Article 1161 of comp.sources.misc:
Path: decwrl!wuarchive!cs.utexas.edu!uunet!allbery
From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
Newsgroups: comp.sources.misc
Subject: v08i114: pcmail part 06 of 08
Message-ID: <71271@uunet.UU.NET>
Date: 4 Nov 89 00:23:37 GMT
Sender: allbery@uunet.UU.NET
Reply-To: markl@oracle.com (Croaker the Physician)
Lines: 1195
Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)

Posting-number: Volume 8, Issue 114
Submitted-by: markl@oracle.com (Croaker the Physician)
Archive-name: pcmail/part06

#--------------------------------CUT HERE-------------------------------------
#! /bin/sh
#
# This is a shell archive.  Save this into a file, edit it
# and delete all lines above this comment.  Then give this
# file to sh by executing the command "sh file".  The files
# will be extracted into the current directory owned by
# you with default permissions.
#
# The files contained herein are:
#
# -rw-rw-r--  1 markl       27066 Oct 31 09:10 pcmailsum.el
# -rw-rw-r--  1 markl       13297 Oct 31 11:50 pcmailout.el
# -rw-rw-r--  1 markl        1737 Oct 30 12:23 vms-doprint.com
# -rw-rw-r--  1 markl        2576 Oct 30 12:23 vms-movemail.com
#
echo 'x - pcmailsum.el'
if test -f pcmailsum.el; then echo 'shar: not overwriting pcmailsum.el'; else
sed 's/^X//' << '________This_Is_The_END________' > pcmailsum.el
X;;;; GNU-EMACS PCMAIL mail reader
X
X;;  Written by Mark L. Lambert
X;;  Architecture Group, Network Products Division
X;;  Oracle Corporation
X;;  20 Davis Dr,
X;;  Belmont CA, 94002
X;;
X;;  internet: markl@oracle.com or markl%oracle.com@apple.com
X;;  UUCP:     {hplabs,uunet,apple}!oracle!markl
X
X;; Copyright (C) 1989 Mark L. Lambert
X
X;; This file is not officially part of GNU Emacs, but is being
X;; donated to the Free Software Foundation.  As such, it is
X;; subject to the standard GNU-Emacs General Public License,
X;; referred to below.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X;;;; global variables
X
X;;; system-defined globals
X
X(defvar pcmail-summary-mode-map nil
X  "Keymap for pcmail summary mode.")
X
X;;;; mode definitions 
X
X(if pcmail-summary-mode-map
X    nil
X  (suppress-keymap (setq pcmail-summary-mode-map (make-keymap)))
X  (define-key pcmail-summary-mode-map "?" 'describe-mode)
X  (define-key pcmail-summary-mode-map ">" 'pcmail-summary-last-message)
X  (define-key pcmail-summary-mode-map "<" 
X    '(lambda () (interactive) (pcmail-summary-goto-message 1)))
X  (define-key pcmail-summary-mode-map "." 'pcmail-summary-beginning-of-message)
X  (define-key pcmail-summary-mode-map " " 'pcmail-summary-scroll-message-up)
X  (define-key pcmail-summary-mode-map "a" 'pcmail-summary-archive-message)
X  (define-key pcmail-summary-mode-map "b" 'pcmail-summary-sort-folder)
X  (define-key pcmail-summary-mode-map "c" 'pcmail-summary-copy-message)
X  (define-key pcmail-summary-mode-map "d" 'pcmail-summary-delete-message)
X  (define-key pcmail-summary-mode-map "e" 'pcmail-summary-expunge-folder)
X  (define-key pcmail-summary-mode-map "f" 'pcmail-summary-forward-message)
X  (define-key pcmail-summary-mode-map "g" 'pcmail-summary-get-mail)
X  (define-key pcmail-summary-mode-map "i" 'pcmail-summary-get-mail)
X  (define-key pcmail-summary-mode-map "j" 'pcmail-summary-goto-message)
X  (define-key pcmail-summary-mode-map "k" 'pcmail-summary-kill-message-later)
X  (define-key pcmail-summary-mode-map "m" 'pcmail-summary-mail)
X  (define-key pcmail-summary-mode-map "n" 'pcmail-summary-next-message)
X  (define-key pcmail-summary-mode-map "o" 'pcmail-summary-print-message)
X  (define-key pcmail-summary-mode-map "p" 'pcmail-summary-previous-message)
X  (define-key pcmail-summary-mode-map "q" 'pcmail-summary-quit)
X  (define-key pcmail-summary-mode-map "r" 'pcmail-summary-answer-message)
X  (define-key pcmail-summary-mode-map "s" 'pcmail-summary-save-folder)
X  (define-key pcmail-summary-mode-map "u" 'pcmail-summary-undelete-message)
X  (define-key pcmail-summary-mode-map "w" 'pcmail-summary-edit-message)
X  (define-key pcmail-summary-mode-map "x" 'pcmail-summary-exit)
X  (define-key pcmail-summary-mode-map "y" 'pcmail-summary-change-message-attr)
X  (define-key pcmail-summary-mode-map "\em" 'pcmail-folder-list-folders)
X  (define-key pcmail-summary-mode-map "\C-d" 
X    'pcmail-summary-delete-message-backward)
X  (define-key pcmail-summary-mode-map "\C-m" 'pcmail-summary-next-message)
X  (define-key pcmail-summary-mode-map "\en" 
X    'pcmail-summary-next-message-of-type)
X  (define-key pcmail-summary-mode-map "\ep" 
X    'pcmail-summary-previous-message-of-type)
X  (define-key pcmail-summary-mode-map "\e\C-f"
X    'pcmail-summary-filter-folder)
X  (define-key pcmail-summary-mode-map "\177" 
X    'pcmail-summary-scroll-message-down))
X
X(defun pcmail-summary-mode (owner-name)
X  "Pcmail Summary Mode is used by the summarization commands to manipulate
Xmessages in a summary window.  A subset of the commands available in 
XFolder Mode are supported in this mode. As commands are issued in the 
Xsummary buffer the corresponding mail message (if any) is manipulated
Xand displayed in the owning folder buffer.
X
X\\{pcmail-summary-mode-map}
X
XEntering this mode causes hook variable pcmail-summary-mode-hook to 
Xbe evaluated."
X  (pcmail-mode-setup 'pcmail-summary-mode "Summary" pcmail-summary-mode-map)
X  (put 'pcmail-summary-mode 'mode-class 'special)
X  (make-local-variable 'pcmail-summary-owner)
X  (setq pcmail-summary-owner "[unknown]")
X  (make-local-variable 'pcmail-summary-size)
X  (setq pcmail-summary-size 0)
X  (setq truncate-lines t)
X  (pcmail-set-summary-mode-line-format owner-name)
X  (run-hooks 'pcmail-summary-mode-hook))
X
X(defun pcmail-set-summary-mode-line-format (owner-name)
X  "Set summary buffer's mode line format."
X  (let ((fill-pre (cond (mode-line-inverse-video "") (t "-----")))
X	(fill-post (cond (mode-line-inverse-video " ") (t "%-"))))
X    (setq mode-line-format (list fill-pre "Summary: " 
X				 owner-name
X				 (make-string 
X				  (max 0 (- 18 (length owner-name))) ? )
X				 'global-mode-string fill-post))))
X
X;;; routines to create a message summary
X
X;; create a summary and place it in the summary buffer
X
X(defun pcmail-summarize-folder (&optional folder-name)
X  "Summarize the messages in a folder.  
XArgs: none
X  If called interactively, a prefix argument means ask for the name of a 
Xfolder to summarize, otherwise summarize the current folder.  If called 
Xas a function, supply the name of the folder to summarize, or NIL to 
Xsummarize the current folder."
X  (interactive 
X   (list (and current-prefix-arg (pcmail-read-folder "Summarize folder: "))))
X  (or folder-name
X      (setq folder-name pcmail-folder-name))
X  (or (pcmail-find-folder folder-name)
X      (error "No folder named %s." folder-name))
X  (pcmail-open-folder folder-name)
X  (pcmail-barf-if-empty-folder)
X  (message "Summarizing %s..." folder-name)
X  (or (and pcmail-summary-buffer
X	   (buffer-name pcmail-summary-buffer))
X      (setq pcmail-summary-buffer
X	    (generate-new-buffer (format "%s-summary" folder-name))))
X  (let ((i 1)
X	(owner-buffer-name (pcmail-folder-buffer-name folder-name))
X	(owner-folder-name pcmail-folder-name)
X	(cmsg pcmail-current-subset-message)
X	(lines)
X	(nlines (pcmail-current-subset-length)))
X    (unwind-protect
X	(save-excursion
X	  (save-restriction
X	    (widen)
X	    (while (<= i (pcmail-current-subset-length))
X	      (setq lines 
X		    (cons (concat (pcmail-get-summary-line i) "\n") lines))
X	      (and (zerop (% (setq i (1+ i)) pcmail-progress-interval))
X		   (message "Summarizing %s...%d" folder-name i)))))
X      (pcmail-goto-message cmsg))
X    (setq lines (nreverse lines))
X    (pop-to-buffer pcmail-summary-buffer)
X    (pcmail-summary-mode owner-folder-name)
X    (let ((buffer-read-only nil))
X      (erase-buffer)
X      (mapcar 'insert lines))
X    (goto-char (point-min))
X    (setq pcmail-summary-owner owner-buffer-name
X	  pcmail-summary-size nlines)
X    (pcmail-summary-goto-message cmsg)
X    (message "Summarizing %s...done (%d message%s)" folder-name
X	     nlines (pcmail-s-ending nlines))))
X
X(defun pcmail-get-summary-line (n)
X  "Return the Nth subset message's summary information.
XArgs: (N)
X  Get message with relative number N's summary line and add to it volatile
Xinformation like message number and D (deleted) or U (unseen) notes.  
XAssumes current buffer is folder buffer that owns this summary."
X  (let* ((abs (pcmail-make-absolute n))
X	 (s (or (aref pcmail-summary-vector abs)
X		(aset pcmail-summary-vector abs
X		      (pcmail-get-summary-line-1 abs)))))
X    (format "%4d%s %s" 
X	    n
X	    (cond ((pcmail-has-attribute-p abs "deleted") "D")
X		  ((pcmail-has-attribute-p abs "unseen") "U")
X		  (t " "))
X	    s)))
X
X(defun pcmail-get-summary-line-1 (n)
X  "Get message absolute-numbered N's summary information.
XArgs: (n)
X  Get summary information from message absolute-numbered N's summary-line 
Xfield.  If the field does not exist, create it.  Assume that the current 
Xbuffer is the folder that owns this summary.  Assume current buffer has been 
Xwidened."
X  (let ((line))
X    (save-excursion
X      (save-restriction
X	(pcmail-narrow-to-unpruned-header n)
X	(cond ((not (setq line (mail-fetch-field "summary-line" nil)))
X	       (setq line (pcmail-create-summary-line-field n))
X	       (goto-char (point-min))
X	       (let ((buffer-read-only nil))
X		 (insert "Summary-line: " line "\n"))))))
X    line))
X
X(defun pcmail-create-summary-line-field (n)
X  "Create a summary-line field using the header of message absolute-numbered N.
XArgs: (n)
X  Use the format string pcmail-summary-format to format the summary line.
XThe format string can request to, from, subject, cc, bcc, date, or message
XID fields in any combination."
X  (save-excursion
X    (save-restriction
X      (pcmail-narrow-to-unpruned-header n)
X      (pcmail-format-string 
X       pcmail-summary-format
X       (list (list "b" '(lambda ()
X			  (pcmail-summary-make-field "bcc")))
X	     (list "c" '(lambda ()
X			  (pcmail-summary-make-field "cc")))
X	     (list "C" '(lambda (n)
X			  (pcmail-message-char-count n)) n)
X	     (list "d" '(lambda (n) 
X			  (let ((arg))
X			    (cond ((setq arg (pcmail-message-date n))
X				   (setq arg 
X					 (pcmail-date-triple-to-string arg)))
X				  (t
X				   (setq arg "[unknown]")))
X			    arg)) n)
X	     (list "f" '(lambda ()
X			  (pcmail-summary-make-from)))
X	     (list "l" '(lambda (n)
X			  (pcmail-message-line-count n)) n)
X	     (list "m" '(lambda ()
X			  (pcmail-summary-make-field "message-id")))
X	     (list "s" '(lambda ()
X			  (pcmail-summary-make-field "subject")))
X	     (list "t" '(lambda ()
X			  (or (pcmail-summary-make-field "to")
X			      (pcmail-summary-make-field "apparently-to")
X			      "") 
X			  )))))))
X
X(defun pcmail-summary-concat (s field len neg)
X  "Concatenate S and the first LEN bytes of FIELD.
XArgs: (s field len neg)
X  If LEN is zero use all of FIELD.  If LEN is greater than the length of 
XFIELD, blank-pad on the right, unless NEG is non-nil, in which case blank
Xpad on the left"
X  (let ((blanks (make-string len ? )))
X    (concat s 
X	    (if (zerop len) 
X		field			;all of the field
X	      (if (not neg)		;left-justify
X		  (concat (substring field 0 (min len (length field)))
X			  (substring blanks 0 
X				     (max 0 (- len (length field)))))
X		(concat (substring blanks 0 (max 0 (- len (length field))))
X			(substring field 0 (min len (length field)))))))))
X  
X(defun pcmail-summary-make-from ()
X  "Return current message's from: summary information .
XArgs: none
X  Create current message's From: summary information.  Assume buffer is
Xnarrowed to desired message's unpruned header.  If the From: field is the 
Xsame as pcmail-primary-folder-name, return the To: field.  Otherwise return 
Xeither the Reply-to: field or the From: field in that order."
X  (let ((from) (to))
X    (setq from (mail-strip-quoted-names 
X		(or (mail-fetch-field "reply-to")
X		    (mail-fetch-field "from")
X		    " ")))
X    (and (string= (or (and (string-match "\\([^%@]+\\)\\([%@].*\\)?" from)
X			   (substring from (match-beginning 1) (match-end 1)))
X		      from)
X		  pcmail-primary-folder-name)
X	 (not (zerop (length (setq to (mail-strip-quoted-names 
X				       (or (mail-fetch-field "to" t)
X					   (mail-fetch-field "apparently-to" t)
X					   ""))))))
X	 (setq from (concat "To: " to)))
X    (and (> (length from) 25)
X	 (setq from (substring from 0 25)))
X    from))
X
X(defun pcmail-summary-make-field (field)
X  "Create a summary-line field given field name FIELD.  
XArgs: (field)
X  Assume buffer narrowed to msg header.  If the field spans multiple lines,
Xtruncate it before the first newline."
X  (let ((s (mail-fetch-field field)))
X    (cond (s
X	   (and (string-match "^[ \t\n]*" s)
X		(setq s (substring s (match-end 0))))
X	   (and (string-match "\n" s)
X		(setq s (substring s 0 (match-beginning 0))))
X	   s)
X	  (t
X	   (format "[no %s field]" field)))))
X
X(defun pcmail-summary-pop-to-owner ()
X  "Resummarize current folder if current summary is out of date.
XArgs: (none)"
X  (or (get-buffer pcmail-summary-owner)
X      (error "Owning folder has disappeared!"))
X  (let ((cbuf (current-buffer)))
X    (pop-to-buffer pcmail-summary-owner)
X    (if pcmail-summary-buffer
X	nil
X      (pcmail-summarize-folder)
X      (kill-buffer cbuf)				     ;kill old summary
X      (pop-to-buffer pcmail-summary-owner))))
X
X;;;; summary commands
X
X;;; movement commands: as in folder mode 
X
X(defun pcmail-summary-last-message ()
X  "Move to the last interesting message in the summary and display it.
XArgs: none
X  Call pcmail-last-message interactively.  See pcmail-last-message."
X  (interactive)
X  (let ((curr))
X    (pcmail-summary-pop-to-owner)
X    (call-interactively 'pcmail-last-message)
X    (setq curr pcmail-current-subset-message)
X    (pop-to-buffer pcmail-summary-buffer)
X    (pcmail-summary-goto-message curr)))
X
X(defun pcmail-summary-next-message ()
X  "Move to the next interesting message in the summary and display it.
XArgs: none
X  Call pcmail-next-message interactively.  See pcmail-next-message."
X  (interactive)
X  (let ((curr))
X    (pcmail-summary-goto-message)
X    (pcmail-summary-pop-to-owner)
X    (call-interactively 'pcmail-next-message)
X    (setq curr pcmail-current-subset-message)
X    (pop-to-buffer pcmail-summary-buffer)
X    (pcmail-summary-goto-message curr)))
X
X(defun pcmail-summary-next-message-of-type ()
X  "Move to the next message in the current subset that satisfies a predicate.
XArgs: none
X  Call pcmail-next-message-of-type interactively.  See 
Xpcmail-next-message-of-type."
X  (interactive)
X  (let ((curr))
X    (pcmail-summary-goto-message)
X    (pcmail-summary-pop-to-owner)
X    (unwind-protect
X	(call-interactively 'pcmail-next-message-of-type)
X      (setq curr pcmail-current-subset-message)
X      (pop-to-buffer pcmail-summary-buffer)
X      (pcmail-summary-goto-message curr))))
X
X(defun pcmail-summary-previous-message ()
X  "Move to the previous interesting message in the summary and display it.
XArgs: none
X  Call pcmail-previous-message interactively.  See pcmail-previous-message."
X  (interactive)
X  (let ((curr))
X    (pcmail-summary-goto-message)
X    (pcmail-summary-pop-to-owner)
X    (call-interactively 'pcmail-previous-message)
X    (setq curr pcmail-current-subset-message)
X    (pop-to-buffer pcmail-summary-buffer)
X    (pcmail-summary-goto-message curr)))
X
X(defun pcmail-summary-previous-message-of-type ()
X  "Move to the previous message in the summary that satisfies a predicate.
XArgs: none
X  Call pcmail-previous-message-of-type interactively.  See 
Xpcmail-previous-message-of-type."
X  (interactive)
X  (let ((curr))
X    (pcmail-summary-goto-message)
X    (pcmail-summary-pop-to-owner)
X    (unwind-protect
X	(call-interactively 'pcmail-previous-message-of-type)
X      (setq curr pcmail-current-subset-message)
X      (pop-to-buffer pcmail-summary-buffer)
X      (pcmail-summary-goto-message curr))))
X
X(defun pcmail-summary-beginning-of-message ()
X  "Move to the beginning of the current message.
XArgs: none"
X  (interactive)
X  (pcmail-summary-goto-message)
X  (pcmail-summary-pop-to-owner)
X  (pcmail-beginning-of-message)
X  (pop-to-buffer pcmail-summary-buffer))
X
X(defun pcmail-summary-goto-message (&optional n)
X  "Move to message number N of the summary and display it.
XArgs: (&optional n)
XDisplay message N in the summary.  If called interactively, N is specified 
Xby a numeric prefix argument.  If not specified, N defaults to the first 
Xmessage in the subset."
X  (interactive "P")
X
X  ;; following skullduggery is here in case the user gets silly and either
X  ;; (1) kills the folder which owns this summary, or (2) kills and
X  ;; then re-gets the folder owning this summary.  A folder with no summary
X  ;; will have a pcmail-summary-buffer local variable value of NIL.  If
X  ;; we think we are owned by a folder, and its summary-buffer is NIL, its
X  ;; time to resummarize and kill ourselves (die bravely for Amber...)
X
X  (or (get-buffer pcmail-summary-owner)
X      (error "Owning folder has disappeared!"))
X  (save-excursion
X    (let ((cbuf (current-buffer)))
X      (set-buffer pcmail-summary-owner)
X      (if pcmail-summary-buffer
X	  nil
X	(pcmail-summarize-folder)
X	(kill-buffer cbuf))))
X  (and (eobp)
X       (forward-line -1))
X  (beginning-of-line)
X  (let ((msg) (deleted-p) (unseen-p))
X    (if n
X	(setq n (prefix-numeric-value n))
X      (setq n (string-to-int (buffer-substring (point) (+ 5 (point))))))
X    (cond ((< n 1)
X	   (setq msg "Beginning of summary"
X		 n 1))
X	  ((> n pcmail-summary-size)
X	   (setq msg "End of summary"
X		 n pcmail-summary-size)))
X    (goto-char (point-min))
X    (forward-line (1- n))
X    (save-excursion
X      (set-buffer pcmail-summary-owner)
X      (setq deleted-p (pcmail-has-attribute-p (pcmail-make-absolute n)
X					      "deleted")
X	    unseen-p (pcmail-has-attribute-p (pcmail-make-absolute n)
X					     "unseen")))
X    (cond ((/= n 
X	       (save-excursion
X		 (set-buffer pcmail-summary-owner)
X		 pcmail-current-subset-message))
X	   (pop-to-buffer pcmail-summary-owner)
X	   (pcmail-goto-message n)
X	   (pop-to-buffer pcmail-summary-buffer)))
X    (pcmail-summary-set-attr ?U unseen-p)
X    (pcmail-summary-set-attr ?D deleted-p)
X    (and msg
X	 (message msg))))
X
X(defun pcmail-summary-set-attr (attr state)
X  "In the summary buffer, set the current message's attribute ATTR to STATE.
XArgs: (attr state)"
X  (let ((buffer-read-only nil))
X    (save-excursion
X      (skip-chars-forward " ")
X      (skip-chars-forward "0-9")
X      (cond ((and (= (following-char) attr)
X		  (not state))
X	     (delete-char 1)
X	     (insert " "))
X	    ((and (= (following-char) ? )
X		  state)
X	     (delete-char 1)
X	     (insert attr))))))
X
X(defun pcmail-summary-scroll-message-up (&optional n)
X  "Scroll the current message forward in the other window.
XArgs: none
X  Scroll the current message up in the other window N lines.  If called 
Xinteractively, prefix arg gives number of lines to scroll.  Can't use
Xscroll-other-window because there might be more than two windows on the 
Xscreen."
X  (interactive "P")
X  (pcmail-summary-goto-message)    
X  (pcmail-summary-pop-to-owner)
X  (unwind-protect
X      (scroll-up n)
X    (pop-to-buffer pcmail-summary-buffer)))
X
X(defun pcmail-summary-scroll-message-down (&optional n)
X  "Scroll the current message backward in the other window
XArgs: n
X  Scroll the current message backward in the other window N lines.  If called 
Xinteractively, prefix arg gives number of lines to scroll.  Can't use
Xscroll-other-window because there might be more than two windows on the 
Xscreen."
X  (interactive "P")
X  (pcmail-summary-goto-message)    
X  (pcmail-summary-pop-to-owner)
X  (unwind-protect
X      (scroll-down n)
X    (pop-to-buffer pcmail-summary-buffer)))
X
X;;; attribute-setting commands.  As in folder mode.
X
X(defun pcmail-summary-delete-message ()
X  "Delete this message and move to the next interesting message.
XArgs: none
X  Call pcmail-delete-message interactively.  See pcamil-delete-message."
X  (interactive)
X  (let ((curr) (old) (d))
X    (pcmail-summary-goto-message)    
X    (pcmail-summary-pop-to-owner)
X    (setq old pcmail-current-subset-message)
X    (call-interactively 'pcmail-delete-message)
X    (setq curr pcmail-current-subset-message)
X    (setq d (pcmail-has-attribute-p (pcmail-make-absolute old) "deleted"))
X    (pop-to-buffer pcmail-summary-buffer)
X    (pcmail-summary-set-attr ?D d)
X    (pcmail-summary-goto-message curr)))
X
X(defun pcmail-summary-delete-message-backward ()
X  "Delete this message and move to the previous interesting message.
XArgs: none
X  Call pcmail-delete-message-backward interactively.  See 
Xpcmail-delete-message-backward."
X  (interactive)
X  (let ((curr) (old) (d))
X    (pcmail-summary-goto-message)    
X    (pcmail-summary-pop-to-owner)
X    (setq old pcmail-current-subset-message)
X    (call-interactively 'pcmail-delete-message-backward)
X    (setq curr pcmail-current-subset-message)
X    (setq d (pcmail-has-attribute-p (pcmail-make-absolute old) "deleted"))
X    (pop-to-buffer pcmail-summary-buffer)
X    (pcmail-summary-set-attr ?D d)
X    (pcmail-summary-goto-message curr)))
X
X(defun pcmail-summary-kill-message-later ()
X  "Cause a message to expire at a future date.
XArgs: none
X  Call pcmail-kill-message-later interactivel.. See pcmail-kill-message-later."
X  (interactive)
X  (pcmail-summary-goto-message)
X  (pcmail-summary-pop-to-owner)
X  (unwind-protect
X      (call-interactively 'pcmail-kill-message-later)
X    (pop-to-buffer pcmail-summary-buffer)))
X
X(defun pcmail-summary-undelete-message ()
X  "Looking backward from the current message, clear the first deleted 
Xmessage's delete attribute.
XArgs: none"
X  (interactive)
X  (let ((curr))
X    (pcmail-summary-goto-message)
X    (pcmail-summary-pop-to-owner)
X    (pcmail-undelete-previous-message)
X    (setq curr pcmail-current-subset-message)
X    (pop-to-buffer pcmail-summary-buffer)
X    (pcmail-summary-goto-message curr)))
X
X(defun pcmail-summary-change-message-attr ()
X  "Toggle a named attribute of the current message.  
XArgs: none
X  Call pcmail-change-message-attr interactively.  See 
Xpcmail-change-message-attr."
X  (interactive)
X  (pcmail-summary-goto-message)
X  (pcmail-summary-pop-to-owner)
X  (unwind-protect			;so C-G leaves you in summary
X      (call-interactively 'pcmail-change-message-attr)
X    (pop-to-buffer pcmail-summary-buffer)
X    (pcmail-summary-goto-message)))	;to get U/D settings right
X
X;;; output commands: copy, file, print
X
X(defun pcmail-summary-copy-message ()
X  "Copy the current message to a named folder.
XArgs: none
X  Call pcmail-copy-messag einteractively.  See pcmail-copy-message."
X  (interactive)
X  (let ((curr) (d) (old))
X    (pcmail-summary-goto-message)
X    (pcmail-summary-pop-to-owner)
X    (setq old pcmail-current-subset-message)
X    (unwind-protect
X	(call-interactively 'pcmail-copy-message)
X      (setq curr pcmail-current-subset-message)
X      (setq d (pcmail-has-attribute-p (pcmail-make-absolute old) "deleted"))
X      (pop-to-buffer pcmail-summary-buffer)
X      (pcmail-summary-set-attr ?D d)
X      (pcmail-summary-goto-message curr))))
X
X(defun pcmail-summary-print-message ()
X  "Print the current message.
XArgs: none
X  Call pcmail-print-message interactively.  See pcmail-print-message."
X  (interactive)
X  (let ((curr) (d) (old))
X    (pcmail-summary-goto-message)
X    (pcmail-summary-pop-to-owner)
X    (setq old pcmail-current-subset-message)
X    (unwind-protect
X	(call-interactively 'pcmail-print-message)
X      (setq curr pcmail-current-subset-message)
X      (setq d (pcmail-has-attribute-p (pcmail-make-absolute old) "deleted"))
X      (pop-to-buffer pcmail-summary-buffer)
X      (pcmail-summary-set-attr ?D d)
X      (pcmail-summary-goto-message curr))))
X
X(defun pcmail-summary-archive-message ()
X  "Archive the current message.  
XArgs: none
X  Call pcmail-archive-message interactively.  See pcmail-archive-message."
X  (interactive)
X  (let ((curr) (d) (old))
X    (pcmail-summary-goto-message)
X    (pcmail-summary-pop-to-owner)
X    (setq old pcmail-current-subset-message)
X    (unwind-protect
X	(call-interactively 'pcmail-archive-message)
X      (setq curr pcmail-current-subset-message)
X      (setq d (pcmail-has-attribute-p (pcmail-make-absolute old) "deleted"))
X      (pop-to-buffer pcmail-summary-buffer)
X      (pcmail-summary-set-attr ?D d)
X      (pcmail-summary-goto-message curr))))
X
X;;; random other commands
X
X(defun pcmail-summary-get-mail ()
X  "Open a named folder and re-summarize it.
XArgs: none
X  Call pcmail-get-mail interactively.  See pcmail-get-mail."
X  (interactive)
X  (pcmail-summary-pop-to-owner)
X  (call-interactively 'pcmail-get-mail)
X  (pcmail-summarize-folder))
X
X(defun pcmail-summary-filter-folder ()
X  "Filter and re-summarize the current folder.
XArgs: none
X  Call pcmail-filter-folder interactively.  See pcmail-filter-folder."
X  (interactive)
X  (pcmail-summary-pop-to-owner)
X  (unwind-protect
X      (call-interactively 'pcmail-filter-folder)
X    (pcmail-summarize-folder)))
X
X(defun pcmail-summary-edit-message ()
X  "Edit the current message in the other window.
XArgs: none
XCall pcmail-edit-message interactively.  See pcmail-edit-message."
X  (interactive)
X  (pcmail-summary-pop-to-owner)
X  (call-interactively 'pcmail-edit-message))
X
X(defun pcmail-summary-sort-folder ()
X  "Sort the current folder by a key and re-summarize the current folder.
XArgs: none
X  Call pcmail-sort-folder.  See pcmail-sort-folder."
X  (interactive)
X  (pcmail-summary-pop-to-owner)
X  (unwind-protect
X      (call-interactively 'pcmail-sort-folder)
X    (pcmail-summarize-folder)))
X
X(defun pcmail-summary-exit ()
X  "Exit the current summary, returning to the owning folder.
XArgs: none
X  A little skullduggery here since pcmail-summary-owner is a local variable
Xand we need our hands on it after nuking the summary buffer in order to
Xpop back to the owner."
X  (interactive)
X  (pop-to-buffer (prog1 (or (get-buffer pcmail-summary-owner)
X			    (other-buffer))
X		   (bury-buffer (current-buffer))))
X  (delete-other-windows))
X
X(defun pcmail-summary-quit ()
X  "Exit the mail reader.  See pcmail-quit.
XArgs: none"
X  (interactive)
X  (pcmail-summary-exit)
X  (call-interactively 'pcmail-quit))
X
X(defun pcmail-summary-expunge-folder ()
X  "Expunge and re-summarize the current folder.
XArgs: none
X  Call pcmail-expunge-folder.  See pcmail-expunge-folder."
X  (interactive)
X  (pcmail-summary-pop-to-owner)
X  (unwind-protect
X      (pcmail-expunge-folder)
X    (pcmail-summarize-folder)))	;in case expunge changed #messages
X
X(defun pcmail-summary-save-folder ()
X  "Save and re-summarize the current folder.
XArgs: none
X  Call pcmail-save-folder.  See pcmail-save-folder"
X  (interactive)
X  (pcmail-summary-pop-to-owner)
X  (unwind-protect
X      (pcmail-save-folder)
X    (pcmail-summarize-folder)))	;in case expunge changed #messages
X
X(defun pcmail-summary-answer-message ()
X  "Reply to the current message.
XArgs: none
X  Call pcmail-answer-message interactively.  See pcmail-answer-message.  
XNote that sending the message does not return you to the summary window, 
Xbut instead leaves you at the current message in the folder."
X  (interactive)
X  (pcmail-summary-pop-to-owner)
X  (call-interactively 'pcmail-answer-message))
X
X(defun pcmail-summary-mail ()
X  "Compose mail in another window.
XArgs: none
X  Call pcmail-mail interactively.  See pcmail-mail.  Note that sending 
Xthe message does not return you to the summary window, but instead
Xleaves you at the current message in the folder."
X  (interactive)
X  (pcmail-summary-pop-to-owner)
X  (call-interactively 'pcmail-mail))
X
X(defun pcmail-summary-forward-message ()
X  "Forward the current message.
XArgs: none
X  Call pcmail-forward-message interactively.  See pcmail-forward-message.  
XNote that sending the message does not return you to the summary window, 
Xbut instead leaves you at the current message in the folder."
X  (interactive)
X  (pcmail-summary-pop-to-owner)
X  (call-interactively 'pcmail-forward-message))
X
X(provide 'pcmailsum)
________This_Is_The_END________
if test `wc -c < pcmailsum.el` -ne 27066; then
	echo 'shar: pcmailsum.el was damaged during transit (should have been 27066 bytes)'
fi
fi		; : end of overwriting check
echo 'x - pcmailout.el'
if test -f pcmailout.el; then echo 'shar: not overwriting pcmailout.el'; else
sed 's/^X//' << '________This_Is_The_END________' > pcmailout.el
X;;;; GNU-EMACS PCMAIL mail reader
X
X;;  Written by Mark L. Lambert
X;;  Architecture Group, Network Products Division
X;;  Oracle Corporation
X;;  20 Davis Dr,
X;;  Belmont CA, 94002
X;;
X;;  internet: markl@oracle.com or markl%oracle.com@apple.com
X;;  UUCP:     {hplabs,uunet,apple}!oracle!markl
X
X;; Copyright (C) 1989 Mark L. Lambert
X
X;; This file is not officially part of GNU Emacs, but is being
X;; donated to the Free Software Foundation.  As such, it is
X;; subject to the standard GNU-Emacs General Public License,
X;; referred to below.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X;;;; global variables
X
X;;; defaults
X
X(defvar pcmail-last-file (expand-file-name "~/pcmail-archive")
X  "The name of the last file given to an archive command.")
X
X;;;; Pcmail output and copy commands by single message and subset
X
X;;; archive a message or current subset
X
X(defun pcmail-archive-subset (file dont-delete)
X  "Archive the current message subset.
XArgs: (file dont-delete)
X  Append the current message subset to the file named by pcmail-last-file.
XIf the variable pcmail-delete-on-archive is non-NIL, set the deleted attribute
Xon all messages in the subset after archiving.  If called interactively, a 
Xprefix argument means do not delete after archiving no matter what the
Xsetting of pcmail-delete-on-archive.  Archived messages have their archived 
Xattribute set upon archiving."
X  (interactive
X   (list
X    (setq pcmail-last-file 
X	  (pcmail-read-file-name "Archive subset to file: " pcmail-last-file))
X    current-prefix-arg))
X  (pcmail-barf-if-empty-folder)
X  (pcmail-archive-message-1 file dont-delete 1 (pcmail-current-subset-length)))
X
X(defun pcmail-archive-message (file dont-delete)
X  "Archive the current message.
XArgs: (file dont-delete)
X  Append this message to the file named by pcmail-last-file.  If the variable 
Xpcmail-delete-on-archive is non-NIL, set this message's deleted attribute 
Xafter archiving, and move to the next interesting message in the folder.  
XIf called interactively, a prefix argument means do not delete after archiving
Xno matter what the setting of pcmail-delete-on-archive.  Set the message's 
Xarchived attribute."
X  (interactive
X   (list
X    (setq pcmail-last-file
X	  (pcmail-read-file-name "Archive message to file: " pcmail-last-file))
X    current-prefix-arg))
X  (pcmail-barf-if-empty-folder)
X  (pcmail-archive-message-1 file dont-delete pcmail-current-subset-message 1))
X
X(defun pcmail-archive-message-1 (file-name dont-delete start len)
X  "Archive a portion of the current message subset.
XArgs: (file-name dont-delete start len)
X  Append to FILE-NAME all messages in the current subset, from message START 
Xfor LEN messages.  Set the archived attribute on all archived messages.  Set 
Xthe deleted attribute on all archived messages if pcmail-delete-on-archive 
Xis non-NIL and DONT-DELETE is NIL.  If any messages were deleted, move to 
Xthe next interesting message in the subset after archiving."
X  (let ((cbuf (current-buffer)) (i start))
X    (message "Archiving...")
X    (unwind-protect
X	(while (< i (+ start len))
X	  (pcmail-narrow-to-message (pcmail-make-absolute i))
X	  (let ((beg (point-min))
X		(end (point-max)))
X	    (save-excursion
X	      (find-file file-name)
X	      (goto-char (point-max))
X	      (insert-buffer-substring cbuf beg end)
X	      (insert "\n\n"))
X	    (pcmail-set-attribute (pcmail-make-absolute i) "filed" t)
X	    (and pcmail-delete-on-archive 
X		 (not dont-delete)
X		 (pcmail-set-attribute (pcmail-make-absolute i) "deleted" 
X				       t)))
X	  (and (zerop (% (- (setq i (1+ i)) start) pcmail-progress-interval))
X	       (message "Archiving...%d" (- i start))))
X      (and pcmail-delete-on-archive
X	   (not dont-delete)
X	   (pcmail-next-message))
X      (pcmail-update-folder-mode-line pcmail-current-subset-message)
X      (save-excursion
X	(find-file file-name)
X	(save-buffer)
X	(bury-buffer (current-buffer))))
X    (message "Archiving...done (%d message%s)" (- i start) 
X	     (pcmail-s-ending (- i start)))))
X
X;;; print a message or current subset
X
X(defun pcmail-print-subset (printer dont-delete)
X  "Print each message in the current subset.
XArgs: (printer dont-delete)
X  Send the current message subset to a named printer.  The default printer 
Xis specified by the variable pcmail-printer-name.  A system-dependent print
Xroutine set up in pcmail-mail-environment prints the message.  If the 
Xvariable pcmail-delete-on-print is non-NIL, set the deleted attribute of all 
Xmessages in the subset after printing.  If called interactively,
Xa prefix argument means do not delete after printing no matter what the
Xsetting of pcmail-delete-on-print.  Printed messages have their printed 
Xattribute set upon printing."
X  (interactive
X      (list (setq pcmail-printer-name 
X		  (pcmail-read-string-default "Send subset to printer: " 
X					      pcmail-printer-name
X					      t))
X	    current-prefix-arg))  
X  (pcmail-barf-if-empty-folder)
X  (pcmail-print-message-1 printer dont-delete 1 
X			  (pcmail-current-subset-length)))
X
X(defun pcmail-print-message (printer dont-delete)
X  "Print the current message.
XArgs: (printer dont-delete)
X  Send the current message to a named printer.  The default printer is 
Xspecified by the variable pcmail-printer-name.  A system-dependent print
Xroutine set up in pcmail-mail-environment prints the message.  If the 
Xvariable pcmail-delete-on-print is non-NIL, set the message's deleted 
Xattribute after printing, and move to the next interesting message in the 
Xfolder.  If called interactively, a prefix argument means do not delete 
Xafter printing no matter what the setting of pcmail-delete-on-print.
XSet the message's printed attribute."
X  (interactive
X      (list (setq pcmail-printer-name 
X		  (pcmail-read-string-default "Send message to printer: " 
X					      pcmail-printer-name t))
X	    current-prefix-arg))
X  (pcmail-barf-if-empty-folder)
X  (pcmail-print-message-1 printer dont-delete pcmail-current-subset-message 1))
X
X(defun pcmail-print-message-1 (printer-name dont-delete start len)
X  "Print a portion of the current subset.
XArgs: (printer-name dont-delete start len)
X  Send to PRINTER-NAME all messages in the current subset, from message START 
Xfor LEN messages.  Set the printed attribute on all printed messages.  Set 
Xthe deleted attribute on all printed messages if pcmail-delete-on-print is 
Xnon-NIL and DONT-DELETE is NIL.  If any messages were deleted, move to the 
Xnext interesting message in the subset after printing."
X  (let ((folder-name pcmail-folder-name) (i start))
X    (message "Printing...")
X    (unwind-protect
X	(while (< i (+ start len))
X	  (pcmail-narrow-to-message (pcmail-make-absolute i))
X	  (save-excursion
X	    (funcall (get 'pcmail-mail-environment 'print-function) 
X		     printer-name folder-name)
X	    (pcmail-set-attribute (pcmail-make-absolute i) "printed" t)
X	    (and pcmail-delete-on-print 
X		 (not dont-delete)
X		 (pcmail-set-attribute (pcmail-make-absolute i) "deleted" t)))
X	  (and (zerop (% (- (setq i (1+ i)) start) pcmail-progress-interval))
X	       (message "Printing...%d" (- i start))))
X      (and pcmail-delete-on-print
X	   (not dont-delete)
X	   (pcmail-next-message))
X      (pcmail-update-folder-mode-line pcmail-current-subset-message))
X    (message "Printing...done (%d message%s)" (- i start)
X	     (pcmail-s-ending (- i start)))))
X   
X;;; copy a message or current subset
X
X(defun pcmail-copy-subset (folder-name dont-delete)
X  "Copy to a named folder each message in the current subset.
XArgs: (folder-name dont-delete)
X  Copy the current message subset to a named folder.  If called interactively,
Xrequest a folder name from the minibuffer.  Completion of input is permitted;
Xinput defaults to the name of the last folder given to a folder command.
XIf the variable pcmail-delete-on-copy is non-NIL, set the deleted attribute 
Xof all messages in the subset after copying.  If called interactively,
Xa prefix argument means do not delete after copying no matter what the
Xsetting of pcmail-delete-on-copy.  Copied messages have their copied
Xattribute set upon copying."
X  (interactive
X      (list (pcmail-read-folder "Copy subset to folder: ") 
X	    current-prefix-arg))
X  (pcmail-barf-if-empty-folder)
X  (pcmail-copy-message-1 folder-name dont-delete 1 
X			 (pcmail-current-subset-length))
X  (pcmail-update-folder-mode-line pcmail-current-subset-message))
X
X(defun pcmail-copy-message (folder-name dont-delete)
X  "Copy the current message to a named folder.
XArgs: (folder-name dont-delete)
X  Copy the current message to a named folder.  If called interactively,
Xrequest a folder name from the minibuffer.  Completion of input is permitted;
Xinput defaults to the name of the last folder given to a folder command.
XIf the variable pcmail-delete-on-copy is non-NIL, set the message's deleted 
Xattribute after copying, and move to the next interesting message in the 
Xfolder.  If called interactively, a prefix argument means do not delete 
Xafter copying no matter what the setting of pcmail-delete-on-copy.  Set the
Xmessage's copied attribute."
X  (interactive
X      (list (pcmail-read-folder "Copy message to folder: ")
X	    current-prefix-arg))
X  (pcmail-barf-if-empty-folder)
X  (pcmail-copy-message-1 folder-name dont-delete pcmail-current-subset-message
X			 1)
X  (and pcmail-delete-on-copy
X       (not dont-delete)
X       (pcmail-next-message))
X  (pcmail-update-folder-mode-line pcmail-current-subset-message))
X
X(defun pcmail-copy-message-1 (target-folder-name dont-delete start len)
X  "Print a portion of the current subset.
XArgs: (target-folder-name dont-delete start len)
X  Copy to FOLDER-NAME all messages in the current subset, from message START 
Xfor LEN messages.  Set the copied attribute on all copied messages.  Set 
Xthe deleted attribute on all copied messages if pcmail-delete-on-copy is 
Xnon-NIL and DONT-DELETE is NIL.  If any messages were deleted, move to the 
Xnext interesting message in the subset after copying."
X  (let ((source-folder-name pcmail-folder-name) (eom) (i start))
X    (and (string= target-folder-name source-folder-name) 
X	 (error "Cannot copy message into itself"))
X    (or (pcmail-find-folder target-folder-name)
X	(error "Target folder %s not found" target-folder-name))
X    (save-excursion
X      (pcmail-open-folder target-folder-name)
X      (save-restriction
X	(widen)
X	(setq eom (point-max))))
X    (message "Copying to %s..." target-folder-name)
X    (unwind-protect
X	(while (< i (+ start len))
X	  (pcmail-perform-copy source-folder-name target-folder-name i)
X	  (pcmail-set-attribute (pcmail-make-absolute i) "copied" t)
X	  (and pcmail-delete-on-copy
X	       (not dont-delete)
X	       (pcmail-set-attribute (pcmail-make-absolute i) "deleted" t))
X	  (and (zerop (% (- (setq i (1+ i)) start) pcmail-progress-interval))
X	       (message "Copying to %s...%d" target-folder-name 
X			(- i start))))
X
X      ; and now update target folder
X      (save-excursion
X	(set-buffer (pcmail-folder-buffer-name target-folder-name))
X	(pcmail-save-buffer)
X	(pcmail-set-message-vectors eom)
X	(pcmail-narrow-to-message 
X	 (pcmail-make-absolute pcmail-current-subset-message))
X	(pcmail-set-nmessages target-folder-name pcmail-total-messages)
X	(pcmail-change-in-folder-list target-folder-name 
X				       pcmail-total-messages)))
X    (message "Copying to %s...done (%d message%s)" target-folder-name
X	     (- i start) (pcmail-s-ending (- i start)))))
X
X(defun pcmail-perform-copy (source target n)
X  "Append message absolute-numbered N in source folder to target folder.
XArgs: (source target n)"
X  (let ((msg (pcmail-message-contents (pcmail-make-absolute n))))
X    (save-excursion
X      (save-restriction
X	(set-buffer (pcmail-folder-buffer-name target))
X	(widen)
X	(goto-char (point-max))
X	(let ((buffer-read-only nil))
X	  (insert msg))))))
X
X(defun pcmail-wastebasket-message (start len)
X  "Copy a portion of the current message subset to the wastebasket folder.
XArgs: (start len)
X  If the current folder is not the wastebasket, copy part of the current
Xfolder to the wastebasket.  Ask to create pcmail-wastebasket-folder if it 
Xdoes not exist.  Then call pcmail-copy-message-1 to perform the copy."
X  (cond ((not (string= pcmail-folder-name pcmail-wastebasket-folder))
X	 (cond ((not (pcmail-find-folder pcmail-wastebasket-folder))
X		(or (yes-or-no-p (concat "Wastebasket folder \"" 
X					 pcmail-wastebasket-folder
X					 "\" does not exist.  Create? "))
X		    (error "Aborted."))
X		(pcmail-create-folder pcmail-wastebasket-folder)))
X	 (save-excursion
X	   (save-restriction
X	     (pcmail-copy-message-1 pcmail-wastebasket-folder nil start
X				    len))))))
X
X(provide 'pcmailout)
________This_Is_The_END________
if test `wc -c < pcmailout.el` -ne 13297; then
	echo 'shar: pcmailout.el was damaged during transit (should have been 13297 bytes)'
fi
fi		; : end of overwriting check
echo 'x - vms-doprint.com'
if test -f vms-doprint.com; then echo 'shar: not overwriting vms-doprint.com'; else
sed 's/^X//' << '________This_Is_The_END________' > vms-doprint.com
X$ !  GNU-EMACS PCMAIL mail reader support utility
X$ ! 
X$ !  Written by Mark L. Lambert
X$ !  Architecture Group, Network Products Division
X$ !  Oracle Corporation
X$ !  20 Davis Dr,
X$ !  Belmont CA, 94002
X$ ! 
X$ !  internet: markl@oracle.com or markl%oracle.com@apple.com
X$ !  UUCP:     {hplabs,uunet,apple}!oracle!markl
X$ ! 
X$ ! Copyright (C) 1989 Mark L. Lambert
X$ !
X$ ! This file is not officially part of GNU Emacs, but is being
X$ ! donated to the Free Software Foundation.  As such, it is
X$ ! subject to the standard GNU-Emacs General Public License,
X$ ! referred to below.
X$ ! 
X$ ! GNU Emacs is distributed in the hope that it will be useful,
X$ ! but WITHOUT ANY WARRANTY.  No author or distributor
X$ ! accepts responsibility to anyone for the consequences of using it
X$ ! or for whether it serves any particular purpose or works at all,
X$ ! unless he says so in writing.  Refer to the GNU Emacs General Public
X$ ! License for full details.
X$ ! 
X$ ! Everyone is granted permission to copy, modify and redistribute
X$ ! GNU Emacs, but only under the conditions described in the
X$ ! GNU Emacs General Public License.   A copy of this license is
X$ ! supposed to have been given to you along with GNU Emacs so you
X$ ! can know your rights and responsibilities.  It should be in a
X$ ! file named COPYING.  Among other things, the copyright notice
X$ ! and this notice must be preserved on all copies.
X$ !
X$ ! COM file to send a named file to a named printer queue via EMACS
X$ ! P1 is the printer queue name, P2 is the file to print, and
X$ ! if parameter P3 is "delete", delete P2 after printing
X$
X$ ! define /user_mode sys$output dcl-junk.txt
X$ print /queue='p1' 'p2'
X$ if p3 .eqs. "delete" then del 'p2'.*
X$ ! delete dcl-junk.txt.*
X$ exit
________This_Is_The_END________
if test `wc -c < vms-doprint.com` -ne 1737; then
	echo 'shar: vms-doprint.com was damaged during transit (should have been 1737 bytes)'
fi
fi		; : end of overwriting check
echo 'x - vms-movemail.com'
if test -f vms-movemail.com; then echo 'shar: not overwriting vms-movemail.com'; else
sed 's/^X//' << '________This_Is_The_END________' > vms-movemail.com
X$ !  GNU-EMACS PCMAIL mail reader support utility
X$
X$ !  Written by Mark L. Lambert
X$ !  Architecture Group, Network Products Division
X$ !  Oracle Corporation
X$ !  20 Davis Dr,
X$ !  Belmont CA, 94002
X$
X$ !  internet: markl@oracle.com or markl%oracle.com@apple.com
X$ !  UUCP:     {hplabs,uunet,apple}!oracle!markl
X$ !
X$ ! Copyright (C) 1989 Mark L. Lambert
X$ !
X$ ! This file is not officially part of GNU Emacs, but is being
X$ ! donated to the Free Software Foundation.  As such, it is
X$ ! subject to the standard GNU-Emacs General Public License,
X$ ! referred to below.
X$ ! 
X$ ! GNU Emacs is distributed in the hope that it will be useful,
X$ ! but WITHOUT ANY WARRANTY.  No author or distributor
X$ ! accepts responsibility to anyone for the consequences of using it
X$ ! or for whether it serves any particular purpose or works at all,
X$ ! unless he says so in writing.  Refer to the GNU Emacs General Public
X$ ! License for full details.
X$ ! 
X$ ! Everyone is granted permission to copy, modify and redistribute
X$ ! GNU Emacs, but only under the conditions described in the
X$ ! GNU Emacs General Public License.   A copy of this license is
X$ ! supposed to have been given to you along with GNU Emacs so you
X$ ! can know your rights and responsibilities.  It should be in a
X$ ! file named COPYING.  Among other things, the copyright notice
X$ ! and this notice must be preserved on all copies.
X$
X$ ! COM file to transfer new mail from VMS into an ASCII file readable by
X$ ! EMACS.  If there is no new mail, mail.temp;1 is empty.
X$ ! P1 is folder from which to select (currently ignored)
X$ ! P2 is name of temp file to finally leave extracted mail in
X$ ! P3 is mail reader directory
X$ 
X$ ! This COM files works fine on our local VMS 5.1.  Since it does delete 
X$ ! mail in the newmail folder after extracting, it would be a very good
X$ ! idea to perform a test on some test messages before trusting it on your
X$ ! system.  I don't understand VMS all that well (and have no desire to),
X$ ! so this file may not be bulletproof.
X$
X$ msg = f$environment("message")
X$ set message /noident/notext/noseverity/nofacility
X$ set default 'p3'
X$ tempfile = "$$extract$$.temp"
X$ dropfile = "'p2'"
X$ del 'tempfile'.*,'dropfile'.*
X$ !emacs dcl-command fn chokes on output so reroute to file and delete later
X$ define /user_mode sys$output dcl-junk.txt
X$ mail
Xselect newmail
Xextract/all $$extract$$.temp
Xdelete/all
Xpurge/reclaim
Xexit
X$ delete dcl-junk.txt.*
X$ exists_p = f$search(tempfile)
X$ if exists_p .eqs. "" then create 'tempfile'
X$ rename 'tempfile' 'dropfile'
X$ set message 'msg'
X$ exit
X
X
________This_Is_The_END________
if test `wc -c < vms-movemail.com` -ne 2576; then
	echo 'shar: vms-movemail.com was damaged during transit (should have been 2576 bytes)'
fi
fi		; : end of overwriting check
exit 0


