[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 6257e3b 033/217: Renamed bad-equals to indent-v
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 6257e3b 033/217: Renamed bad-equals to indent-value-expression. Added info to README.md |
Date: |
Sun, 29 Aug 2021 11:30:38 -0400 (EDT) |
branch: elpa/scala-mode
commit 6257e3bd9da2755318cddf233bf51834be7b92f8
Author: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Commit: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Renamed bad-equals to indent-value-expression. Added info to README.md
---
README.md | 29 +++++++++++++++++++++++++++++
scala-mode-indent.el | 26 +++++++++++++++++++++++---
2 files changed, 52 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 38692bc..21f7839 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,8 @@ are having trouble with colors, try setting the customization
variable
## Indenting modes
+### Run-on lines (scala-indent:default-run-on-strategy)
+
The indenting engine has three modes for handling run-on lines. The
'reluctant' (default) mode is geared toward a general style of coding
and the 'eager' for strictly functional style. A third mode called
@@ -74,6 +76,33 @@ val y = foo("bar")
However, in all three modes pressing tab repeatedly on a line
will toggle between the modes.
+### Value expressions (scala-indent:indent-value-expression)
+
+When 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:
+
+```
+val x = try {
+ some()
+} catch {
+ case e => other
+} finally {
+ clean-up()
+}
+```
+
## Motion
Basic emacs motion will work as expected. The forward-sexp and
diff --git a/scala-mode-indent.el b/scala-mode-indent.el
index 54fb86e..03ae083 100644
--- a/scala-mode-indent.el
+++ b/scala-mode-indent.el
@@ -13,8 +13,28 @@ indentation will be one or two steps depending on context."
:type 'integer
:group 'scala)
-(defcustom scala-indent:pad-equals t
- "Whether or not to indent an extral level directly after =."
+(defcustom scala-indent:indent-value-expression t
+ "Whether or not to indent multi-line value expressions, with
+one extra step. When true, indenting will be
+
+val x = try {
+ some()
+ } catch {
+ case e => other
+ } finally {
+ clean-up()
+ }
+
+When nil, the same will indent as
+
+val x = try {
+ some()
+} catch {
+ case e => other
+} finally {
+ clean-up()
+}
+"
:type 'boolean
:group 'scala)
@@ -472,7 +492,7 @@ anchor for calculating block indent for current point (or
point
;;; calculate a lead that is used for all steps. The lead is one
;;; indent step if there is a '=' between anchor and start,
;;; otherwise 0.
- ((lead (if (and scala-indent:pad-equals (ignore-errors
+ ((lead (if (and scala-indent:indent-value-expression (ignore-errors
(save-excursion
(let ((block-beg (nth 1 (syntax-ppss start))))
(goto-char anchor)
- [nongnu] elpa/scala-mode 61a511f 021/217: Update README.md, (continued)
- [nongnu] elpa/scala-mode 61a511f 021/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode fe5c2c4 031/217: Fixes #11: was still using the slow regexp, not faster, ELPA Syncer, 2021/08/29
- [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 <=
- [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, 2021/08/29
- [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