summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-01-28 22:58:07 +0000
committerjao <jao@gnu.org>2022-01-28 22:58:07 +0000
commit06be7163b4d5e7d2e2d65f604bf2098bdba969f2 (patch)
tree9fa0577331b8ee3f95f0cc28c51579db17e6a244
parentbb9d5cb200a5c0410af4eb63d244e5445614366c (diff)
downloadgeiser-06be7163b4d5e7d2e2d65f604bf2098bdba969f2.tar.gz
geiser-06be7163b4d5e7d2e2d65f604bf2098bdba969f2.tar.bz2
Slightly better default project default function
-rw-r--r--elisp/geiser-repl.el12
1 files changed, 7 insertions, 5 deletions
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")))