branch: elpa/javelin
commit 13c92e8b52408df5c0dcac4d8a8627f232b611c0
Author: Otávio Schwanck dos Santos <[email protected]>
Commit: Otávio Schwanck dos Santos <[email protected]>
remove projectile dependency
---
README.org | 8 ++++++--
harpoon.el | 11 +++++++----
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/README.org b/README.org
index b317efaea33..d53289427c2 100644
--- a/README.org
+++ b/README.org
@@ -67,8 +67,12 @@ Example of how to set the shortcuts:
* Customizing
You can customize by setting this variable:
-| Variable | Description | Default |
-| harpoon-separate-by-branch | If nil, ignores the branch | t |
+| Variable | Description | Default
|
+| harpoon-separate-by-branch | If nil, ignores the branch | t
|
+| harpoon-project-name-function | Function to get project name |
'projectile-project-name |
+
+* For project.el users
+
* My other works:
** Rails i18n:
diff --git a/harpoon.el b/harpoon.el
index ed3814b62e5..72f2ecdf9a7 100644
--- a/harpoon.el
+++ b/harpoon.el
@@ -6,7 +6,7 @@
;; Keywords: tools languages
;; Homepage: https://github.com/otavioschwanck/harpoon.el
;; Version: 0.3
-;; Package-Requires: ((emacs "27.2") (projectile "2.5.0") (magit "3.3.0") (f
"0.20.0"))
+;; Package-Requires: ((emacs "27.2") (magit "3.3.0") (f "0.20.0"))
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -29,7 +29,6 @@
;; separated by project and branch.
;;; Code:
-(require 'projectile)
(require 'magit)
(require 'f)
@@ -45,6 +44,10 @@
"Where the cache will be saved."
:type 'string)
+(defcustom harpoon-project-name-function 'projectile-project-name
+ "Function used to get project name."
+ :type 'symbol)
+
(defcustom harpoon-separate-by-branch t
"Harpoon separated by branch."
:type 'boolean)
@@ -64,10 +67,10 @@
(defun harpoon--cache-key ()
"Key to save current file on cache."
(if harpoon-separate-by-branch
- (concat (harpoon--sanitize (projectile-project-name))
+ (concat (harpoon--sanitize (funcall harpoon-project-name-function))
"#"
(harpoon--sanitize (magit-get-current-branch)))
- (harpoon--sanitize (projectile-project-name))))
+ (harpoon--sanitize (funcall harpoon-project-name-function))))
(defun harpoon--create-directory ()
"Create harpoon cache dir if doesn't exist."