# HG changeset patch # User Richard M. Stallman # Date 753876292 0 # Node ID 976d7492e00e3d07855e5630340df0c290c1f3b9 # Parent 8b59fb13665eec6ba29a97b51657c43f9d1bd0ca (mail-fetch-field): Exclude trailing whitespace. Delete duplicate (goto-char (point-min)). diff -r 8b59fb13665e -r 976d7492e00e lisp/mail/mail-utils.el --- a/lisp/mail/mail-utils.el Sun Nov 21 09:04:48 1993 +0000 +++ b/lisp/mail/mail-utils.el Sun Nov 21 10:04:52 1993 +0000 @@ -161,16 +161,19 @@ (goto-char (point-min)) (let ((case-fold-search t) (name (concat "^" (regexp-quote field-name) "[ \t]*:[ \t]*"))) - (goto-char (point-min)) (if all (let ((value "")) (while (re-search-forward name nil t) (let ((opoint (point))) (while (progn (forward-line 1) (looking-at "[ \t]"))) + ;; Back up over newline, then trailing spaces or tabs + (forward-char -1) + (while (member (preceding-char) '(? ?\t)) + (forward-char -1)) (setq value (concat value (if (string= value "") "" ", ") - (buffer-substring opoint (1- (point))))))) + (buffer-substring opoint (point)))))) (and (not (string= value "")) value)) (if (re-search-forward name nil t) (progn @@ -178,7 +181,11 @@ (let ((opoint (point))) (while (progn (forward-line 1) (looking-at "[ \t]"))) - (buffer-substring opoint (1- (point)))))))))) + ;; Back up over newline, then trailing spaces or tabs + (forward-char -1) + (while (member (preceding-char) '(? ?\t)) + (forward-char -1)) + (buffer-substring opoint (point))))))))) ;; Parse a list of tokens separated by commas. ;; It runs from point to the end of the visible part of the buffer.