Function: rfc822-bad-address

rfc822-bad-address is a byte-compiled function defined in rfc822.el.gz.

Signature

(rfc822-bad-address REASON)

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rfc822.el.gz
;; uses rfc822-address-start free, throws to address
(defun rfc822-bad-address (reason)
  (save-restriction
    (insert "_^_")
    (narrow-to-region rfc822-address-start
		      (if (re-search-forward "[,;]" nil t)
			  (max (point-min) (1- (point)))
			(point-max)))
    ;; make the error string be suitable for inclusion in (...)
    (let ((losers '("\\" "(" ")" "\n")))
      (while losers
	(goto-char (point-min))
	(while (search-forward (car losers) nil t)
	  (backward-char 1)
	  (insert ?\\)
	  (forward-char 1))
	(setq losers (cdr losers))))
    (goto-char (point-min)) (insert "(Unparsable address -- "
				    reason
				    ": \"")
    (goto-char (point-max)) (insert "\")"))
  (rfc822-nuke-whitespace)
  (throw 'address (buffer-substring rfc822-address-start (point))))