mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-23 07:19:15 +00:00
(rmail-make-basic-summary-line): If there's
no From field, still try to use the To field.
This commit is contained in:
parent
6f1f54c7e9
commit
71f46c95f6
@ -396,49 +396,52 @@ Setting this variable has an effect only before reading a mail."
|
|||||||
(t "??????"))))
|
(t "??????"))))
|
||||||
" "
|
" "
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(if (not (re-search-forward "^From:[ \t]*" nil t))
|
(let* ((from (and (re-search-forward "^From:[ \t]*" nil t)
|
||||||
" "
|
(mail-strip-quoted-names
|
||||||
(let* ((from (mail-strip-quoted-names
|
(buffer-substring
|
||||||
(buffer-substring
|
(1- (point))
|
||||||
(1- (point))
|
;; Get all the lines of the From field
|
||||||
;; Get all the lines of the From field
|
;; so that we get a whole comment if there is one,
|
||||||
;; so that we get a whole comment if there is one,
|
;; so that mail-strip-quoted-names can discard it.
|
||||||
;; so that mail-strip-quoted-names can discard it.
|
(let ((opoint (point)))
|
||||||
(let ((opoint (point)))
|
(while (progn (forward-line 1)
|
||||||
(while (progn (forward-line 1)
|
(looking-at "[ \t]")))
|
||||||
(looking-at "[ \t]")))
|
;; Back up over newline, then trailing spaces or tabs
|
||||||
;; Back up over newline, then trailing spaces or tabs
|
(forward-char -1)
|
||||||
(forward-char -1)
|
(skip-chars-backward " \t")
|
||||||
(skip-chars-backward " \t")
|
(point))))))
|
||||||
(point)))))
|
len mch lo)
|
||||||
len mch lo)
|
(if (or (null from)
|
||||||
(if (string-match
|
(string-match
|
||||||
(or rmail-user-mail-address-regexp
|
(or rmail-user-mail-address-regexp
|
||||||
(concat "^\\("
|
(concat "^\\("
|
||||||
(regexp-quote (user-login-name))
|
(regexp-quote (user-login-name))
|
||||||
"\\($\\|@\\)\\|"
|
"\\($\\|@\\)\\|"
|
||||||
(regexp-quote
|
(regexp-quote
|
||||||
;; Don't lose if run from init file
|
;; Don't lose if run from init file
|
||||||
;; where user-mail-address is not
|
;; where user-mail-address is not
|
||||||
;; set yet.
|
;; set yet.
|
||||||
(or user-mail-address
|
(or user-mail-address
|
||||||
(concat (user-login-name) "@"
|
(concat (user-login-name) "@"
|
||||||
(or mail-host-address
|
(or mail-host-address
|
||||||
(system-name)))))
|
(system-name)))))
|
||||||
"\\>\\)"))
|
"\\>\\)"))
|
||||||
from)
|
from))
|
||||||
(save-excursion
|
;; No From field, or it's this user.
|
||||||
(goto-char (point-min))
|
(save-excursion
|
||||||
(if (not (re-search-forward "^To:[ \t]*" nil t))
|
(goto-char (point-min))
|
||||||
nil
|
(if (not (re-search-forward "^To:[ \t]*" nil t))
|
||||||
(setq from
|
nil
|
||||||
(concat "to: "
|
(setq from
|
||||||
(mail-strip-quoted-names
|
(concat "to: "
|
||||||
(buffer-substring
|
(mail-strip-quoted-names
|
||||||
(point)
|
(buffer-substring
|
||||||
(progn (end-of-line)
|
(point)
|
||||||
(skip-chars-backward " \t")
|
(progn (end-of-line)
|
||||||
(point)))))))))
|
(skip-chars-backward " \t")
|
||||||
|
(point)))))))))
|
||||||
|
(if (null from)
|
||||||
|
" "
|
||||||
(setq len (length from))
|
(setq len (length from))
|
||||||
(setq mch (string-match "[@%]" from))
|
(setq mch (string-match "[@%]" from))
|
||||||
(format "%25s"
|
(format "%25s"
|
||||||
|
Loading…
Reference in New Issue
Block a user