emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el
Date: Fri, 30 Nov 2001 19:36:12 -0500

Index: emacs/lisp/mail/smtpmail.el
diff -c emacs/lisp/mail/smtpmail.el:1.35 emacs/lisp/mail/smtpmail.el:1.36
*** emacs/lisp/mail/smtpmail.el:1.35    Sun Nov 25 12:43:47 2001
--- emacs/lisp/mail/smtpmail.el Fri Nov 30 19:36:12 2001
***************
*** 70,75 ****
--- 70,77 ----
  (autoload 'starttls-open-stream "starttls")
  (autoload 'starttls-negotiate "starttls")
  (autoload 'mail-strip-quoted-names "mail-utils")
+ (autoload 'message-make-date "message")
+ (autoload 'message-make-message-id "message")
  (autoload 'rfc2104-hash "rfc2104")
  
  ;;;
***************
*** 293,298 ****
--- 295,308 ----
                         (insert ")\n"))
                        ((null mail-from-style)
                         (insert "From: " login "\n")))))
+           ;; Insert a `Message-Id:' field if there isn't one yet.
+           (goto-char (point-min))
+           (unless (re-search-forward "^Message-Id:" delimline t)
+             (insert "Message-Id: " (message-make-message-id) "\n"))
+           ;; Insert a `Date:' field if there isn't one yet.
+           (goto-char (point-min))
+           (unless (re-search-forward "^Date:" delimline t)
+             (insert "Date: " (message-make-date) "\n"))
            ;; Insert an extra newline if we need it to work around
            ;; Sun's bug that swallows newlines.
            (goto-char (1+ delimline))
***************
*** 303,310 ****
            (if (re-search-forward "^FCC:" delimline t)
                (mail-do-fcc delimline))
            (if mail-interactive
!               (save-excursion
!                 (set-buffer errbuf)
                  (erase-buffer))))
          ;;
          ;;
--- 313,319 ----
            (if (re-search-forward "^FCC:" delimline t)
                (mail-do-fcc delimline))
            (if mail-interactive
!               (with-current-buffer errbuf
                  (erase-buffer))))
          ;;
          ;;
***************
*** 331,338 ****
                   (buffer-data (create-file-buffer file-data))
                   (buffer-elisp (create-file-buffer file-elisp))
                   (buffer-scratch "*queue-mail*"))
!             (save-excursion
!               (set-buffer buffer-data)
                (erase-buffer)
                (insert-buffer tembuf)
                (write-file file-data)
--- 340,346 ----
                   (buffer-data (create-file-buffer file-data))
                   (buffer-elisp (create-file-buffer file-elisp))
                   (buffer-scratch "*queue-mail*"))
