Skip to content

Commit

Permalink
Restore compatibility with project.el before Emacs 29.1 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrick authored Feb 23, 2024
1 parent ad67176 commit 0189963
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions activity-watch-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,12 @@ use it to find the project's name." docstring)
,@body)))))

(activity-watch--gen-feature-resolver 'project project
(when (project-current)
(project-name (project-current))))
(when-let ((project (project-current)))
(if (fboundp 'project-name)
;; `project-name' is a generic function added in Emacs 29.1
(project-name project)
;; For earlier versions, use the generic function's default definition
(file-name-nondirectory (directory-file-name (first (project-roots project)))))))

(activity-watch--gen-feature-resolver 'projectile projectile
(when (projectile-project-p)
Expand Down

0 comments on commit 0189963

Please sign in to comment.