[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 338ff73 060/217: Changed the indent defaults, c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 338ff73 060/217: Changed the indent defaults, closes #19 |
Date: |
Sun, 29 Aug 2021 11:30:43 -0400 (EDT) |
branch: elpa/scala-mode
commit 338ff7344ad5dd4130a91a06d87180603d5d1272
Author: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Commit: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Changed the indent defaults, closes #19
---
README.md | 83 ++++++++++++++++++++++++++--------------------------
scala-mode-indent.el | 6 ++--
2 files changed, 45 insertions(+), 44 deletions(-)
diff --git a/README.md b/README.md
index 080456f..f44a388 100644
--- a/README.md
+++ b/README.md
@@ -97,21 +97,8 @@ line will toggle between the modes.
### Value expressions (scala-indent:indent-value-expression)
-When this variable is set to *t* (default), blocks in value
-expressions will be indented one extra step to make the *val*, *var*
-or *def* stand out. For example:
-
-```
-val x = try {
- some()
- } catch {
- case e => other
- } finally {
- clean-up()
- }
-```
-
-When the variable is set to *nil*, the same will indent as:
+When this variable is set to *nil* (default), body of a value
+expressions will be indented in the traditional way.
```
val x = try {
@@ -123,67 +110,81 @@ val x = try {
}
```
+However, when the variable is set to *t*, the body will be indented
+one extra step to make the *val*, *var* or *def* stand out. For
+example:
+
+```
+val x = try {
+ some()
+ } catch {
+ case e => other
+ } finally {
+ clean-up()
+ }
+```
+
### Parameter lists (scala-indent:align-parameters)
-When this variable is set to *t* (default), parameters and run-on
-lines in parameter lists will always align under and acording to the
+When this variable is set to *nil* (default), parameters and run-on
+lines in parameter lists will not align under or acording to the
first parameter.
```
val y = List( "Alpha", "Bravo",
- "Charlie" )
+ "Charlie" )
val x = equals(List(1,2,3) map (x =>
- x + 1))
+ x + 1))
```
-When the variable is set to *nil*, the same will be indented as:
+When the variable is set to *t*, the same will be indented as:
```
val y = List( "Alpha", "Bravo",
- "Charlie" )
+ "Charlie" )
val x = equals(List(1,2,3) map (x =>
- x + 1))
+ x + 1))
```
### Expresison forms: if, for, try (scala-indent:align-forms)
-When this variable is set to *t* (default), *if*, *for* and *try*
-forms are aligned.
+When this variable is set to *nil* (default), *if*, *for* and *try*
+forms are not aligned specially.
```
val x = if (kala)
- foo
- else if (koira)
- bar
- else
- zot
+ foo
+else if (koira)
+ bar
+else
+ zot
val x = try "1".toInt
- catch { case e => 0}
- finally { println("hello") }
+catch { case e => 0}
+finally { println("hello") }
val xs = for (i <- 1 to 10)
- yield i
+yield i
```
-When the variable is set to *nil*, the same will be indented as:
+When the variable is set to *t*, the same will be indented as:
```
val x = if (kala)
- foo
- else if (koira)
- bar
- else
- zot
+ foo
+ else if (koira)
+ bar
+ else
+ zot
val x = try "1".toInt
- catch { case e => 0}
- finally { println("hello") }
+ catch { case e => 0}
+ finally { println("hello") }
val xs = for (i <- 1 to 10)
- yield i
+ yield i
```
## Indenting multi-line comments
diff --git a/scala-mode-indent.el b/scala-mode-indent.el
index 1e656e1..cf953c0 100644
--- a/scala-mode-indent.el
+++ b/scala-mode-indent.el
@@ -13,7 +13,7 @@ indentation will be one or two steps depending on context."
:type 'integer
:group 'scala)
-(defcustom scala-indent:indent-value-expression t
+(defcustom scala-indent:indent-value-expression nil
"Whether or not to indent multi-line value expressions, with
one extra step. When true, indenting will be
@@ -38,7 +38,7 @@ val x = try {
:type 'boolean
:group 'scala)
-(defcustom scala-indent:align-parameters t
+(defcustom scala-indent:align-parameters nil
"Whether or not to indent parameter lists so that next
parameter lines always align under the first parameter. When
non-nil, indentation will be
@@ -62,7 +62,7 @@ val x = foo(1, List(1, 2, 3) map (i =>
:type 'boolean
:group 'scala)
-(defcustom scala-indent:align-forms t
+(defcustom scala-indent:align-forms nil
"Whether or not to align 'else', 'yield', 'catch', 'finally'
below their respective expression start. When non-nil, identing
will be
- [nongnu] elpa/scala-mode 1a3d958 029/217: forward/backward-sexp, (continued)
- [nongnu] elpa/scala-mode 1a3d958 029/217: forward/backward-sexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e30b35a 008/217: Indentation working, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 59cdd94 074/217: Add `scala-indent:use-javadoc-style` defcustom., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 347faeb 075/217: Add Evan Meagher to contributors list., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 081a92b 081/217: scala-indent:remove-indent-from-previous-empty-line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0fac9ae 014/217: removed debug messages, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9476d4c 018/217: Fixes #3: alignment of else inside parens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3f724ed 030/217: Add the scala-indent:pad-equals setting., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6257e3b 033/217: Renamed bad-equals to indent-value-expression. Added info to README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 4e3a24f 043/217: Updated Examples.md to reflect issues already solved, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 338ff73 060/217: Changed the indent defaults, closes #19,
ELPA Syncer <=
- [nongnu] elpa/scala-mode 6c257f6 057/217: Enhanced support for comments and multi-line strings, including, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 68ca175 056/217: Fixes #20, the cons bug (a :: b :: Nil) as well as improving some of, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 78fff40 039/217: scala-indent:align-forms customization variable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode f61e32d 047/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0991658 051/217: Fixes #17: string syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3174f4c 048/217: Update README.md clone to be a valid command., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a78716d 046/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ac13b94 061/217: post-self-insert-hooks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 2201b1c 092/217: Interact nicely with global-font-lock-mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 98d22a5 099/217: Added programming languages to README.md code, ELPA Syncer, 2021/08/29