Xref: utzoo gnu.emacs:975 comp.emacs:6181 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!talos!kjones From: kjones@talos.UUCP (Kyle Jones) Newsgroups: gnu.emacs,comp.emacs Subject: VM 4.11 (part 3 of 4) Message-ID: <544@talos.UUCP> Date: 30 May 89 14:17:00 GMT Sender: kjones@talos.UUCP Lines: 1344 #!/bin/sh # this is part 3 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # file vm.el continued # CurArch=3 if test ! -r s2_seq_.tmp then echo "Please unpack part 1 first!" exit 1; fi ( read Scheck if test "$Scheck" != $CurArch then echo "Please unpack part $Scheck next!" exit 1; else exit 0; fi ) < s2_seq_.tmp || exit 1 echo "x - Continuing file vm.el" sed 's/^X//' << 'SHAR_EOF' >> vm.el X (setq start-regexp "^\001\001\001\001\n" X separator-string "\n\001\001\001\001\n\001\001\001\001" X trailer-length 6) X (setq start-regexp "^From " X separator-string "\n\nFrom " X trailer-length 2)) X (if vm-message-list X (let ((mp vm-message-list) X (end (point-min))) X (while mp X (if (< end (vm-end-of (car mp))) X (setq end (vm-end-of (car mp)))) X (setq mp (cdr mp))) X ;; move back past trailer so separator-string will match below X (goto-char (- end trailer-length)) X (setq tail-cons (vm-last vm-message-list))) X (goto-char (point-min)) X (if (looking-at start-regexp) X (progn X (setq message (vm-make-message) prev-message message) X (vm-set-start-of message (vm-marker (match-beginning 0))) X (setq vm-message-list (list message) X tail-cons vm-message-list)))) X (while (search-forward separator-string nil t) X (setq marker (vm-marker (+ trailer-length (match-beginning 0))) X message (vm-make-message)) X (vm-set-start-of message marker) X (if prev-message X (vm-set-end-of prev-message marker)) X (if tail-cons X (progn X (setcdr tail-cons (list message)) X (setq tail-cons (cdr tail-cons) X prev-message message)) X (setq vm-message-list (list message) X tail-cons vm-message-list X prev-message message))) X (if prev-message X (vm-set-end-of prev-message (vm-marker (point-max))))))) X X(defun vm-build-visible-header-alist () X (let ((header-alist (cons nil nil)) X (vheaders vm-visible-headers) X list) X (setq list header-alist) X (while vheaders X (setcdr list (cons (cons (car vheaders) nil) nil)) X (setq list (cdr list) vheaders (cdr vheaders))) X (setq vm-visible-header-alist (cdr header-alist)))) X X;; Group the headers that the user wants to see at the end of the headers X;; section so we can narrow to them. The vheaders field of the X;; message struct is set. This function is called on demand whenever X;; a vheaders field is discovered to be nil for a particular message. X X(defun vm-reorder-message-headers (message) X (save-excursion X (vm-save-restriction X (let ((header-alist vm-visible-header-alist) list buffer-read-only X (inhibit-quit t) X (old-buffer-modified-p (buffer-modified-p))) X (goto-char (vm-start-of message)) X (forward-line) X (while (not (= (following-char) ?\n)) X (setq list (vm-match-visible-header header-alist)) X ;; cannot fail, looking-at used to set match data X (looking-at vm-generic-header-regexp) X (if (null list) X (goto-char (match-end 0)) X (if (cdr list) X (setcdr list X (concat X (cdr list) X (buffer-substring (match-beginning 0) X (match-end 0)))) X (setcdr list (buffer-substring (match-beginning 0) X (match-end 0)))) X (delete-region (match-beginning 0) (match-end 0)))) X (vm-set-vheaders-of message (point-marker)) X (setq list header-alist) X (while list X (if (cdr (car list)) X (progn X (insert (cdr (car list))) X (setcdr (car list) nil))) X (setq list (cdr list))) X (set-buffer-modified-p old-buffer-modified-p))))) X X;; Read the attribute headers from the messages and store their contents X;; in attributes fields of the message structures. If a message has no X;; attributes header assume it is new. If a message already has X;; attributes don't bother checking the headers. X;; X;; Stores the position where the message text begins in the message struct. X X(defun vm-read-attributes () X (save-excursion X (let ((mp vm-message-list)) X (setq vm-new-count 0 X vm-unread-count 0 X vm-total-count 0) X (while mp X (vm-increment vm-total-count) X (if (vm-attributes-of (car mp)) X () X (goto-char (vm-start-of (car mp))) X (search-forward "\n\n" (vm-text-end-of (car mp)) 0) X (vm-set-text-of (car mp) (point-marker)) X (goto-char (vm-start-of (car mp))) X (cond ((re-search-forward vm-attributes-header-regexp X (vm-text-of (car mp)) t) X (goto-char (match-beginning 1)) X (vm-set-attributes-of (car mp) X (condition-case () X (read (current-buffer)) X (error (vector t nil nil nil nil)))) X ;; If attributes are unrecogniable just assume the X ;; message is new. X (cond ((or (not (vectorp (vm-attributes-of (car mp)))) X (not (= (length (vm-attributes-of (car mp))) X 5))) X (vm-set-attributes-of (car mp) X (vector t nil nil nil nil))))) X ((and vm-berkeley-mail-compatibility X (re-search-forward vm-berkeley-mail-status-header-regexp X (vm-text-of (car mp)) t)) X (vm-set-attributes-of (car mp) (vector nil (looking-at "R") X nil nil nil))) X (t X (vm-set-attributes-of (car mp) (vector t nil nil nil nil))))) X (cond ((vm-deleted-flag (car mp))) ; don't count deleted messages X ((vm-new-flag (car mp)) X (vm-increment vm-new-count)) X ((vm-unread-flag (car mp)) X (vm-increment vm-unread-count))) X (setq mp (cdr mp)))))) X X;; Stuff the messages attributes back into the messages as headers. X(defun vm-stuff-attributes () X (save-excursion X (vm-save-restriction X (widen) X (let ((mp vm-message-list) attributes buffer-read-only X (old-buffer-modified-p (buffer-modified-p))) X (while mp X (setq attributes (vm-attributes-of (car mp))) X (goto-char (vm-start-of (car mp))) X (if (re-search-forward vm-attributes-header-regexp X (vm-text-of (car mp)) t) X (delete-region (match-beginning 0) (match-end 0))) X (cond (vm-berkeley-mail-compatibility X (goto-char (vm-start-of (car mp))) X (if (re-search-forward vm-berkeley-mail-status-header-regexp X (vm-text-of (car mp)) t) X (delete-region (match-beginning 0) (match-end 0))) X (cond ((not (vm-new-flag (car mp))) X (goto-char (vm-start-of (car mp))) X (forward-line) X (insert-before-markers X vm-berkeley-mail-status-header X (if (vm-unread-flag (car mp)) "" "R") X "O\n"))))) X (goto-char (vm-start-of (car mp))) X (forward-line) X (insert-before-markers vm-attributes-header " " X (prin1-to-string attributes) "\n") X (setq mp (cdr mp))) X (set-buffer-modified-p old-buffer-modified-p))))) X X;; Remove any message marked for deletion from the buffer and the X;; message list. X(defun vm-gobble-deleted-messages () X (save-excursion X (vm-save-restriction X (widen) X (let ((mp vm-message-list) prev buffer-read-only) X (while mp X (if (not (vm-deleted-flag (car mp))) X (setq prev mp) X (delete-region (vm-start-of (car mp)) X (vm-end-of (car mp))) X (if (null prev) X (setq vm-message-list (cdr vm-message-list)) X (setcdr prev (cdr mp)))) X (setq mp (cdr mp)))))) X (vm-clear-expunge-invalidated-undos) X (if (null vm-message-list) X (setq overlay-arrow-position nil)) X (cond ((and vm-last-message-pointer X (vm-deleted-flag (car vm-last-message-pointer))) X (setq vm-last-message-pointer nil))) X (cond ((and vm-message-pointer (vm-deleted-flag (car vm-message-pointer))) X (setq vm-system-state nil) X (setq vm-message-pointer nil)))) X X(defun vm-change-all-new-to-unread () X (let ((mp vm-message-list)) X (while mp X (if (vm-new-flag (car mp)) X (progn X (vm-set-new-flag (car mp) nil) X (vm-set-unread-flag (car mp) t))) X (setq mp (cdr mp))))) X X(defun vm-update-summary-and-mode-line () X (setq vm-ml-message-number (vm-number-of (car vm-message-pointer))) X (cond ((vm-new-flag (car vm-message-pointer)) X (setq vm-ml-attributes-string "new")) X ((vm-unread-flag (car vm-message-pointer)) X (setq vm-ml-attributes-string "unread")) X (t (setq vm-ml-attributes-string "read"))) X (cond ((vm-filed-flag (car vm-message-pointer)) X (setq vm-ml-attributes-string X (concat vm-ml-attributes-string " filed")))) X (cond ((vm-replied-flag (car vm-message-pointer)) X (setq vm-ml-attributes-string X (concat vm-ml-attributes-string " replied")))) X (cond ((vm-deleted-flag (car vm-message-pointer)) X (setq vm-ml-attributes-string X (concat vm-ml-attributes-string " deleted")))) X (while vm-messages-needing-display-update X (vm-update-message-summary vm-messages-needing-display-update) X (setq vm-messages-needing-display-update X (cdr vm-messages-needing-display-update))) X (save-excursion X (set-buffer (other-buffer)) X (set-buffer-modified-p (buffer-modified-p)))) X X(defun vm-goto-message (n) X "Go to the message numbered N. XInteractively N is the prefix argument. If no prefix arg is provided XN is prompted for in the minibuffer." X (interactive "NGo to message: ") X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (let ((cons (nthcdr (1- n) vm-message-list))) X (if (null cons) X (error "No such message.")) X (if (eq vm-message-pointer cons) X (vm-preview-current-message) X (setq vm-last-message-pointer vm-message-pointer X vm-message-pointer cons) X (vm-set-summary-pointer (car vm-message-pointer)) X (vm-preview-current-message)))) X X(defun vm-goto-message-last-seen () X "Go to the message last previewed." X (interactive) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (if vm-last-message-pointer X (let (tmp) X (setq tmp vm-message-pointer X vm-message-pointer vm-last-message-pointer X vm-last-message-pointer tmp) X (vm-set-summary-pointer (car vm-message-pointer)) X (vm-preview-current-message)))) X X(defun vm-move-message-pointer (direction) X (let ((mp vm-message-pointer)) X (if (eq direction 'forward) X (progn X (setq mp (cdr mp)) X (if (null mp) X (setq mp vm-message-list))) X (if (eq mp vm-message-list) X (setq mp (vm-last vm-message-list)) X (setq mp (let ((curr vm-message-list)) X (while (not (eq (cdr curr) mp)) X (setq curr (cdr curr))) X curr)))) X (setq vm-message-pointer mp))) X X(defun vm-next-message (count) X "Go forward one message and preview it. XWith prefix arg COUNT, go forward COUNT messages. A negative COUNT Xmeans go backward. If at last message wrap around to the first message. XIf the absolute value of COUNT > 1 the values of the variables Xvm-skip-deleted-messages and vm-skip-read-messages are ignored." X (interactive "p") X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (let ((oldmp vm-message-pointer) X (direction (if (> count 0) 'forward 'backward)) X (count (vm-abs count))) X (cond ((> count 1) X (while (not (zerop count)) X (vm-move-message-pointer direction) X (vm-decrement count))) X (t X (vm-move-message-pointer direction) X (while X (and X (not (eq oldmp vm-message-pointer)) X (or X (and vm-skip-deleted-messages X (vm-deleted-flag (car vm-message-pointer))) X (and vm-skip-read-messages X (or X (vm-deleted-flag (car vm-message-pointer)) X (not (or X (vm-new-flag (car vm-message-pointer)) X (vm-unread-flag (car vm-message-pointer)))))))) X (vm-move-message-pointer direction)) X (and X (eq oldmp vm-message-pointer) X (or X (and vm-skip-deleted-messages X (vm-deleted-flag (car vm-message-pointer))) X (and vm-skip-read-messages X (or X (vm-deleted-flag (car vm-message-pointer)) X (not (or X (vm-new-flag (car vm-message-pointer)) X (vm-unread-flag (car vm-message-pointer))))))) X (vm-move-message-pointer direction)))) X (setq vm-last-message-pointer oldmp) X (vm-set-summary-pointer (car vm-message-pointer)) X (vm-preview-current-message))) X X(defun vm-previous-message (count) X "Go back one message and preview it. XWith prefix arg COUNT, go backward COUNT messages. A negative COUNT Xmeans go forward. If at first message wrap around to the last message. XIf the absolute value of COUNT > 1 the values of the variables Xvm-skip-deleted-messages and vm-skip-read-messages are ignored." X (interactive "p") X (vm-next-message (- count))) X X(defun vm-Next-message (count) X "Like vm-next-message but will not skip messages." X (interactive "p") X (let (vm-skip-deleted-messages vm-skip-read-messages) X (vm-next-message count))) X X(defun vm-Previous-message (count) X "Like vm-previous-message but will not skip messages." X (interactive "p") X (let (vm-skip-deleted-messages vm-skip-read-messages) X (vm-previous-message count))) X X(defun vm-next-unread-message () X "Move forward to the nearest new or unread message, if there is one. XOtherwise behave like vm-next-message." X (interactive) X (let ((vm-skip-read-messages t)) X (vm-next-message 1))) X X(defun vm-previous-unread-message () X "Move backward to the nearest new or unread message, if there is one. XOtherwise behave like vm-previous-message." X (interactive) X (let ((vm-skip-read-messages t)) X (vm-previous-message 1))) X X(defun vm-preview-current-message () X (setq vm-system-state 'previewing) X (widen) X (narrow-to-region X (vm-vheaders-of (car vm-message-pointer)) X (if vm-preview-lines X (save-excursion X (goto-char (vm-text-of (car vm-message-pointer))) X (forward-line (if (natnump vm-preview-lines) vm-preview-lines 0)) X (point)) X (vm-text-of (car vm-message-pointer)))) X (let ((w (get-buffer-window (current-buffer)))) X (and w (progn (set-window-start w (point-min)) X (set-window-point w (point-max)))) X (and w vm-highlighted-header-regexp X (progn X (save-restriction X (narrow-to-region (point) (point)) X (sit-for 0)) X (goto-char (point-min)) X (while (re-search-forward vm-highlighted-header-regexp nil t) X (save-restriction X (goto-char (match-beginning 0)) X (looking-at vm-generic-header-regexp) X (goto-char (match-beginning 1)) X (narrow-to-region (point-min) (point)) X (sit-for 0) X (setq inverse-video t) X (widen) X (narrow-to-region (point-min) (match-end 1)) X (sit-for 0) X (setq inverse-video nil) X (goto-char (match-end 0))))))) X (goto-char (point-max)) X (if (null vm-preview-lines) X (vm-show-current-message t) X (vm-update-summary-and-mode-line))) X X(defun vm-show-current-message (&optional sit-and-howl) X (setq vm-system-state 'reading) X (save-excursion X (goto-char (point-min)) X (widen) X (narrow-to-region (point) (vm-text-end-of (car vm-message-pointer)))) X (cond ((vm-new-flag (car vm-message-pointer)) X (vm-set-new-flag (car vm-message-pointer) nil)) X ((vm-unread-flag (car vm-message-pointer)) X (vm-set-unread-flag (car vm-message-pointer) nil))) X (vm-update-summary-and-mode-line) X (cond (sit-and-howl X (sit-for 0) X (vm-howl-if-eom-visible)))) X X(defun vm-expose-hidden-headers () X "Expose headers omitted from vm-visible-headers." X (interactive) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (save-excursion X (goto-char (point-max)) X (widen) X (narrow-to-region (point) (vm-start-of (car vm-message-pointer))) X (let (w) X (and (setq w (get-buffer-window (current-buffer))) X (= (window-start w) (vm-vheaders-of (car vm-message-pointer))) X (set-window-start w (vm-start-of (car vm-message-pointer))))))) X X(defun vm-howl-if-eom-visible () X (let ((w (get-buffer-window (current-buffer)))) X (and w (pos-visible-in-window-p (point-max) w) X (message "End of message %s from %s" X (vm-number-of (car vm-message-pointer)) X (vm-su-full-name (car vm-message-pointer)))))) X X(defun vm-scroll-forward (&optional arg) X "Scroll forward a screenful of text. XIf the current message is being previewed, the message body is revealed. XIf at the end of the current message, move to the next message." X (interactive "P") X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (if (null (get-buffer-window (current-buffer))) X (progn X (display-buffer (current-buffer)) X (if (and vm-summary-buffer (get-buffer-window vm-summary-buffer)) X (vm-proportion-windows)))) X (if (eq vm-system-state 'previewing) X (vm-show-current-message t) X (let ((w (get-buffer-window (current-buffer))) X (old-w (selected-window))) X (unwind-protect X (progn X (select-window w) X (if (not (eq (condition-case () (scroll-up arg) X (end-of-buffer (if (null arg) X (progn X (vm-next-message 1) X 'next-message)))) X 'next-message)) X (vm-howl-if-eom-visible))) X (select-window old-w))))) X X(defun vm-scroll-backward (&optional arg) X "Scroll backward a screenful of text." X (interactive "P") X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (if (null (get-buffer-window (current-buffer))) X (progn X (display-buffer (current-buffer)) X (if (and vm-summary-buffer (get-buffer-window vm-summary-buffer)) X (vm-proportion-windows)))) X (let ((w (get-buffer-window (current-buffer))) X (old-w (selected-window))) X (unwind-protect X (progn X (select-window w) X (scroll-down arg)) X (select-window old-w)))) X X(defun vm-end-of-message () X "Displays the end of the current message, exposing and marking it read Xas necessary." X (interactive) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (if (eq vm-system-state 'previewing) X (vm-show-current-message)) X (goto-char (point-max)) X (vm-howl-if-eom-visible)) X X(defun vm-delete-message (count) X "Mark the current message for deletion. XWith a prefix arg mark the next COUNT messages for deletion. A negative Xarg means the previous COUNT messages are marked." X (interactive "p") X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (let ((direction (if (< count 0) 'backward 'forward)) X (count (vm-abs count)) X (oldmp vm-message-pointer) X (vm-message-pointer vm-message-pointer)) X (while (not (zerop count)) X (if (not (vm-deleted-flag (car vm-message-pointer))) X (vm-set-deleted-flag (car vm-message-pointer) t)) X (vm-move-message-pointer direction) X (vm-decrement count))) X (vm-update-summary-and-mode-line)) X X(defun vm-undelete-message (count) X "Remove the deletion mark from the current message. XWith a prefix arg unmark the next COUNT messages. A negative arg means Xthe previous COUNT messages are unmarked." X (interactive "p") X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (let ((direction (if (< count 0) 'backward 'forward)) X (count (vm-abs count)) X (oldmp vm-message-pointer) X (vm-message-pointer vm-message-pointer)) X (while (not (zerop count)) X (if (vm-deleted-flag (car vm-message-pointer)) X (vm-set-deleted-flag (car vm-message-pointer) nil)) X (vm-move-message-pointer direction) X (vm-decrement count))) X (vm-update-summary-and-mode-line)) X X(defun vm-kill-subject () X "Mark all mesages with the same subject as the current message X\(ignoring re:'s) for deletion." X (interactive) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm-error-if-mailbox-empty) X (let ((subject (vm-subject-of (car vm-message-pointer))) X (mp vm-message-list)) X (if (string-match "^\\(re: *\\)+" subject) X (setq subject (substring subject (match-end 0)))) X (setq subject (concat "^\\(re: *\\)*" (regexp-quote subject) " *$")) X (while mp X (if (and (not (vm-deleted-flag (car mp))) X (string-match subject (vm-subject-of (car mp)))) X (vm-set-deleted-flag (car mp) t)) X (setq mp (cdr mp)))) X (vm-update-summary-and-mode-line)) X X(defun vm-expunge-folder (&optional quitting shaddap) X "Expunge deleted messages, but don't save folder to disk or exit VM." X (interactive) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (if (not (buffer-modified-p)) X (error "No messages are marked for deletion.")) X (let ((inhibit-quit t)) X (vm-gobble-deleted-messages) X (if (not quitting) X (progn X (if (not shaddap) X (message "Deleted messages expunged.")) X (vm-number-messages) X (if vm-summary-buffer X (vm-do-summary)) X (if (and vm-message-pointer vm-summary-buffer) X (vm-set-summary-pointer (car vm-message-pointer))) X (if (null vm-message-pointer) X (vm-next-message 1) X (vm-update-summary-and-mode-line)))))) X X(defun vm-quit-no-change () X "Exit VM without saving changes made to the folder." X (interactive) X (vm-quit t)) X X(defun vm-quit (&optional no-change) X "Quit VM, saving changes and expunging messages marked for deletion. XNew messages are changed to unread." X (interactive) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (let ((inhibit-quit t)) X (if (not no-change) X (vm-change-all-new-to-unread)) X (if (and (buffer-modified-p) (not no-change)) X (vm-save-folder t)) X (let ((summary-buffer vm-summary-buffer) X (mail-buffer (current-buffer))) X (if summary-buffer X (progn X (setq overlay-arrow-position nil) X (delete-windows-on vm-summary-buffer) X (kill-buffer summary-buffer))) X (set-buffer mail-buffer) X (set-buffer-modified-p nil) X (kill-buffer (current-buffer))) X ;; If we land on a buffer that VM knows about X ;; do some nice things for the user. X (cond ((and (eq major-mode 'vm-mode) X vm-summary-buffer X vm-startup-with-summary) X (condition-case () (vm-summarize t) (error nil)) X (and (eq vm-startup-with-summary t) (not (one-window-p t)) X (delete-window))) X ((eq major-mode 'vm-summary-mode) X (cond ((eq vm-startup-with-summary nil) X (switch-to-buffer vm-mail-buffer)) X ((not (eq vm-startup-with-summary t)) X (display-buffer vm-mail-buffer) X (vm-proportion-windows))))))) X X;; This allows C-x C-s to do the right thing for VM mail buffers. X;; Note that deleted messages are not expunged. X(defun vm-write-file-hook () X (if (not (eq major-mode 'vm-mode)) X () X (if vm-inhibit-write-file-hook X () X ;; The vm-save-restriction isn't really necessary here (since X ;; vm-stuff-atributes cleans up after itself) but should remain X ;; as a safeguard against the time when other stuff is added here. X (vm-save-restriction X (let ((inhibit-quit t) X (buffer-read-only)) X (vm-stuff-attributes) X nil ))))) X X(defun vm-save-folder (&optional quitting) X "Save current folder to disk." X (interactive) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (if (buffer-modified-p) X (let ((inhibit-quit t)) X ;; may get error if mailbox is emptied by the expunge. X (condition-case () X (vm-expunge-folder quitting t) X (error nil)) X (vm-stuff-attributes) X (let ((vm-inhibit-write-file-hook t)) X (save-buffer)) X (if (not quitting) X (if vm-message-pointer X (vm-update-summary-and-mode-line) X (vm-next-message 1)))))) X X(defun vm-visit-folder (folder) X "Visit a mail file. XVM will parse and present its messages to you in the usual way." X (interactive X (list (read-file-name X "Visit folder: " (if vm-folder-directory X (expand-file-name vm-folder-directory) X default-directory) nil t))) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (vm folder)) X X(defun vm-help () X "Display VM command and variable information." X (interactive) X (if (and vm-mail-buffer (get-buffer-window vm-mail-buffer)) X (set-buffer vm-mail-buffer)) X (cond X ((eq last-command 'vm-help) X (describe-mode)) X ((eq vm-system-state 'previewing) X (message "Type SPC to read message, n previews next message (? gives more help)")) X ((eq vm-system-state 'reading) X (message "SPC and b scroll, (d)elete, (s)ave, (n)ext, (r)eply (? gives more help)")) X (t (describe-mode)))) X X(defun vm-move-mail (source destination) X (call-process "movemail" nil nil nil (expand-file-name source) X (expand-file-name destination))) X X(defun vm-gobble-crash-box () X (save-excursion X (vm-save-restriction X (widen) X (let ((opoint-max (point-max)) crash-buf buffer-read-only X (old-buffer-modified-p (buffer-modified-p))) X (setq crash-buf (find-file-noselect vm-crash-box)) X (goto-char (point-max)) X (insert-buffer-substring crash-buf X 1 (1+ (save-excursion X (set-buffer crash-buf) X (widen) X (buffer-size)))) X (write-region opoint-max (point-max) buffer-file-name t t) X ;; make sure primary inbox is private. 384 = octal 600 X (condition-case () (set-file-modes buffer-file-name 384) (error nil)) X (set-buffer-modified-p old-buffer-modified-p) X (kill-buffer crash-buf) X (condition-case () (delete-file vm-crash-box) X (error nil)))))) X X(defun vm-get-spooled-mail () X (let ((spool-files (or vm-spool-files X (list (concat vm-spool-directory (user-login-name))))) X (inhibit-quit t) X (got-mail)) X (if (file-exists-p vm-crash-box) X (progn X (message "Recovering messages from crash box...") X (vm-gobble-crash-box) X (message "Recovering messages from crash box... done") X (setq got-mail t))) X (while spool-files X (if (file-readable-p (car spool-files)) X (progn X (message "Getting new mail from %s..." (car spool-files)) X (vm-move-mail (car spool-files) vm-crash-box) X (vm-gobble-crash-box) X (message "Getting new mail from %s... done" (car spool-files)) X (setq got-mail t))) X (setq spool-files (cdr spool-files))) X got-mail )) X X(defun vm-get-new-mail () X "Move any new mail that has arrived in the system mailbox into the Xprimary inbox. New mail is appended to the disk and buffer copies of Xthe primary inbox. X XThis command is valid only from the primary inbox buffer." X (interactive) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (if (not vm-primary-inbox-p) X (error "This is not your primary inbox.")) X (if (not (and (vm-get-spooled-mail) (vm-assimilate-new-messages))) X (message "No new mail.") X (vm-emit-totals-blurb) X (vm-thoughtfully-select-message) X (if vm-summary-buffer X (progn X (vm-do-summary) X (vm-set-summary-pointer (car vm-message-pointer)))))) X X(defun vm-emit-totals-blurb () X (message "%d message%s, %d new, %d unread." X vm-total-count (if (= vm-total-count 1) "" "s") X vm-new-count vm-unread-count)) X X(defun vm-find-first-unread-message () X (let (mp unread-mp) X (setq mp vm-message-list) X (while mp X (if (and (vm-new-flag (car mp)) (not (vm-deleted-flag (car mp)))) X (setq unread-mp mp mp nil) X (setq mp (cdr mp)))) X (if (null unread-mp) X (progn X (setq mp vm-message-list) X (while mp X (if (and (vm-unread-flag (car mp)) X (not (vm-deleted-flag (car mp)))) X (setq unread-mp mp mp nil) X (setq mp (cdr mp)))))) X unread-mp)) X X;; returns non-nil if there were any new messages X(defun vm-assimilate-new-messages () X (let ((tail-cons (vm-last vm-message-list)) X (new-messages-p (null vm-message-pointer))) X (vm-save-restriction X (widen) X (vm-build-message-list) X (vm-read-attributes) X (setq new-messages-p (or new-messages-p (cdr tail-cons))) X (if (and vm-current-grouping new-messages-p) X (condition-case data X (vm-group-messages vm-current-grouping) X ;; presumably an unsupported grouping X (error (message (car (cdr data))) X (sleep-for 2) X (vm-number-messages))) X (vm-number-messages))) X new-messages-p )) X X(defun vm-thoughtfully-select-message () X (if (not (and vm-message-pointer (eq vm-system-state 'reading))) X (let ((mp (vm-find-first-unread-message))) X (if mp X (progn X (if vm-message-pointer X (setq vm-last-message-pointer vm-message-pointer X vm-message-pointer mp) X (setq vm-message-pointer mp)) X (vm-preview-current-message)) X (if (null vm-message-pointer) X (vm-Next-message 1)))))) X X(defun vm-display-startup-message () X (if (sit-for 5) X (let ((lines X '( X"You may give out copies of VM. Type \\[vm-show-copying-restrictions] to see the conditions" X"VM comes with ABSOLUTELY NO WARRANTY; type \\[vm-show-no-warranty] for full details" X ))) X (message "VM %s, Copyright (C) 1989 Kyle E. Jones; type ? for help" X vm-version) X (while (and (sit-for 4) lines) X (message (substitute-command-keys (car lines))) X (setq lines (cdr lines))))) X (message "")) X X(defun vm (&optional mailbox) X "Read mail under Emacs. XOptional first arg MAILBOX specifies the mailbox to visit. It defaults Xto the value of vm-primary-inbox. The mailbox buffer is put into VM Xmode, a major mode for reading mail. X XVisiting the primary inbox causes any contents of the system mailbox to Xbe moved and appended to the resulting buffer. X XAll the messages can be read by repeatedly pressing SPC. Messages are Xmarked for deletion with `d', and saved to a folder with `s'. Quitting XVM with `q' expunges messages marked for deletion and saves the buffered Xmailbox to disk. X XSee the documentation for vm-mode for more information." X (interactive) X (if vm-session-beginning X (progn X (load "vm-undo") X (load "vm-summary"))) X (if vm-mail-buffer X (set-buffer vm-mail-buffer)) X (find-file (or mailbox (expand-file-name vm-primary-inbox))) X (delete-other-windows) X (let ((first-time (not (eq major-mode 'vm-mode))) X (inhibit-quit t)) X (if first-time X (progn X (buffer-flush-undo (current-buffer)) X (auto-save-mode 0) X (abbrev-mode 0) X (auto-fill-mode 0) X (vm-mode))) X (if (or (and vm-primary-inbox-p (vm-get-spooled-mail)) first-time) X (progn X (vm-assimilate-new-messages) X ;; Can't allow a mailbox-empty error here because execution X ;; abort before the session startup code below. X (if (null vm-message-list) X (message "Mailbox is empty.") X (vm-emit-totals-blurb) X (vm-thoughtfully-select-message)))) X (if (and vm-message-list vm-startup-with-summary) X (progn X (vm-summarize) X (and (eq vm-startup-with-summary t) (delete-window)))) X (if vm-session-beginning X (progn X (setq vm-session-beginning nil) X (or vm-inhibit-startup-message mailbox X (vm-display-startup-message)) X (if (and vm-message-list (not (input-pending-p))) X (vm-emit-totals-blurb)))))) X X(defun vm-mode () X "Major mode for reading mail. X XCommands: X h - summarize folder contents X X n - go to next message X p - go to previous message X N - like `n' but ignores skip-variable settings X P - like `p' but ignores skip-variable settings X M-n - go to next unread message X M-p - go to previous unread message X RET - go to numbered message (uses prefix arg or prompts in minibuffer) X TAB - go to last message seen X M-s - incremental search through the folder X X t - display hidden headers X SPC - scroll forward a page (if at end of message, then display next message) X b - scroll backward a page X > - go to end of current message X X d - delete current message (mark as deleted) X u - undelete X k - mark for deletion all messages with same subject as the current message X X r - reply (only to the sender of the message) X R - reply with included text for current message X f - followup (reply to all recipients of message) X F - followup with included text from the current message X z - forward the current message X m - send a message X X @ - digestify and mail entire folder contents (the folder is not modified) X * - burst a digest into indivdual messages, and append and assimilate these X message into the current folder. X X G - group messages according to some criteria X X g - get any new mail that has arrived in the system mailbox X (new mail is appended to the disk and buffer copies of the X primary inbox.) X v - visit another mail folder X X s - save current message in a folder (appends if folder already exists) X w - write current message to a file without its headers (appends if exists) X S - save entire folder to disk, without quitting VM X A - save unfiled messages to their vm-auto-folder-alist specified folders X # - expunge deleted messages (without saving folder) X q - quit VM, deleted messages are expunged, folder saved to disk X x - exit VM with no change to the folder X X C-_ - undo, special undo that retracts the most recent X changes in message attributes. Expunges and saves X cannot be undone. X X ? - help X X ! - run a shell command X | - run a shell command with the current message as input X X M-c - view conditions under which youmay redistribute of VM X M-w - view the details of VM's lack of a warranty X XVariables: X vm-auto-folder-alist X vm-berkeley-mail-compatibility X vm-crash-box X vm-folder-directory X vm-gargle-uucp X vm-group-by X vm-highlighted-header-regexp X vm-included-text-attribution-format X vm-included-text-prefix X vm-inhibit-startup-message X vm-mail-window-percentage X vm-mode-hooks X vm-preview-lines X vm-primary-inbox X vm-rfc934-forwarding X vm-search-using-regexps X vm-skip-deleted-messages X vm-skip-read-messages X vm-startup-with-summary X vm-summary-format X vm-visible-headers X vm-visit-when-saving" X (widen) X (setq X buffer-read-only nil X case-fold-search t X major-mode 'vm-mode X mode-line-format X '("" mode-line-modified mode-line-buffer-identification " " X global-mode-string X (vm-message-list X (" %[(" vm-ml-attributes-string ")%]----") X (" %[()%]----")) X (-3 . "%p") "-%-") X mode-line-buffer-identification X '("VM " vm-version ": %b" X (vm-message-list X (" " vm-ml-message-number X " (of " vm-ml-highest-message-number ")") X " (no messages)")) X mode-name "VM" X require-final-newline nil X vm-current-grouping vm-group-by X vm-primary-inbox-p (equal buffer-file-name X (expand-file-name vm-primary-inbox))) X (use-local-map vm-mode-map) X (run-hooks 'vm-mode-hooks)) X X(put 'vm-mode 'mode-class 'special) X X(autoload 'vm-group-messages "vm-group" nil t) X X(autoload 'vm-reply "vm-reply" nil t) X(autoload 'vm-reply-include-text "vm-reply" nil t) X(autoload 'vm-followup "vm-reply" nil t) X(autoload 'vm-followup-include-text "vm-reply" nil t) X(autoload 'vm-mail "vm-reply" nil t) X(autoload 'vm-forward-message "vm-reply" nil t) X(autoload 'vm-send-digest "vm-reply" nil t) X X(autoload 'vm-isearch-forward "vm-search" nil t) X X(autoload 'vm-burst-digest "vm-digest" nil t) X(autoload 'vm-rfc934-char-stuff-region "vm-digest") X(autoload 'vm-digestify-region "vm-digest") X X(autoload 'vm-show-no-warranty "vm-license" nil t) X(autoload 'vm-show-copying-restrictions "vm-license" nil t) X X(autoload 'vm-auto-archive-messages "vm-save" nil t) X(autoload 'vm-save-message "vm-save" nil t) X(autoload 'vm-save-message-sans-headers "vm-save" nil t) X(autoload 'vm-pipe-message-to-command "vm-save" nil t) X X(if (not (memq 'vm-write-file-hook write-file-hooks)) X (setq write-file-hooks X (cons 'vm-write-file-hook write-file-hooks))) SHAR_EOF echo "File vm.el is complete" chmod 0664 vm.el || echo "restore of vm.el fails" echo "x - extracting vm.texinfo (Text)" sed 's/^X//' << 'SHAR_EOF' > vm.texinfo && X@comment -*-Texinfo-*- X@setfilename vm.info X@ignore XThis file documents the VM mail reader. X XCopyright (C) 1989 Kyle E. Jones X XPermission is granted to make and distribute verbatim copies of Xthis manual provided the copyright notice and this permission notice Xare preserved on all copies. X@end ignore X X@node Top, Introduction,, (DIR) X XThis manual documents the VM mail reader. It is divided into the Xfollowing chapters. X X@menu X* Introduction:: Overview of the VM interface. X* Starting Up:: What happens when your start VM. X* Selecting Messages:: How to select messages for reading. X* Sending Messages:: How to send messages from within VM. X* Saving Messages:: How to save messages. X* Deleting Messages:: How to delete, undelete and expunge messages X* Undoing:: How to undo changes to message attributes. X* Grouping Messages:: How to make VM present messages X* Reading Digests:: How to read digests under VM. X* Summaries:: How to view and customize the summary of a folder. X* Miscellaneous:: Various customization variables undescribed elsewhere. X XIndices: X X* Key Index:: Menus of command keys and their references. X* Command Index:: Menus of commands and their references. X* Variable Index:: Menus of variables and their references. X@end menu X X@node Introduction, Starting Up, Variable Index, Top X@chapter Introduction X XVM (View Mail) is an Emacs subsystem that allows UNIX mail to be read Xand disposed of within Emacs. Commands exist to do the normal things Xexpected of a mail user agent, such as generating replies, saving Xmessages to folders, deleting messages and so on. There are other more Xadvanced commands that do tasks like bursting and creating digests, Xmessage forwarding, and organizing message presentation according to Xvarious criteria. X XTo invoke VM simply type @kbd{M-x vm}. VM gathers any mail that has Xarrived in your system mailbox and appends it to a file known as your X@dfn{primary inbox}, and visits that file for reading. @xref{Starting Up}. XA file visited for reading by VM is called the @dfn{current folder}.@refill X X@findex vm-scroll-forward X@findex vm-scroll-backward X@kindex SPC X@kindex b XIf there are any messages in the primary inbox, VM selects the first new Xor unread message, and previews it. @dfn{Previewing} is VM's way of Xshowing you part of message and allowing you to decide whether you want Xto read it. @xref{Previewing}. By default VM shows you the message's Xsender, recipient, subject and date headers. Typing @key{SPC} X(@code{vm-scroll-forward}) exposes the body of the message and marks the Xmessage as read. Subsequent @key{SPC}'s scroll forward through the Xmessage, @kbd{b} scrolls backward. When you reach the end of a message, Xtyping a @key{SPC} or @kbd{n} moves you forward to preview the next Xmessage.@refill X XIf you do not want to read a message that's being previewed, just type X@kbd{n} and VM will move on to the next message (if there is one). X@xref{Selecting Messages}.@refill X XTo save a message to a mail folder use @kbd{s} (@code{vm-save-message}). XVM will prompt you for the folder name in the minibuffer. X@xref{Saving Messages}.@refill X XMessages are deleted by typing @kbd{d} (@code{vm-delete-message}) while Xpreviewing or reading them. The message is not deleted right away; it Xis simply marked for deletion. If you change your mind about deleting a Xmessage just select it and type @kbd{u} (@code{vm-undelete-message}), Xand the message will be undeleted. @xref{Deleting Messages}. The Xactual removal of deleted messages from the current folder is called X@dfn{expunging} and it is accomplished by typing @kbd{#} (@code{vm-expunge-folder}). The message is still present in the on-disk Xversion of the folder until the folder is saved. @xref{Saving Folders}.@refill X XTyping @kbd{h} (@code{vm-summarize}) causes VM to pop up a window Xcontaining a summary of contents of the current folder. Each message is Xsumamrized, one per line, by message number listing its author, date Xsent, line and byte count, and subject. Also various letters appear Xbeside the message number to indicate that a message is new, unread, Xmarked for deletion, etc. An arrow @samp{->} appears to the left of the Xline summarizing the current messge. The summary format is user Xconfigurable, @pxref{Summaries}.@refill X X@findex vm-save-folder X@kindex S XWhen you are finished reading mail the current folder must be saved, so Xthat the next time the folder is visited VM will know which message have Xbeen already read, replied to and so on. Typing @kbd{S} X(@code{vm-save-folder}) expunges all deleted message and saves the Xfolder. @kbd{C-x C-s} saves the folder without expunging deleted Xmessages but the message are still marked deleted. The next time the Xfolder is visited these messages will still be marked for deletion.@refill X X@findex vm-quit X@findex vm-quit-no-change X@kindex q X@kindex x XTo quit VM you can type @kbd{q} (@code{vm-quit}) or @kbd{x} X(@code{vm-quit-no-change}). Typing @kbd{q} expunges and saves the Xcurrent folder before quitting. Also, any messages marked new are Xchanged to be marked unread, before saving. The @kbd{x} command quits XVM without expunging, saving or otherwise modifying the current folder. XQuitting is not required; you can simply switch to another Emacs buffer Xwhen you've finished reading mail.@refill X X@findex vm-get-new-mail X@kindex g XAt any time while reading mail in the primary inbox you can type @kbd{g} X(@code{vm-get-new-mail}) to check to see if new mail has arrived. If Xnew mail has arrived it will be merged into the primary inbox. If you Xare not in the middle of another message, VM will also jump to the first Xnew message. X X@node Starting Up, Selecting Messages, Introduction, Top X@chapter Starting Up X XThere are two ways to start VM: @kbd{M-x vm} and @kbd{M-x vm-visit-folder}. X X@findex vm X@vindex vm-primary-inbox X@kbd{M-x vm} causes VM to gather any mail present in your system mailbox Xand append it to a file known as your @dfn{primary inbox}, creating Xthis file if necessary. The default name of this file is X@file{~/INBOX}, but VM will use whatever file is named by the variable X@code{vm-primary-inbox}.@refill X X@vindex vm-crash-box XVM transfers the mail from the system mailbox to the primary inbox via a Xtemporary file known as the @dfn{crash box}. The variable X@code{vm-crash-box} names the crash box file. VM first copies the mail Xto the crash box, deletes the system mailbox, merges the crash box Xcontents into the primary inbox, and then deletes the crash box. If the Xsystem or Emacs should crash in the midst of this transfer, any message Xno present in the primary inbox will be either in the system mailbox or Xthe crash box. Some messages may be duplicated but no mail will be Xlost.@refill X XIf the file named by @code{vm-crash-box} already exists when VM is Xstarted up, VM will merge that with the primary inbox before getting any Xnew messages from the system mailbox.@refill X X@vindex vm-spool-files XBy default, the system mailbox is determined heuristically by VM based Xon what type of system you're using. VM can be told explicitly where Xthe system mailbox is through the variable @code{vm-spool-files}. The Xvalue of this variable should be a list of strings naming files VM Xshould try when searching for newly arrived mail. Thus multiple Xmailboxes can be specified if you receive mail in more than one Xplace.@refill X X@findex vm-visit-folder X@kindex v X@kbd{M-x vm-visit-folder} (@kbd{v} from within VM) allows you to visit Xsome other mail folder than the primary inbox. The folder name will be Xprompted for in the minibuffer.@refill X XOnce VM has read the folder, the first new or unread message will be Xselected. If there is no such message, the first message in the folder Xis selected. X X@vindex vm-startup-with-summary XThe variable @code{vm-startup-with-summary} controls whether VM Xautomatically displays a summary of the folder's contents at startup. A Xvalue of @code{nil} gives no summary; a value of @code{t} gives a full Xscreen summary. A value that is neither @code{t} nor @code{nil} splits Xthe screen between the summary and the folder display. The latter only Xworks if the variable pop-up-windows's value is non-nil.@refill X X@vindex vm-mail-window-percentage XThe variable @{vm-mail-window-percentage} tells VM what percentage of Xthe screen should be given the folder display when both it and the Xfolder summary are being displayed. Note that Emacs enforces a minimum Xwindow sizew limit, so a very high or very low value for this variable Xmay squeeze out one of the displays entirely. This variable's default Xvalue is 75, which works with Emacs' default minimum window size limit, Xon a 24 line terminal.@refill X X@vindex vm-inhibit-startup-message XA non-@code{nil} value for the variable @{vm-inhibit-startup-message} Xdisables the display of the VM's copyright, copying and warranty Xdisclaimer. If you must, set this variable in your own .emacs file; Xdon't set it globally for everyone. Users should be told their rights. XThe startup messages abort at the first press of a key so they do not Ximpede mail reading. X X@node Selecting Messages, Sending Messages, Starting Up, Top X@chapter Selecting Messages X X@findex vm-next-message X@findex vm-previous-message X@kindex n X@kindex p X@vindex vm-skip-deleted-messages X@vindex vm-skip-read-messages XThe primary commands for selecting messages in VM are @kbd{n} X(@code{vm-next-message}) and @kbd{p} (@code{vm-previous-message}). XThese command move forward and backward through the current folder. XWhen they go beyond the end or beginning of the folder they wrap to the Xbeginning and end respectively. By default these commands skip messages Xmarked for deletion. This behavior can be disabled by setting the value Xof the variable @code{vm-skip-deleted-messages} to @code{nil}. These Xcommands can also be made to skip message that have been read; set X@code{vm-skip-read-messages} to @code{t} to do this. If all the message Xis the current folder would be skipped (i.e all are read and/or Xdeleted), @kbd{n} and @kbd{p} simply move to the next message.@refill X XThe command @kbd{n} and @kbd{p} also take prefix arguments that specify Xthe number of message to move forward or backward. If the magnitude of Xthe prefix argument is greater than 1, no message skipping will be done Xregardless of the settings of the previously mentioned skip control Xvariables. X XOther commands to select messages: X X@table @key X@findex vm-goto-message X@kindex RET X@item RET (@code{vm-goto-message}) XGo to message number @var{n}. @var{n} is the prefix argument, if Xprovided, otherwise it is prompted for in the minibuffer. X@findex vm-goto-message X@kindex TAB X@item TAB (@code{vm-goto-message-last-seen}) XGo to message last previewed or read. X@findex vm-Next-message X@findex vm-Previous-message X@kindex N X@kindex P X@item N (@code{vm-Next-message}) X@itemx P (@code{vm-Previous-message}) XGo to the next (previous) message, ignoring the settings of the skip Xcontrol variables. X@findex vm-next-unread-message X@findex vm-previous-unread-message X@kindex M-n X@kindex M-p X@item M-n (@code{vm-next-unread-message}) X@itemx M-p (@code{vm-previous-unread-message}) XMove forward (backward) to the nearest new or unread message. If no Xsuch message exists then these commands work like @kbd{n} and @kbd{p}. X@findex vm-isearch-forward X@kindex M-s X@item M-s (@code{vm-isearch-forward}) XThis works just like Emacs' normal incremental search except that when Xthe search ends, VM selects the message containing point. X@xref{Incremental Search,,,emacs, the GNU Emacs Manual}. X@end table X XSelecting a message within VM normally causes VM to preview it. X@iftex X@xref{Previewing}. X@end iftex X X@menu X* Previewing:: Customizing message previews. X@end menu X X@node Previewing,, Selecting Messages, Selecting Messages X@section Previewing X X@dfn{Previewing} is VM's way of showing you a small portion of a message Xand allowing you to decide whether you want to read it. Typing X@key{SPC} exposes the body of the message. X XBy default the sender, recipient, subject and date headers are shown Xwhen previewing; the rest of the message is hidden. This behavior may Xbe augmented by the settings of two variables: @code{vm-visible-headers} Xand @code{vm-preview-lines}.@refill X X@vindex vm-preview-lines XThe value of @code{vm-preview-lines} should be a number that tells VM Xhow many lines of the text of the message should be visible. The default Xvalue of this variable is 0. If @code{vm-preview-lines} is @code{nil}, Xthen previewing is not done at all; when a message is first presented it Xis immediately exposed in its entirety and is marked as read.@refill X X@vindex vm-visible-headers XThe value of @code{vm-visible-headers} should be a list of regular Xexpressions matching the beginnings of headers that should be made Xvisible when a message is presented. The regexps should be listed in Xthe preferred order of presentation for the headers they match.@refill X X@vindex vm-highlighted-headers XAnother variable of interest is @code{vm-highlighted-headers}. The Xvalue of this variable should be a single regular expression that Xmatches the beginnings of any header that should be presented in inverse Xvideo when previewing. For example, a value of @samp{"^From\\|^Subject"} Xcauses the From and Subject headers to be highlighted.@refill X X@node Sending Messages, Saving Messages, Selecting Messages, Top X@chapter Sending Messages X XWhen sending messages from within VM, you will always use the standard XMail major mode provided with GNU Emacs. X@xref{Mail Mode,,,emacs, the GNU Emacs Manual}. XHowever, ``*mail*'' buffers created by VM have extra command keys:@refill X X@table @key X@findex vm-yank-message X@kindex C-c C-y X@item C-c C-y XCopies a message from the current folder into the *mail* buffer. The message SHAR_EOF echo "End of part 3" echo "File vm.texinfo is continued in part 4" echo "4" > s2_seq_.tmp exit 0