[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 42fedf5 116/184: counsel.el (counsel-file-stale-p): Extrac
From: |
Oleh Krehel |
Subject: |
[elpa] master 42fedf5 116/184: counsel.el (counsel-file-stale-p): Extract |
Date: |
Wed, 16 Oct 2019 13:15:02 -0400 (EDT) |
branch: master
commit 42fedf55a6e6507623063ea6f9bfd7b093bceeeb
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-file-stale-p): Extract
---
counsel.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/counsel.el b/counsel.el
index c8567cc..1476f38 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2465,16 +2465,20 @@ string - the full shell command to run."
"Location where to put the locatedb in case your home folder is encrypted."
:type 'file)
+(defun counsel-file-stale-p (fname seconds)
+ "Return non-nil if FNAME was modified more than SECONDS ago."
+ (> (time-to-seconds
+ (time-subtract
+ (current-time)
+ (nth 5 (file-attributes fname))))
+ seconds))
+
(defun counsel--locate-updatedb ()
(when (file-exists-p "~/.Private")
(let ((db-fname (expand-file-name counsel-locate-db-path)))
(setenv "LOCATE_PATH" db-fname)
(when (or (not (file-exists-p db-fname))
- (> (time-to-seconds
- (time-subtract
- (current-time)
- (nth 5 (file-attributes db-fname))))
- 60))
+ (counsel-file-stale-p db-fname 60))
(message "Updating %s..." db-fname)
(counsel--command
"updatedb" "-l" "0" "-o" db-fname "-U" (expand-file-name "~"))))))
- [elpa] master cd7e924 077/184: ivy.el (ivy-read): Fix docstring, (continued)
- [elpa] master cd7e924 077/184: ivy.el (ivy-read): Fix docstring, Oleh Krehel, 2019/10/16
- [elpa] master da7e546 085/184: ivy.el (ivy-previous-line-and-call): Fix typo, Oleh Krehel, 2019/10/16
- [elpa] master 03fdaea 087/184: doc/ivy.org: Add more recommended key bindings, Oleh Krehel, 2019/10/16
- [elpa] master 941d408 086/184: doc/ivy.org: Fix "C-M-n" description, Oleh Krehel, 2019/10/16
- [elpa] master 4e9aaec 092/184: ivy-test: Fix tests using file names on Windows, Oleh Krehel, 2019/10/16
- [elpa] master 139816a 106/184: counsel.el (counsel-mark-ring): Add the latest mark to selection, Oleh Krehel, 2019/10/16
- [elpa] master 9592cba 101/184: ivy-hydra.el: Use ivy-read-action-by-key in hydra-ivy, Oleh Krehel, 2019/10/16
- [elpa] master 79333e9 099/184: counsel.el (counsel-fonts): Add, Oleh Krehel, 2019/10/16
- [elpa] master 89deb75 096/184: counsel.el (counsel-rg): When in dired, operate on marked files, Oleh Krehel, 2019/10/16
- [elpa] master 4cddec4 102/184: Respect counsel-describe-function-function from counsel-M-x, Oleh Krehel, 2019/10/16
- [elpa] master 42fedf5 116/184: counsel.el (counsel-file-stale-p): Extract,
Oleh Krehel <=
- [elpa] master 0895c1a 113/184: Add key binding to allow switching directory in counsel-git-grep, Oleh Krehel, 2019/10/16
- [elpa] master d27eb38 119/184: counsel.el (counsel-git-grep): Change args order so counsel-cd works, Oleh Krehel, 2019/10/16
- [elpa] master 582c9d4 014/184: swiper.el (swiper--candidates): Don't store line number as a string, Oleh Krehel, 2019/10/16
- [elpa] master 4a44c9e 018/184: counsel.el (counsel--async-last-error-string): Add for ease of debugging, Oleh Krehel, 2019/10/16
- [elpa] master 5e79f16 020/184: ivy.el (ivy--input): Fix point moving in TRAMP sessions, Oleh Krehel, 2019/10/16
- [elpa] master f30c6e1 022/184: swiper.el: Fix overlay faces using regex-ignore-order, Oleh Krehel, 2019/10/16
- [elpa] master 9c4cdb7 025/184: swiper.el (swiper-isearch-action): Fix for ivy-occur, Oleh Krehel, 2019/10/16
- [elpa] master ed1ba4e 028/184: Makefile (deps): Add target, Oleh Krehel, 2019/10/16
- [elpa] master b5e869e 026/184: swiper.el (swiper--occur-cands): Fix wgrep, Oleh Krehel, 2019/10/16
- [elpa] master 6928beb 031/184: ivy-test.el (ivy-read-file-name-in-buffer-visiting-file): Passes, Oleh Krehel, 2019/10/16