(internal): revert completions from hash table to alist (#643)

Initially we thought that using hash-tables would shave some seconds
because searching for a key is O(1), but when we present completions, we
typically want them sorted, and hash-tables do not support sorted keys.

Co-authored-by: Leo Vivier <leo.vivier+dev@gmail.com>
This commit is contained in:
Jethro Kuan
2020-05-16 18:17:37 +08:00
committed by GitHub
parent 1267a43043
commit 8091f4598e
2 changed files with 14 additions and 16 deletions

View File

@ -333,7 +333,7 @@ This uses the templates defined at `org-roam-capture-templates'."
(let* ((completions (org-roam--get-title-path-completions))
(title-with-keys (org-roam-completion--completing-read "File: "
completions))
(res (gethash title-with-keys completions))
(res (cdr (assoc title-with-keys completions)))
(title (plist-get res :title))
(file-path (plist-get res :file-path)))
(let ((org-roam-capture--info (list (cons 'title title)