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

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

[nongnu] elpa/inf-clojure 52f9404 016/313: Add apropos command


From: ELPA Syncer
Subject: [nongnu] elpa/inf-clojure 52f9404 016/313: Add apropos command
Date: Wed, 11 Aug 2021 09:59:37 -0400 (EDT)

branch: elpa/inf-clojure
commit 52f940437524ed2dbde81869d796a3d125022fb1
Author: Bozhidar Batsov <bozhidar@batsov.com>
Commit: Bozhidar Batsov <bozhidar@batsov.com>

    Add apropos command
---
 inf-clojure.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/inf-clojure.el b/inf-clojure.el
index cfe7c4a..78a0d1a 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -100,6 +100,7 @@ mode.  Default is whitespace followed by 0 or 1 
single-letter colon-keyword
     (define-key map "\C-c\C-v" 'clojure-show-var-documentation)
     (define-key map "\C-c\C-s" 'clojure-show-var-source)
     (define-key map "\C-c\C-i" 'clojure-show-ns-vars)
+    (define-key map "\C-c\C-A" 'clojure-apropos)
     map))
 
 ;;;###autoload
@@ -401,6 +402,11 @@ Used by this command to determine defaults."
   "(clojure.repl/dir %s)\n"
   "Command to show the public vars in a namespace.")
 
+(defvar clojure-apropos-command
+  "(doseq [var (sort (clojure.repl/apropos \"%s\"))]
+     (println (str var)))\n"
+  "Command to invoke apropos.")
+
 ;;; Ancillary functions
 ;;; ===================
 
@@ -466,6 +472,12 @@ See variable `clojure-ns-vars-command'."
   (interactive (clojure-symprompt "Ns vars" (clojure-find-ns)))
   (comint-proc-query (inf-clojure-proc) (format clojure-ns-vars-command ns)))
 
+(defun clojure-apropos (var)
+  "Send a command to the inferior Clojure to give apropos for VAR.
+See variable `clojure-apropos-command'."
+  (interactive (clojure-symprompt "Var apropos" (clojure-var-at-pt)))
+  (comint-proc-query (inf-clojure-proc) (format clojure-apropos-command var)))
+
 
 ;;  "Returns the current inferior Clojure process.
 ;; See variable `inf-clojure-buffer'."



reply via email to

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