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

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

[nongnu] elpa/inf-clojure 1f6f949 019/313: Add command inf-clojure-set-n


From: ELPA Syncer
Subject: [nongnu] elpa/inf-clojure 1f6f949 019/313: Add command inf-clojure-set-ns
Date: Wed, 11 Aug 2021 09:59:38 -0400 (EDT)

branch: elpa/inf-clojure
commit 1f6f94916c5f34496509e330ea6d22caf10eb9d0
Author: Bozhidar Batsov <bozhidar@tradeo.com>
Commit: Bozhidar Batsov <bozhidar@tradeo.com>

    Add command inf-clojure-set-ns
---
 inf-clojure.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/inf-clojure.el b/inf-clojure.el
index a1fe136..70ad7c6 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -102,6 +102,7 @@ mode.  Default is whitespace followed by 0 or 1 
single-letter colon-keyword
     (define-key map "\C-c\C-a" 'inf-clojure-show-arglist)
     (define-key map "\C-c\C-v" 'inf-clojure-show-var-documentation)
     (define-key map "\C-c\C-s" 'inf-clojure-show-var-source)
+    (define-key map "\C-c\M-n" 'inf-clojure-set-ns)
     map))
 
 ;;;###autoload
@@ -403,6 +404,10 @@ Used by this command to determine defaults."
   "(clojure.repl/dir %s)\n"
   "Command to show the public vars in a namespace.")
 
+(defvar inf-clojure-set-ns-command
+  "(clojure.core/in-ns '%s)\n"
+  "Command to set the namespace of the inferior Clojure process.")
+
 (defvar inf-clojure-apropos-command
   "(doseq [var (sort (clojure.repl/apropos \"%s\"))]
      (println (str var)))\n"
@@ -479,6 +484,12 @@ See variable `inf-clojure-ns-vars-command'."
   (interactive (inf-clojure-symprompt "Ns vars" (clojure-find-ns)))
   (comint-proc-query (inf-clojure-proc) (format inf-clojure-ns-vars-command 
ns)))
 
+(defun inf-clojure-set-ns (ns)
+  "Set the ns of the inferior Clojure process to NS.
+Defaults to the ns of the current buffer."
+  (interactive (inf-clojure-symprompt "Set ns to" (clojure-find-ns)))
+  (comint-proc-query (inf-clojure-proc) (format inf-clojure-set-ns-command 
ns)))
+
 (defun inf-clojure-apropos (var)
   "Send a command to the inferior Clojure to give apropos for VAR.
 See variable `inf-clojure-apropos-command'."



reply via email to

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