Function: diary-icalendar-save-attachments-from

diary-icalendar-save-attachments-from is a byte-compiled function defined in diary-icalendar.el.gz.

Signature

(diary-icalendar-save-attachments-from ATTACHMENT-NODES UID)

Documentation

Save attachments in ATTACHMENT-NODES and return a list of attachments.

If these nodes contain binary data, rather than an URL, save the data to a file in diary-icalendar-attachment-directory (unless this variable is nil). UID should be the universal ID of the component containing ATTACHMENT-NODES; the attachments will be saved in a subdirectory of the same name. The returned list is a list of strings, which are either URLs or filenames.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/diary-icalendar.el.gz
(defun di:save-attachments-from (attachment-nodes uid)
  "Save attachments in ATTACHMENT-NODES and return a list of attachments.

If these nodes contain binary data, rather than an URL, save the data to
a file in `diary-icalendar-attachment-directory' (unless this variable
is nil).  UID should be the universal ID of the component containing
ATTACHMENT-NODES; the attachments will be saved in a subdirectory of the
same name.  The returned list is a list of strings, which are either
URLs or filenames."
  (let (entry-attachments)
    (dolist (node attachment-nodes)
      (ical:with-property node
        ((ical:fmttypeparam :value fmttype))
        (when (and (eq 'ical:binary value-type)
                   di:attachment-directory)
          (let ((filename (di:save-binary-attachment value uid fmttype)))
            (push filename entry-attachments)))
        (when (eq 'ical:url value-type)
          (push value entry-attachments))))
    ;; Return the list of filenames and URLs:
    entry-attachments))