ruby-mode.el: Expand some docstrings with examples
* lisp/progmodes/ruby-mode.el (ruby-align-chained-calls) (ruby-method-params-indent): Expand docstrings with examples.
This commit is contained in:
parent
89cb3c3f15
commit
ae7e28a437
1 changed files with 25 additions and 3 deletions
|
@ -336,7 +336,15 @@ Only has effect when `ruby-use-smie' is t."
|
||||||
"If non-nil, align chained method calls.
|
"If non-nil, align chained method calls.
|
||||||
|
|
||||||
Each method call on a separate line will be aligned to the column
|
Each method call on a separate line will be aligned to the column
|
||||||
of its parent.
|
of its parent. Example:
|
||||||
|
|
||||||
|
my_array.select { |str| str.size > 5 }
|
||||||
|
.map { |str| str.downcase }
|
||||||
|
|
||||||
|
When nil, each method call is indented with the usual offset:
|
||||||
|
|
||||||
|
my_array.select { |str| str.size > 5 }
|
||||||
|
.map { |str| str.downcase }
|
||||||
|
|
||||||
Only has effect when `ruby-use-smie' is t."
|
Only has effect when `ruby-use-smie' is t."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
|
@ -346,12 +354,26 @@ Only has effect when `ruby-use-smie' is t."
|
||||||
(defcustom ruby-method-params-indent t
|
(defcustom ruby-method-params-indent t
|
||||||
"Indentation of multiline method parameters.
|
"Indentation of multiline method parameters.
|
||||||
|
|
||||||
When t, the parameters list is indented to the method name.
|
When t, the parameters list is indented to the method name:
|
||||||
|
|
||||||
|
def foo(
|
||||||
|
baz,
|
||||||
|
bar
|
||||||
|
)
|
||||||
|
hello
|
||||||
|
end
|
||||||
|
|
||||||
When a number, indent the parameters list this many columns
|
When a number, indent the parameters list this many columns
|
||||||
against the beginning of the method (the \"def\" keyword).
|
against the beginning of the method (the \"def\" keyword).
|
||||||
|
|
||||||
The value nil means the same as 0.
|
The value nil means the same as 0:
|
||||||
|
|
||||||
|
def foo(
|
||||||
|
baz,
|
||||||
|
bar
|
||||||
|
)
|
||||||
|
hello
|
||||||
|
end
|
||||||
|
|
||||||
Only has effect when `ruby-use-smie' is t."
|
Only has effect when `ruby-use-smie' is t."
|
||||||
:type '(choice (const :tag "Indent to the method name" t)
|
:type '(choice (const :tag "Indent to the method name" t)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue