emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ivy-hydra b20a6db 135/395: counsel.el (counsel-recentf-


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra b20a6db 135/395: counsel.el (counsel-recentf-candidates): Sort remote files better
Date: Thu, 25 Feb 2021 08:31:48 -0500 (EST)

branch: externals/ivy-hydra
commit b20a6dbc3885fc5586dd402bb9d8e0c8e7835635
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]