From 06be7163b4d5e7d2e2d65f604bf2098bdba969f2 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 28 Jan 2022 22:58:07 +0000 Subject: Slightly better default project default function --- elisp/geiser-repl.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'elisp') diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index ede0bef..b30d5fc 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -1,6 +1,6 @@ ;;; geiser-repl.el --- Geiser's REPL -;; Copyright (C) 2009-2022 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009-2013, 2015-2016, 2018-2022 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -54,16 +54,18 @@ used to discover a buffer's project." (declare project-root "project.el") (declare project-current "project.el") -(defun geiser-repl--project () - (when-let (p (project-current)) (project-root p))) +(defun geiser-repl-project-root () + "Use project.el, when available, to determine a buffer's project root." + (when (featurep 'project) + (when-let (p (project-current)) (project-root p)))) (geiser-custom--defcustom geiser-repl-current-project-function - (if (featurep 'project) #'geiser-repl--project 'ignore) + #'geiser-repl-project-root "Function used to determine the current project. The function is called from both source and REPL buffers, and should return a value which uniquely identifies the project." :type '(choice (function-item :tag "Ignore projects" ignore) - (function-item :tag "Use Project.el" geiser-repl--project) + (function-item :tag "Use Project.el" geiser-repl-project-root) (function-item :tag "Use Projectile" projectile-project-root) (function :tag "Other function"))) -- cgit v1.2.3