Function: org-persist-write:elisp

org-persist-write:elisp is a byte-compiled function defined in org-persist.el.gz.

Signature

(org-persist-write:elisp CONTAINER COLLECTION)

Documentation

Write elisp CONTAINER according to COLLECTION.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-persist.el.gz
(defun org-persist-write:elisp (container collection)
  "Write elisp CONTAINER according to COLLECTION."
  (let ((scope (nth 2 container)))
    (pcase scope
      ((pred stringp)
       (when-let ((buf (or (get-buffer scope)
                           (get-file-buffer scope))))
         ;; FIXME: There is `buffer-local-boundp' introduced in Emacs 28.
         ;; Not using it yet to keep backward compatibility.
         (condition-case nil
             (buffer-local-value (cadr container) buf)
           (void-variable nil))))
      (`local
       (when (boundp (cadr container))
         (symbol-value (cadr container))))
      (`nil
       (if-let ((buf (and (plist-get (plist-get collection :associated) :file)
                          (get-file-buffer (plist-get (plist-get collection :associated) :file)))))
           ;; FIXME: There is `buffer-local-boundp' introduced in Emacs 28.
           ;; Not using it yet to keep backward compatibility.
           (condition-case nil
               (buffer-local-value (cadr container) buf)
             (void-variable nil))
         (when (boundp (cadr container))
           (symbol-value (cadr container))))))))