emacs: Eliminate duplicate From header in replies.

The original code was intended to work, but clearly wasn't tested. Use
mail-header (as in existing code) to extract a header from a header alist.

This fixes the duplicate-from-line bug that is exercised by the test
just added to the test suite.
This commit is contained in:
Carl Worth 2010-10-27 18:44:05 -07:00
parent 76f1c84e6f
commit 6d93d2090d

View file

@ -126,7 +126,7 @@ list."
(when (not (string= "" user-agent))
(push (cons "User-Agent" user-agent) other-headers))))
(unless (assoc "From" other-headers)
(unless (mail-header 'from other-headers)
(push (cons "From" (concat
(notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))