* gnus-delay.el (gnus-delay-article): Undo the last change.
* gnus-draft.el: Revert to the original implementation.
(gnus-draft-edit-message): Pass restore as the 3rd argument of
gnus-draft-setup; call save-buffer instead of message-save-drafts.
(gnus-draft-setup): Rename from gnus-draft-setup-for-editing.
(gnus-draft-setup-for-sending): Abolish.
* gnus-i18n.el (gnus-newsgroup-default-charset-alist): Don't
decode headers of articles stored in nndraft:drafts.
* nnheader.el (nnheader-auto-save-coding-system): New variable.
* message.el (message-draft-coding-system): Delegate the
value to nnheader-auto-save-coding-system.
(message-mode-map): Don't bind message-save-drafts.
(message-dont-send): Use save-buffer instead of message-save-buffer.
(message-save-drafts): Abolish.
* nndraft.el (nndraft-request-article): Revert to the
original implementation.
(nndraft-request-create-group gnus-delay-group)
(message-disassociate-draft)
(nndraft-request-associate-buffer gnus-delay-group)
- (message-save-drafts)
+ (save-buffer 0)
(kill-buffer (current-buffer))
(message-do-actions message-postpone-actions))
(let ((article (gnus-summary-article-number))
(group gnus-newsgroup-name))
(gnus-summary-mark-as-read article gnus-canceled-mark)
- (gnus-draft-setup-for-editing article group)
+ (gnus-draft-setup article group t)
(set-buffer-modified-p t)
(save-excursion
(save-restriction
(message-narrow-to-headers)
(message-remove-header "date")))
- (message-save-drafts)
+ (save-buffer)
(let ((gnus-verbose-backends nil))
(gnus-request-expire-articles (list article) group t))
(push
(let ((message-syntax-checks (if interactive message-syntax-checks
'dont-check-for-anything-just-trust-me))
(message-inhibit-body-encoding (or (not group)
+ (equal group "nndraft:queue")
message-inhibit-body-encoding))
- (message-send-hook (and group message-send-hook))
- (message-setup-hook (and group message-setup-hook))
+ (message-send-hook (and group (not (equal group "nndraft:queue"))
+ message-send-hook))
+ (message-setup-hook (and group (not (equal group "nndraft:queue"))
+ message-setup-hook))
type method)
- (gnus-draft-setup-for-editing article (or group "nndraft:queue"))
+ (gnus-draft-setup article (or group "nndraft:queue"))
;; We read the meta-information that says how and where
;; this message is to be sent.
(save-restriction
(let ((message-sending-message
(format "Sending message %d of %d..."
(- total (length articles)) total)))
- (gnus-draft-send article "nndraft:queue" t)))))))
+ (gnus-draft-send article)))))))
;;;###autoload
(defun gnus-draft-reminder ()
;;;!!!This has been fixed in recent versions of Emacs and XEmacs,
;;;!!!but for the time being, we'll just run this tiny function uncompiled.
-(defun gnus-draft-setup-for-editing (narticle group)
+(defun gnus-draft-setup (narticle group &optional restore)
(let (ga)
(gnus-setup-message 'forward
(let ((article narticle))
(erase-buffer)
(if (not (gnus-request-restore-buffer article group))
(error "Couldn't restore the article")
- (funcall gnus-draft-decoding-function)
+ (when (and restore
+ (equal group "nndraft:queue"))
+ (funcall gnus-draft-decoding-function))
;; Insert the separator.
(goto-char (point-min))
(search-forward "\n\n")
'add '(reply)))))
'send)))))
-(defvar gnus-draft-send-draft-buffer " *send draft*")
-(defun gnus-draft-setup-for-sending (narticle group)
- (let ((article narticle))
- (if (not (get-buffer gnus-draft-send-draft-buffer))
- (get-buffer-create gnus-draft-send-draft-buffer))
- (set-buffer gnus-draft-send-draft-buffer)
- (erase-buffer)
- (if (not (gnus-request-restore-buffer article group))
- (error "Couldn't restore the article"))))
-
(defun gnus-draft-article-sendable-p (article)
"Say whether ARTICLE is sendable."
(not (memq article gnus-newsgroup-unsendable)))
("\\(^\\|:\\)hk\\(star\\)?\\." . cn-big5)
("\\(^\\|:\\)tw\\." . cn-big5)
("\\(^\\|:\\)alt\\.chinese" . hz-gb-2312)
+ ("\\`nndraft:\\(drafts\\|delayed\\)\\'" . nil)
)
"Alist of newsgroup patterns vs. corresponding default MIME charset.
Each element looks like (REGEXP . SYMBOL). REGEXP is pattern for
It is specified by variable `gnus-newsgroup-default-charset-alist'
\(cf. function `gnus-set-newsgroup-default-charset')."
(if (buffer-live-p gnus-summary-buffer)
- (let ((charset
+ (let ((regexp-to-charset
(catch 'found
(let ((group
(save-excursion
(while alist
(let ((pair (car alist)))
(if (string-match (car pair) group)
- (throw 'found (cdr pair))
+ (throw 'found pair)
))
(setq alist (cdr alist)))
))))
- (if charset
+ (if regexp-to-charset
(progn
(save-excursion
(set-buffer gnus-summary-buffer)
(make-local-variable 'default-mime-charset)
- (setq default-mime-charset charset))
+ (setq default-mime-charset (cdr regexp-to-charset)))
(make-local-variable 'default-mime-charset)
- (setq default-mime-charset charset))
+ (setq default-mime-charset (cdr regexp-to-charset)))
(kill-local-variable 'default-mime-charset)))))
(require 'product)
(provide 'gnus-vers)
-(defconst gnus-revision-number "01"
+(defconst gnus-revision-number "02"
"Revision number for this version of gnus.")
;; Product information of this gnus.
(const :tag "ask" ask)))
(defvar message-draft-coding-system
- (cond
- ((boundp 'MULE) '*junet*)
- ((not (fboundp 'find-coding-system)) nil)
- ((find-coding-system 'emacs-mule)
- (if (memq system-type '(windows-nt ms-dos ms-windows))
- 'emacs-mule-dos 'emacs-mule))
- ((find-coding-system 'escape-quoted) 'escape-quoted)
- ((find-coding-system 'no-conversion) 'no-conversion)
- (t nil))
+ nnheader-auto-save-coding-system
"Coding system to compose mail.")
(defcustom message-send-mail-partially-limit 1000000
(define-key message-mode-map "\t" 'message-tab)
(define-key message-mode-map "\M-;" 'comment-region)
- (define-key message-mode-map "\C-x\C-s" 'message-save-drafts)
(define-key message-mode-map "\C-xk" 'message-mimic-kill-buffer))
(easy-menu-define
"Don't send the message you have been editing.
Instead, just auto-save the buffer and then bury it."
(interactive)
- (message-save-drafts)
+ (set-buffer-modified-p t)
+ (save-buffer)
(let ((actions message-postpone-actions)
(frame (selected-frame))
(org-frame message-original-frame))
(require 'messagexmas)
(message-xmas-redefine))
-(defun message-save-drafts ()
- "Postponing the message."
- (interactive)
- (message "Saving %s..." buffer-file-name)
- (let ((reply-headers message-reply-headers)
- (buffer (current-buffer)))
- (with-temp-file buffer-file-name
- (insert-buffer-substring buffer)
- (setq message-reply-headers reply-headers)
- (message-generate-headers '((optional . In-Reply-To)))
- (let ((mime-header-encode-method-alist
- '((eword-encode-unstructured-field-body))))
- (mime-edit-translate-buffer)))
- (set-buffer-modified-p nil))
- (message "Saving %s...done" buffer-file-name))
-
(provide 'message)
(run-hooks 'message-load-hook)
(newest (if (file-newer-than-file-p file auto) file auto))
(nntp-server-buffer (or buffer nntp-server-buffer)))
(when (and (file-exists-p newest)
- (let ((nnmail-file-coding-system nnheader-text-coding-system))
+ (let ((nnmail-file-coding-system
+ (if (file-newer-than-file-p file auto)
+ (if (equal group "drafts")
+ message-draft-coding-system
+ nnheader-text-coding-system)
+ nnheader-auto-save-coding-system)))
(nnmail-find-file newest)))
(save-excursion
(set-buffer nntp-server-buffer)
"Text coding system for write.
This variable is a substitute for `mm-text-coding-system-for-write'.")
+(defvar nnheader-auto-save-coding-system
+ (cond
+ ((boundp 'MULE) '*junet*)
+ ((not (fboundp 'find-coding-system)) nil)
+ ((find-coding-system 'emacs-mule)
+ (if (memq system-type '(windows-nt ms-dos ms-windows))
+ 'emacs-mule-dos 'emacs-mule))
+ ((find-coding-system 'escape-quoted) 'escape-quoted)
+ ((find-coding-system 'no-conversion) 'no-conversion)
+ (t nil))
+ "Coding system of auto save file.")
+
(eval-and-compile
(autoload 'nnmail-message-id "nnmail")
(autoload 'mail-position-on-field "sendmail")