Remove org link syntax from help search commands

And prevent ivy sorting them.
This commit is contained in:
Henrik Lissner 2019-05-19 19:15:29 -04:00
parent 9d5e8fdda4
commit 8aa6273dcf
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -146,7 +146,7 @@ selection of all minor-modes, active or not."
(list (or (+org-get-property "TITLE") (list (or (+org-get-property "TITLE")
(file-relative-name buffer-file-name)))) (file-relative-name buffer-file-name))))
path path
(list text)) (list (replace-regexp-in-string org-any-link-re "\\4" text)))
" > ") " > ")
tags) tags)
" ") " ")
@ -158,15 +158,16 @@ selection of all minor-modes, active or not."
;;;###autoload ;;;###autoload
(defun doom-completing-read-org-headings (prompt files &optional depth include-files initial-input) (defun doom-completing-read-org-headings (prompt files &optional depth include-files initial-input)
"TODO" "TODO"
(if-let* ((result (completing-read (let (ivy-sort-functions-alist)
prompt (if-let* ((result (completing-read
(doom--org-headings files depth include-files) prompt
nil nil initial-input))) (doom--org-headings files depth include-files)
(cl-destructuring-bind (file . location) nil nil initial-input)))
(get-text-property 0 'location result) (cl-destructuring-bind (file . location)
(find-file file) (get-text-property 0 'location result)
(goto-char location)) (find-file file)
(user-error "Aborted"))) (goto-char location))
(user-error "Aborted"))))
;;;###autoload ;;;###autoload
(defun doom/help () (defun doom/help ()
@ -178,16 +179,15 @@ selection of all minor-modes, active or not."
(defun doom/help-search (&optional initial-input) (defun doom/help-search (&optional initial-input)
"Search Doom's documentation and jump to a headline." "Search Doom's documentation and jump to a headline."
(interactive) (interactive)
(let (ivy-sort-functions-alist) (doom-completing-read-org-headings
(doom-completing-read-org-headings "Find in Doom help: "
"Find in Doom help: " (list "getting_started.org"
(list "getting_started.org" "contributing.org"
"contributing.org" "troubleshooting.org"
"troubleshooting.org" "tutorials.org"
"tutorials.org" "faq.org"
"faq.org" "../modules/README.org")
"../modules/README.org") 2 t initial-input))
2 t initial-input)))
;;;###autoload ;;;###autoload
(defun doom/help-faq (&optional initial-input) (defun doom/help-faq (&optional initial-input)