Fix stringp errors in doom/help search commands
This commit is contained in:
parent
a8300a53f1
commit
c612ba58a9
1 changed files with 28 additions and 30 deletions
|
@ -121,40 +121,38 @@ selection of all minor-modes, active or not."
|
||||||
;;
|
;;
|
||||||
;;; Documentation commands
|
;;; Documentation commands
|
||||||
|
|
||||||
(defun doom--org-headings (files &optional depth _prompt include-files)
|
(defun doom--org-headings (files &optional depth include-files)
|
||||||
(require 'org)
|
(require 'org)
|
||||||
(let ((org-agenda-files (doom-enlist files))
|
(let* ((default-directory doom-docs-dir)
|
||||||
(default-directory doom-docs-dir))
|
(org-agenda-files (mapcar #'expand-file-name (doom-enlist files)))
|
||||||
|
(depth (if (integerp depth) depth)))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(delq nil
|
(delq nil
|
||||||
(org-map-entries
|
(org-map-entries
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let* ((components (org-heading-components))
|
(cl-destructuring-bind (level _reduced-level _todo _priority text tags)
|
||||||
(path (org-get-outline-path))
|
(org-heading-components)
|
||||||
(level (nth 0 components))
|
(let ((path (org-get-outline-path)))
|
||||||
(text (nth 4 components))
|
(when (and (or (null depth)
|
||||||
(tags (nth 5 components)))
|
(<= level depth))
|
||||||
(when (and (or (not depth)
|
(or (null tags)
|
||||||
(and (integerp depth)
|
(not (string-match-p ":TOC" tags))))
|
||||||
(<= level depth)))
|
(list
|
||||||
(or (not tags)
|
(mapconcat
|
||||||
(not (string-match-p ":TOC" tags))))
|
'identity
|
||||||
(list
|
(list (mapconcat #'identity
|
||||||
(mapconcat
|
(append (when include-files
|
||||||
'identity
|
(list (or (+org-get-property "TITLE")
|
||||||
(list (mapconcat 'identity
|
(file-relative-name buffer-file-name))))
|
||||||
(append (when include-files
|
path
|
||||||
(list (or (+org-get-property "TITLE")
|
(list text))
|
||||||
(file-relative-name buffer-file-name))))
|
" > ")
|
||||||
path
|
tags)
|
||||||
(list text))
|
" ")
|
||||||
" > ")
|
buffer-file-name
|
||||||
tags)
|
(point)))
|
||||||
" ")
|
)))
|
||||||
buffer-file-name
|
t 'agenda))
|
||||||
(point)))))
|
|
||||||
nil
|
|
||||||
'agenda))
|
|
||||||
(mapc #'kill-buffer org-agenda-new-buffers)
|
(mapc #'kill-buffer org-agenda-new-buffers)
|
||||||
(setq org-agenda-new-buffers nil))))
|
(setq org-agenda-new-buffers nil))))
|
||||||
|
|
||||||
|
@ -175,7 +173,7 @@ selection of all minor-modes, active or not."
|
||||||
"troubleshooting.org"
|
"troubleshooting.org"
|
||||||
"tutorials.org"
|
"tutorials.org"
|
||||||
"faq.org")
|
"faq.org")
|
||||||
2 nil t))))
|
2 t))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/help-faq ()
|
(defun doom/help-faq ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue