- "")
- (concat (regexp-quote (user-login-name))
- "\\>"))))
- (let ((match (concat "\\(^\\|,\\)[ \t\n]*"
- ;; Can anyone figure out what this is for?
- ;; Is it an obsolete remnant of another way of
- ;; handling Foo Bar <foo@machine>?
- "\\([^,\n]*[!<]\\|\\)"
- "\\("
- rmail-dont-reply-to-names
- "\\|"
- ;; Include the human name that precedes <foo@bar>.
- "\\([^\,.<\"]\\|\"[^\"]*\"\\)*"
- "<\\(" rmail-dont-reply-to-names "\\)"
- "\\)[^,]*"))
- (case-fold-search t)
- pos epos)
- (while (setq pos (string-match match userids pos))
- ;; If there's a match, it starts at the beginning of the string,
- ;; or with `,'. We must delete from that position to the
- ;; end of the user-id which starts at match-beginning 2.
- (let (inside-quotes quote-pos last-quote-pos)
- (save-match-data
- (while (and (setq quote-pos (string-match "\"" userids quote-pos))
- (< quote-pos pos))
- (setq last-quote-pos quote-pos)
- (setq quote-pos (1+ quote-pos))
- (setq inside-quotes (not inside-quotes))))
- (if inside-quotes
- (if (string-match "\"" userids pos)
- (setq pos (string-match "\"" userids pos))
+ "")
+ (if (and user-mail-address
+ (not (equal user-mail-address user-login-name)))
+ (concat (regexp-quote user-mail-address) "\\|")
+ "")
+ (concat (regexp-quote user-login-name) "\\>"))))
+ ;; Split up DESTINATIONS and match each element separately.
+ (let ((start-pos 0) (cur-pos 0)
+ (case-fold-search t))
+ (while start-pos
+ (setq cur-pos (string-match "[,\"]" destinations cur-pos))
+ (if (and cur-pos (equal (match-string 0 destinations) "\""))
+ ;; Search for matching quote.
+ (let ((next-pos (string-match "\"" destinations (1+ cur-pos))))
+ (if next-pos
+ (setq cur-pos (1+ next-pos))