+2000-10-28 10:09:41 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * message.el (message-options): New variable.
+ (message-send): Use it.
+ * gnus-int.el (gnus-request-replace-article): Use it.
+ (gnus-request-accept-article): Ditto.
+ * mml.el (mml-preview): Use it.
+ * gnus-sum.el (gnus-summary-edit-article): Use it.
+
+ * message.el (message-options-get): New function.
+ (message-options-get): New function.
+ * rfc2047.el (rfc2047-encode-message-header): Use them.
+ * mm-bodies.el (mm-encode-body): Use them.
+
2000-10-28 Simon Josefsson <sj@extundo.com>
* nnimap.el (nnimap-retrieve-which-headers):
(unless (bolp)
(insert "\n"))
(unless no-encode
- (save-restriction
- (message-narrow-to-head)
- (let ((mail-parse-charset message-default-charset))
- (mail-encode-encoded-word-buffer)))
- (message-encode-message-body))
+ (let ((message-options message-options))
+ (save-restriction
+ (message-narrow-to-head)
+ (let ((mail-parse-charset message-default-charset))
+ (mail-encode-encoded-word-buffer)))
+ (message-encode-message-body)))
(let ((func (car (or gnus-command-method
(gnus-find-method-for-group group)))))
(funcall (intern (format "%s-request-accept-article" func))
(defun gnus-request-replace-article (article group buffer &optional no-encode)
(unless no-encode
- (save-restriction
- (message-narrow-to-head)
- (let ((mail-parse-charset message-default-charset))
- (mail-encode-encoded-word-buffer)))
- (message-encode-message-body))
+ (let ((message-options message-options))
+ (save-restriction
+ (message-narrow-to-head)
+ (let ((mail-parse-charset message-default-charset))
+ (mail-encode-encoded-word-buffer)))
+ (message-encode-message-body)))
(let ((func (car (gnus-group-name-to-method group))))
(funcall (intern (format "%s-request-replace-article" func))
article (gnus-group-real-name group) buffer)))
(add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))))
`(lambda (no-highlight)
(let ((mail-parse-charset ',gnus-newsgroup-charset)
+ (message-options message-options)
(mail-parse-ignored-charsets
',gnus-newsgroup-ignored-charsets))
,(if (not raw) '(progn
(User-Agent))
"Alist used for formatting headers.")
+(defvar message-options nil
+ "Some saved answers when sending message.")
+
(eval-and-compile
(autoload 'message-setup-toolbar "messagexmas")
(autoload 'mh-new-draft-name "mh-comp")
(message message-sending-message)
(let ((alist message-send-method-alist)
(success t)
- elem sent)
+ elem sent
+ (message-options message-options))
(while (and success
(setq elem (pop alist)))
(when (funcall (cadr elem))
(goto-char (point-max))
(insert "From: " email "\n"))))
+(defun message-options-get (symbol)
+ (cdr (assq symbol message-options)))
+
+(defun message-options-set (symbol value)
+ (let ((the-cons (assq symbol message-options)))
+ (if the-cons
+ (if value
+ (setcdr the-cons value)
+ (setq message-options (delq the-cons message-options)))
+ (and value
+ (push (cons symbol value) message-options))))
+ value)
+
(provide 'message)
(run-hooks 'message-load-hook)
(goto-char (point-min))
(if (re-search-forward "[^\x0-\x7f]" nil t)
(or mail-parse-charset
- (mm-read-charset "Charset used in the article: "))
+ (message-options-get 'mm-encody-body-charset)
+ (message-options-set
+ 'mm-encody-body-charset
+ (mm-read-charset "Charset used in the article: ")))
;; The logic in `mml-generate-mime-1' confirms that it's OK
;; to return nil here.
nil))
If RAW, don't highlight the article."
(interactive "P")
(let ((buf (current-buffer))
+ (message-options message-options)
(message-posting-charset (or (gnus-setup-posting-charset
(save-restriction
(message-narrow-to-headers-or-head)
(and (delq 'ascii
(mm-find-charset-region (point-min)
(point-max)))
- (if (y-or-n-p
- "Some texts are not encoded. Encode them anyway?")
+ (if (or (message-options-get
+ 'rfc2047-encode-message-header-encode-any)
+ (message-options-set
+ 'rfc2047-encode-message-header-encode-any
+ (y-or-n-p
+ "Some texts are not encoded. Encode anyway?")))
(rfc2047-encode-region (point-min) (point-max))
(error "Cannot send unencoded text."))))
((mm-coding-system-p method)