@@ -230,10 +230,11 @@ This should usually be a combination of `inf-clojure-prompt' and
230
230
`inf-clojure-subprompt' ."
231
231
:type 'regexp )
232
232
233
- (defcustom inf-clojure-prompt-on-set-ns t
233
+ (defcustom inf-clojure-prompt-on-commands t
234
234
" Controls whether to prompt when switching namespace."
235
235
:type '(choice (const :tag " always" t )
236
- (const :tag " never" nil )))
236
+ (const :tag " never" nil ))
237
+ :safe 'booleanp )
237
238
238
239
(defcustom inf-clojure-repl-use-same-window nil
239
240
" Controls whether to display the REPL buffer in the current window or not."
@@ -686,19 +687,25 @@ The value is nil if it can't find one."
686
687
(defun inf-clojure-show-var-documentation (var )
687
688
" Send a form to the inferior Clojure to give documentation for VAR.
688
689
See function `inf-clojure-var-doc-form' ."
689
- (interactive (inf-clojure-symprompt " Var doc" (inf-clojure-var-at-pt)))
690
+ (interactive (list (if inf-clojure-prompt-on-commands
691
+ (inf-clojure-symprompt " Var doc" (inf-clojure-var-at-pt))
692
+ (inf-clojure-var-at-pt))))
690
693
(comint-proc-query (inf-clojure-proc) (format (inf-clojure-var-doc-form) var)))
691
694
692
695
(defun inf-clojure-show-var-source (var )
693
- " Send a form to the inferior Clojure to give source for VAR.
694
- See variable `inf-clojure-var-source-form' ."
695
- (interactive (inf-clojure-symprompt " Var source" (inf-clojure-var-at-pt)))
696
+ " Send a command to the inferior Clojure to give source for VAR.
697
+ See variable `inf-clojure-var-source-command' ."
698
+ (interactive (list (if inf-clojure-prompt-on-commands
699
+ (inf-clojure-symprompt " Var source" (inf-clojure-var-at-pt))
700
+ (inf-clojure-var-at-pt))))
696
701
(comint-proc-query (inf-clojure-proc) (format inf-clojure-var-source-form var)))
697
702
698
703
(defun inf-clojure-arglist (fn )
699
704
" Send a query to the inferior Clojure for the arglist for function FN.
700
705
See variable `inf-clojure-arglist-form' ."
701
- (interactive (inf-clojure-symprompt " Arglist" (inf-clojure-fn-called-at-pt)))
706
+ (interactive (list (if inf-clojure-prompt-on-commands
707
+ (inf-clojure-symprompt " Arglist" (inf-clojure-fn-called-at-pt))
708
+ (inf-clojure-fn-called-at-pt))))
702
709
(let* ((proc (inf-clojure-proc))
703
710
(comint-filt (process-filter proc))
704
711
(kept " " )
@@ -709,29 +716,32 @@ See variable `inf-clojure-arglist-form'."
709
716
(process-send-string proc eldoc-snippet)
710
717
(while (and (not (string-match inf-clojure-prompt kept))
711
718
(accept-process-output proc 2 )))
712
- (setq eldoc (and (string-match " (.+)" kept) (match-string 0 kept)))
713
- )
719
+ (setq eldoc (and (string-match " (.+)" kept) (match-string 0 kept))))
714
720
(set-process-filter proc comint-filt))
715
721
eldoc))
716
722
717
723
(defun inf-clojure-show-arglist (fn )
718
724
" Show the arglist for function FN in the mini-buffer."
719
- (interactive (inf-clojure-symprompt " Arglist" (inf-clojure-fn-called-at-pt)))
725
+ (interactive (list (if inf-clojure-prompt-on-commands
726
+ (inf-clojure-symprompt " Arglist" (inf-clojure-fn-called-at-pt))
727
+ (inf-clojure-fn-called-at-pt))))
720
728
(let ((eldoc (inf-clojure-arglist fn)))
721
729
(when eldoc
722
730
(message " %s : %s " fn eldoc))))
723
731
724
732
(defun inf-clojure-show-ns-vars (ns )
725
733
" Send a query to the inferior Clojure for the public vars in NS.
726
734
See variable `inf-clojure-ns-vars-form' ."
727
- (interactive (inf-clojure-symprompt " Ns vars" (clojure-find-ns)))
735
+ (interactive (list (if inf-clojure-prompt-on-commands
736
+ (inf-clojure-symprompt " Ns vars" (clojure-find-ns))
737
+ (clojure-find-ns))))
728
738
(comint-proc-query (inf-clojure-proc) (format inf-clojure-ns-vars-form ns)))
729
739
730
740
(defun inf-clojure-set-ns (ns )
731
741
" Set the ns of the inferior Clojure process to NS.
732
742
Defaults to the ns of the current buffer, always prompting before
733
743
setting, unless `inf-clojure-prompt-on-set-ns` is nil."
734
- (interactive (list (if inf-clojure-prompt-on-set-ns
744
+ (interactive (list (if inf-clojure-prompt-on-commands
735
745
(inf-clojure-symprompt " Set ns to" (clojure-find-ns))
736
746
(clojure-find-ns))))
737
747
(when (or (not ns) (equal ns " " ))
@@ -741,7 +751,9 @@ setting, unless `inf-clojure-prompt-on-set-ns` is nil."
741
751
(defun inf-clojure-apropos (var )
742
752
" Send a form to the inferior Clojure to give apropos for VAR.
743
753
See variable `inf-clojure-apropos-form' ."
744
- (interactive (inf-clojure-symprompt " Var apropos" (inf-clojure-var-at-pt)))
754
+ (interactive (list (if inf-clojure-prompt-on-commands
755
+ (inf-clojure-symprompt " Var apropos" (inf-clojure-var-at-pt))
756
+ (inf-clojure-var-at-pt))))
745
757
(comint-proc-query (inf-clojure-proc) (format inf-clojure-apropos-form var)))
746
758
747
759
(defun inf-clojure-macroexpand (&optional macro-1 )
0 commit comments