|
7 | 7 | ;; Version: 0.0.1 |
8 | 8 | ;; Keywords: project, convenience |
9 | 9 | ;; Homepage: https://github.com/zonuexe/projectile-variable |
10 | | -;; Package-Requires: ((emacs "24") (cl-lib "0.5") (projectile "0.14.0")) |
| 10 | +;; Package-Requires: ((emacs "24") (cl-lib "0.5")) |
11 | 11 |
|
12 | 12 | ;; This file is NOT part of GNU Emacs. |
13 | 13 |
|
|
41 | 41 |
|
42 | 42 | ;;; Code: |
43 | 43 | (require 'cl-lib) |
44 | | -(require 'projectile) |
| 44 | +(require 'projectile nil t) |
45 | 45 |
|
46 | 46 | (defconst projectile-variable--prefix "projectile-variable--") |
47 | 47 |
|
| 48 | +(defgroup projectile-variable nil |
| 49 | + "Store project local variables." |
| 50 | + :group 'lisp |
| 51 | + :prefix "projectile-variable-") |
| 52 | + |
| 53 | +(defcustom projectile-variable-default-project-root-function #'projectile-project-root |
| 54 | + "Default function to retrieve root directory." |
| 55 | + :type 'function) |
| 56 | + |
| 57 | +(defvar projectile-variable-project-root-function nil) |
| 58 | + |
| 59 | +(defun projectile-variable--get-root () |
| 60 | + "Return path to root directory the project." |
| 61 | + (if projectile-variable-project-root-function |
| 62 | + (funcall projectile-variable-project-root-function) |
| 63 | + (if (fboundp projectile-variable-default-project-root-function) |
| 64 | + (funcall projectile-variable-default-project-root-function) |
| 65 | + (error "Function `%s' is not exists" projectile-variable-default-project-root-function)))) |
| 66 | + |
48 | 67 | (defun projectile-variable--make-symbol () |
49 | 68 | "Make symbol for save project local variable." |
50 | | - (intern (concat projectile-variable--prefix (projectile-project-root)))) |
| 69 | + (intern (concat projectile-variable--prefix (projectile-variable--get-root)))) |
51 | 70 |
|
52 | 71 | (defun projectile-variable-plist (&optional prefix) |
53 | 72 | "Return project local property list. Fiter properties by prefix if PREFIX is not nil." |
|
0 commit comments