Function: Rmail-msg-to-p

Rmail-msg-to-p is a byte-compiled function defined in hrmail.el.

Signature

(Rmail-msg-to-p MAIL-MSG-ID MAIL-FILE)

Documentation

Set current buffer to start of msg with MAIL-MSG-ID in MAIL-FILE.

Return t if successful, else nil.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hrmail.el
(defun Rmail-msg-to-p (mail-msg-id mail-file)
  "Set current buffer to start of msg with MAIL-MSG-ID in MAIL-FILE.
Return t if successful, else nil."
  (if (not (file-readable-p mail-file))
      nil
    (let ((buf (get-file-buffer mail-file)))
      (cond (buf
	     (switch-to-buffer buf)
	     (or (eq major-mode 'rmail-mode)
		 (rmail mail-file)))
	    (t (rmail mail-file))))
    (widen)
    (goto-char 1)
    (if (re-search-forward (concat rmail:msg-hdr-prefix
				   (regexp-quote mail-msg-id)) nil t)
	;; Found matching msg
	(progn
	  (setq buffer-read-only t)
	  (rmail-show-message (Rmail-msg-num))
	  t))))