Skip to content

Commit e1ff981

Browse files
committed
[Fix #571] Remove project.el integration
Due to the caching employed by `clojure-project-dir` this was breaking project switching. As clojure-mode's project-related functionality is mostly for tools like CIDER and inf-clojure it's probably best to just leave project.el to do its own project root detection based on VCS.
1 parent 4de7e02 commit e1ff981

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
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+
### Changes
6+
7+
* [#571](https://github.com/clojure-emacs/clojure-mode/issues/571): Remove `project.el` integration.
8+
59
## 5.12.0 (2020-08-13)
610

711
### New features

clojure-mode.el

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
(require 'align)
7171
(require 'subr-x)
7272
(require 'lisp-mnt)
73-
(require 'project)
7473

7574
(declare-function lisp-fill-paragraph "lisp-mode" (&optional justify))
7675

@@ -558,9 +557,7 @@ replacement for `cljr-expand-let`."
558557
(beginning-of-line-text)
559558
(eq (get-text-property (point) 'face)
560559
'font-lock-doc-face)))
561-
'do-indent)))
562-
;; integration with project.el
563-
(add-hook 'project-find-functions #'clojure-current-project))
560+
'do-indent))))
564561

565562
(defcustom clojure-verify-major-mode t
566563
"If non-nil, warn when activating the wrong `major-mode'."
@@ -1733,16 +1730,6 @@ are cached in a buffer local variable (`clojure-cached-project-dir')."
17331730
(setq clojure-cached-project-dir project-dir))
17341731
project-dir))
17351732

1736-
(defun clojure-current-project (&optional dir-name)
1737-
"Return the current project as a cons cell usable by project.el.
1738-
1739-
Call is delegated down to `clojure-project-dir' with
1740-
optional DIR-NAME as argument."
1741-
(let ((project-dir (clojure-project-dir dir-name)))
1742-
(if project-dir
1743-
(cons 'clojure project-dir)
1744-
nil)))
1745-
17461733
(defun clojure-project-root-path (&optional dir-name)
17471734
"Return the absolute path to the project's root directory.
17481735
@@ -1756,11 +1743,6 @@ Return nil if not inside a project."
17561743
(when (> (length choices) 0)
17571744
(car (sort choices #'file-in-directory-p)))))
17581745

1759-
;; project.el integration
1760-
(cl-defmethod project-roots ((project (head clojure)))
1761-
"Return the list of directory roots of the PROJECT."
1762-
(list (cdr project)))
1763-
17641746
(defun clojure-project-relative-path (path)
17651747
"Denormalize PATH by making it relative to the project root."
17661748
(file-relative-name path (clojure-project-dir)))

0 commit comments

Comments
 (0)