branch: elpa/inf-ruby
commit 70da83f8e497ad78420527e8231278cb230e1db4
Merge: 310da805b6 00237986d8
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>
Merge pull request #54 from wasamasa/feature-defcustom
Apply `defcustom` fixes
---
inf-ruby.el | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index a5dc00a6f5..f9ed36e4e6 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -77,10 +77,26 @@
(defcustom inf-ruby-prompt-read-only t
"If non-nil, the prompt will be read-only.
-Also see the description of `ielm-prompt-read-only'.")
+Also see the description of `ielm-prompt-read-only'."
+ :type 'boolean
+ :group 'inf-ruby)
-(defvar inf-ruby-default-implementation "ruby"
- "Which Ruby implementation to use if none is specified.")
+(defcustom inf-ruby-implementations
+ '(("ruby" . "irb --prompt default --noreadline -r irb/completion")
+ ("jruby" . "jruby -S irb --prompt default --noreadline -r
irb/completion")
+ ("rubinius" . "rbx -r irb/completion")
+ ("yarv" . "irb1.9 -r irb/completion")
+ ("macruby" . "macirb -r irb/completion")
+ ("pry" . "pry"))
+ "An alist of ruby implementations to irb executable names."
+ :type '(repeat (cons string string))
+ :group 'inf-ruby)
+
+(defcustom inf-ruby-default-implementation "ruby"
+ "Which Ruby implementation to use if none is specified."
+ :type `(choice ,@(mapcar (lambda (item) (list 'const (car item)))
+ inf-ruby-implementations))
+ :group 'inf-ruby)
(defconst inf-ruby-prompt-format
(concat
@@ -119,15 +135,6 @@ graphical char in all other prompts.")
map)
"Mode map for `inf-ruby-mode'.")
-(defvar inf-ruby-implementations
- '(("ruby" . "irb --prompt default --noreadline -r irb/completion")
- ("jruby" . "jruby -S irb --prompt default --noreadline -r
irb/completion")
- ("rubinius" . "rbx -r irb/completion")
- ("yarv" . "irb1.9 -r irb/completion")
- ("macruby" . "macirb -r irb/completion")
- ("pry" . "pry"))
- "An alist of ruby implementations to irb executable names.")
-
;;;###autoload
(defvar ruby-source-modes '(ruby-mode enh-ruby-mode)
"Used to determine if a buffer contains Ruby source code.