Skip to content

Commit 9a2c3e7

Browse files
committed
Fix the project.el integration
Turned out that it expected as a return value a cons cell like (project-type . project-dir).
1 parent d335f9a commit 9a2c3e7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## master (unreleased)
44

5+
### Bugs fixed
6+
7+
* Fix the project.el integration.
8+
59
## 5.8.0 (2018-06-26)
610

711
### New features

clojure-mode.el

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ replacement for `cljr-expand-let`."
555555
(add-hook 'electric-indent-functions
556556
(lambda (_char) (if (clojure-in-docstring-p) 'do-indent)))
557557
;; integration with project.el
558-
(add-hook 'project-find-functions #'clojure-project-dir))
558+
(add-hook 'project-find-functions #'clojure-current-project))
559559

560560
(defcustom clojure-verify-major-mode t
561561
"If non-nil, warn when activating the wrong `major-mode'."
@@ -1665,6 +1665,16 @@ are cached in a buffer local variable (`clojure-cached-project-dir')."
16651665
(setq clojure-cached-project-dir project-dir))
16661666
project-dir))
16671667

1668+
(defun clojure-current-project (&optional dir-name)
1669+
"Return the current project as a cons cell usable by project.el.
1670+
1671+
Call is delegated down to `clojure-clojure-dir' with
1672+
optional DIR-NAME as argument."
1673+
(let ((project-dir (clojure-project-dir dir-name)))
1674+
(if project-dir
1675+
(cons 'clojure project-dir)
1676+
nil)))
1677+
16681678
(defun clojure-project-root-path (&optional dir-name)
16691679
"Return the absolute path to the project's root directory.
16701680

0 commit comments

Comments
 (0)