[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 27b3adb 06/22: Check if the original Dired buffer is still
From: |
Dmitry Gutov |
Subject: |
[elpa] master 27b3adb 06/22: Check if the original Dired buffer is still alive |
Date: |
Fri, 02 Jan 2015 23:46:27 +0000 |
branch: master
commit 27b3adbe7af7e720e84b4523adbc73976cccb1ed
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Check if the original Dired buffer is still alive
SVN can be awfully slow, and the user might call
`dired-find-alternate-file'.
---
diff-hl-dired.el | 56 +++++++++++++++++++++++++++--------------------------
1 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/diff-hl-dired.el b/diff-hl-dired.el
index 2bbf12b..f1effda 100644
--- a/diff-hl-dired.el
+++ b/diff-hl-dired.el
@@ -84,25 +84,26 @@
(vc-call-backend
backend 'dir-status def-dir
(lambda (entries &optional more-to-come)
- (with-current-buffer buffer
- (dolist (entry entries)
- (cl-destructuring-bind (file state &rest) entry
- (let ((type (plist-get
- '(edited change added insert removed delete
- unregistered unknown)
- state)))
- (if (string-match "\\`\\([^/]+\\)/" file)
- (let* ((dir (match-string 1 file))
- (value (cdr (assoc dir dirs-alist))))
- (unless (eq value type)
- (if (null value)
- (push (cons dir type) dirs-alist)
- (setcdr (assoc dir dirs-alist) 'change))))
- (push (cons file type) files-alist)))))
- (unless more-to-come
- (diff-hl-dired-highlight-items (append dirs-alist
- files-alist))
- (diff-hl-dired-update-ignores backend def-dir))))
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (dolist (entry entries)
+ (cl-destructuring-bind (file state &rest) entry
+ (let ((type (plist-get
+ '(edited change added insert removed delete
+ unregistered unknown)
+ state)))
+ (if (string-match "\\`\\([^/]+\\)/" file)
+ (let* ((dir (match-string 1 file))
+ (value (cdr (assoc dir dirs-alist))))
+ (unless (eq value type)
+ (if (null value)
+ (push (cons dir type) dirs-alist)
+ (setcdr (assoc dir dirs-alist) 'change))))
+ (push (cons file type) files-alist)))))
+ (unless more-to-come
+ (diff-hl-dired-highlight-items (append dirs-alist
+ files-alist))
+ (diff-hl-dired-update-ignores backend def-dir)))))
)))))
(defun diff-hl-dired-update-ignores (backend def-dir)
@@ -117,14 +118,15 @@
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))))
+ (when (buffer-live-p buffer)
+ (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)
- [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, 2015/01/02
- [elpa] master 27b3adb 06/22: Check if the original Dired buffer is still alive,
Dmitry Gutov <=
- [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
- [elpa] master 469e332 15/22: Add user option `diff-hl-dired-extra-indicators', Dmitry Gutov, 2015/01/02