summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2023-10-01 20:32:31 +0100
committerjao <jao@gnu.org>2023-10-01 20:32:31 +0100
commit58bd510da5d09d9de52f4a6e60882b35445ca17a (patch)
tree5650a29c80b4635740f3e5d209d64a537c7f6eae /elisp
parent5575975b5a4ff774768f48d6b014d62198b1fe47 (diff)
downloadgeiser-58bd510da5d09d9de52f4a6e60882b35445ca17a.tar.gz
geiser-58bd510da5d09d9de52f4a6e60882b35445ca17a.tar.bz2
fix: better error message for symbol not found on M-.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-edit.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el
index fbe625f..0f2b080 100644
--- a/elisp/geiser-edit.el
+++ b/elisp/geiser-edit.el
@@ -1,6 +1,6 @@
;;; geiser-edit.el -- scheme edit locations -*- lexical-binding: t; -*-
-;; Copyright (C) 2009, 2010, 2012, 2013, 2019-2022 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2012, 2013, 2019-2023 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
@@ -148,10 +148,10 @@ or following links in error buffers.")
(error "Couldn't find location for '%s'" symbol)))))
(defsubst geiser-edit--try-edit (symbol ret &optional method no-error)
- (geiser-edit--try-edit-location symbol
- (geiser-eval--retort-result ret)
- method
- no-error))
+ (let ((res (geiser-eval--retort-result ret)))
+ (if (listp res)
+ (geiser-edit--try-edit-location symbol res method no-error)
+ (unless no-error (error "Couldn't find location for '%s'" symbol)))))
;;; Links
@@ -292,11 +292,11 @@ With prefix, asks for the symbol to locate."
"Opens a new window visiting the module at point."
(interactive)
(let ((marker (point-marker)))
- (geiser-edit-module (or (geiser-completion--module-at-point)
- (geiser-completion--read-module))
- nil no-error)
- (when marker (xref-push-marker-stack marker))
- t))
+ (when (geiser-edit-module (or (geiser-completion--module-at-point)
+ (geiser-completion--read-module))
+ nil no-error)
+ (when marker (xref-push-marker-stack marker))
+ t)))
(defun geiser-insert-lambda (&optional full)
"Insert λ at point. With prefix, inserts (λ ())."