Function: mail-position-on-field

mail-position-on-field is an autoloaded and byte-compiled function defined in sendmail.el.gz.

Signature

(mail-position-on-field FIELD &optional SOFT)

Documentation

Move to the end of the contents of header field FIELD.

If there is no such header, insert one, unless SOFT is non-nil. If there are multiple FIELD fields, this goes to the first. Returns non-nil if FIELD was originally present.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/sendmail.el.gz
(defun mail-position-on-field (field &optional soft)
  "Move to the end of the contents of header field FIELD.
If there is no such header, insert one, unless SOFT is non-nil.
If there are multiple FIELD fields, this goes to the first.
Returns non-nil if FIELD was originally present."
  (let (end
	(case-fold-search t))
    (setq end (mail-header-end))
    (goto-char (point-min))
    (if (re-search-forward (concat "^" (regexp-quote field) ":") end t)
	(progn
	  (re-search-forward "^[^ \t]" nil 'move)
	  (beginning-of-line)
	  (skip-chars-backward "\n")
	  t)
      (or soft
	  (progn (goto-char end)
		 (insert field ": \n")
		 (skip-chars-backward "\n")))
      nil)))