(gnus-simplify-buffer-fuzzy-step
"^ *\\(re\\|fw\\|fwd\\)[[{(^0-9]*[])}]?[:;] *")
(gnus-simplify-buffer-fuzzy-step "^[[].*:\\( .*\\)[]]$" "\\1"))
-
(gnus-simplify-buffer-fuzzy-step " *[[{(][^()\n]*[]})] *$")
- (gnus-simplify-buffer-fuzzy-step " +" " ")
- (setq modified-tick nil)
- (while (not (eq modified-tick (buffer-modified-tick)))
- (setq modified-tick (buffer-modified-tick))
- (gnus-simplify-buffer-fuzzy-step
- "\\([^\000-\177]\\) \\([^\000-\177]\\)" "\\1\\2")
- (gnus-simplify-buffer-fuzzy-step
- "\\([\000-\177]\\) \\([^\000-\177]\\)" "\\1\\2")
- (gnus-simplify-buffer-fuzzy-step
- "\\([^\000-\177]\\) \\([\000-\177]\\)" "\\1\\2"))
- (gnus-simplify-buffer-fuzzy-step " $")
- (gnus-simplify-buffer-fuzzy-step "^ +")))
+ (goto-char (point-min))
+ (while (re-search-forward " +" nil t)
+ (delete-region (match-beginning 0) (match-end 0))
+ (or (bolp) (eobp)
+ (> (char-after) 127) (> (char-before) 127)
+ (insert " ")))))
(defun gnus-simplify-subject-fuzzy (subject)
"Simplify a subject string fuzzily.
(charsets-mime-charset-alist charsets-mime-charset-alist)
message-locale-args)
(message-locale-setup-mime-charset locale-list)
- (if (catch 'mime-edit-error
- (save-excursion
- (mime-edit-pgp-enclose-buffer)
- (mime-edit-translate-body)
- ))
- (error "Translation error!")
- ))
+ (when (catch 'mime-edit-error
+ (save-excursion
+ (mime-edit-pgp-enclose-buffer)
+ (mime-edit-translate-body)))
+ (error "Translation error!")))
(end-of-invisible)
- (run-hooks 'mime-edit-exit-hook)
- )))
+ (run-hooks 'mime-edit-exit-hook))))
;;;
;;; Detect locale.
default-mime-charset-for-write)))
charsets))
(intern (downcase charset))
- (error "Canceled.")))))))
+ (throw 'message-sending-cancel t)))))))
(defun message-mime-charset-recover-ask-y-or-n (default-charset charsets)
- (or (y-or-n-p (format "MIME charset %s is selected. OK? "
+ (and (y-or-n-p (format "MIME charset %s is selected. OK? "
default-charset))
- (error "Canceled."))
- default-charset)
+ default-charset))
(defun message-mime-charset-recover-ask-charset (default-charset charsets)
(let ((alist (mapcar
Otherwise any failure is reported in a message back to
the user from the mailer."
(interactive "P")
- ;; Disabled test.
- (when (or (buffer-modified-p)
- (message-check-element 'unchanged)
- (y-or-n-p "No changes in the buffer; really send? "))
- ;; Make it possible to undo the coming changes.
- (undo-boundary)
- (let ((inhibit-read-only t))
- (put-text-property (point-min) (point-max) 'read-only nil))
- (run-hooks 'message-send-hook)
- (message "Sending...")
- (let ((message-encoding-buffer
- (message-generate-new-buffer-clone-locals " message encoding"))
- (message-edit-buffer (current-buffer))
- (message-mime-mode mime-edit-mode-flag)
- (alist message-send-method-alist)
- (success t)
- elem sent)
- (save-excursion
- (set-buffer message-encoding-buffer)
- (erase-buffer)
- (insert-buffer message-edit-buffer)
- (funcall message-encode-function)
- (message-fix-before-sending)
- (while (and success
- (setq elem (pop alist)))
- (when (and (or (not (funcall (cadr elem)))
- (and (or (not (memq (car elem)
- message-sent-message-via))
- (y-or-n-p
- (format
- "Already sent message via %s; resend? "
- (car elem))))
- (setq success (funcall (caddr elem) arg)))))
- (setq sent t))))
- (prog1
- (when (and success sent)
- (message-do-fcc)
- ;;(when (fboundp 'mail-hist-put-headers-into-history)
- ;; (mail-hist-put-headers-into-history))
- (run-hooks 'message-sent-hook)
- (message "Sending...done")
- ;; Mark the buffer as unmodified and delete auto-save.
- (set-buffer-modified-p nil)
- (delete-auto-save-file-if-necessary t)
- (message-disassociate-draft)
- ;; Delete other mail buffers and stuff.
- (message-do-send-housekeeping)
- (message-do-actions message-send-actions)
- ;; Return success.
- t)
- (kill-buffer message-encoding-buffer)))))
+ (if (catch 'message-sending-cancel
+ ;; Disabled test.
+ (unless (or (buffer-modified-p)
+ (message-check-element 'unchanged)
+ (y-or-n-p "No changes in the buffer; really send? "))
+ (throw 'message-sending-cancel t))
+ ;; Make it possible to undo the coming changes.
+ (undo-boundary)
+ (let ((inhibit-read-only t))
+ (put-text-property (point-min) (point-max) 'read-only nil))
+ (run-hooks 'message-send-hook)
+ (message "Sending...")
+ (let ((message-encoding-buffer
+ (message-generate-new-buffer-clone-locals " message encoding"))
+ (message-edit-buffer (current-buffer))
+ (message-mime-mode mime-edit-mode-flag)
+ (alist message-send-method-alist)
+ (success t)
+ elem sent)
+ (unwind-protect
+ (if (save-excursion
+ (set-buffer message-encoding-buffer)
+ (erase-buffer)
+ (insert-buffer message-edit-buffer)
+ (funcall message-encode-function)
+ (message-fix-before-sending)
+ (while (and success
+ (setq elem (pop alist)))
+ (and (funcall (cadr elem))
+ (and (or (not (memq (car elem)
+ message-sent-message-via))
+ (y-or-n-p
+ (format
+ "Already sent message via %s; resend? "
+ (car elem))))
+ (setq success (funcall (caddr elem) arg)))
+ (setq sent t)))
+ (not (and success sent)))
+ (throw 'message-sending-cancel t)
+ (message-do-fcc)
+ (run-hooks 'message-sent-hook)
+ (message "Sending...done")
+ ;; Mark the buffer as unmodified and delete auto-save.
+ (set-buffer-modified-p nil)
+ (delete-auto-save-file-if-necessary t)
+ (message-disassociate-draft)
+ ;; Delete other mail buffers and stuff.
+ (message-do-send-housekeeping)
+ (message-do-actions message-send-actions)
+ nil)
+ (kill-buffer message-encoding-buffer))))
+ (progn
+ (message "Canceled")
+ nil)
+ ;; Return success.
+ t))
(defun message-send-via-mail (arg)
"Send the current message via mail."
(setq result 255))))
(let ((default-directory "/")
(inbox-info (nnmail-parse-spool-file-name inbox)))
- (setenv "MAILHOST" (nnmail-spool-mailhost inbox-info))
+ (and popmail
+ (setenv "MAILHOST"
+ (nnmail-spool-mailhost inbox-info)))
(setq result
(apply
'call-process
(expand-file-name
nnmail-movemail-program exec-directory)
nil errors nil
- (concat "po:" (nnmail-spool-maildrop inbox-info))
+ (concat (if popmail "po:" "")
+ (nnmail-spool-maildrop inbox-info))
tofile)
- (when nnmail-internal-password
- (list nnmail-internal-password)))))))
+ (and popmail
+ nnmail-internal-password
+ (list nnmail-internal-password)))))))
(push inbox nnmail-moved-inboxes)
(if (and (not (buffer-modified-p errors))
(zerop result))
(delete-region (point-min) (match-end 0)))
(unless (yes-or-no-p
(format "movemail: %s (%d return). Continue? "
- (buffer-string)))
+ (buffer-string) result))
(error "%s" (buffer-string)))
(setq tofile nil)))
))))