Function: rmail-create-summary

rmail-create-summary is a byte-compiled function defined in rmailsum.el.gz.

Signature

(rmail-create-summary MSGNUM DELETED UNSEEN LINES)

Documentation

Return the summary line for message MSGNUM.

The current buffer should already be narrowed to the header for that message. It could be either buffer, so don't access Rmail local variables. DELETED is t if this message is marked deleted. UNSEEN is t if it is marked unseen. LINES is the number of lines in the message (if we should display that)
 or else nil.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rmailsum.el.gz
(defun rmail-create-summary (msgnum deleted unseen lines)
  "Return the summary line for message MSGNUM.
The current buffer should already be narrowed to the header for that message.
It could be either buffer, so don't access Rmail local variables.
DELETED is t if this message is marked deleted.
UNSEEN is t if it is marked unseen.
LINES is the number of lines in the message (if we should display that)
 or else nil."
  (goto-char (point-min))
  (let ((line (rmail-header-summary))
	(labels (rmail-get-summary-labels))
        status prefix basic-start basic-end linecount-string)

    (setq linecount-string
	  (cond
	   ((not lines)       " ")
	   ((<= lines      9) (format "   [%d]" lines))
	   ((<= lines     99) (format "  [%d]" lines))
	   ((<= lines    999) (format " [%d]" lines))
	   ((<= lines   9999) (format "  [%dk]" (/ lines 1000)))
	   ((<= lines  99999) (format " [%dk]" (/ lines 1000)))
	   (t                 (format "[%dk]" (/ lines 1000)))))

    (setq status (cond
		  (deleted ?D)
		  (unseen ?-)
		  (t ? ))
	  prefix (format "%5d%c " msgnum status)
	  basic-start (car line)
	  basic-end (cadr line))
    (funcall rmail-summary-line-decoder
	     (concat prefix basic-start linecount-string " "
		     labels basic-end))))