Skip to content

Commit 7dd6b96

Browse files
committed
Rename defcustoms to inf-clojure-*-form where appropriate
This patch renames all the `inf-clojure-*-command` defcustoms to `inf-clojure-*-form` where the content is a Clojure form to be evaluated at the REPL.
1 parent a36d2a0 commit 7dd6b96

File tree

2 files changed

+43
-42
lines changed

2 files changed

+43
-42
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### New Features
66

7+
* [#50](https://github.com/clojure-emacs/inf-clojure/pull/50): Rename defcustoms to `inf-clojure-*-form` where appropriate.
78
* [#34](https://github.com/clojure-emacs/inf-clojure/pull/34): Add support for socket REPL connections.
89
* [#46](https://github.com/clojure-emacs/inf-clojure/pull/46): Make it possible to disable prompt on `inf-clojure-set-ns`.
910
* New interactive command `inf-clojure-display-version`.

inf-clojure.el

+42-42
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ be used instead of `comint-send-string`."
209209
(inf-clojure--set-repl-type proc)
210210
(comint-simple-send proc string))
211211

212-
(defcustom inf-clojure-load-command "(clojure.core/load-file \"%s\")\n"
212+
(defcustom inf-clojure-load-form "(clojure.core/load-file \"%s\")\n"
213213
"Format-string for building a Clojure expression to load a file.
214-
This format string should use `%s' to substitute a file name
215-
and should result in a Clojure expression that will command the inferior Clojure
216-
to load that file."
214+
This format string should use `%s' to substitute a file name and
215+
should result in a Clojure form that will be sent to the inferior
216+
Clojure to load that file."
217217
:type 'string)
218218

219219
(defcustom inf-clojure-prompt "^[^=> \n]+=> *"
@@ -282,7 +282,7 @@ Runs a Clojure interpreter as a subprocess of Emacs, with Clojure
282282
I/O through an Emacs buffer. Variables of the type
283283
`inf-clojure-*-cmd' combined with the project type controls how
284284
a Clojure REPL is started. Variables `inf-clojure-prompt',
285-
`inf-clojure-filter-regexp' and `inf-clojure-load-command' can
285+
`inf-clojure-filter-regexp' and `inf-clojure-load-form' can
286286
customize this mode for different Clojure REPLs.
287287
288288
For information on running multiple processes in multiple buffers, see
@@ -546,7 +546,7 @@ The prefix argument SWITCH-TO-REPL controls whether to switch to REPL after the
546546
(setq inf-clojure-prev-l/c-dir/file (cons (file-name-directory file-name)
547547
(file-name-nondirectory file-name)))
548548
(inf-clojure--send-string (inf-clojure-proc)
549-
(format inf-clojure-load-command file-name))
549+
(format inf-clojure-load-form file-name))
550550
(when switch-to-repl
551551
(inf-clojure-switch-to-repl t))))
552552

@@ -559,17 +559,17 @@ The prefix argument SWITCH-TO-REPL controls whether to switch to REPL after the
559559
;;; describe symbol.
560560
;;; ===========================================================================
561561

562-
;;; Command strings
563-
;;; ===============
562+
;;; Command forms
563+
;;; =============
564564

565565
(defcustom inf-clojure-var-doc-form
566566
"(clojure.repl/doc %s)\n"
567-
"Command to query inferior Clojure for a var's documentation."
567+
"Form to query inferior Clojure for a var's documentation."
568568
:type 'string)
569569

570570
(defcustom inf-clojure-var-doc-form-lumo
571571
"(lumo.repl/doc %s)\n"
572-
"Lumo command to query inferior Clojure for a var's documentation."
572+
"Lumo form to query inferior Clojure for a var's documentation."
573573
:type 'string)
574574

575575
(defun inf-clojure-var-doc-form ()
@@ -580,24 +580,24 @@ If you are using REPL types, it will pickup the most approapriate
580580
(lumo inf-clojure-var-doc-form-lumo)
581581
(_ inf-clojure-var-doc-form)))
582582

583-
(defcustom inf-clojure-var-source-command
583+
(defcustom inf-clojure-var-source-form
584584
"(clojure.repl/source %s)\n"
585-
"Command to query inferior Clojure for a var's source."
585+
"Form to query inferior Clojure for a var's source."
586586
:type 'string)
587587

588-
(defcustom inf-clojure-arglist-command
588+
(defcustom inf-clojure-arglist-form
589589
"(try
590590
(:arglists
591591
(clojure.core/meta
592592
(clojure.core/resolve
593593
(clojure.core/read-string \"%s\"))))
594594
(catch Throwable t nil))\n"
595-
"Command to query inferior Clojure for a function's arglist."
595+
"Form to query inferior Clojure for a function's arglist."
596596
:type 'string)
597597

598598
(defcustom inf-clojure-completion-form
599599
"(complete.core/completions \"%s\")\n"
600-
"Command to query inferior Clojure for completion candidates."
600+
"Form to query inferior Clojure for completion candidates."
601601
:type 'string)
602602

603603
(defcustom inf-clojure-completion-form-lumo
@@ -613,30 +613,30 @@ If you are using REPL types, it will pickup the most approapriate
613613
(lumo inf-clojure-completion-form-lumo)
614614
(_ inf-clojure-completion-form)))
615615

616-
(defcustom inf-clojure-ns-vars-command
616+
(defcustom inf-clojure-ns-vars-form
617617
"(clojure.repl/dir %s)\n"
618-
"Command to show the public vars in a namespace."
618+
"Form to show the public vars in a namespace."
619619
:type 'string)
620620

621-
(defcustom inf-clojure-set-ns-command
621+
(defcustom inf-clojure-set-ns-form
622622
"(clojure.core/in-ns '%s)\n"
623-
"Command to set the namespace of the inferior Clojure process."
623+
"Form to set the namespace of the inferior Clojure process."
624624
:type 'string)
625625

626-
(defcustom inf-clojure-apropos-command
626+
(defcustom inf-clojure-apropos-form
627627
"(doseq [var (sort (clojure.repl/apropos \"%s\"))]
628628
(println (str var)))\n"
629-
"Command to invoke apropos."
629+
"Form to invoke apropos."
630630
:type 'string)
631631

632-
(defcustom inf-clojure-macroexpand-command
632+
(defcustom inf-clojure-macroexpand-form
633633
"(clojure.core/macroexpand '%s)\n"
634-
"Command to invoke macroexpand."
634+
"Form to invoke macroexpand."
635635
:type 'string)
636636

637-
(defcustom inf-clojure-macroexpand-1-command
637+
(defcustom inf-clojure-macroexpand-1-form
638638
"(clojure.core/macroexpand-1 '%s)\n"
639-
"Command to invoke macroexpand-1."
639+
"Form to invoke macroexpand-1."
640640
:type 'string)
641641

642642
;;; Ancillary functions
@@ -684,28 +684,28 @@ The value is nil if it can't find one."
684684
;;; ======================================================================
685685

686686
(defun inf-clojure-show-var-documentation (var)
687-
"Send a command to the inferior Clojure to give documentation for VAR.
687+
"Send a form to the inferior Clojure to give documentation for VAR.
688688
See function `inf-clojure-var-doc-form'."
689689
(interactive (inf-clojure-symprompt "Var doc" (inf-clojure-var-at-pt)))
690690
(comint-proc-query (inf-clojure-proc) (format (inf-clojure-var-doc-form) var)))
691691

692692
(defun inf-clojure-show-var-source (var)
693-
"Send a command to the inferior Clojure to give source for VAR.
694-
See variable `inf-clojure-var-source-command'."
693+
"Send a form to the inferior Clojure to give source for VAR.
694+
See variable `inf-clojure-var-source-form'."
695695
(interactive (inf-clojure-symprompt "Var source" (inf-clojure-var-at-pt)))
696-
(comint-proc-query (inf-clojure-proc) (format inf-clojure-var-source-command var)))
696+
(comint-proc-query (inf-clojure-proc) (format inf-clojure-var-source-form var)))
697697

698698
(defun inf-clojure-arglist (fn)
699699
"Send a query to the inferior Clojure for the arglist for function FN.
700-
See variable `inf-clojure-arglist-command'."
700+
See variable `inf-clojure-arglist-form'."
701701
(interactive (inf-clojure-symprompt "Arglist" (inf-clojure-fn-called-at-pt)))
702702
(let* ((proc (inf-clojure-proc))
703703
(comint-filt (process-filter proc))
704704
(kept "")
705705
eldoc)
706706
(set-process-filter proc (lambda (_proc string) (setq kept (concat kept string))))
707707
(unwind-protect
708-
(let ((eldoc-snippet (format inf-clojure-arglist-command fn)))
708+
(let ((eldoc-snippet (format inf-clojure-arglist-form fn)))
709709
(process-send-string proc eldoc-snippet)
710710
(while (and (not (string-match inf-clojure-prompt kept))
711711
(accept-process-output proc 2)))
@@ -723,9 +723,9 @@ See variable `inf-clojure-arglist-command'."
723723

724724
(defun inf-clojure-show-ns-vars (ns)
725725
"Send a query to the inferior Clojure for the public vars in NS.
726-
See variable `inf-clojure-ns-vars-command'."
726+
See variable `inf-clojure-ns-vars-form'."
727727
(interactive (inf-clojure-symprompt "Ns vars" (clojure-find-ns)))
728-
(comint-proc-query (inf-clojure-proc) (format inf-clojure-ns-vars-command ns)))
728+
(comint-proc-query (inf-clojure-proc) (format inf-clojure-ns-vars-form ns)))
729729

730730
(defun inf-clojure-set-ns (ns)
731731
"Set the ns of the inferior Clojure process to NS.
@@ -736,25 +736,25 @@ setting, unless `inf-clojure-prompt-on-set-ns` is nil."
736736
(clojure-find-ns))))
737737
(when (or (not ns) (equal ns ""))
738738
(user-error "No namespace selected"))
739-
(comint-proc-query (inf-clojure-proc) (format inf-clojure-set-ns-command ns)))
739+
(comint-proc-query (inf-clojure-proc) (format inf-clojure-set-ns-form ns)))
740740

741741
(defun inf-clojure-apropos (var)
742-
"Send a command to the inferior Clojure to give apropos for VAR.
743-
See variable `inf-clojure-apropos-command'."
742+
"Send a form to the inferior Clojure to give apropos for VAR.
743+
See variable `inf-clojure-apropos-form'."
744744
(interactive (inf-clojure-symprompt "Var apropos" (inf-clojure-var-at-pt)))
745-
(comint-proc-query (inf-clojure-proc) (format inf-clojure-apropos-command var)))
745+
(comint-proc-query (inf-clojure-proc) (format inf-clojure-apropos-form var)))
746746

747747
(defun inf-clojure-macroexpand (&optional macro-1)
748-
"Send a command to the inferior Clojure to give apropos for VAR.
749-
See variable `inf-clojure-macroexpand-command'.
750-
With a prefix arg MACRO-1 uses `inf-clojure-macroexpand-1-command'."
748+
"Send a form to the inferior Clojure to give apropos for VAR.
749+
See variable `inf-clojure-macroexpand-form'.
750+
With a prefix arg MACRO-1 uses `inf-clojure-macroexpand-1-form'."
751751
(interactive "P")
752752
(let ((last-sexp (buffer-substring-no-properties (save-excursion (backward-sexp) (point)) (point))))
753753
(inf-clojure--send-string
754754
(inf-clojure-proc)
755755
(format (if macro-1
756-
inf-clojure-macroexpand-1-command
757-
inf-clojure-macroexpand-command)
756+
inf-clojure-macroexpand-1-form
757+
inf-clojure-macroexpand-form)
758758
last-sexp))))
759759

760760

0 commit comments

Comments
 (0)