Skip to content

Commit 916ec97

Browse files
committed
Infer the customization group from defcustom names
This removes a lot of repeated group mentions.
1 parent 24463b4 commit 916ec97

File tree

1 file changed

+23
-39
lines changed

1 file changed

+23
-39
lines changed

inf-clojure.el

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848

4949
(defgroup inf-clojure nil
5050
"Run an external Clojure process (REPL) in an Emacs buffer."
51-
:group 'clojure)
51+
:prefix "inf-clojure-"
52+
:group 'clojure
53+
:link '(url-link :tag "GitHub" "https://github.com/clojure-emacs/inf-clojure")
54+
:link '(emacs-commentary-link :tag "Commentary" "inf-clojure"))
5255

5356
(defconst inf-clojure-version "1.5.0-snapshot"
5457
"The current version of `inf-clojure'.")
@@ -57,17 +60,15 @@
5760
"If non-nil, the prompt will be read-only.
5861
5962
Also see the description of `ielm-prompt-read-only'."
60-
:type 'boolean
61-
:group 'inf-clojure)
63+
:type 'boolean)
6264

6365
(defcustom inf-clojure-filter-regexp
6466
"\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'"
6567
"What not to save on inferior Clojure's input history.
6668
Input matching this regexp is not saved on the input history in Inferior Clojure
6769
mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword
6870
\(as in :a, :c, etc.)"
69-
:type 'regexp
70-
:group 'inf-clojure)
71+
:type 'regexp)
7172

7273
(defvar inf-clojure-mode-map
7374
(let ((map (copy-keymap comint-mode-map)))
@@ -160,45 +161,38 @@ of command, consisting of a host and port
160161
number (e.g. (\"localhost\" . 5555)). That's useful if you're
161162
often connecting to a remote REPL process."
162163
:type '(choice (string)
163-
(cons string integer))
164-
:group 'inf-clojure)
164+
(cons string integer)))
165165

166166
(defcustom inf-clojure-load-command "(clojure.core/load-file \"%s\")\n"
167167
"Format-string for building a Clojure expression to load a file.
168168
This format string should use `%s' to substitute a file name
169169
and should result in a Clojure expression that will command the inferior Clojure
170170
to load that file."
171-
:type 'string
172-
:group 'inf-clojure)
171+
:type 'string)
173172

174173
(defcustom inf-clojure-prompt "^[^=> \n]+=> *"
175174
"Regexp to recognize prompts in the Inferior Clojure mode."
176-
:type 'regexp
177-
:group 'inf-clojure)
175+
:type 'regexp)
178176

179177
(defcustom inf-clojure-subprompt " *#_=> *"
180178
"Regexp to recognize subprompts in the Inferior Clojure mode."
181-
:type 'regexp
182-
:group 'inf-clojure)
179+
:type 'regexp)
183180

184181
(defcustom inf-clojure-comint-prompt-regexp "^\\( *#_\\|[^=> \n]+\\)=> *"
185182
"Regexp to recognize both main prompt and subprompt for comint.
186183
This should usually be a combination of `inf-clojure-prompt' and
187184
`inf-clojure-subprompt'."
188-
:type 'regexp
189-
:group 'inf-clojure)
185+
:type 'regexp)
190186

191187
(defcustom inf-clojure-prompt-on-set-ns t
192188
"Controls whether to prompt when switching namespace."
193189
:type '(choice (const :tag "always" t)
194-
(const :tag "never" nil))
195-
:group 'inf-clojure)
190+
(const :tag "never" nil)))
196191

197192
(defcustom inf-clojure-repl-use-same-window nil
198193
"Controls whether to display the REPL buffer in the current window or not."
199194
:type '(choice (const :tag "same" t)
200-
(const :tag "different" nil))
201-
:group 'inf-clojure)
195+
(const :tag "different" nil)))
202196

203197
(defvar inf-clojure-buffer nil
204198
"The current inf-clojure process buffer.
@@ -463,8 +457,7 @@ describing the last `inf-clojure-load-file' command.")
463457
If it's loaded into a buffer that is in one of these major modes, it's
464458
considered a Clojure source file by `inf-clojure-load-file'.
465459
Used by this command to determine defaults."
466-
:type '(repeat symbol)
467-
:group 'inf-clojure)
460+
:type '(repeat symbol))
468461

469462
(defun inf-clojure-load-file (&optional switch-to-repl file-name)
470463
"Load a Clojure file FILE-NAME into the inferior Clojure process.
@@ -498,14 +491,12 @@ The prefix argument SWITCH-TO-REPL controls whether to switch to REPL after the
498491
(defcustom inf-clojure-var-doc-command
499492
"(clojure.repl/doc %s)\n"
500493
"Command to query inferior Clojure for a var's documentation."
501-
:type 'string
502-
:group 'inf-clojure)
494+
:type 'string)
503495

504496
(defcustom inf-clojure-var-source-command
505497
"(clojure.repl/source %s)\n"
506498
"Command to query inferior Clojure for a var's source."
507-
:type 'string
508-
:group 'inf-clojure)
499+
:type 'string)
509500

510501
(defcustom inf-clojure-arglist-command
511502
"(try
@@ -515,45 +506,38 @@ The prefix argument SWITCH-TO-REPL controls whether to switch to REPL after the
515506
(clojure.core/read-string \"%s\"))))
516507
(catch Throwable t nil))\n"
517508
"Command to query inferior Clojure for a function's arglist."
518-
:type 'string
519-
:group 'inf-clojure)
509+
:type 'string)
520510

521511
(defcustom inf-clojure-completion-command
522512
"(complete.core/completions \"%s\")\n"
523513
"Command to query inferior Clojure for completion candidates."
524-
:type 'string
525-
:group 'inf-clojure)
514+
:type 'string)
526515

527516
(defcustom inf-clojure-ns-vars-command
528517
"(clojure.repl/dir %s)\n"
529518
"Command to show the public vars in a namespace."
530-
:type 'string
531-
:group 'inf-clojure)
519+
:type 'string)
532520

533521
(defcustom inf-clojure-set-ns-command
534522
"(clojure.core/in-ns '%s)\n"
535523
"Command to set the namespace of the inferior Clojure process."
536-
:type 'string
537-
:group 'inf-clojure)
524+
:type 'string)
538525

539526
(defcustom inf-clojure-apropos-command
540527
"(doseq [var (sort (clojure.repl/apropos \"%s\"))]
541528
(println (str var)))\n"
542529
"Command to invoke apropos."
543-
:type 'string
544-
:group 'inf-clojure)
530+
:type 'string)
545531

546532
(defcustom inf-clojure-macroexpand-command
547533
"(clojure.core/macroexpand '%s)\n"
548534
"Command to invoke macroexpand."
549-
:type 'string
550-
:group 'inf-clojure)
535+
:type 'string)
551536

552537
(defcustom inf-clojure-macroexpand-1-command
553538
"(clojure.core/macroexpand-1 '%s)\n"
554539
"Command to invoke macroexpand-1."
555-
:type 'string
556-
:group 'inf-clojure)
540+
:type 'string)
557541

558542
;;; Ancillary functions
559543
;;; ===================

0 commit comments

Comments
 (0)