(define-mail-alias): Remove excess whitespace better.

This commit is contained in:
Richard M. Stallman 1993-06-15 20:51:15 +00:00
parent 51e4ece8a5
commit 3af1a1f3c2

View file

@ -157,10 +157,10 @@ DEFINITION can be one or more mail addresses separated by commas."
(setq mail-aliases nil)
(if (file-exists-p "~/.mailrc")
(build-mail-aliases))))
;; Strip leading and trailing blanks.
(if (string-match "^[ \t]+" definition)
;; strip garbage from front and end
(if (string-match "\\`[ \t\n,]+" definition)
(setq definition (substring definition (match-end 0))))
(if (string-match "[ \t]+$" definition)
(if (string-match "[ \t\n,]+\\'" definition)
(setq definition (substring definition 0 (match-beginning 0))))
(let ((first (aref definition 0))
(last (aref definition (1- (length definition))))