Skip to content

Commit

Permalink
doc: correct the documentation
Browse files Browse the repository at this point in the history
Prior to this commit the documentation incorrectly presented Emacs
indentation. It was actually indented using a customized
scheme-mode. This commit updates the comparison to show differences
versus the stock Emacs 27.2 configuration.
  • Loading branch information
payneca committed Jul 18, 2022
1 parent 215dbfd commit 2c4a8cd
Showing 1 changed file with 50 additions and 10 deletions.
60 changes: 50 additions & 10 deletions indentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Default Emacs configurations use a `fill-column` of 70. Doom Emacs
defaults this to 80 without being explicitly set in the user's
configuration. This code uses 70.

The following examples attempt to express the differences between
Emacs's style and this indentation code.
The following examples attempt to express the differences between the
stock Emacs 27.2 configuration and this indentation code.

### Block comments `#| ... |#`

Expand All @@ -41,12 +41,52 @@ little importance.
The indenter applies its normal code indentation strategy for datum
comments `#;`.

### Head subforms

In Emacs:
``` scheme
(f e1
e2
e3)
(foo e1
e2
e3)
```

The indenter opts for two spaces. For the `f` case, this seems less
pleasing, but has the advantage that the subsequent forms will remain
at the same level if `f` is renamed.
``` scheme
(f e1
e2
e3)
(foo e1
e2
e3)
```

In Emacs most mathematical operators and single-character identifiers
work as expected. To achieve similar results, the indenter overrides
its default behavior for `+`, `-`, `*`, `/`, `!`, `@`, `$`, `%`, `^`,
`&`, `:`, `?`, `~`, and `_`. Both indent like this:
``` scheme
(+ e1
e2
e3)
(@ e1
e2
e3)
```

### Certain bytevectors

In Emacs:
``` scheme
#vu8(#x01 #x02 #x03
#x04 #x05 #x06)
#x04 #x05 #x06)
```

The indenter:
Expand Down Expand Up @@ -80,10 +120,10 @@ The indenter:
In Emacs:
``` scheme
(match x
[,x
12]
[#vu8(1 2 3)
13])
[,x
12]
[#vu8(1 2 3)
13])
```

The indenter:
Expand All @@ -100,9 +140,9 @@ The indenter:
In Emacs:
``` scheme
(match x
[(,abc .
,def)
12])
[(,abc .
,def)
12])
```

The indenter:
Expand Down

0 comments on commit 2c4a8cd

Please sign in to comment.