aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShengHuo ZHU2000-12-20 20:20:51 +0000
committerShengHuo ZHU2000-12-20 20:20:51 +0000
commit158d6e07f0788e7de5f41758fd838d6df58241c5 (patch)
tree13dc0922842cd95089d4fcaaa0bac9318202d8e4
parent19594307c97cb7c9b9fed97f704c427d8c9c695f (diff)
downloademacs-158d6e07f0788e7de5f41758fd838d6df58241c5.tar.gz
emacs-158d6e07f0788e7de5f41758fd838d6df58241c5.zip
* message.el (message-narrow-to-head-1): New function.
(message-narrow-to-head): Use it. (message-reply): Ditto. (message-cancel-news): Ditto. (message-supersede): Ditto. (message-make-forward-subject): Ditto. (message-bounce): Ditto. * gnus-msg.el (gnus-summary-mail-forward): Use original buffer. * message.el (message-forward): Copy buffer in unibyte mode. (message-make-forward-subject): Don't widen. Decode. (message-forward): Don't decode subject. * mml.el (gnus-ems): Require it. * gnus-msg.el (gnus-summary-mail-forward): * message.el (message-forward): Move mime-to-mml here. * nnmbox.el (nnmbox-file-coding-system): Use binary. (nnmbox-active-file-coding-system): Ditto. * gnus-cus.el (gnus-group-parameters): Add posting-style. * mm-uu.el: Require binhex. * qp.el (quoted-printable-encode-region): Upcase QP.
-rw-r--r--lisp/gnus/ChangeLog33
-rw-r--r--lisp/gnus/gnus-cus.el18
-rw-r--r--lisp/gnus/gnus-msg.el19
-rw-r--r--lisp/gnus/message.el64
-rw-r--r--lisp/gnus/mm-uu.el5
-rw-r--r--lisp/gnus/mml.el1
-rw-r--r--lisp/gnus/nnmbox.el4
-rw-r--r--lisp/gnus/qp.el84
8 files changed, 145 insertions, 83 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 326d346b9a8..b2e6d65febb 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,5 +1,38 @@
12000-12-20 ShengHuo ZHU <zsh@cs.rochester.edu> 12000-12-20 ShengHuo ZHU <zsh@cs.rochester.edu>
2 2
3 * message.el (message-narrow-to-head-1): New function.
4 (message-narrow-to-head): Use it.
5 (message-reply): Ditto.
6 (message-cancel-news): Ditto.
7 (message-supersede): Ditto.
8 (message-make-forward-subject): Ditto.
9 (message-bounce): Ditto.
10
11 * gnus-msg.el (gnus-summary-mail-forward): Use original buffer.
12
13 * message.el (message-forward): Copy buffer in unibyte mode.
14 (message-make-forward-subject): Don't widen. Decode.
15 (message-forward): Don't decode subject.
16
17 * mml.el (gnus-ems): Require it.
18
19 * gnus-msg.el (gnus-summary-mail-forward):
20
21 * message.el (message-forward): Move mime-to-mml here.
22
23 * nnmbox.el (nnmbox-file-coding-system): Use binary.
24 (nnmbox-active-file-coding-system): Ditto.
25
26 * gnus-cus.el (gnus-group-parameters): Add posting-style.
27
28 * mm-uu.el: Require binhex.
29
302000-12-20 Christoph Conrad <C.Conrad@cli.de>
31
32 * qp.el (quoted-printable-encode-region): Upcase QP.
33
342000-12-20 ShengHuo ZHU <zsh@cs.rochester.edu>
35
3 * gnus-util.el (gnus-add-text-properties-when): New function. 36 * gnus-util.el (gnus-add-text-properties-when): New function.
4 (gnus-remove-text-properties-when): Ditto. 37 (gnus-remove-text-properties-when): Ditto.
5 38
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el
index c735fe984d1..87987e59e49 100644
--- a/lisp/gnus/gnus-cus.el
+++ b/lisp/gnus/gnus-cus.el
@@ -270,7 +270,23 @@ default charset will be used instead.")
270 (symbol :tag "Face" 270 (symbol :tag "Face"
271 gnus-emphasis-highlight-words)))) 271 gnus-emphasis-highlight-words))))
272 "highlight regexps. 272 "highlight regexps.
273See gnus-emphasis-alist.")) 273See gnus-emphasis-alist.")
274
275 (posting-style
276 (choice :tag "Posting style"
277 :value nil
278 (repeat (list
279 (choice :tag "Type"
280 :value nil
281 (const signature)
282 (const signature-file)
283 (const organization)
284 (const address)
285 (const name)
286 (const body))
287 (string :format "%v"))))
288 "post style.
289See gnus-posting-styles."))
274 "Alist of valid group or topic parameters. 290 "Alist of valid group or topic parameters.
275 291
276Each entry has the form (NAME TYPE DOC), where NAME is the parameter 292Each entry has the form (NAME TYPE DOC), where NAME is the parameter
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index d9ec9a56019..91baed2029c 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -721,23 +721,8 @@ If POST, post instead of mail."
721 (gnus-setup-message 'forward 721 (gnus-setup-message 'forward
722 (gnus-summary-select-article) 722 (gnus-summary-select-article)
723 (let ((mail-parse-charset gnus-newsgroup-charset) 723 (let ((mail-parse-charset gnus-newsgroup-charset)
724 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) 724 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets))
725 text) 725 (set-buffer gnus-original-article-buffer)
726 (save-excursion
727 (set-buffer gnus-original-article-buffer)
728 (setq text (buffer-string)))
729 (set-buffer
730 (gnus-get-buffer-create
731 (generate-new-buffer-name " *Gnus forward*")))
732 (erase-buffer)
733 (unless message-forward-show-mml
734 (mm-disable-multibyte))
735 (insert text)
736 (goto-char (point-min))
737 (when (looking-at "From ")
738 (replace-match "X-From-Line: ") )
739 (when message-forward-show-mml
740 (mime-to-mml))
741 (message-forward post))))) 726 (message-forward post)))))
742 727
743(defun gnus-summary-resend-message (address n) 728(defun gnus-summary-resend-message (address n)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index ef0cc85393c..11ea1a40fb0 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1242,10 +1242,8 @@ Return the number of headers removed."
1242 (point-max))) 1242 (point-max)))
1243 (goto-char (point-min))) 1243 (goto-char (point-min)))
1244 1244
1245(defun message-narrow-to-head () 1245(defun message-narrow-to-head-1 ()
1246 "Narrow the buffer to the head of the message. 1246 "Like `message-narrow-to-head'. Don't widen."
1247Point is left at the beginning of the narrowed-to region."
1248 (widen)
1249 (narrow-to-region 1247 (narrow-to-region
1250 (goto-char (point-min)) 1248 (goto-char (point-min))
1251 (if (search-forward "\n\n" nil 1) 1249 (if (search-forward "\n\n" nil 1)
@@ -1253,6 +1251,12 @@ Point is left at the beginning of the narrowed-to region."
1253 (point-max))) 1251 (point-max)))
1254 (goto-char (point-min))) 1252 (goto-char (point-min)))
1255 1253
1254(defun message-narrow-to-head ()
1255 "Narrow the buffer to the head of the message.
1256Point is left at the beginning of the narrowed-to region."
1257 (widen)
1258 (message-narrow-to-head-1))
1259
1256(defun message-narrow-to-headers-or-head () 1260(defun message-narrow-to-headers-or-head ()
1257 "Narrow the buffer to the head of the message." 1261 "Narrow the buffer to the head of the message."
1258 (widen) 1262 (widen)
@@ -3758,7 +3762,7 @@ OTHER-HEADERS is an alist of header/value pairs."
3758 (message-this-is-mail t) 3762 (message-this-is-mail t)
3759 gnus-warning) 3763 gnus-warning)
3760 (save-restriction 3764 (save-restriction
3761 (message-narrow-to-head) 3765 (message-narrow-to-head-1)
3762 ;; Allow customizations to have their say. 3766 ;; Allow customizations to have their say.
3763 (if (not wide) 3767 (if (not wide)
3764 ;; This is a regular reply. 3768 ;; This is a regular reply.
@@ -3932,7 +3936,7 @@ If ARG, allow editing of the cancellation message."
3932 (save-excursion 3936 (save-excursion
3933 ;; Get header info from original article. 3937 ;; Get header info from original article.
3934 (save-restriction 3938 (save-restriction
3935 (message-narrow-to-head) 3939 (message-narrow-to-head-1)
3936 (setq from (message-fetch-field "from") 3940 (setq from (message-fetch-field "from")
3937 sender (message-fetch-field "sender") 3941 sender (message-fetch-field "sender")
3938 newsgroups (message-fetch-field "newsgroups") 3942 newsgroups (message-fetch-field "newsgroups")
@@ -3994,7 +3998,7 @@ header line with the old Message-ID."
3994 (message-pop-to-buffer (message-buffer-name "supersede")) 3998 (message-pop-to-buffer (message-buffer-name "supersede"))
3995 (insert-buffer-substring cur) 3999 (insert-buffer-substring cur)
3996 (mime-to-mml) 4000 (mime-to-mml)
3997 (message-narrow-to-head) 4001 (message-narrow-to-head-1)
3998 ;; Remove unwanted headers. 4002 ;; Remove unwanted headers.
3999 (when message-ignored-supersedes-headers 4003 (when message-ignored-supersedes-headers
4000 (message-remove-header message-ignored-supersedes-headers t)) 4004 (message-remove-header message-ignored-supersedes-headers t))
@@ -4082,13 +4086,15 @@ the message."
4082 "Return a Subject header suitable for the message in the current buffer." 4086 "Return a Subject header suitable for the message in the current buffer."
4083 (save-excursion 4087 (save-excursion
4084 (save-restriction 4088 (save-restriction
4085 (current-buffer) 4089 (message-narrow-to-head-1)
4086 (message-narrow-to-head)
4087 (let ((funcs message-make-forward-subject-function) 4090 (let ((funcs message-make-forward-subject-function)
4088 (subject (if message-wash-forwarded-subjects 4091 (subject (message-fetch-field "Subject")))
4089 (message-wash-subject 4092 (setq subject
4090 (or (message-fetch-field "Subject") "")) 4093 (if subject
4091 (or (message-fetch-field "Subject") "")))) 4094 (mail-decode-encoded-word-string subject)
4095 ""))
4096 (if message-wash-forwarded-subjects
4097 (setq subject (message-wash-subject subject)))
4092 ;; Make sure funcs is a list. 4098 ;; Make sure funcs is a list.
4093 (and funcs 4099 (and funcs
4094 (not (listp funcs)) 4100 (not (listp funcs))
@@ -4108,10 +4114,7 @@ Optional NEWS will use news to forward instead of mail.
4108Optional DIGEST will use digest to forward." 4114Optional DIGEST will use digest to forward."
4109 (interactive "P") 4115 (interactive "P")
4110 (let* ((cur (current-buffer)) 4116 (let* ((cur (current-buffer))
4111 (subject (if message-forward-show-mml 4117 (subject (message-make-forward-subject))
4112 (message-make-forward-subject)
4113 (mail-decode-encoded-word-string
4114 (message-make-forward-subject))))
4115 art-beg) 4118 art-beg)
4116 (if news 4119 (if news
4117 (message-news nil subject) 4120 (message-news nil subject)
@@ -4134,8 +4137,29 @@ Optional DIGEST will use digest to forward."
4134 (insert-buffer-substring cur) 4137 (insert-buffer-substring cur)
4135 (mml-insert-buffer cur)) 4138 (mml-insert-buffer cur))
4136 (if message-forward-show-mml 4139 (if message-forward-show-mml
4137 (insert-buffer-substring cur) 4140 (let ((target (current-buffer)) tmp)
4138 (mml-insert-buffer cur))) 4141 (with-temp-buffer
4142 (mm-disable-multibyte) ;; Must copy buffer in unibyte mode
4143 (setq tmp (current-buffer))
4144 (set-buffer cur)
4145 (mm-with-unibyte-current-buffer
4146 (set-buffer tmp)
4147 (insert-buffer-substring cur))
4148 (set-buffer tmp)
4149 (mm-enable-multibyte)
4150 (mime-to-mml)
4151 (goto-char (point-min))
4152 (when (looking-at "From ")
4153 (replace-match "X-From-Line: "))
4154 (set-buffer target)
4155 (insert-buffer-substring tmp)
4156 (set-buffer tmp))
4157 (goto-char (point-max)))
4158 (mml-insert-buffer cur)
4159 (goto-char (point-min))
4160 (when (looking-at "From ")
4161 (replace-match "X-From-Line: "))
4162 (goto-char (point-max))))
4139 (setq e (point)) 4163 (setq e (point))
4140 (if message-forward-as-mime 4164 (if message-forward-as-mime
4141 (if digest 4165 (if digest
@@ -4241,7 +4265,7 @@ you."
4241 (mm-enable-multibyte) 4265 (mm-enable-multibyte)
4242 (mime-to-mml) 4266 (mime-to-mml)
4243 (save-restriction 4267 (save-restriction
4244 (message-narrow-to-head) 4268 (message-narrow-to-head-1)
4245 (message-remove-header message-ignored-bounced-headers t) 4269 (message-remove-header message-ignored-bounced-headers t)
4246 (goto-char (point-max)) 4270 (goto-char (point-max))
4247 (insert mail-header-separator)) 4271 (insert mail-header-separator))
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index c7bab9dd4d3..c50c04b2291 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -32,10 +32,7 @@
32(require 'mm-decode) 32(require 'mm-decode)
33(require 'mailcap) 33(require 'mailcap)
34(require 'uudecode) 34(require 'uudecode)
35 35(require 'binhex)
36(eval-and-compile
37 (autoload 'binhex-decode-region "binhex")
38 (autoload 'binhex-decode-region-external "binhex"))
39 36
40(defun mm-uu-copy-to-buffer (from to) 37(defun mm-uu-copy-to-buffer (from to)
41 "Copy the contents of the current buffer to a fresh buffer. 38 "Copy the contents of the current buffer to a fresh buffer.
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 4bd92f3a220..b11a2d8bb14 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -27,6 +27,7 @@
27(require 'mm-bodies) 27(require 'mm-bodies)
28(require 'mm-encode) 28(require 'mm-encode)
29(require 'mm-decode) 29(require 'mm-decode)
30(require 'gnus-ems)
30(eval-when-compile (require 'cl)) 31(eval-when-compile (require 'cl))
31 32
32(eval-and-compile 33(eval-and-compile
diff --git a/lisp/gnus/nnmbox.el b/lisp/gnus/nnmbox.el
index 33a951d1fad..43b00a65098 100644
--- a/lisp/gnus/nnmbox.el
+++ b/lisp/gnus/nnmbox.el
@@ -61,9 +61,9 @@
61(defvoo nnmbox-group-alist nil) 61(defvoo nnmbox-group-alist nil)
62(defvoo nnmbox-active-timestamp nil) 62(defvoo nnmbox-active-timestamp nil)
63 63
64(defvoo nnmbox-file-coding-system mm-text-coding-system) 64(defvoo nnmbox-file-coding-system mm-binary-coding-system)
65(defvoo nnmbox-file-coding-system-for-write nil) 65(defvoo nnmbox-file-coding-system-for-write nil)
66(defvoo nnmbox-active-file-coding-system mm-text-coding-system) 66(defvoo nnmbox-active-file-coding-system mm-binary-coding-system)
67(defvoo nnmbox-active-file-coding-system-for-write nil) 67(defvoo nnmbox-active-file-coding-system-for-write nil)
68 68
69 69
diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el
index cb0b4bb4a7e..a5993de136f 100644
--- a/lisp/gnus/qp.el
+++ b/lisp/gnus/qp.el
@@ -89,52 +89,58 @@ the form expected by `skip-chars-forward'.
89If `mm-use-ultra-safe-encoding' is set, fold lines unconditionally and 89If `mm-use-ultra-safe-encoding' is set, fold lines unconditionally and
90encode lines starting with \"From\"." 90encode lines starting with \"From\"."
91 (interactive "r") 91 (interactive "r")
92 ;; Fixme: what should this do in XEmacs/Mule?
93 (if (fboundp 'find-charset-region) ; else XEmacs, non-Mule
94 (if (delq 'unknown ; Emacs 20 unibyte
95 (delq 'eight-bit-graphic ; Emacs 21
96 (delq 'eight-bit-control
97 (delq 'ascii (find-charset-region from to)))))
98 (error "Multibyte character in QP encoding region")))
99 (unless class 92 (unless class
100 (setq class "^\000-\007\013\015-\037\200-\377=")) 93 ;; Avoid using 8bit characters. = is \075.
94 ;; Equivalent to "^\000-\007\013\015-\037\200-\377="
95 (setq class "\010-\012\014\040-\074\076-\177"))
101 (if (fboundp 'string-as-multibyte) 96 (if (fboundp 'string-as-multibyte)
102 (setq class (string-as-multibyte class))) 97 (setq class (string-as-multibyte class)))
103 (save-excursion 98 (save-excursion
104 (save-restriction 99 (save-restriction
105 (narrow-to-region from to) 100 (narrow-to-region from to)
106 ;; Encode all the non-ascii and control characters. 101 (mm-with-unibyte-current-buffer-mule4
107 (goto-char (point-min)) 102 ;; Fixme: what should this do in XEmacs/Mule?
108 (while (and (skip-chars-forward class) 103 (if (fboundp 'find-charset-region) ; else XEmacs, non-Mule
109 (not (eobp))) 104 (if (delq 'unknown ; Emacs 20 unibyte
110 (insert 105 (delq 'eight-bit-graphic ; Emacs 21
111 (prog1 106 (delq 'eight-bit-control
112 (format "=%02x" (upcase (char-after))) 107 (delq 'ascii
113 (delete-char 1)))) 108 (find-charset-region from to)))))
114 ;; Encode white space at the end of lines. 109 (error "Multibyte character in QP encoding region")))
115 (goto-char (point-min)) 110 ;; Encode all the non-ascii and control characters.
116 (while (re-search-forward "[ \t]+$" nil t) 111 (goto-char (point-min))
117 (goto-char (match-beginning 0)) 112 (while (and (skip-chars-forward class)
118 (while (not (eolp)) 113 (not (eobp)))
119 (insert 114 (insert
120 (prog1 115 (prog1
121 (format "=%02x" (upcase (char-after))) 116 (format "=%02X" (char-after))
122 (delete-char 1))))) 117 (delete-char 1))))
123 (let ((mm-use-ultra-safe-encoding 118 ;; Encode white space at the end of lines.
124 (and (boundp 'mm-use-ultra-safe-encoding) 119 (goto-char (point-min))
125 mm-use-ultra-safe-encoding))) 120 (while (re-search-forward "[ \t]+$" nil t)
126 (when (or fold mm-use-ultra-safe-encoding) 121 (goto-char (match-beginning 0))
127 ;; Fold long lines. 122 (while (not (eolp))
128 (let ((tab-width 1)) ; HTAB is one character. 123 (insert
129 (goto-char (point-min)) 124 (prog1
130 (while (not (eobp)) 125 (format "=%02X" (char-after))
131 ;; In ultra-safe mode, encode "From " at the beginning 126 (delete-char 1)))))
132 ;; of a line. 127 (let ((mm-use-ultra-safe-encoding
133 (when mm-use-ultra-safe-encoding 128 (and (boundp 'mm-use-ultra-safe-encoding)
134 (beginning-of-line) 129 mm-use-ultra-safe-encoding)))
135 (when (looking-at "From ") 130 (when (or fold mm-use-ultra-safe-encoding)
136 (replace-match "From=20" nil t))) 131 ;; Fold long lines.
137 (end-of-line) 132 (let ((tab-width 1)) ; HTAB is one character.
133 (goto-char (point-min))
134 (while (not (eobp))
135 ;; In ultra-safe mode, encode "From " at the beginning
136 ;; of a line.
137 (when mm-use-ultra-safe-encoding
138 (beginning-of-line)
139 (if (looking-at "From ")
140 (replace-match "From=20" nil t)
141 (if (looking-at "-")
142 (replace-match "=2D" nil t))))
143 (end-of-line)
138 (while (> (current-column) 76) ; tab-width must be 1. 144 (while (> (current-column) 76) ; tab-width must be 1.
139 (beginning-of-line) 145 (beginning-of-line)
140 (forward-char 75) ; 75 chars plus an "=" 146 (forward-char 75) ; 75 chars plus an "="
@@ -142,7 +148,7 @@ encode lines starting with \"From\"."
142 (insert "=\n") 148 (insert "=\n")
143 (end-of-line)) 149 (end-of-line))
144 (unless (eobp) 150 (unless (eobp)
145 (forward-line))))))))) 151 (forward-line))))))))))
146 152
147(defun quoted-printable-encode-string (string) 153(defun quoted-printable-encode-string (string)
148 "Encode the STRING as quoted-printable and return the result." 154 "Encode the STRING as quoted-printable and return the result."