Fix stringp errors in doom/help search commands

This commit is contained in:
Henrik Lissner 2019-05-15 20:51:52 -04:00
parent a8300a53f1
commit c612ba58a9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -121,28 +121,26 @@ 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)
(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
(list (mapconcat #'identity
(append (when include-files
(list (or (+org-get-property "TITLE")
(file-relative-name buffer-file-name))))
@ -152,9 +150,9 @@ selection of all minor-modes, active or not."
tags)
" ")
buffer-file-name
(point)))))
nil
'agenda))
(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 ()