ndwarshuis / org-sql

SQL backend for Emacs Org-Mode
GNU General Public License v3.0
100 stars 9 forks source link

`s-matches-p`: Wrong type argument #14

Closed jcguu95 closed 2 years ago

jcguu95 commented 2 years ago

Thanks for making such a wonderful tool! I really like the pushing functionality.

For pulling, it fails because s-matches-p expects a string but gets a nil instead.

;; error
Pulling data from Org SQL database
s-matches-p: Wrong type argument: stringp, nil

This should be reproducible on emacs 27.2 and with the org file having the following content

* a

123
ndwarshuis commented 2 years ago

fixed with 71b6e01ff94be4c68cfeb17a34518bf1f118cf95

jcguu95 commented 2 years ago

Similar error persists on the latest version while pulling from db.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^\\*" nil nil)
  s-matches-p("^\\*" nil)
  org-ml-from-string(section nil)
  (cons (car it) (org-ml-from-string 'section (car (cdr it))))
  (closure ((ol-out . "20b78819e69deb900a48867f01733bf3\36\34\35") (it-out . "20b78819e69deb900a48867f01733bf3\36\34\35") (rc . 0) (--dash-source-243-- . "20b78819e69deb900a48867f01733bf3\36\34\35") (input0 0 . "20b78819e69deb900a48867f01733bf3\36\34\35") (fp-out . "/tmp/huge.org\03620b78819e69deb900a48867f01733bf3\35") (it-out . "/tmp/huge.org\03620b78819e69deb900a48867f01733bf3\35") (rc . 0) (--dash-source-242-- . "/tmp/huge.org\03620b78819e69deb900a48867f01733bf3\35") (input0 0 . "/tmp/huge.org\03620b78819e69deb900a48867f01733bf3\35") (hl-out . "0\03620b78819e69deb900a48867f01733bf3\0361\36a\36\34\0361\36\34\36\34\0360\0360\036123\n\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\35") (it-out . "0\03620b78819e69deb900a48867f01733bf3\0361\36a\36\34\0361\36\34\36\34\0360\0360\036123\n\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\35") (rc . 0) (--dash-source-241-- . "0\03620b78819e69deb900a48867f01733bf3\0361\36a\36\34\0361\36\34\36\34\0360\0360\036123\n\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\35") (input0 0 . "0\03620b78819e69deb900a48867f01733bf3\0361\36a\36\34\0361\36\34\36\34\0360\0360\036123\n\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\35") (ol-deserializers (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (identity it)))) (hl-deserializers (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (string-to-number it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (string-to-number it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (string-to-number it))) (lambda (it) (unless (equal it "\34") (string-to-number it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (pcase it ("1" 1) ("0" 0)))) (lambda (it) (unless (equal it "\34") (pcase it ("1" 1) ("0" 0)))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (string-to-number it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (string-to-number it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it))))) (ol-query . "SELECT outline_hash, outline_preamble from outlines") (fp-query . "SELECT file_path, outline_hash from file_metadata") (hl-query . "WITH RECURSIVE paths AS (SELECT hc.headline_id AS parent_id, CAST(h.headline_index AS TEXT) AS ipath FROM headline_closures hc JOIN headlines h ON h.headline_id = hc.parent_id WHERE hc.depth = 0 AND h.level = 1 UNION ALL SELECT hc.headline_id, p.ipath||'\37'||h.headline_index FROM headline_closures hc JOIN headlines h ON h.headline_id = hc.headline_id JOIN paths p ON p.parent_id = hc.parent_id WHERE hc.depth = 1),_logbooks AS (SELECT headline_id, GROUP_CONCAT(CASE WHEN note IS NULL THEN header ELSE header||'\\\\\n'||note END, '\37') AS entries FROM logbook_entries GROUP BY headline_id),_clocks AS (SELECT headline_id, GROUP_CONCAT(CAST(time_start AS TEXT), '\37') AS clock_starts, GROUP_CONCAT(CAST(time_end AS TEXT), '\37') AS clock_ends, GROUP_CONCAT(clock_note, '\37') AS clock_notes FROM clocks GROUP BY headline_id),_headline_tags AS (SELECT headline_id, GROUP_CONCAT(tag, '\37') AS tags FROM headline_tags GROUP BY headline_id),_scheduled AS (SELECT t.headline_id, t.raw_value FROM timestamps t JOIN planning_entries p ON p.timestamp_id = t.timestamp_id WHERE p.planning_type = 'scheduled'),_deadline AS (SELECT t.headline_id, t.raw_value FROM timestamps t JOIN planning_entries p ON p.timestamp_id = t.timestamp_id WHERE p.planning_type = 'deadline'),_closed AS (SELECT t.headline_id, t.raw_value FROM timestamps t JOIN planning_entries p ON p.timestamp_id = t.timestamp_id WHERE p.planning_type = 'closed'),_headline_properties AS (SELECT h.headline_id, GROUP_CONCAT(p.key_text, '\37') AS pkeys, GROUP_CONCAT(p.val_text, '\37') AS pvals FROM headline_properties h JOIN properties p ON p.property_id = h.property_id GROUP BY h.headline_id) SELECT p.ipath,h.outline_hash,h.headline_id,h.headline_text,h.keyword,h.level,h.effort,h.priority,h.is_archived,h.is_commented,h.content,t.tags,hp.pkeys,hp.pvals,sch.raw_value,dead.raw_value,cls.raw_value,lb.entries,c.clock_starts,c.clock_ends,c.clock_notes FROM paths p JOIN headlines h ON p.parent_id = h.headline_id LEFT JOIN _headline_properties hp ON hp.headline_id = h.headline_id LEFT JOIN _headline_tags t ON t.headline_id = h.headline_id LEFT JOIN _scheduled sch ON sch.headline_id = h.headline_id LEFT JOIN _deadline dead ON dead.headline_id = h.headline_id LEFT JOIN _closed cls ON cls.headline_id = h.headline_id LEFT JOIN _logbooks lb ON lb.headline_id = h.headline_id LEFT JOIN _clocks c ON c.headline_id = h.headline_id ORDER BY h.outline_hash, p.ipath;") (fmt . "%s") (--cl-compare-lists-- closure #23 (A B) (let ((input0 A) (input1 B)) (let* ((--dash-source-239-- input0) (a (car-safe (prog1 --dash-source-239-- (setq --dash-source-239-- (cdr --dash-source-239--))))) (as --dash-source-239--) (--dash-source-240-- input1) (b (car-safe (prog1 --dash-source-240-- (setq --dash-source-240-- (cdr --dash-source-240--))))) (bs --dash-source-240--)) (cond ((and (not a) (not b)) (error "If this happens, the list has duplicates")) ((null a) t) ((null b) nil) ((= a b) (funcall --cl-compare-lists-- as bs)) (t (< a b)))))) t) (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it)))))(("20b78819e69deb900a48867f01733bf3" nil))
  mapcar((closure ((ol-out . "20b78819e69deb900a48867f01733bf3\36\34\35") (it-out . "20b78819e69deb900a48867f01733bf3\36\34\35") (rc . 0) (--dash-source-243-- . "20b78819e69deb900a48867f01733bf3\36\34\35") (input0 0 . "20b78819e69deb900a48867f01733bf3\36\34\35") (fp-out . "/tmp/huge.org\03620b78819e69deb900a48867f01733bf3\35") (it-out . "/tmp/huge.org\03620b78819e69deb900a48867f01733bf3\35") (rc . 0) (--dash-source-242-- . "/tmp/huge.org\03620b78819e69deb900a48867f01733bf3\35") (input0 0 . "/tmp/huge.org\03620b78819e69deb900a48867f01733bf3\35") (hl-out . "0\03620b78819e69deb900a48867f01733bf3\0361\36a\36\34\0361\36\34\36\34\0360\0360\036123\n\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\35") (it-out . "0\03620b78819e69deb900a48867f01733bf3\0361\36a\36\34\0361\36\34\36\34\0360\0360\036123\n\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\35") (rc . 0) (--dash-source-241-- . "0\03620b78819e69deb900a48867f01733bf3\0361\36a\36\34\0361\36\34\36\34\0360\0360\036123\n\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\35") (input0 0 . "0\03620b78819e69deb900a48867f01733bf3\0361\36a\36\34\0361\36\34\36\34\0360\0360\036123\n\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\36\34\35") (ol-deserializers (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (identity it)))) (hl-deserializers (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (string-to-number it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (string-to-number it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (string-to-number it))) (lambda (it) (unless (equal it "\34") (string-to-number it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (pcase it ("1" 1) ("0" 0)))) (lambda (it) (unless (equal it "\34") (pcase it ("1" 1) ("0" 0)))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (identity it))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (string-to-number it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (string-to-number it))) (s-split org-sql--unit-sep it)))) (lambda (it) (unless (equal it "\34") (-map (lambda (it) (unless (equal it "\34") (identity it))) (s-split org-sql--unit-sep it))))) (ol-query . "SELECT outline_hash, outline_preamble from outlines") (fp-query . "SELECT file_path, outline_hash from file_metadata") (hl-query . "WITH RECURSIVE paths AS (SELECT hc.headline_id AS parent_id, CAST(h.headline_index AS TEXT) AS ipath FROM headline_closures hc JOIN headlines h ON h.headline_id = hc.parent_id WHERE hc.depth = 0 AND h.level = 1 UNION ALL SELECT hc.headline_id, p.ipath||'\37'||h.headline_index FROM headline_closures hc JOIN headlines h ON h.headline_id = hc.headline_id JOIN paths p ON p.parent_id = hc.parent_id WHERE hc.depth = 1),_logbooks AS (SELECT headline_id, GROUP_CONCAT(CASE WHEN note IS NULL THEN header ELSE header||'\\\\\n'||note END, '\37') AS entries FROM logbook_entries GROUP BY headline_id),_clocks AS (SELECT headline_id, GROUP_CONCAT(CAST(time_start AS TEXT), '\37') AS clock_starts, GROUP_CONCAT(CAST(time_end AS TEXT), '\37') AS clock_ends, GROUP_CONCAT(clock_note, '\37') AS clock_notes FROM clocks GROUP BY headline_id),_headline_tags AS (SELECT headline_id, GROUP_CONCAT(tag, '\37') AS tags FROM headline_tags GROUP BY headline_id),_scheduled AS (SELECT t.headline_id, t.raw_value FROM timestamps t JOIN planning_entries p ON p.timestamp_id = t.timestamp_id WHERE p.planning_type = 'scheduled'),_deadline AS (SELECT t.headline_id, t.raw_value FROM timestamps t JOIN planning_entries p ON p.timestamp_id = t.timestamp_id WHERE p.planning_type = 'deadline'),_closed AS (SELECT t.headline_id, t.raw_value FROM timestamps t JOIN planning_entries p ON p.timestamp_id = t.timestamp_id WHERE p.planning_type = 'closed'),_headline_properties AS (SELECT h.headline_id, GROUP_CONCAT(p.key_text, '\37') AS pkeys, GROUP_CONCAT(p.val_text, '\37') AS pvals FROM headline_properties h JOIN properties p ON p.property_id = h.property_id GROUP BY h.headline_id) SELECT p.ipath,h.outline_hash,h.headline_id,h.headline_text,h.keyword,h.level,h.effort,h.priority,h.is_archived,h.is_commented,h.content,t.tags,hp.pkeys,hp.pvals,sch.raw_value,dead.raw_value,cls.raw_value,lb.entries,c.clock_starts,c.clock_ends,c.clock_notes FROM paths p JOIN headlines h ON p.parent_id = h.headline_id LEFT JOIN _headline_properties hp ON hp.headline_id = h.headline_id LEFT JOIN _headline_tags t ON t.headline_id = h.headline_id LEFT JOIN _scheduled sch ON sch.headline_id = h.headline_id LEFT JOIN _deadline dead ON dead.headline_id = h.headline_id LEFT JOIN _closed cls ON cls.headline_id = h.headline_id LEFT JOIN _logbooks lb ON lb.headline_id = h.headline_id LEFT JOIN _clocks c ON c.headline_id = h.headline_id ORDER BY h.outline_hash, p.ipath;") (fmt . "%s") (--cl-compare-lists-- closure #24 (A B) (let ((input0 A) (input1 B)) (let* ((--dash-source-239-- input0) (a (car-safe (prog1 --dash-source-239-- (setq --dash-source-239-- (cdr --dash-source-239--))))) (as --dash-source-239--) (--dash-source-240-- input1) (b (car-safe (prog1 --dash-source-240-- (setq --dash-source-240-- (cdr --dash-source-240--))))) (bs --dash-source-240--)) (cond ((and (not a) (not b)) (error "If this happens, the list has duplicates")) ((null a) t) ((null b) nil) ((= a b) (funcall --cl-compare-lists-- as bs)) (t (< a b)))))) t) (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (("20b78819e69deb900a48867f01733bf3" nil)))
  (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out)))
  (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))
  (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out)))))
  (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out))
  (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))
  (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out))))
  (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))
  (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out))))))
  (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out))
  (let* ((--dash-source-242-- input0) (rc (car-safe (prog1 --dash-source-242-- (setq --dash-source-242-- (cdr --dash-source-242--))))) (it-out --dash-source-242--)) (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out)))
  (let ((input0 (org-sql-send-sql fp-query))) (let* ((--dash-source-242-- input0) (rc (car-safe (prog1 --dash-source-242-- (setq --dash-source-242-- (cdr --dash-source-242--))))) (it-out --dash-source-242--)) (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out))))
  (let ((hl-out it-out)) (let ((input0 (org-sql-send-sql fp-query))) (let* ((--dash-source-242-- input0) (rc (car-safe (prog1 --dash-source-242-- (setq --dash-source-242-- (cdr --dash-source-242--))))) (it-out --dash-source-242--)) (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out)))))
  (progn (let ((hl-out it-out)) (let ((input0 (org-sql-send-sql fp-query))) (let* ((--dash-source-242-- input0) (rc (car-safe (prog1 --dash-source-242-- (setq --dash-source-242-- (cdr --dash-source-242--))))) (it-out --dash-source-242--)) (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out))))))
  (if (= 0 rc) (progn (let ((hl-out it-out)) (let ((input0 (org-sql-send-sql fp-query))) (let* ((--dash-source-242-- input0) (rc (car-safe (prog1 --dash-source-242-- (setq --dash-source-242-- (cdr --dash-source-242--))))) (it-out --dash-source-242--)) (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out)))))) (error it-out))
  (let* ((--dash-source-241-- input0) (rc (car-safe (prog1 --dash-source-241-- (setq --dash-source-241-- (cdr --dash-source-241--))))) (it-out --dash-source-241--)) (if (= 0 rc) (progn (let ((hl-out it-out)) (let ((input0 (org-sql-send-sql fp-query))) (let* ((--dash-source-242-- input0) (rc (car-safe (prog1 --dash-source-242-- (setq --dash-source-242-- (cdr --dash-source-242--))))) (it-out --dash-source-242--)) (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out)))))) (error it-out)))
  (let ((input0 (org-sql-send-sql hl-query))) (let* ((--dash-source-241-- input0) (rc (car-safe (prog1 --dash-source-241-- (setq --dash-source-241-- (cdr --dash-source-241--))))) (it-out --dash-source-241--)) (if (= 0 rc) (progn (let ((hl-out it-out)) (let ((input0 (org-sql-send-sql fp-query))) (let* ((--dash-source-242-- input0) (rc (car-safe (prog1 --dash-source-242-- (setq --dash-source-242-- (cdr --dash-source-242--))))) (it-out --dash-source-242--)) (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out)))))) (error it-out))))
  (let* ((fmt (let* ((temp (car org-sql-db-config))) (cond ((eql temp 'mysql) "SET sql_mode = NO_BACKSLASH_ESCAPES;%s") ((eql temp 'postgres) "%s") ((eql temp 'sqlite) "%s") ((eql temp 'sqlserver) "%s") (t (error "Invalid mode: %s" (car org-sql-db-config)))))) (hl-query (format fmt (org-sql--format-pull-query org-sql-db-config))) (fp-query (org-sql--format-pull-filepath-query org-sql-db-config)) (ol-query (org-sql--format-pull-preamble-query org-sql-db-config)) (hl-deserializers (org-sql--compile-deserializers org-sql-db-config)) (ol-deserializers (mapcar #'(lambda (it) (ignore it) (org-sql--compile-deserializer org-sql-db-config it)) (list 'varchar 'text)))) (let ((input0 (org-sql-send-sql hl-query))) (let* ((--dash-source-241-- input0) (rc (car-safe (prog1 --dash-source-241-- (setq --dash-source-241-- (cdr --dash-source-241--))))) (it-out --dash-source-241--)) (if (= 0 rc) (progn (let ((hl-out it-out)) (let ((input0 (org-sql-send-sql fp-query))) (let* ((--dash-source-242-- input0) (rc (car-safe (prog1 --dash-source-242-- (setq --dash-source-242-- (cdr --dash-source-242--))))) (it-out --dash-source-242--)) (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out)))))) (error it-out)))))
  (let (--cl-compare-lists--) (setq --cl-compare-lists-- #'(lambda (A B) (let ((input0 A) (input1 B)) (let* ((--dash-source-239-- input0) (a (car-safe (prog1 --dash-source-239-- (setq --dash-source-239-- (cdr --dash-source-239--))))) (as --dash-source-239--) (--dash-source-240-- input1) (b (car-safe (prog1 --dash-source-240-- (setq --dash-source-240-- (cdr --dash-source-240--))))) (bs --dash-source-240--)) (cond ((and (not a) (not b)) (error "If this happens, the list has duplicates")) ((null a) t) ((null b) nil) ((= a b) (funcall --cl-compare-lists-- as bs)) (t (< a b))))))) (let* ((fmt (let* ((temp (car org-sql-db-config))) (cond ((eql temp 'mysql) "SET sql_mode = NO_BACKSLASH_ESCAPES;%s") ((eql temp 'postgres) "%s") ((eql temp 'sqlite) "%s") ((eql temp 'sqlserver) "%s") (t (error "Invalid mode: %s" (car org-sql-db-config)))))) (hl-query (format fmt (org-sql--format-pull-query org-sql-db-config))) (fp-query (org-sql--format-pull-filepath-query org-sql-db-config)) (ol-query (org-sql--format-pull-preamble-query org-sql-db-config)) (hl-deserializers (org-sql--compile-deserializers org-sql-db-config)) (ol-deserializers (mapcar #'(lambda (it) (ignore it) (org-sql--compile-deserializer org-sql-db-config it)) (list 'varchar 'text)))) (let ((input0 (org-sql-send-sql hl-query))) (let* ((--dash-source-241-- input0) (rc (car-safe (prog1 --dash-source-241-- (setq --dash-source-241-- (cdr --dash-source-241--))))) (it-out --dash-source-241--)) (if (= 0 rc) (progn (let ((hl-out it-out)) (let ((input0 (org-sql-send-sql fp-query))) (let* ((--dash-source-242-- input0) (rc (car-safe (prog1 --dash-source-242-- (setq --dash-source-242-- (cdr --dash-source-242--))))) (it-out --dash-source-242--)) (if (= 0 rc) (progn (let ((fp-out it-out)) (let ((input0 (org-sql-send-sql ol-query))) (let* ((--dash-source-243-- input0) (rc (car-safe (prog1 --dash-source-243-- (setq --dash-source-243-- (cdr --dash-source-243--))))) (it-out --dash-source-243--)) (if (= 0 rc) (progn (let ((ol-out it-out)) (let ((trees (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-sql--aggregate-headlines 1 (-map #'org-sql--row-to-headline (-sort #'(lambda (it other) (funcall --cl-compare-lists-- (nth 0 it) (nth 0 other))) (cdr it)))))) (nreverse (-map #'(lambda (n) (cons (car n) (nreverse (cdr n)))) (let ((acc nil)) (let ((list (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 hl-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config hl-out))) (i 0) it it-index) (ignore it it-index) (while list (setq it (car-safe (prog1 list (setq list (cdr list)))) it-index i i (1+ i)) (setq acc (let* ((k (nth 1 it)) (grp (assoc k acc))) (if grp (setcdr grp (cons it (cdr grp))) (setq acc (cons (list k it) acc))) acc)))) acc))))) (preambles (mapcar #'(lambda (it) (ignore it) (cons (car it) (org-ml-from-string 'section (car (cdr it))))) (mapcar #'(lambda (it) (ignore it) (let ((result nil) (list1 ol-deserializers) (list2 it)) (while (and list1 list2) (let ((it (car list1)) (other (car list2))) (setq result (cons (funcall it other) result)) (setq list1 (cdr list1)) (setq list2 (cdr list2)))) (nreverse result))) (org-sql--parse-output-to-list org-sql-db-config ol-out))))) (mapcar #'(lambda (it) (ignore it) (let* ((--dash-source-244-- it) (fp (car-safe (prog1 --dash-source-244-- (setq --dash-source-244-- (cdr --dash-source-244--))))) (hash (car --dash-source-244--)) (headlines (cdr (let (needle) (let ((list trees) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle))) (preamble (cdr (let (needle) (let ((list preambles) (i 0) elt it it-index) (ignore it it-index) (while (and list (setq elt (car-safe (prog1 list (setq list (cdr list)))) it elt it-index i) (or (not (equal (car it) hash)) (ignore (setq needle it)))) (setq it elt it-index i i (1+ i)))) needle)))) (cons fp (org-sql--build-org-data preamble headlines)))) (org-sql--parse-output-to-list org-sql-db-config fp-out))))) (error it-out)))))) (error it-out)))))) (error it-out))))))
  org-sql-pull-from-db()
  org-sql-user-pull()
  (setq *X* (org-sql-user-pull))
  eval((setq *X* (org-sql-user-pull)) nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  eros-eval-last-sexp(nil)
  funcall-interactively(eros-eval-last-sexp nil)
  call-interactively(eros-eval-last-sexp nil nil)
  command-execute(eros-eval-last-sexp)
ndwarshuis commented 2 years ago

This works on my end (to be clear, this is version 3.0.3). How are you installing the package and what are the exact step-by-step commands you are running?