Function: mh-mh-directive-present-p

mh-mh-directive-present-p is an autoloaded and byte-compiled function defined in mh-mime.el.gz.

Signature

(mh-mh-directive-present-p &optional BEGIN END)

Documentation

Check if the text between BEGIN and END might be a MH-style directive.

The optional argument BEGIN defaults to the beginning of the buffer, while END defaults to the end of the buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-mime.el.gz
;;;###mh-autoload
(defun mh-mh-directive-present-p (&optional begin end)
  "Check if the text between BEGIN and END might be a MH-style directive.
The optional argument BEGIN defaults to the beginning of the
buffer, while END defaults to the end of the buffer."
  (unless begin (setq begin (point-min)))
  (unless end (setq end (point-max)))
  (save-excursion
    (cl-block search-for-mh-directive
      (goto-char begin)
      (while (re-search-forward "^#" end t)
        (let ((s (buffer-substring-no-properties
                  (point) (mh-line-end-position))))
          (cond ((equal s ""))
                ((string-match "^forw[ \t\n]+" s)
                 (cl-return-from search-for-mh-directive t))
                (t (let ((first-token (car (split-string s "[ \t;@]"))))
                     (when (and first-token
                                (string-match mh-media-type-regexp
                                              first-token))
                       (cl-return-from search-for-mh-directive t)))))))
      nil)))