From: James N. V. Cash Date: Sun, 11 Sep 2022 12:50:58 +0000 (+0300) Subject: ENHANCED: Display message if unable to find predicate location X-Git-Tag: v0.2.0~10 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f82827fdb08a4d8c4bf159368a4372247164e9cb;p=dict.git ENHANCED: Display message if unable to find predicate location --- diff --git a/sweep.el b/sweep.el index c10870f..9dcc116 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)