Mercurial > core / lisp/lib/organ/element/greater/drawer.lisp
changeset 136: |
6ad95601645e |
parent: |
a5ae5a58c4cd
|
child: |
7ca4cdbd52c2 |
author: |
ellis <ellis@rwest.io> |
date: |
Wed, 27 Dec 2023 23:47:25 -0500 |
permissions: |
-rw-r--r-- |
description: |
org work, once we fix org-parse-planning-and-properties we ready to rumble |
1 ;;; lib/organ/element/greater/drawer.lisp --- Org Drawer Elements 3 ;; Drawers match the pattern: 11 ;; Drawers can't be nested. 16 (define-org-element drawer (name contents) :greater t) 18 (define-org-element property-drawer 19 ((contents :initform (make-array 0 :element-type 'org-node-property :adjustable t :fill-pointer 0) 20 :accessor org-contents :type (vector 'org-node-property))) 22 :documentation "A special type of ORG-DRAWER with a names of 23 'PROPERTIES'. This class is built into the slot of ORG-HEADING, 24 ORG-DOCUMENT, and ORG-INLINETASK objects.") 26 (define-org-parser (property-drawer :from stream) 27 (let ((l (read-line input nil :eof))) 28 (unless (or (eq l :eof) (not (typep l 'string))) 29 (if (scan org-property-start-rx l) 30 (let ((drawer (org-create :property-drawer))) 31 (loop for p = (read-line input nil :eof) 32 until (or (eq p :eof) (scan org-end-rx p)) 33 do (vector-push-extend (org-parse :node-property p) (org-contents drawer))) 36 (define-org-parser (property-drawer :from string) 37 (with-input-from-string (s input) 38 (org-parse :property-drawer s)))