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

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

[nongnu] elpa/cider 605d409d88 1/3: Show error message if symbol is not


From: ELPA Syncer
Subject: [nongnu] elpa/cider 605d409d88 1/3: Show error message if symbol is not found on ClojureDocs (#3689)
Date: Thu, 30 May 2024 09:59:57 -0400 (EDT)

branch: elpa/cider
commit 605d409d882e3576f9847fafa06bbe2ee6053086
Author: Kato Muso <m@katomuso.io>
Commit: GitHub <noreply@github.com>

    Show error message if symbol is not found on ClojureDocs (#3689)
---
 CHANGELOG.md         |  1 +
 cider-clojuredocs.el | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 93429a3c77..12cbff8c0d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,6 +40,7 @@
 
 ### Bugs fixed
 
+- [#3689](https://github.com/clojure-emacs/cider/pull/3689): Fix 
`cider-clojuredocs-lookup` to show friendly error message if symbol is not 
found on ClojureDocs.
 - [#3673](https://github.com/clojure-emacs/cider/pull/3673): Fix buggy 
`special-display-buffer-names` check.
 - [#3659](https://github.com/clojure-emacs/cider/pull/3659): Fixes completions 
when using `flex`-like completion styles.
 - [#3600](https://github.com/clojure-emacs/cider/pull/3600): Fix scittle 
jack-in when using `cider-jack-in-clj`.
diff --git a/cider-clojuredocs.el b/cider-clojuredocs.el
index 1c7af97c45..50e7620a7a 100644
--- a/cider-clojuredocs.el
+++ b/cider-clojuredocs.el
@@ -144,14 +144,16 @@ opposite of what that option dictates."
 
 (defun cider-clojuredocs-lookup (sym)
   "Look up the ClojureDocs documentation for SYM."
-  (let ((docs (cider-sync-request:clojuredocs-lookup (cider-current-ns) sym)))
-    (pop-to-buffer (cider-create-clojuredocs-buffer 
(cider-clojuredocs--content docs)))
-    ;; highlight the symbol in question in the docs buffer
-    (highlight-regexp
-     (regexp-quote
-      (or (cadr (split-string sym "/"))
-          sym))
-     'bold)))
+  (if-let ((docs (cider-sync-request:clojuredocs-lookup (cider-current-ns) 
sym)))
+      (progn
+        (pop-to-buffer (cider-create-clojuredocs-buffer 
(cider-clojuredocs--content docs)))
+        ;; highlight the symbol in question in the docs buffer
+        (highlight-regexp
+         (regexp-quote
+          (or (cadr (split-string sym "/"))
+              sym))
+         'bold))
+    (user-error "ClojureDocs documentation for %s is not found" sym)))
 
 ;;;###autoload
 (defun cider-clojuredocs (&optional arg)



reply via email to

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