;;; syd-project.el -*- lexical-binding: t; -*- (eval-when-compile (require 'cl-lib)) (require 'project) (cl-defun syd-project-root (&key (dir default-directory)) "Return the project root of DIR, or nil if DIR belongs to no project." (when-let* ((project (project-current nil dir))) (project-root project))) (defun syd-cd-project () "Change the working directory to the root of the current project." (cd (syd-project-root))) (provide 'syd-project) ;;; syd-project.el ends here