semi "Sending..." : why no (n/m)?
Katsumi Yamaoka
yamaoka at jpl.org
Tue Aug 10 08:38:50 JST 2004
>>>>> In [emacs-mime-en : No.00148]
>>>>> John Owens <wl.20.jowens at spamgourmet.com> wrote:
> I'm using SEMI 1.14.6 and when I send a large message, it indicates
> "Sending...". I would prefer it to say "Sending (n/m)... where n is
> the number of bites it's sent and m is the total number of bytes.
That may be useful but may be useless. The case where the mail
server is far is the former. Those who have a very fast
connection to the server may be bothered. In addition, we will
have to consider what unit is suitable. Showing it in bytes may
be too fine.
> What's weird is that when I look in the elisp, that appears to be how
> it's designed. I don't see ANY "Sending..." strings in that code. Yet
> it indicates "Sending..." anyway. This is the only version of SEMI
> I've ever installed, so it shouldn't be a matter of old version
> corruption. Any thoughts?
The "Sending..." message is produced by Wanderlust probably in
your case. See wl-draft.el. It suggests that other mail
softwares using FLIM and SEMI may say another word, e.g.,
"Posting...", "Injecting...", etc. It will have to be passed to
the function showing the progress message. The function which
actually sends mail data makes the progress message. Although
the function is wl-draft-send-mail-with-smtp by default in the
case of Wanderlust, users can change it. Therefore, only some
functions will be able to support it.
Here is a quick hack which adds the progress message feature to
wl-draft-send-mail-with-smtp:
;--8<---------------cut here---------------start------------->8---
(defadvice smtp-primitive-data (around show-progress-message (package)
activate)
"Show progress message in bytes."
(let* ((connection
(smtp-find-connection (current-buffer)))
response total bol)
(smtp-send-command connection "DATA")
(setq response (smtp-read-response connection))
(if (/= (car response) 354)
(smtp-response-error response))
(save-excursion
(set-buffer (smtp-package-buffer-internal package))
(setq total (buffer-size))
(goto-char (point-min))
(while (not (eobp))
(setq bol (point))
(end-of-line)
(message "Sending (%d/%d)..." (- (point) (point-min) -1) total)
(smtp-send-data connection (buffer-substring bol (point)))
(beginning-of-line 2)))
(smtp-send-command connection ".")
(setq response (smtp-read-response connection))
(if (/= (car response) 250)
(smtp-response-error response))))
;--8<---------------cut here---------------end--------------->8---
More information about the Emacs-mime-en
mailing list