Function: calendar-mark-visible-date

calendar-mark-visible-date is a byte-compiled function defined in calendar.el.gz.

Signature

(calendar-mark-visible-date DATE &optional MARK)

Documentation

Mark DATE in the calendar window with MARK.

MARK is a single-character string, a list of face attributes/values, or a face. MARK defaults to diary-entry-marker.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/calendar.el.gz
(defun calendar-mark-visible-date (date &optional mark)
  "Mark DATE in the calendar window with MARK.
MARK is a single-character string, a list of face attributes/values,
or a face.  MARK defaults to `diary-entry-marker'."
  (if (calendar-date-is-valid-p date)
      (with-current-buffer (calendar-get-buffer)
        (save-excursion
          (calendar-cursor-to-visible-date date)
          (setq mark
                (or (and (stringp mark) (= (length mark) 1) mark) ; single-char
                    ;; The next two use to also check font-lock-mode.
                    ;; See comments above diary-entry-marker for why
                    ;; this was dropped.
;;;                    (and font-lock-mode
;;;                         (or
                          (and (listp mark) (> (length mark) 0) mark) ; attrs
                          (and (facep mark) mark) ; )) face-name
                          diary-entry-marker))
          (cond
           ;; Face or an attr-list that contained a face.
           ((facep mark)
            (overlay-put
             (make-overlay (1- (point)) (1+ (point))) 'face mark))
           ;; Single-character mark, goes after the date.
           ((and (stringp mark) (= (length mark) 1))
            (overlay-put
             (make-overlay (1+ (point)) (+ 2 (point))) 'display mark))
           (t                           ; attr list
            (overlay-put
             (make-overlay (1- (point)) (1+ (point))) 'face
             (calendar-make-temp-face mark))))))))