[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a6f3b89 05/22: diff-hl-dired: Highlight ignored files
From: |
Dmitry Gutov |
Subject: |
[elpa] master a6f3b89 05/22: diff-hl-dired: Highlight ignored files |
Date: |
Fri, 02 Jan 2015 23:46:27 +0000 |
branch: master
commit a6f3b89590c35795a2874fcc5e7f452cc23a11ed
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
diff-hl-dired: Highlight ignored files
#25
---
diff-hl-dired.el | 34 ++++++++++++++++++++++++++++++----
diff-hl.el | 1 +
2 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/diff-hl-dired.el b/diff-hl-dired.el
index 928bb9c..2bbf12b 100644
--- a/diff-hl-dired.el
+++ b/diff-hl-dired.el
@@ -49,6 +49,10 @@
'((default :inherit diff-header))
"Face used to highlight unregistered files.")
+(defface diff-hl-dired-ignored
+ '((default :inherit shadow))
+ "Face used to highlight unregistered files.")
+
;;;###autoload
(define-minor-mode diff-hl-dired-mode
"Toggle VC diff highlighting on the side of a Dired window."
@@ -79,7 +83,7 @@
(erase-buffer)
(vc-call-backend
backend 'dir-status def-dir
- (lambda (entries &optional _more-to-come)
+ (lambda (entries &optional more-to-come)
(with-current-buffer buffer
(dolist (entry entries)
(cl-destructuring-bind (file state &rest) entry
@@ -95,12 +99,34 @@
(push (cons dir type) dirs-alist)
(setcdr (assoc dir dirs-alist) 'change))))
(push (cons file type) files-alist)))))
- ;; Process's finished, time to use the results.
- (unless (get-buffer-process diff-hl-dired-process-buffer)
+ (unless more-to-come
(diff-hl-dired-highlight-items (append dirs-alist
- files-alist)))))
+ files-alist))
+ (diff-hl-dired-update-ignores backend def-dir))))
)))))
+(defun diff-hl-dired-update-ignores (backend def-dir)
+ (let ((buffer (current-buffer))
+ entries-alist)
+ (with-current-buffer diff-hl-dired-process-buffer
+ (erase-buffer)
+ (vc-call-backend
+ backend 'dir-status-files def-dir
+ (cl-loop for file in (directory-files def-dir)
+ unless (member file '("." ".."))
+ collect file)
+ nil
+ (lambda (entries &optional more-to-come)
+ (with-current-buffer buffer
+ (dolist (entry entries)
+ (cl-destructuring-bind (file state &rest) entry
+ (when (eq state 'ignored)
+ (push (cons (directory-file-name file)
+ 'ignored) entries-alist))))
+ (unless more-to-come
+ (diff-hl-dired-highlight-items entries-alist))))
+ ))))
+
(defun diff-hl-dired-highlight-items (alist)
"Highlight ALIST containing (FILE . TYPE) elements."
(dolist (pair alist)
diff --git a/diff-hl.el b/diff-hl.el
index 258e48a..2488f4d 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -184,6 +184,7 @@
(cl-case type
(unknown 'question-mark)
(change 'exclamation-mark)
+ (ignored 'filled-square)
(t (intern (format "diff-hl-bmp-%s" type)))))
(defvar vc-svn-diff-switches)
- [elpa] master updated (c9c9f55 -> 8cec226), Dmitry Gutov, 2015/01/02
- [elpa] master c246d44 02/22: diff-hl-define-bitmaps: Handle text scaling and line spacing better, Dmitry Gutov, 2015/01/02
- [elpa] master ecc7fc3 03/22: diff-hl-fringe-bmp-from-type: Use `exclamation-mark', Dmitry Gutov, 2015/01/02
- [elpa] master 03531f2 04/22: Add and use fringe faces specific to diff-hl-dired, Dmitry Gutov, 2015/01/02
- [elpa] master a6f3b89 05/22: diff-hl-dired: Highlight ignored files,
Dmitry Gutov <=
- [elpa] master 27b3adb 06/22: Check if the original Dired buffer is still alive, Dmitry Gutov, 2015/01/02
- [elpa] master 50e88c2 07/22: Work around debbugs.gnu.org/18605, Dmitry Gutov, 2015/01/02
- [elpa] master 7466986 08/22: Update copyright year, Dmitry Gutov, 2015/01/02
- [elpa] master f2546ca 09/22: diff-hl-changes: Handle diffs where only file mode changed, Dmitry Gutov, 2015/01/02
- [elpa] master 58615cd 10/22: auto-revert-mode integration, Dmitry Gutov, 2015/01/02
- [elpa] master 8dd7d96 12/22: Don't error out when fringe is disabled, Dmitry Gutov, 2015/01/02
- [elpa] master ccaca25 11/22: Merge pull request #30 from sunesimonsen/master, Dmitry Gutov, 2015/01/02
- [elpa] master 9c5004e 13/22: diff-hl-dired-{unknown, ignored}: inherit from dired-ignored instead, Dmitry Gutov, 2015/01/02
- [elpa] master 32951f0 01/22: Add link to an issue, Dmitry Gutov, 2015/01/02
- [elpa] master 788f1fd 14/22: diff-hl-dired-update-ignores: Specifically exclude .hg from iteration, Dmitry Gutov, 2015/01/02