mirror of
https://github.com/org-roam/org-roam
synced 2025-08-03 12:27:23 -05:00
(fix): fix sort by mtime in completions (#1087)
This commit is contained in:
16
org-roam.el
16
org-roam.el
@ -859,10 +859,10 @@ to the file."
|
|||||||
:left :join files
|
:left :join files
|
||||||
:on (= titles:file files:file)]))
|
:on (= titles:file files:file)]))
|
||||||
completions)
|
completions)
|
||||||
(seq-sort-by (lambda (x)
|
(setq rows (seq-sort-by (lambda (x)
|
||||||
(plist-get (nth 3 x) :mtime))
|
(plist-get (nth 3 x) :mtime))
|
||||||
#'time-less-p
|
#'time-less-p
|
||||||
rows)
|
rows))
|
||||||
(dolist (row rows completions)
|
(dolist (row rows completions)
|
||||||
(pcase-let ((`(,file-path ,title ,tags) row))
|
(pcase-let ((`(,file-path ,title ,tags) row))
|
||||||
(let ((k (org-roam--prepend-tag-string title tags))
|
(let ((k (org-roam--prepend-tag-string title tags))
|
||||||
@ -915,10 +915,10 @@ FILTER can either be a string or a function:
|
|||||||
:left :join refs :on (= titles:file refs:file)
|
:left :join refs :on (= titles:file refs:file)
|
||||||
:where refs:file :is :not :null]))
|
:where refs:file :is :not :null]))
|
||||||
completions)
|
completions)
|
||||||
(seq-sort-by (lambda (x)
|
(setq rows (seq-sort-by (lambda (x)
|
||||||
(plist-get (nth 3 x) :mtime))
|
(plist-get (nth 3 x) :mtime))
|
||||||
#'time-less-p
|
#'time-less-p
|
||||||
rows)
|
rows))
|
||||||
(dolist (row rows completions)
|
(dolist (row rows completions)
|
||||||
(pcase-let ((`(,type ,ref ,file-path ,title ,tags) row))
|
(pcase-let ((`(,type ,ref ,file-path ,title ,tags) row))
|
||||||
(when (pcase filter
|
(when (pcase filter
|
||||||
|
Reference in New Issue
Block a user