commit d3b75e45b97b751793f44f1c4ee41ee7a95dd1a6
parent e523816eca6461ef5d83d76254423257d34c7cf6
Author: Vincent Demeester <vincent@sbr.pm>
Date: Mon, 22 Aug 2022 16:14:43 +0200
tools/emacs: fix project-current mismatch between emacs versions
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/emacs/config/config-projects.el b/tools/emacs/config/config-projects.el
@@ -36,12 +36,15 @@
:init
(setq-default project-compilation-buffer-name-function 'project-prefixed-buffer-name)
+ (defun vde-project--project-current ()
+ "Return directory from `project-current' based on Emacs version."
+ (if (>= emacs-major-version 29)
+ (project-root (project-current))
+ (cdr (project-current))))
(defun vde-project-magit-status ()
"Run `magit-status' on project."
(interactive)
- (let* ((pr (project-current t))
- (dir (cdr pr)))
- (magit-status dir)))
+ (magit-status (vde-project--project-current)))
(defun vde-project-vterm ()
"Run `vterm' on project.