diff options
Diffstat (limited to '.emacs.d/lisp/init-project.el')
-rw-r--r-- | .emacs.d/lisp/init-project.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/.emacs.d/lisp/init-project.el b/.emacs.d/lisp/init-project.el index 3e847da..e66a4cd 100644 --- a/.emacs.d/lisp/init-project.el +++ b/.emacs.d/lisp/init-project.el @@ -5,16 +5,17 @@ (require 'subr-x) (use-package project + :ensure (:ref "87db670d045bea2d90139b1f741eea8db7c193ea" :pin t) :config (defun project--clojure-switch-to-test (filename project-root) (let* ((project-src-file (string-remove-prefix project-root filename)) (project-test-file (replace-regexp-in-string "\.clj$" "_test.clj" - (replace-regexp-in-string "^src/" "test/" project-src-file)))) + (replace-regexp-in-string "^src/" "test/" project-src-file)))) (find-file (expand-file-name project-test-file project-root)))) (defun project--clojure-switch-to-src (test-filename project-root) (let* ((project-test-file (string-remove-prefix project-root test-filename)) (project-src-file (replace-regexp-in-string "_test\.clj$" ".clj" - (replace-regexp-in-string "^test/" "src/" project-test-file)))) + (replace-regexp-in-string "^test/" "src/" project-test-file)))) (find-file (expand-file-name project-src-file project-root)))) (defun project-clojure-test-switch () (interactive) @@ -28,14 +29,18 @@ "Show a list of recently visited files in a project." (interactive) (if (boundp 'recentf-list) + ;; Use expand-file-name for project-root and later recentf-list to ensure consistency (let* ((project-root (expand-file-name (project-root (project-current)))) (project-recentf-files (mapcar (lambda (f) (file-relative-name f project-root)) - (seq-filter (apply-partially 'string-prefix-p project-root) recentf-list)))) + (seq-filter (apply-partially 'string-prefix-p project-root) + (mapcar 'expand-file-name recentf-list))))) (find-file (expand-file-name (funcall project-read-file-name-function "Find recent project files" - project-recentf-files) + project-recentf-files + nil + 'file-name-history) project-root))) (message "recentf is not enabled"))) (defun project-switch-src-project () @@ -136,7 +141,7 @@ mode as the current buffer (or do nothing)." :bind ("C-x p p" . switch-project) - ("C-c C-M-j" . persp-switch-to-previous-buffer) + ("C-c C-M-b" . persp-switch-to-previous-buffer) ("C-x C-b" . persp-previous-buffer-same-mode) ("C-x 4 C-b" . persp-previous-buffer-same-mode-other-window) ("C-x C-S-b" . persp-switch-buffer-same-mode) |