branch: externals/ivy-hydra
commit b20a6dbc3885fc5586dd402bb9d8e0c8e7835635
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-recentf-candidates): Sort remote files better
When the file is remote, don't look at file attributes.
Doing so would require accessing the remote machine.
---
counsel.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/counsel.el b/counsel.el
index fe74515..c34de08 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2259,8 +2259,13 @@ time."
(sort (append (mapcar #'substring-no-properties recentf-list)
(counsel--recentf-get-xdg-recent-files))
(lambda (file1 file2)
- (> (time-to-seconds (file-attribute-access-time
(file-attributes file1)))
- (time-to-seconds (file-attribute-access-time
(file-attributes file2)))))))
+ (cond ((file-remote-p file1)
+ nil)
+ ((file-remote-p file2)
+ t)
+ (t
+ (> (time-to-seconds (file-attribute-access-time
(file-attributes file1)))
+ (time-to-seconds (file-attribute-access-time
(file-attributes file2)))))))))
(mapcar #'substring-no-properties recentf-list)))
(defun counsel--strip-prefix (prefix str)