Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix #451] respect project root dir suggested by custom function #452

Merged
merged 6 commits into from
Oct 8, 2017
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ Out-of-the box `clojure-mode' understands lein, boot and gradle."
(and (listp value)
(cl-every 'stringp value))))

(defcustom clojure-project-root-function 'clojure-project-root-path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the ' to a #'

"Function to locate clojure project root directory."
:type 'function
:risky t
:package-version '(clojure-mode . "5.7.0"))

(defcustom clojure-refactor-map-prefix (kbd "C-c C-r")
"Clojure refactor keymap prefix."
:type 'string
Expand Down Expand Up @@ -1600,6 +1606,13 @@ nil."
(defun clojure-project-dir (&optional dir-name)
"Return the absolute path to the project's root directory.

Call is delegated down to `clojure-project-root-function' with
optional DIR-NAME as argument."
(funcall clojure-project-root-function dir-name))

(defun clojure-project-root-path (&optional dir-name)
"Return the absolute path to the project's root directory.

Use `default-directory' if DIR-NAME is nil.
Return nil if not inside a project."
(let* ((dir-name (or dir-name default-directory))
Expand Down