[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-got dcb5b83 083/145: extract the filtering to its ow
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vc-got dcb5b83 083/145: extract the filtering to its own function |
Date: |
Thu, 9 Sep 2021 15:58:38 -0400 (EDT) |
branch: externals/vc-got
commit dcb5b83a7470b57af0f2d26f6fbe6810308b13aa
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>
extract the filtering to its own function
I got tired of `n` a millions of time when debugging
vc-got-dir-status-files, so I extracted it to its own function.
(yeah, I could have used a conditional breakpoint, but I feel this is
more readable)
---
vc-got.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index f4c2417..3dec6b9 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -407,15 +407,19 @@ files on disk."
'up-to-date
(vc-got--parse-status-char (char-after))))))))
+(defun vc-got--dir-filter-files (files)
+ "Remove ., .. and .got from FILES."
+ (cl-loop for file in files
+ unless (or (string= file "..")
+ (string= file ".")
+ (string= file ".got"))
+ collect file))
+
(defun vc-got-dir-status-files (dir files update-function)
"Build the status for FILES in DIR.
The builded result is given to the callback UPDATE-FUNCTION. If
FILES is nil, consider all the files in DIR."
- (let* ((fs (seq-filter (lambda (file)
- (and (not (string= file ".."))
- (not (string= file "."))
- (not (string= file ".got"))))
- (or files (directory-files dir))))
+ (let* ((fs (vc-got--dir-filter-files (or files (directory-files dir))))
(res (vc-got--status nil dir files)))
(cl-loop for file in fs
do (when (and (not (cdr (assoc file res #'string=)))
- [elpa] externals/vc-got 43c93a8 063/145: typo, (continued)
- [elpa] externals/vc-got 43c93a8 063/145: typo, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 6eea6cf 075/145: drop unnecessary `:group's directive in defcustom, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 8ed796d 062/145: vc-got-dir-status-files: show changes in subdirs, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got ffa81a1 067/145: typo, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 6b6c8a7 064/145: fundamentals for staging changes, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 93562d9 073/145: fix default directory during stage operation, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 67332ba 076/145: docs fixes, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5b4a6b9 069/145: more docs, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got a323f60 071/145: show list of files when committing staged stuff, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got daae979 066/145: implement vc-got-stage-commit to commit staged changes, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got dcb5b83 083/145: extract the filtering to its own function,
ELPA Syncer <=
- [elpa] externals/vc-got 76d978f 082/145: minor tweaks, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got cb97383 085/145: ignore ignored files but not up-to-date ones, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 445e2bd 087/145: typo, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 2d039a2 089/145: fix vc-dir listing on sub-directories, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 2b7241a 086/145: revamp readme, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5fb2f47 099/145: implement revision-completion-table, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 0a3316a 091/145: implement log-view-mode, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 8014bde 101/145: implement half create-tag, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got e9a5df0 098/145: make vc-annotate-show-diff-revision-at-line works, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 567c17a 093/145: vc-got trims '----' by itself now, ELPA Syncer, 2021/09/09