diff options
| author | Richard M. Stallman | 2003-04-09 01:31:31 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-04-09 01:31:31 +0000 |
| commit | 71f46c95f65b5bbc9d66a3be0815f3d9669e3273 (patch) | |
| tree | c283665ab5b810bf5532039f3467eedab3bffb86 | |
| parent | 6f1f54c7e99a92f3c24de3e4d0947f0c8f344698 (diff) | |
| download | emacs-71f46c95f65b5bbc9d66a3be0815f3d9669e3273.tar.gz emacs-71f46c95f65b5bbc9d66a3be0815f3d9669e3273.zip | |
(rmail-make-basic-summary-line): If there's
no From field, still try to use the To field.
| -rw-r--r-- | lisp/mail/rmailsum.el | 89 |
1 files changed, 46 insertions, 43 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 8e55901f3c0..cb14d6a7c44 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el | |||
| @@ -396,49 +396,52 @@ Setting this variable has an effect only before reading a mail." | |||
| 396 | (t "??????")))) | 396 | (t "??????")))) |
| 397 | " " | 397 | " " |
| 398 | (save-excursion | 398 | (save-excursion |
| 399 | (if (not (re-search-forward "^From:[ \t]*" nil t)) | 399 | (let* ((from (and (re-search-forward "^From:[ \t]*" nil t) |
| 400 | " " | 400 | (mail-strip-quoted-names |
| 401 | (let* ((from (mail-strip-quoted-names | 401 | (buffer-substring |
| 402 | (buffer-substring | 402 | (1- (point)) |
| 403 | (1- (point)) | 403 | ;; Get all the lines of the From field |
| 404 | ;; Get all the lines of the From field | 404 | ;; so that we get a whole comment if there is one, |
| 405 | ;; so that we get a whole comment if there is one, | 405 | ;; so that mail-strip-quoted-names can discard it. |
| 406 | ;; so that mail-strip-quoted-names can discard it. | 406 | (let ((opoint (point))) |
| 407 | (let ((opoint (point))) | 407 | (while (progn (forward-line 1) |
| 408 | (while (progn (forward-line 1) | 408 | (looking-at "[ \t]"))) |
| 409 | (looking-at "[ \t]"))) | 409 | ;; Back up over newline, then trailing spaces or tabs |
| 410 | ;; Back up over newline, then trailing spaces or tabs | 410 | (forward-char -1) |
| 411 | (forward-char -1) | 411 | (skip-chars-backward " \t") |
| 412 | (skip-chars-backward " \t") | 412 | (point)))))) |
| 413 | (point))))) | 413 | len mch lo) |
| 414 | len mch lo) | 414 | (if (or (null from) |
| 415 | (if (string-match | 415 | (string-match |
| 416 | (or rmail-user-mail-address-regexp | 416 | (or rmail-user-mail-address-regexp |
| 417 | (concat "^\\(" | 417 | (concat "^\\(" |
| 418 | (regexp-quote (user-login-name)) | 418 | (regexp-quote (user-login-name)) |
| 419 | "\\($\\|@\\)\\|" | 419 | "\\($\\|@\\)\\|" |
| 420 | (regexp-quote | 420 | (regexp-quote |
| 421 | ;; Don't lose if run from init file | 421 | ;; Don't lose if run from init file |
| 422 | ;; where user-mail-address is not | 422 | ;; where user-mail-address is not |
| 423 | ;; set yet. | 423 | ;; set yet. |
| 424 | (or user-mail-address | 424 | (or user-mail-address |
| 425 | (concat (user-login-name) "@" | 425 | (concat (user-login-name) "@" |
| 426 | (or mail-host-address | 426 | (or mail-host-address |
| 427 | (system-name))))) | 427 | (system-name))))) |
| 428 | "\\>\\)")) | 428 | "\\>\\)")) |
| 429 | from) | 429 | from)) |
| 430 | (save-excursion | 430 | ;; No From field, or it's this user. |
| 431 | (goto-char (point-min)) | 431 | (save-excursion |
| 432 | (if (not (re-search-forward "^To:[ \t]*" nil t)) | 432 | (goto-char (point-min)) |
| 433 | nil | 433 | (if (not (re-search-forward "^To:[ \t]*" nil t)) |
| 434 | (setq from | 434 | nil |
| 435 | (concat "to: " | 435 | (setq from |
| 436 | (mail-strip-quoted-names | 436 | (concat "to: " |
| 437 | (buffer-substring | 437 | (mail-strip-quoted-names |
| 438 | (point) | 438 | (buffer-substring |
| 439 | (progn (end-of-line) | 439 | (point) |
| 440 | (skip-chars-backward " \t") | 440 | (progn (end-of-line) |
| 441 | (point))))))))) | 441 | (skip-chars-backward " \t") |
| 442 | (point))))))))) | ||
| 443 | (if (null from) | ||
| 444 | " " | ||
| 442 | (setq len (length from)) | 445 | (setq len (length from)) |
| 443 | (setq mch (string-match "[@%]" from)) | 446 | (setq mch (string-match "[@%]" from)) |
| 444 | (format "%25s" | 447 | (format "%25s" |