-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #4 use project-root[s] to get project root
- Loading branch information
Showing
1 changed file
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
;; Author: Andrii Kolomoiets <[email protected]> | ||
;; Keywords: tools | ||
;; URL: https://github.com/muffinmad/emacs-ibuffer-project | ||
;; Package-Version: 2.0 | ||
;; Package-Version: 2.1 | ||
;; Package-Requires: ((emacs "25.1")) | ||
|
||
;; This file is NOT part of GNU Emacs. | ||
|
@@ -75,6 +75,7 @@ | |
|
||
(require 'ibuffer) | ||
(require 'ibuf-ext) | ||
(require 'project) | ||
|
||
(defgroup ibuffer-project nil | ||
"Group ibuffer entries by project." | ||
|
@@ -98,7 +99,15 @@ To clear cache use `ibuffer-project-clear-cache' command." | |
(ibuffer-project-clear-cache) | ||
(set-default s v)) | ||
|
||
(defcustom ibuffer-project-root-functions '(((lambda (dir) (cdr (project-current nil dir))) . "Project") | ||
(defun ibuffer-project-project-root (dir) | ||
"Get project root in DIR." | ||
(let ((project (project-current nil dir))) | ||
(and project | ||
(if (functionp 'project-root) | ||
(project-root project) | ||
(car (project-roots project)))))) | ||
|
||
(defcustom ibuffer-project-root-functions '((ibuffer-project-project-root . "Project") | ||
(identity . "Directory")) | ||
"Functions to get root to group by. | ||
Cons of each item can be: | ||
|