summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-10-14 20:40:59 -0400
committerKyle Meyer <kyle@kyleam.com>2016-10-14 20:40:59 -0400
commitf2918264af77e47f535db3c62d82c5a974634b13 (patch)
tree4c111095c8514a87ea1ce4461d56bf28d606cc71
parentb6de9b086afa46620888d647642f404a06bee857 (diff)
downloademacs.d-f2918264af77e47f535db3c62d82c5a974634b13.tar.gz
Replace projectile-kill-other-buffers with visible variant
-rw-r--r--init.el2
-rw-r--r--lisp/km-projectile.el14
2 files changed, 8 insertions, 8 deletions
diff --git a/init.el b/init.el
index 84fe57f..26455a2 100644
--- a/init.el
+++ b/init.el
@@ -799,7 +799,7 @@
("." . km/projectile-copy-project-filename-as-kill)
("e" . km/projectile-restore-thing)
("k" . km/projectile-kill-buffers)
- ("K" . km/projectile-kill-other-buffers)
+ ("K" . km/projectile-kill-nondisplayed-buffers)
("v" . km/projectile-view-file)
("w" . km/projectile-save-thing))
diff --git a/lisp/km-projectile.el b/lisp/km-projectile.el
index 79666d5..4bf38b3 100644
--- a/lisp/km-projectile.el
+++ b/lisp/km-projectile.el
@@ -180,14 +180,14 @@ Like `projectile-kill-buffers', but
(projectile-kill-buffers)))
;;;###autoload
-(defun km/projectile-kill-other-buffers ()
- "Kill all project buffers except the current one."
+(defun km/projectile-kill-nondisplayed-buffers ()
+ "Kill project buffers that aren't displayed in current frame"
(interactive)
- (let ((cbuf (current-buffer)))
- (mapc #'kill-buffer
- (cl-remove-if
- (lambda (b) (or (buffer-base-buffer b) (eq cbuf b)))
- (projectile-project-buffers)))))
+ (mapc #'kill-buffer
+ (cl-remove-if
+ (lambda (b) (or (buffer-base-buffer b)
+ (get-buffer-window b)))
+ (projectile-project-buffers))))
(provide 'km-projectile)
;;; km-projectile.el ends here