home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

project-func.el (620B)


      1 ;;; project-func.el --- -*- lexical-binding: t -*-
      2 ;;; Commentary:
      3 ;;; Code:
      4 (require 'project)
      5 
      6 ;;;###autoload
      7 (defun vde-project--project-current ()
      8   "Return directory from `project-current' based on Emacs version."
      9   (if (>= emacs-major-version 29)
     10       (project-root (project-current))
     11     (cdr (project-current))))
     12 
     13 (defun vde-project--project-root-or-default-directory ()
     14   "Return path to the project root *or* the default-directory."
     15   (cond
     16    ((and (featurep 'project) (project-current))
     17     (project-root (project-current)))
     18    (t default-directory)))
     19 
     20 (provide 'project-func)
     21 ;;; project-func.el ends here