Function: appt-mode-line

appt-mode-line is a byte-compiled function defined in appt.el.gz.

Signature

(appt-mode-line MIN-TO-APP &optional ABBREV)

Documentation

Return an appointment string suitable for use in the mode-line.

MIN-TO-APP is a list of minutes, as strings. If ABBREV is non-nil, abbreviates some text.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/appt.el.gz
(defun appt-mode-line (min-to-app &optional abbrev)
  "Return an appointment string suitable for use in the mode-line.
MIN-TO-APP is a list of minutes, as strings.
If ABBREV is non-nil, abbreviates some text."
  ;; All this silliness is just to make the formatting slightly nicer.
  (let* ((multiple (> (length min-to-app) 1))
         (imin (if (or (not multiple)
                       (not (delete (car min-to-app) min-to-app)))
                   (car min-to-app))))
    (format "%s%s %s"
            (if abbrev "App't" "Appointment")
            (if multiple "s" "")
            (if (equal imin "0") "now"
              (format "in %s %s"
                      (or imin (mapconcat #'identity min-to-app ","))
                      (if abbrev "min."
                        (format "minute%s" (if (equal imin "1") "" "s"))))))))