]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-make-basic-summary-line): If there's
authorRichard M. Stallman <rms@gnu.org>
Wed, 9 Apr 2003 01:31:31 +0000 (01:31 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 9 Apr 2003 01:31:31 +0000 (01:31 +0000)
no From field, still try to use the To field.

lisp/mail/rmailsum.el

index 8e55901f3c0c8406cceb1af93786c2ea5f52fc10..cb14d6a7c44c2cede7db69a12fa46b66749a0fb6 100644 (file)
@@ -396,49 +396,52 @@ Setting this variable has an effect only before reading a mail."
                    (t "??????"))))
          "  "
          (save-excursion
-           (if (not (re-search-forward "^From:[ \t]*" nil t))
-               "                         "
-             (let* ((from (mail-strip-quoted-names
-                           (buffer-substring
-                            (1- (point))
-                            ;; Get all the lines of the From field
-                            ;; so that we get a whole comment if there is one,
-                            ;; so that mail-strip-quoted-names can discard it.
-                            (let ((opoint (point)))
-                              (while (progn (forward-line 1)
-                                            (looking-at "[ \t]")))
-                              ;; Back up over newline, then trailing spaces or tabs
-                              (forward-char -1)
-                              (skip-chars-backward " \t")
-                              (point)))))
-                     len mch lo)
-               (if (string-match
-                    (or rmail-user-mail-address-regexp
-                        (concat "^\\("
-                                (regexp-quote (user-login-name))
-                                "\\($\\|@\\)\\|"
-                                (regexp-quote
-                                 ;; Don't lose if run from init file
-                                 ;; where user-mail-address is not
-                                 ;; set yet.
-                                 (or user-mail-address
-                                     (concat (user-login-name) "@"
-                                             (or mail-host-address
-                                                 (system-name)))))
-                                "\\>\\)"))
-                    from)
-                   (save-excursion
-                     (goto-char (point-min))
-                     (if (not (re-search-forward "^To:[ \t]*" nil t))
-                         nil
-                       (setq from
-                             (concat "to: "
-                                     (mail-strip-quoted-names
-                                      (buffer-substring
-                                       (point)
-                                       (progn (end-of-line)
-                                              (skip-chars-backward " \t")
-                                              (point)))))))))
+           (let* ((from (and (re-search-forward "^From:[ \t]*" nil t)
+                             (mail-strip-quoted-names
+                              (buffer-substring
+                               (1- (point))
+                               ;; Get all the lines of the From field
+                               ;; so that we get a whole comment if there is one,
+                               ;; so that mail-strip-quoted-names can discard it.
+                               (let ((opoint (point)))
+                                 (while (progn (forward-line 1)
+                                               (looking-at "[ \t]")))
+                                 ;; Back up over newline, then trailing spaces or tabs
+                                 (forward-char -1)
+                                 (skip-chars-backward " \t")
+                                 (point))))))
+                  len mch lo)
+             (if (or (null from)
+                     (string-match
+                      (or rmail-user-mail-address-regexp
+                          (concat "^\\("
+                                  (regexp-quote (user-login-name))
+                                  "\\($\\|@\\)\\|"
+                                  (regexp-quote
+                                   ;; Don't lose if run from init file
+                                   ;; where user-mail-address is not
+                                   ;; set yet.
+                                   (or user-mail-address
+                                       (concat (user-login-name) "@"
+                                               (or mail-host-address
+                                                   (system-name)))))
+                                  "\\>\\)"))
+                      from))
+                 ;; No From field, or it's this user.
+                 (save-excursion
+                   (goto-char (point-min))
+                   (if (not (re-search-forward "^To:[ \t]*" nil t))
+                       nil
+                     (setq from
+                           (concat "to: "
+                                   (mail-strip-quoted-names
+                                    (buffer-substring
+                                     (point)
+                                     (progn (end-of-line)
+                                            (skip-chars-backward " \t")
+                                            (point)))))))))
+             (if (null from)
+                 "                         "
                (setq len (length from))
                (setq mch (string-match "[@%]" from))
                (format "%25s"