aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el28
1 files changed, 24 insertions, 4 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index fa51597697f..1f3e9b6ae7b 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -212,7 +212,7 @@ It should match the part after \"def\" and until \"=\".")
212 :safe 'booleanp) 212 :safe 'booleanp)
213 213
214(defcustom ruby-indent-level 2 214(defcustom ruby-indent-level 2
215 "Indentation of Ruby statements." 215 "Number of spaces for each indentation step in `ruby-mode'."
216 :type 'integer 216 :type 'integer
217 :safe 'integerp) 217 :safe 'integerp)
218 218
@@ -268,6 +268,23 @@ Only has effect when `ruby-use-smie' is t."
268 :safe 'booleanp 268 :safe 'booleanp
269 :version "24.4") 269 :version "24.4")
270 270
271(defcustom ruby-method-params-indent t
272 "Indentation of multiline method parameters.
273
274When t, the parameters list is indented to the method name.
275
276When a number, indent the parameters list this many columns
277against the beginning of the method (the \"def\" keyword).
278
279The value nil means the same as 0.
280
281Only has effect when `ruby-use-smie' is t."
282 :type '(choice (const :tag "Indent to the method name" t)
283 (number :tag "Indent specified number of columns against def")
284 (const :tag "Indent to def" nil))
285 :safe (lambda (val) (or (memq val '(t nil)) (numberp val)))
286 :version "29.1")
287
271(defcustom ruby-deep-arglist t 288(defcustom ruby-deep-arglist t
272 "Deep indent lists in parenthesis when non-nil. 289 "Deep indent lists in parenthesis when non-nil.
273Also ignores spaces after parenthesis when `space'. 290Also ignores spaces after parenthesis when `space'.
@@ -660,9 +677,12 @@ This only affects the output of the command `ruby-toggle-block'."
660 (unless (or (eolp) (forward-comment 1)) 677 (unless (or (eolp) (forward-comment 1))
661 (cons 'column (current-column))))) 678 (cons 'column (current-column)))))
662 ('(:before . " @ ") 679 ('(:before . " @ ")
663 (save-excursion 680 (if (or (eq ruby-method-params-indent t)
664 (skip-chars-forward " \t") 681 (not (smie-rule-parent-p "def" "def=")))
665 (cons 'column (current-column)))) 682 (save-excursion
683 (skip-chars-forward " \t")
684 (cons 'column (current-column)))
685 (smie-rule-parent (or ruby-method-params-indent 0))))
666 ('(:before . "do") (ruby-smie--indent-to-stmt)) 686 ('(:before . "do") (ruby-smie--indent-to-stmt))
667 ('(:before . ".") 687 ('(:before . ".")
668 (if (smie-rule-sibling-p) 688 (if (smie-rule-sibling-p)