From f487ef185c1ec0fc8bcc3ae3d40ba47f07a7ec6e Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Sat, 20 Feb 2021 09:37:36 -0800 Subject: [PATCH] Fix build for emacs-master --- apheleia.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apheleia.el b/apheleia.el index 56c3990..16d4c1a 100644 --- a/apheleia.el +++ b/apheleia.el @@ -43,7 +43,13 @@ then `projectile' (if the latter is installed), before falling back to `default-directory'." (expand-file-name (if-let ((project (project-current))) - (car (project-roots project)) + ;; `project-roots' was replaced with `project-root' in Emacs + ;; 28, and the former function deprecated. Use whichever one is + ;; available and non-deprecated. + (with-no-warnings + (if (fboundp 'project-root) + (project-root project) + (car (project-roots project)))) (or (and (require 'projectile nil 'noerror) (projectile-project-root)) default-directory))))