emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c28ba11: Leave signaling the exact error to cl-generic's internal


From: Dmitry Gutov
Subject: master c28ba11: Leave signaling the exact error to cl-generic's internals
Date: Wed, 17 Mar 2021 20:35:41 -0400 (EDT)

branch: master
commit c28ba117782cd825b2a4dd6ffcc0206ecf36898e
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Leave signaling the exact error to cl-generic's internals
    
    * lisp/progmodes/project.el (project-root): Extract default
    definition to a new method, predicated on a context
    (https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00771.html).
---
 lisp/progmodes/project.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 65897b0..bd552c9 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -216,10 +216,12 @@ of the project instance object."
 It usually contains the main build file, dependencies
 configuration file, etc. Though neither is mandatory.
 
-The directory name must be absolute."
-  (if project--within-roots-fallback
-      (signal 'cl-no-applicable-method (list 'project-root project))
-    (car (project-roots project))))
+The directory name must be absolute.")
+
+(cl-defmethod project-root (project
+                            &context (project--within-roots-fallback
+                                      (eql nil)))
+  (car (project-roots project)))
 
 (cl-defgeneric project-roots (project)
   "Return the list containing the current project root.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]