From c612ba58a920e62571f501f930350cd0a37f69c6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 15 May 2019 20:51:52 -0400 Subject: [PATCH] Fix stringp errors in doom/help search commands --- core/autoload/help.el | 58 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/core/autoload/help.el b/core/autoload/help.el index 11a1a1101..c9c232067 100644 --- a/core/autoload/help.el +++ b/core/autoload/help.el @@ -121,40 +121,38 @@ selection of all minor-modes, active or not." ;; ;;; Documentation commands -(defun doom--org-headings (files &optional depth _prompt include-files) +(defun doom--org-headings (files &optional depth include-files) (require 'org) - (let ((org-agenda-files (doom-enlist files)) - (default-directory doom-docs-dir)) + (let* ((default-directory doom-docs-dir) + (org-agenda-files (mapcar #'expand-file-name (doom-enlist files))) + (depth (if (integerp depth) depth))) (unwind-protect (delq nil (org-map-entries (lambda () - (let* ((components (org-heading-components)) - (path (org-get-outline-path)) - (level (nth 0 components)) - (text (nth 4 components)) - (tags (nth 5 components))) - (when (and (or (not depth) - (and (integerp depth) - (<= level depth))) - (or (not tags) - (not (string-match-p ":TOC" tags)))) - (list - (mapconcat - 'identity - (list (mapconcat 'identity - (append (when include-files - (list (or (+org-get-property "TITLE") - (file-relative-name buffer-file-name)))) - path - (list text)) - " > ") - tags) - " ") - buffer-file-name - (point))))) - nil - 'agenda)) + (cl-destructuring-bind (level _reduced-level _todo _priority text tags) + (org-heading-components) + (let ((path (org-get-outline-path))) + (when (and (or (null depth) + (<= level depth)) + (or (null tags) + (not (string-match-p ":TOC" tags)))) + (list + (mapconcat + 'identity + (list (mapconcat #'identity + (append (when include-files + (list (or (+org-get-property "TITLE") + (file-relative-name buffer-file-name)))) + path + (list text)) + " > ") + tags) + " ") + buffer-file-name + (point))) + ))) + t 'agenda)) (mapc #'kill-buffer org-agenda-new-buffers) (setq org-agenda-new-buffers nil)))) @@ -175,7 +173,7 @@ selection of all minor-modes, active or not." "troubleshooting.org" "tutorials.org" "faq.org") - 2 nil t)))) + 2 t)))) ;;;###autoload (defun doom/help-faq ()