Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation of list argument broken. #21

Open
Janfel opened this issue Feb 16, 2020 · 3 comments
Open

Indentation of list argument broken. #21

Janfel opened this issue Feb 16, 2020 · 3 comments

Comments

@Janfel
Copy link
Contributor

Janfel commented Feb 16, 2020

The Meson Style Guide contains this piece of code:

sources = files([
  'aaa/a1.c',
  'aaa/a2.c',
  'bbb/subdir1/b1.c',
  'bbb/subdir2/b2.c',
  'bbb/subdir10/b3.c',
  'bbb/subdir20/b4.c',
  'bbb/b5.c',
  'bbb/b6.c',
  'f1.c',
  'f2.c',
  'f10.c',
  'f20.c'
])

When I copy this into Emacs and indent it, the output is this:

sources = files([
                 'aaa/a1.c',
                 'aaa/a2.c',
                 'bbb/subdir1/b1.c',
                 'bbb/subdir2/b2.c',
                 'bbb/subdir10/b3.c',
                 'bbb/subdir20/b4.c',
                 'bbb/b5.c',
                 'bbb/b6.c',
                 'f1.c',
                 'f2.c',
                 'f10.c',
                 'f20.c'
               ])

This seems like unintended behavior to me.

@wentasah
Copy link
Owner

Hmm, meson-mode indentation was implemented before there was any style guide and adheres to how indentation in many other emacs modes works. But I understand that it makes sense to support recommended indentation style. I'll look at that, but it may take me some time.

Most probably, I'll make the indentation style configurable with the meson recommended style being the default and allowing people to switch to the previous "emacs style" if they want.

wentasah added a commit that referenced this issue Aug 20, 2021
@wentasah
Copy link
Owner

It seems I was able to fix this even without introducing a "indentation style" configuration variable. I tested the above commit with meson.build files from a few projects and I didn't see any unwanted indentation breakage.

@wentasah
Copy link
Owner

Reopening this. The current solution is not ideal. List arguments are indented according to the style guide, but non-list argument are indented differently.

lib = static_library('mylib', [
	'getopt.c',
	'lib.c',
	'math.c',
],
	             include_directories : include_directories('include'),
	             c_args : '-Dxxx',
                    )

I'll need to figure out, how to handle this consistently. Suggestions welcome :-)

@wentasah wentasah reopened this Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants