Coverage report: /home/ellis/comp/core/lib/organ/heading.lisp

KindCoveredAll%
expression2330 76.7
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; lib/organ/obj.lisp --- Org Heading
2
 
3
 ;;
4
 
5
 ;;; Code:
6
 (in-package :organ)
7
 
8
 (defclass org-heading ()
9
   ((headline :initarg :headline :initform (org-create :headline) :type org-headline :accessor org-headline)
10
    (planning :initarg :planning :initform nil :type (or null org-planning) :accessor org-planning)
11
    (properties :initarg :properties :initform nil :type (or null org-property-drawer) :accessor org-properties)
12
    (contents :initarg :contents :initform nil :type (or null (vector (or org-section org-heading))) 
13
              :accessor org-contents)))
14
 
15
 (defmethod org-create ((type (eql :header)) &rest initargs &key &allow-other-keys)
16
   (apply #'make-instance (sym-to-org-class-name type) initargs))
17
 
18
 ;; TODO 2024-03-17: fix org-parse-planning-properties -- hangs
19
 (define-org-parser (heading :from stream)
20
   (when-let* ((l (read-line input))
21
               (headline (org-parse :headline l)))
22
     (let ((planning (org-parse :planning input)))
23
       (make-instance 'org-heading
24
         :headline headline
25
         :planning planning
26
         :properties (org-parse :property-drawer input)
27
         :contents (org-parse :section input)))))
28
 
29
 (define-org-parser (heading :from string)
30
   (with-input-from-string (s input)
31
     (org-parse :heading s)))