emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/sweeprolog f82827fdb0 093/166: ENHANCED: Display message i


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog f82827fdb0 093/166: ENHANCED: Display message if unable to find predicate location
Date: Fri, 30 Sep 2022 04:59:29 -0400 (EDT)

branch: elpa/sweeprolog
commit f82827fdb08a4d8c4bf159368a4372247164e9cb
Author: James N. V. Cash <james.cash@occasionallycogent.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    ENHANCED: Display message if unable to find predicate location
---
 sweep.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/sweep.el b/sweep.el
index c10870f541..9dcc1166db 100644
--- a/sweep.el
+++ b/sweep.el
@@ -385,12 +385,13 @@ FLAG and VALUE are specified as strings and read as 
Prolog terms."
 MFN must be a string of the form \"M:F/N\" where M is a Prolog
 module name, F is a functor name and N is its arity."
   (interactive (list (sweep-read-predicate)))
-  (let* ((loc (sweep-predicate-location mfn))
-         (path (car loc))
-         (line (or (cdr loc) 1)))
-    (find-file path)
-    (goto-char (point-min))
-    (forward-line (1- line))))
+  (if-let ((loc (sweep-predicate-location mfn)))
+      (let ((path (car loc))
+            (line (or (cdr loc) 1)))
+        (find-file path)
+        (goto-char (point-min))
+        (forward-line (1- line)))
+    (user-error "Unable to locate predicate %s" mfn)))
 
 (defun sweep-modules-collection ()
   (sweep-open-query "user" "sweep" "sweep_modules_collection" nil)



reply via email to

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