!             (with-current-buffer buffer-data
                (erase-buffer)
                (insert-buffer tembuf)
                (write-file file-data)
***************
*** 363,375 ****
    (let ((buffer-index (find-file-noselect smtpmail-queue-index))
        (file-msg "")
        (tembuf nil))
!     (save-excursion
!       (set-buffer buffer-index)
        (beginning-of-buffer)
        (while (not (eobp))
!       (setq file-msg (buffer-substring (point) (save-excursion
!                                                  (end-of-line)
!                                                  (point))))
        (load file-msg)
        (setq tembuf (find-file-noselect file-msg))
        (if (not (null smtpmail-recipient-address-list))
--- 371,380 ----
    (let ((buffer-index (find-file-noselect smtpmail-queue-index))
        (file-msg "")
        (tembuf nil))
!     (with-current-buffer buffer-index
        (beginning-of-buffer)
        (while (not (eobp))
!       (setq file-msg (buffer-substring (point) (line-end-position)))
        (load file-msg)
        (setq tembuf (find-file-noselect file-msg))
        (if (not (null smtpmail-recipient-address-list))
***************
*** 520,527 ****
                (get-buffer-create (format "*trace of SMTP session to %s*" 
host)))
  
          ;; clear the trace buffer of old output
!         (save-excursion
!           (set-buffer process-buffer)
            (erase-buffer))
  
          ;; open the connection to the server
--- 525,531 ----
                (get-buffer-create (format "*trace of SMTP session to %s*" 
host)))
  
          ;; clear the trace buffer of old output
!         (with-current-buffer process-buffer
            (erase-buffer))
  
          ;; open the connection to the server
***************
*** 531,538 ****
          ;; set the send-filter
          (set-process-filter process 'smtpmail-process-filter)
  
!         (save-excursion
!           (set-buffer process-buffer)
            (set-buffer-process-coding-system 'raw-text-unix 'raw-text-unix)
            (make-local-variable 'smtpmail-read-point)
            (setq smtpmail-read-point (point-min))
--- 535,541 ----
          ;; set the send-filter
          (set-process-filter process 'smtpmail-process-filter)
  
!         (with-current-buffer process-buffer
            (set-buffer-process-coding-system 'raw-text-unix 'raw-text-unix)
            (make-local-variable 'smtpmail-read-point)
            (setq smtpmail-read-point (point-min))
***************
*** 629,636 ****
                   (if (or (member 'size supported-extensions)
                           (assoc 'size supported-extensions))
                       (format " SIZE=%d"
!                              (save-excursion
!                                (set-buffer smtpmail-text-buffer)
                                 ;; size estimate:
                                 (+ (- (point-max) (point-min))
                                    ;; Add one byte for each change-of-line
--- 632,638 ----
                   (if (or (member 'size supported-extensions)
                           (assoc 'size supported-extensions))
                       (format " SIZE=%d"
!                              (with-current-buffer smtpmail-text-buffer
                                 ;; size estimate:
                                 (+ (- (point-max) (point-min))
                                    ;; Add one byte for each change-of-line
***************
*** 713,720 ****
  ;              (throw 'done nil))
            t ))
        (if process
!         (save-excursion
!           (set-buffer (process-buffer process))
            (smtpmail-send-command process "QUIT")
            (smtpmail-read-response process)
  
--- 715,721 ----
  ;              (throw 'done nil))
            t ))
        (if process
!         (with-current-buffer (process-buffer process)
            (smtpmail-send-command process "QUIT")
            (smtpmail-read-response process)
  
***************
*** 727,734 ****
  
  
  (defun smtpmail-process-filter (process output)
!   (save-excursion
!     (set-buffer (process-buffer process))
      (goto-char (point-max))
      (insert output)))
  
--- 728,734 ----
  
  
  (defun smtpmail-process-filter (process output)
!   (with-current-buffer (process-buffer process)
      (goto-char (point-max))
      (insert output)))
  
***************
*** 819,831 ****
         this-line
         this-line-end)
  
!     (save-excursion
!       (set-buffer buffer)
        (goto-char (point-min)))
  
      (while data-continue
!       (save-excursion
!       (set-buffer buffer)
        (beginning-of-line)
        (setq this-line (point))
        (end-of-line)
--- 819,829 ----
         this-line
         this-line-end)
  
!     (with-current-buffer buffer
        (goto-char (point-min)))
  
      (while data-continue
!       (with-current-buffer buffer
        (beginning-of-line)
        (setq this-line (point))
        (end-of-line)
***************
*** 844,851 ****
  (defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start 
header-end)
    "Get address list suitable for smtp RCPT TO: <address>."
    (unwind-protect
!       (save-excursion
!       (set-buffer smtpmail-address-buffer) (erase-buffer)
        (let
            ((case-fold-search t)
             (simple-address-list "")
--- 842,849 ----
  (defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start 
header-end)
    "Get address list suitable for smtp RCPT TO: <address>."
    (unwind-protect
!       (with-current-buffer smtpmail-address-buffer
!       (erase-buffer)
        (let
            ((case-fold-search t)
             (simple-address-list "")
***************
*** 856,864 ****
          (goto-char (point-min))
          ;; RESENT-* fields should stop processing of regular fields.
          (save-excursion
!           (if (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):" header-end t)
!               (setq addr-regexp "^Resent-\\(to\\|cc\\|bcc\\):")
!             (setq addr-regexp  "^\\(To:\\|Cc:\\|Bcc:\\)")))
  
          (while (re-search-forward addr-regexp header-end t)
            (replace-match "")
--- 854,864 ----
          (goto-char (point-min))
          ;; RESENT-* fields should stop processing of regular fields.
          (save-excursion
!           (setq addr-regexp
!                 (if (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):"
!                                        header-end t)
!                     "^Resent-\\(to\\|cc\\|bcc\\):"
!                   "^\\(To:\\|Cc:\\|Bcc:\\)")))
  
          (while (re-search-forward addr-regexp header-end t)
            (replace-match "")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]