Function: diary-icalendar-parse-weekday-name

diary-icalendar-parse-weekday-name is a byte-compiled function defined in diary-icalendar.el.gz.

Signature

(diary-icalendar-parse-weekday-name)

Documentation

Parse a weekday name on the current line.

The day name must appear in calendar-day-name-array or calendar-day-abbrev-array. If a day name is found, move the current restriction past it, and return a day number between 0 (=Sunday) and
6 (=Saturday). Otherwise, return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/diary-icalendar.el.gz
(defun di:parse-weekday-name ()
  "Parse a weekday name on the current line.

The day name must appear in `calendar-day-name-array' or
`calendar-day-abbrev-array'.  If a day name is found, move the current
restriction past it, and return a day number between 0 (=Sunday) and
6 (=Saturday).  Otherwise, return nil."
  (goto-char (point-min))
  (let ((day-names-regexp
         (rx line-start
             (zero-or-one (regexp diary-nonmarking-symbol))
             (group-n 1
               (regexp (diary-name-pattern calendar-day-name-array
                                           calendar-day-abbrev-array))))))
    (when (re-search-forward day-names-regexp (line-end-position) t)
      (let ((day-name (capitalize (match-string 1))))
        (narrow-to-region (match-end 0) (point-max))
        (alist-get
         day-name
         (calendar-make-alist calendar-day-name-array 0 nil
                              calendar-day-abbrev-array
                              (mapcar (lambda (e) (format "%s." e))
                                      calendar-day-abbrev-array))
         nil nil #'equal)))))