summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2023-01-22 04:40:40 +0200
committerDmitry Gutov <dgutov@yandex.ru>2023-01-22 04:40:40 +0200
commitae7e28a43726522610df04bd39659b908da9ddfc (patch)
tree3f421067a3c5d4b2739486d4a01db05f464f946e
parent89cb3c3f1576fdc69eb061cccc8b537f4b7c8228 (diff)
downloademacs-ae7e28a43726522610df04bd39659b908da9ddfc.tar.gz
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.
-rw-r--r--lisp/progmodes/ruby-mode.el28
1 files changed, 25 insertions, 3 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 6e524693e37..dba9ff0a846 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -336,7 +336,15 @@ Only has effect when `ruby-use-smie' is t."
"If non-nil, align chained method calls.
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."
:type 'boolean
@@ -346,12 +354,26 @@ Only has effect when `ruby-use-smie' is t."
(defcustom ruby-method-params-indent t
"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
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."
:type '(choice (const :tag "Indent to the method name" t)