annotate lisp/mail/undigest.el @ 7291:373b9db3c71c

Removed some keystrokes for obscure toggle commands: C-c C-v C-a, C-c C-v C-p, C-c C-v C-q and C-c C-v C-k. (gnus-uu-decode-and-save-all-unread-articles-and-mark): Fn deleted. (gnus-uu-decode-and-save-all-articles-and-mark): Fn deleted. (gnus-uu-do-sloppy-uudecode): Variable deleted. (gnus-uu-decode-and-save-articles): Rewritten. (gnus-uu-grab-articles, gnus-uu-uustrip-article-as): Rewritten to properly handle multiple encoded files in one gulp. (gnus-uu-uustrip-article-as): Replace spaces in file names with underscores before giving the file to uudecode. (gnus-uu-save-in-digest): Doc fix. (gnus-uu-save-articles, gnus-uu-save-article, gnus-uu-digest-and-forward, gnus-uu-marked-digest-and-forward): Changed old functions and added new functions to digest and forward articles. (gnus-uu-mark-thread): New function to mark a thread for later treatment. (gnus-uu-mark-by-regexp): Changed to add articles instead of clearing before adding. (gnus-uu-check-for-generated-files): First delete files, then directories. (gnus-uu-edit-begin-line, gnus-uu-decode-and-show-in-buffer): Select the current article before starting work. (gnus-uu-decode-and-view-all-unread-articles) (gnus-uu-decode-and-view-all-articles): Two new functions for decoding and viewing all (unread) articles in a newsgroup. (gnus-uu-view-directory, gnus-uu-unpack-archives, gnus-uu-treat-archive): gnus-uu will now treat archives in archives (etc) properly when viewing. (gnus-uu-threaded-multi-decode-and-save, gnus-uu-threaded-multi-decode-and-view): New interactive functions for decoding/saving threads. Bound to `C-c C-v C-j'. (gnus-uu-save-article): Added RFC1153-compliant digest saving. (gnus-uu-initialize): Does some checks and expands relative temp dir names. (gnus-uu-decode-and-show-in-buffer) (gnus-uu-decode-and-strip, gnus-uu-grab-articles) (gnus-uu-decode-and-view-or-save): Allow multiple encoded files to be decoded (and viewed) in one fell swoop. (gnus-uu-work-dir): New variable. (gnus-uu-view-file): Changed to work with metamail. (gnus-uu-get-action, gnus-uu-toggle-view-with-metamail): New functions. (gnus-uu-ext-to-mime, gnus-uu-view-with-metamail): New variables. (gnus-uu-ctl-map): Add C-a binding. (gnus-uu-summary-next-subject): Ensures that the next unread article is moved to. (gnus-uu-default-interactive-view-rules-end): New variable to provide a "catch-all" when using interactive mode. (gnus-uu-get-action): Changed viewing rules in interactive mode. (gnus-uu-uustrip-article-as): Disabled case-fold-search and changed gnus-uu-body-line to be more restrictive. (gnus-uu-multi-decode-and-view-or-save, gnus-uu-uustrip-article-as): Changed hard returns to \r. (gnus-uu-post-reply-mode): New mode for sending encoded files. (gnus-uu-post-news, gnus-uu-post-insert-binary-in-article) (gnus-uu-post-encode-uuencode, gnus-uu-post-encode-mime-uuencode) (gnus-uu-post-encode-mime, gnus-uu-post-make-mime) (gnus-uu-post-encode-file, gnus-uu-post-news-inews) (gnus-uu-post-insert-binary, gnus-uu-post-encoded): New functions. (gnus-uu-post-encode-method, gnus-uu-post-include-before-composing) (gnus-uu-post-threaded, gnus-uu-post-binary-separator): New variables.
author Richard M. Stallman <rms@gnu.org>
date Tue, 03 May 1994 06:05:48 +0000
parents e640d438df9a
children cc7cd83ccf3f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 35
diff changeset
1 ;;; undigest.el --- digest-cracking support for the RMAIL mail reader
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 35
diff changeset
2
841
2cdce064065f entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
3 ;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
2cdce064065f entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
4
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
5 ;; Maintainer: FSF
814
38b2499cb3e9 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
6 ;; Keywords: mail
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
7
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; any later version.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; GNU General Public License for more details.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
24 ;;; Commentary:
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
25
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
26 ;; See Internet RFC 934
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
27
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
28 ;;; Code:
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29
7038
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
30 (require 'rmail)
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
31
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 (defun undigestify-rmail-message ()
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 "Break up a digest message into its constituent messages.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 Leaves original message, deleted, before the undigestified messages."
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 (interactive)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 (widen)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 (let ((buffer-read-only nil)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 (msg-string (buffer-substring (rmail-msgbeg rmail-current-message)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 (rmail-msgend rmail-current-message))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 (goto-char (rmail-msgend rmail-current-message))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 (narrow-to-region (point) (point))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 (insert msg-string)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 (narrow-to-region (point-min) (1- (point-max))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 (let ((error t)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 (buffer-read-only nil))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 (unwind-protect
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 (progn
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 (save-restriction
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 (goto-char (point-min))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 (delete-region (point-min)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 (progn (search-forward "\n*** EOOH ***\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 (point)))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 (insert "\^_\^L\n0, unseen,,\n*** EOOH ***\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 (narrow-to-region (point)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 (point-max))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 (let* ((fill-prefix "")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 (case-fold-search t)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 (digest-name
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 (mail-strip-quoted-names
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 (or (save-restriction
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 (search-forward "\n\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 (narrow-to-region (point-min) (point))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 (goto-char (point-max))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 (or (mail-fetch-field "Reply-To")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 (mail-fetch-field "To")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 (mail-fetch-field "Apparently-To")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 (mail-fetch-field "From")))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 (error "Message is not a digest")))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 (save-excursion
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 (goto-char (point-max))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 (skip-chars-backward " \t\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 (let ((count 10) found)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 ;; compensate for broken un*x digestifiers. Sigh Sigh.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 (while (and (> count 0) (not found))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 (forward-line -1)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 (setq count (1- count))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 (if (looking-at (concat "End of.*Digest.*\n"
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 (regexp-quote "*********") "*"
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 "\\(\n------*\\)*"))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 (setq found t)))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 (if (not found) (error "Message is not a digest"))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 (re-search-forward (concat "^" (make-string 55 ?-) "-*\n*"))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 (replace-match "\^_\^L\n0, unseen,,\n*** EOOH ***\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 (save-restriction
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 (narrow-to-region (point)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 (progn (search-forward "\n\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 (point)))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 (if (mail-fetch-field "To") nil
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 (goto-char (point-min))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 (insert "To: " digest-name "\n")))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 (while (re-search-forward
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 (concat "\n\n" (make-string 27 ?-) "-*\n*")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 nil t)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 (replace-match "\n\n\^_\^L\n0, unseen,,\n*** EOOH ***\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 (save-restriction
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 (if (looking-at "End ")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 (insert "To: " digest-name "\n\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 (narrow-to-region (point)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 (progn (search-forward "\n\n"
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 nil 'move)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 (point))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 (if (mail-fetch-field "To") nil
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 (goto-char (point-min))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 (insert "To: " digest-name "\n"))))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 (setq error nil)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 (message "Message successfully undigestified")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 (let ((n rmail-current-message))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 (rmail-forget-messages)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 (rmail-show-message n)
7038
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
110 (rmail-delete-forward)
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
111 (if (rmail-summary-exists)
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
112 (rmail-select-summary
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
113 (rmail-update-summary)))))
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 (cond (error
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 (narrow-to-region (point-min) (1+ (point-max)))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 (delete-region (point-min) (point-max))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 (rmail-show-message rmail-current-message))))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 35
diff changeset
119 ;;; undigest.el ends here