Function: rmail-what-message

rmail-what-message is a byte-compiled function defined in rmail.el.gz.

Signature

(rmail-what-message &optional POS)

Documentation

Return message number POS (or point) is in.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rmail.el.gz
(defun rmail-what-message (&optional pos)
  "Return message number POS (or point) is in."
  (let* ((high rmail-total-messages)
         (mid (/ high 2))
         (low 1)
         (where (or pos
		    (with-current-buffer (if (rmail-buffers-swapped-p)
					     rmail-view-buffer
					   (current-buffer))
		      (point)))))
    (while (> (- high low) 1)
      (if (>= where (rmail-msgbeg mid))
          (setq low mid)
          (setq high mid))
      (setq mid (+ low (/ (- high low) 2))))
    (if (>= where (rmail-msgbeg high)) high low)))