unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* lua-mode: indentation of multi-line conditionals
@ 2023-07-25  4:50 Werner LEMBERG
  2023-07-25 12:02 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Werner LEMBERG @ 2023-07-25  4:50 UTC (permalink / raw)
  To: emacs-devel


Looking at

  https://dev.minetest.net/Lua_code_style_guidelines

I read the following about Lua source code:

> Conditional expressions have continuation lines indented by two
> tabs.[*]

For Emacs, replacing 'tabs' with 'indentation level', this would be

```
if long_function_call(with, many, arguments) and
      another_function_call() then
   do_something()
end
```

However, this is not what Emacs does by default in Lua mode; you
rather get

```
if long_function_call(with, many, arguments) and
   another_function_call() then
   do_something()
end
```

which makes the code hard to read.

Assuming that this functionality is available, how can I activate this
in Lua mode?  Otherwise I wonder whether I should file a bug report.


    Werner


[*] Another recommended way to format multi-line conditionals is
described at

  https://roblox.github.io/lua-style-guide/#newlines-in-long-expressions

```
if
   long_function_call(with, many, arguments)
   and another_function_call()
then
   do_something()
end
```

However, this becomes ugly if you are going to use `else` and
`elseif`.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-25 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-25  4:50 lua-mode: indentation of multi-line conditionals Werner LEMBERG
2023-07-25 12:02 ` Eli Zaretskii
2023-07-25 14:41   ` Werner LEMBERG

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).