From: Richard M. Stallman Date: Thu, 25 Aug 2005 11:00:38 +0000 (+0000) Subject: (build-mail-aliases): Delete comments X-Git-Tag: emacs-pretest-22.0.90~7456 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/1296b4cdd99217bbdb34023e92136985c8275ea7 (build-mail-aliases): Delete comments from the contents before processing them. --- diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index 56882f04eb..48f3494a0e 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -262,6 +262,12 @@ By default, this is the file specified by `mail-personal-alias-file'." ((file-exists-p (setq file (concat "~/" file))) (insert-file-contents file)) (t (setq file nil))) + (goto-char (point-min)) + ;; Delete comments from the contents. + (while (search-forward "# " nil t) + (let ((p (- (point) 2))) + (end-of-line) + (delete-region p (point)))) ;; Don't lose if no final newline. (goto-char (point-max)) (or (eq (preceding-char) ?\n) (newline))