mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-05 22:02:01 -07:00
Some of the fixes are to continue to use American rather than British spelling. * doc/misc/modus-themes.org (my-modus-themes-engraved-faces): Fix misspelled ‘:foreground’s. * etc/themes/modus-themes.el (modus-themes-faces): Fix misspelled ‘modus-themes-bold’. * lisp/emacs-lisp/rx.el (rx--normalize-char-pattern): Rename from rx--normalise-char-pattern. (rx--optimize-or-args): Rename from rx--optimise-or-args. * lisp/frame.el (frame--special-parameters): Fix misspelled "right-divider-width". * lisp/net/tramp.el (tramp-fingerprint-prompt-regexp): Use American spelling “centered”, to match current libfprintf. * lisp/org/org-fold-core.el (org-fold-core--optimize-for-huge-buffers): Rename from org-fold-core--optimise-for-huge-buffers. (org-fold-core-update-optimization): Rename from org-fold-core-update-optimisation, leaving an alias behind. (org-fold-core-remove-optimization): Rename from org-fold-core-remove-optimisation, leaving an alias behind. * lisp/org/org.el (org-advertized-archive-subtree): This alias is now obsolete. * lisp/play/zone.el (zone-ignored-buffers): Fix misspelling of ‘zone--buffer-encrypted-p’. * lisp/progmodes/csharp-mode.el (csharp-ts-mode-faces): Fix misspelling of ‘csharp’ group. * lisp/vc/vc.el (vc-clonable-backends-custom-type): Rename from vc-cloneable-backends-custom-type, leaving an alias behind. * test/lisp/emacs-lisp/bytecomp-tests.el: (bytecomp-tests--warn-arity-non-compiled-callee): Rename from bytecomp-tests--warn-arity-noncompiled-callee. (bytecomp-test-defface-spec): Reword a deliberate misspelling of “default” that is so common I don’t want it to pollute the spelling dictionary. * test/lisp/emacs-lisp/package-vc-tests.el: (package-vc-tests-preserve-artifacts): Rename from package-vc-tests-preserve-artifacts. * test/lisp/eshell/em-prompt-tests.el: (em-prompt-test/forward-backward-paragraph-1): Reword a deliberate misspelling of “goodbye” that is so common I don’t want it to pollute the spelling dictionary.
390 lines
3.9 KiB
Text
390 lines
3.9 KiB
Text
Code:
|
|
(lambda ()
|
|
(elixir-ts-mode)
|
|
(indent-region (point-min) (point-max)))
|
|
|
|
Point-Char: $
|
|
|
|
Name: Basic modules
|
|
|
|
=-=
|
|
defmodule Foobar do
|
|
def bar() do
|
|
"one"
|
|
end
|
|
end
|
|
=-=
|
|
defmodule Foobar do
|
|
def bar() do
|
|
"one"
|
|
end
|
|
end
|
|
=-=-=
|
|
|
|
Name: Map
|
|
|
|
=-=
|
|
map = %{
|
|
"a" => 1,
|
|
"b" => 2
|
|
}
|
|
=-=-=
|
|
|
|
Name: Map in function def
|
|
|
|
=-=
|
|
def foobar() do
|
|
%{
|
|
one: "one",
|
|
two: "two",
|
|
three: "three",
|
|
four: "four"
|
|
}
|
|
end
|
|
=-=-=
|
|
|
|
Name: Map in tuple
|
|
|
|
=-=
|
|
def foo() do
|
|
{:ok,
|
|
%{
|
|
state
|
|
| extra_arguments: extra_arguments,
|
|
max_children: max_children,
|
|
max_restarts: max_restarts,
|
|
max_seconds: max_seconds,
|
|
strategy: strategy
|
|
}}
|
|
end
|
|
=-=-=
|
|
|
|
Name: Nested maps
|
|
|
|
=-=
|
|
%{
|
|
foo: "bar",
|
|
bar: %{
|
|
foo: "bar"
|
|
}
|
|
}
|
|
|
|
def foo() do
|
|
%{
|
|
foo: "bar",
|
|
bar: %{
|
|
foo: "bar"
|
|
}
|
|
}
|
|
end
|
|
=-=-=
|
|
|
|
Name: Bitstring multiline
|
|
|
|
=-=
|
|
<<12, 22,
|
|
22, 32
|
|
>>
|
|
=-=
|
|
<<12, 22,
|
|
22, 32
|
|
>>
|
|
=-=-=
|
|
|
|
Name: Block assignments
|
|
|
|
=-=
|
|
foo =
|
|
if true do
|
|
"yes"
|
|
else
|
|
"no"
|
|
end
|
|
=-=-=
|
|
|
|
Name: Function rescue
|
|
|
|
=-=
|
|
def foo do
|
|
"bar"
|
|
rescue
|
|
e ->
|
|
"bar"
|
|
end
|
|
=-=-=
|
|
|
|
Name: With statement
|
|
=-=
|
|
with one <- one(),
|
|
two <- two(),
|
|
{:ok, value} <- get_value(one, two) do
|
|
{:ok, value}
|
|
else
|
|
{:error, %{"Message" => message}} ->
|
|
{:error, message}
|
|
end
|
|
=-=-=
|
|
|
|
Name: Pipe statements with fn
|
|
|
|
=-=
|
|
[1, 2]
|
|
|> Enum.map(fn num ->
|
|
num + 1
|
|
end)
|
|
=-=-=
|
|
|
|
Name: Pipe statements stab clauses
|
|
|
|
=-=
|
|
[1, 2]
|
|
|> Enum.map(fn
|
|
x when x < 10 -> x * 2
|
|
x -> x * 3
|
|
end)
|
|
=-=-=
|
|
|
|
Name: Pipe statements params
|
|
|
|
=-=
|
|
[1, 2]
|
|
|> foobar(
|
|
:one,
|
|
:two,
|
|
:three,
|
|
:four
|
|
)
|
|
=-=-=
|
|
|
|
Name: Parameter maps
|
|
|
|
=-=
|
|
def something(%{
|
|
one: :one,
|
|
two: :two
|
|
}) do
|
|
{:ok, "done"}
|
|
end
|
|
=-=-=
|
|
|
|
Name: Binary operator in else block
|
|
|
|
=-=
|
|
defp foobar() do
|
|
if false do
|
|
:foo
|
|
else
|
|
:bar |> foo
|
|
end
|
|
end
|
|
=-=-=
|
|
|
|
Name: Tuple indentation
|
|
|
|
=-=
|
|
tuple = {
|
|
:one,
|
|
:two
|
|
}
|
|
|
|
{
|
|
:one,
|
|
:two
|
|
}
|
|
=-=-=
|
|
|
|
Name: Call with keywords
|
|
|
|
=-=
|
|
def foo() do
|
|
bar(:one,
|
|
:two,
|
|
one: 1,
|
|
two: 2
|
|
)
|
|
end
|
|
=-=-=
|
|
|
|
Name: Call with @spec
|
|
|
|
=-=
|
|
@spec foobar(
|
|
t,
|
|
acc,
|
|
(one, something -> :bar | far),
|
|
(two -> :bar | far)
|
|
) :: any()
|
|
when chunk: any
|
|
def foobar(enumerable, acc, chunk_fun, after_fun) do
|
|
{_, {res, acc}} =
|
|
case after_fun.(acc) do
|
|
{:one, "one"} ->
|
|
"one"
|
|
|
|
{:two, "two"} ->
|
|
"two"
|
|
end
|
|
end
|
|
=-=-=
|
|
|
|
Name: Spec with multi-line result
|
|
|
|
=-=
|
|
@type result ::
|
|
{:done, term}
|
|
| {:two}
|
|
| {:one}
|
|
|
|
@type result ::
|
|
{
|
|
:done,
|
|
term
|
|
}
|
|
| {:two}
|
|
| {:one}
|
|
|
|
@type boo_bar ::
|
|
(foo :: pos_integer, bar :: pos_integer -> any())
|
|
|
|
@spec foo_bar(
|
|
t,
|
|
(foo -> any),
|
|
(() -> any) | (foo, foo -> boolean) | module()
|
|
) :: any
|
|
when foo: any
|
|
def foo(one, fun, other)
|
|
=-=-=
|
|
|
|
Name: String concatenation in call
|
|
|
|
=-=
|
|
IO.warn(
|
|
"one" <>
|
|
"two" <>
|
|
"bar"
|
|
)
|
|
|
|
IO.warn(
|
|
"foo" <>
|
|
"bar"
|
|
)
|
|
=-=-=
|
|
|
|
Name: Incomplete tuple
|
|
|
|
=-=
|
|
map = {
|
|
:foo
|
|
|
|
=-=
|
|
map = {
|
|
:foo
|
|
|
|
=-=-=
|
|
|
|
Name: Incomplete map
|
|
|
|
=-=
|
|
map = %{
|
|
"a" => "a",
|
|
=-=-=
|
|
|
|
Name: Incomplete list
|
|
|
|
=-=
|
|
map = [
|
|
:foo
|
|
|
|
=-=
|
|
map = [
|
|
:foo
|
|
|
|
=-=-=
|
|
|
|
Name: String concatenation
|
|
|
|
=-=
|
|
"one" <>
|
|
"two" <>
|
|
"three" <>
|
|
"four"
|
|
=-=-=
|
|
|
|
Name: Tuple with same line first node
|
|
|
|
=-=
|
|
{:one,
|
|
:two}
|
|
|
|
{:ok,
|
|
fn one ->
|
|
one
|
|
|> String.upcase(one)
|
|
end}
|
|
=-=-=
|
|
|
|
Name: Long tuple
|
|
|
|
=-=
|
|
{"January", "February", "March", "April", "May", "June", "July", "August", "September",
|
|
"October", "November", "December"}
|
|
=-=-=
|
|
|
|
Name: Doc
|
|
|
|
=-=
|
|
defmodule Foo do
|
|
"""
|
|
bar
|
|
"""
|
|
end
|
|
=-=
|
|
defmodule Foo do
|
|
"""
|
|
bar
|
|
"""
|
|
end
|
|
=-=-=
|
|
|
|
Name: Embedded HEEx
|
|
|
|
=-=
|
|
defmodule Foo do
|
|
def foo(assigns) do
|
|
~H"""
|
|
<span>
|
|
text
|
|
</span>
|
|
"""
|
|
end
|
|
end
|
|
=-=
|
|
defmodule Foo do
|
|
def foo(assigns) do
|
|
~H"""
|
|
<span>
|
|
text
|
|
</span>
|
|
"""
|
|
end
|
|
end
|
|
=-=-=
|
|
|
|
Code:
|
|
(lambda ()
|
|
(elixir-ts-mode)
|
|
(newline)
|
|
(indent-for-tab-command))
|
|
|
|
Name: New list item
|
|
|
|
=-=
|
|
[
|
|
:foo,$
|
|
]
|
|
=-=
|
|
[
|
|
:foo,
|
|
$
|
|
]
|
|
=-=-=
|